]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - plugins/playvideos/playvideos.php
Process main page (linklist) through Slim controller
[github/shaarli/Shaarli.git] / plugins / playvideos / playvideos.php
CommitLineData
b17c19ff 1<?php
840caea6
A
2/**
3 * Plugin PlayVideos
4 *
5 * Add a button in the toolbar allowing to watch all videos.
6 * Note: this plugin adds jQuery.
7 */
b17c19ff 8
e1850388 9use Shaarli\Plugin\PluginManager;
1a8ac737 10use Shaarli\Render\TemplatePage;
a932f486 11
b17c19ff
A
12/**
13 * When linklist is displayed, add play videos to header's toolbar.
14 *
15 * @param array $data - header data.
840caea6 16 *
b17c19ff
A
17 * @return mixed - header data with playvideos toolbar item.
18 */
840caea6
A
19function hook_playvideos_render_header($data)
20{
1a8ac737 21 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
ba0fd807
A
22 $playvideo = array(
23 'attr' => array(
24 'href' => '#',
12266213 25 'title' => t('Video player'),
ba0fd807
A
26 'id' => 'playvideos',
27 ),
12266213 28 'html' => '► '. t('Play Videos')
ba0fd807
A
29 );
30 $data['buttons_toolbar'][] = $playvideo;
b17c19ff
A
31 }
32
33 return $data;
34}
35
36/**
37 * When linklist is displayed, include playvideos JS files.
38 *
39 * @param array $data - footer data.
840caea6 40 *
b17c19ff
A
41 * @return mixed - footer data with playvideos JS files added.
42 */
840caea6
A
43function hook_playvideos_render_footer($data)
44{
1a8ac737 45 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
b17c19ff
A
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';
48 }
49
50 return $data;
db6dec0d 51}
12266213
A
52
53/**
54 * This function is never called, but contains translation calls for GNU gettext extraction.
55 */
56function playvideos_dummy_translation()
57{
58 // meta
59 t('Add a button in the toolbar allowing to watch all videos.');
60}