2015-07-15 12:01:06 +02:00
|
|
|
<?php
|
2015-11-07 16:30:56 +01:00
|
|
|
/**
|
|
|
|
* Plugin PlayVideos
|
|
|
|
*
|
|
|
|
* Add a button in the toolbar allowing to watch all videos.
|
|
|
|
* Note: this plugin adds jQuery.
|
|
|
|
*/
|
2015-07-15 12:01:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When linklist is displayed, add play videos to header's toolbar.
|
|
|
|
*
|
|
|
|
* @param array $data - header data.
|
2015-11-07 16:30:56 +01:00
|
|
|
*
|
2015-07-15 12:01:06 +02:00
|
|
|
* @return mixed - header data with playvideos toolbar item.
|
|
|
|
*/
|
2015-11-07 16:30:56 +01:00
|
|
|
function hook_playvideos_render_header($data)
|
|
|
|
{
|
2015-07-15 12:01:06 +02:00
|
|
|
if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
|
2016-12-01 11:38:21 +01:00
|
|
|
$playvideo = array(
|
|
|
|
'attr' => array(
|
|
|
|
'href' => '#',
|
|
|
|
'title' => 'Video player',
|
|
|
|
'id' => 'playvideos',
|
|
|
|
),
|
|
|
|
'html' => '► Play Videos'
|
|
|
|
);
|
|
|
|
$data['buttons_toolbar'][] = $playvideo;
|
2015-07-15 12:01:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When linklist is displayed, include playvideos JS files.
|
|
|
|
*
|
|
|
|
* @param array $data - footer data.
|
2015-11-07 16:30:56 +01:00
|
|
|
*
|
2015-07-15 12:01:06 +02:00
|
|
|
* @return mixed - footer data with playvideos JS files added.
|
|
|
|
*/
|
2015-11-07 16:30:56 +01:00
|
|
|
function hook_playvideos_render_footer($data)
|
|
|
|
{
|
2015-07-15 12:01:06 +02:00
|
|
|
if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
|
|
|
|
$data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
|
|
|
|
$data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
2016-08-13 14:22:22 +02:00
|
|
|
}
|