5 * Add a button in the toolbar allowing to watch all videos.
6 * Note: this plugin adds jQuery.
9 use Shaarli\Plugin\PluginManager
;
13 * When linklist is displayed, add play videos to header's toolbar.
15 * @param array $data - header data.
17 * @return mixed - header data with playvideos toolbar item.
19 function hook_playvideos_render_header($data)
21 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
25 'title' => t('Video player'),
28 'html' => '► '. t('Play Videos')
30 $data['buttons_toolbar'][] = $playvideo;
37 * When linklist is displayed, include playvideos JS files.
39 * @param array $data - footer data.
41 * @return mixed - footer data with playvideos JS files added.
43 function hook_playvideos_render_footer($data)
45 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
46 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
47 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
54 * This function is never called, but contains translation calls for GNU gettext extraction.
56 function playvideos_dummy_translation()
59 t('Add a button in the toolbar allowing to watch all videos.');