aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/playvideos/playvideos.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-07-15 12:01:06 +0200
committerArthurHoaro <arthur@hoa.ro>2015-11-07 16:21:21 +0100
commitb17c19ff76dc63b9ad10d26b244630b59e691e5c (patch)
tree58b220900e327069c6ba9eccedf894984ce871d9 /plugins/playvideos/playvideos.php
parenta52e8435939c641f964939f1df55cf7ceddcc0fd (diff)
downloadShaarli-b17c19ff76dc63b9ad10d26b244630b59e691e5c.tar.gz
Shaarli-b17c19ff76dc63b9ad10d26b244630b59e691e5c.tar.zst
Shaarli-b17c19ff76dc63b9ad10d26b244630b59e691e5c.zip
PLUGIN playvideos
Display a button in buttons toolbar which allows to play all videos found.
Diffstat (limited to 'plugins/playvideos/playvideos.php')
-rw-r--r--plugins/playvideos/playvideos.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/playvideos/playvideos.php b/plugins/playvideos/playvideos.php
new file mode 100644
index 00000000..9918453c
--- /dev/null
+++ b/plugins/playvideos/playvideos.php
@@ -0,0 +1,30 @@
1<?php
2
3/**
4 * When linklist is displayed, add play videos to header's toolbar.
5 *
6 * @param array $data - header data.
7 * @return mixed - header data with playvideos toolbar item.
8 */
9function hook_playvideos_render_header($data) {
10 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
11 $data['buttons_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/playvideos/playvideos.html');
12 }
13
14 return $data;
15}
16
17/**
18 * When linklist is displayed, include playvideos JS files.
19 *
20 * @param array $data - footer data.
21 * @return mixed - footer data with playvideos JS files added.
22 */
23function hook_playvideos_render_footer($data) {
24 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
25 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
26 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
27 }
28
29 return $data;
30} \ No newline at end of file