]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - plugins/playvideos/playvideos.php
Merge pull request #284 from ArthurHoaro/plugin-playvideos
[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
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
16function hook_playvideos_render_header($data)
17{
b17c19ff
A
18 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
19 $data['buttons_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/playvideos/playvideos.html');
20 }
21
22 return $data;
23}
24
25/**
26 * When linklist is displayed, include playvideos JS files.
27 *
28 * @param array $data - footer data.
840caea6 29 *
b17c19ff
A
30 * @return mixed - footer data with playvideos JS files added.
31 */
840caea6
A
32function hook_playvideos_render_footer($data)
33{
b17c19ff
A
34 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
35 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
36 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
37 }
38
39 return $data;
40}