6 * Add a button in the toolbar allowing to watch all videos.
7 * Note: this plugin adds jQuery.
10 use Shaarli\Plugin\PluginManager
;
11 use Shaarli\Render\TemplatePage
;
14 * When linklist is displayed, add play videos to header's toolbar.
16 * @param array $data - header data.
18 * @return mixed - header data with playvideos toolbar item.
20 function hook_playvideos_render_header($data)
22 if ($data['_PAGE_'] == TemplatePage
::LINKLIST
) {
26 'title' => t('Video player'),
29 'html' => '► ' . t('Play Videos')
31 $data['buttons_toolbar'][] = $playvideo;
38 * When linklist is displayed, include playvideos JS files.
40 * @param array $data - footer data.
42 * @return mixed - footer data with playvideos JS files added.
44 function hook_playvideos_render_footer($data)
46 if ($data['_PAGE_'] == TemplatePage
::LINKLIST
) {
47 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
48 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
55 * This function is never called, but contains translation calls for GNU gettext extraction.
57 function playvideos_dummy_translation()
60 t('Add a button in the toolbar allowing to watch all videos.');