diff options
author | Arthur <arthur@hoa.ro> | 2015-11-08 13:29:32 +0100 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2015-11-08 13:29:32 +0100 |
commit | fd006c630b64146edc402b68d8503c716f8a55d6 (patch) | |
tree | e53904cc6232c7f2fe8e1de6f23c9a5d6c5403ad /plugins/playvideos/playvideos.php | |
parent | 70df947af60afb05529024bb2d3825eaf6cc7950 (diff) | |
parent | 056107ab4eae0a4867cf8d55de77d31f8868b899 (diff) | |
download | Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.gz Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.zst Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.zip |
Merge pull request #275 from shaarli/plugin-proposition
Plugin proposition
Diffstat (limited to 'plugins/playvideos/playvideos.php')
-rw-r--r-- | plugins/playvideos/playvideos.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/playvideos/playvideos.php b/plugins/playvideos/playvideos.php new file mode 100644 index 00000000..0a80aa58 --- /dev/null +++ b/plugins/playvideos/playvideos.php | |||
@@ -0,0 +1,40 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * Plugin PlayVideos | ||
4 | * | ||
5 | * Add a button in the toolbar allowing to watch all videos. | ||
6 | * Note: this plugin adds jQuery. | ||
7 | */ | ||
8 | |||
9 | /** | ||
10 | * When linklist is displayed, add play videos to header's toolbar. | ||
11 | * | ||
12 | * @param array $data - header data. | ||
13 | * | ||
14 | * @return mixed - header data with playvideos toolbar item. | ||
15 | */ | ||
16 | function hook_playvideos_render_header($data) | ||
17 | { | ||
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. | ||
29 | * | ||
30 | * @return mixed - footer data with playvideos JS files added. | ||
31 | */ | ||
32 | function hook_playvideos_render_footer($data) | ||
33 | { | ||
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 | } \ No newline at end of file | ||