]>
Commit | Line | Data |
---|---|---|
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 A |
8 | |
9 | /** | |
10 | * When linklist is displayed, add play videos to header's toolbar. | |
11 | * | |
12 | * @param array $data - header data. | |
840caea6 | 13 | * |
b17c19ff A |
14 | * @return mixed - header data with playvideos toolbar item. |
15 | */ | |
840caea6 A |
16 | function hook_playvideos_render_header($data) |
17 | { | |
b17c19ff | 18 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { |
c8f0a06d A |
19 | $playvideo = array( |
20 | 'href' => '#', | |
21 | 'title' => 'Video player', | |
22 | 'id' => 'playvideos', | |
23 | 'html' => '► Play Videos' | |
24 | ); | |
25 | $data['buttons_toolbar'][] = $playvideo; | |
b17c19ff A |
26 | } |
27 | ||
28 | return $data; | |
29 | } | |
30 | ||
31 | /** | |
32 | * When linklist is displayed, include playvideos JS files. | |
33 | * | |
34 | * @param array $data - footer data. | |
840caea6 | 35 | * |
b17c19ff A |
36 | * @return mixed - footer data with playvideos JS files added. |
37 | */ | |
840caea6 A |
38 | function hook_playvideos_render_footer($data) |
39 | { | |
b17c19ff A |
40 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { |
41 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js'; | |
42 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js'; | |
43 | } | |
44 | ||
45 | return $data; | |
6aa08e74 | 46 | } |