diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-11-07 16:30:56 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-11-07 16:30:56 +0100 |
commit | 840caea64f8c37f035fb3525f63153eb68492731 (patch) | |
tree | 792022187b13f1e65b658f10e755c683f4a2606c /plugins | |
parent | b17c19ff76dc63b9ad10d26b244630b59e691e5c (diff) | |
download | Shaarli-840caea64f8c37f035fb3525f63153eb68492731.tar.gz Shaarli-840caea64f8c37f035fb3525f63153eb68492731.tar.zst Shaarli-840caea64f8c37f035fb3525f63153eb68492731.zip |
Add unit tests for Playvideos plugin
+ coding style
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/playvideos/playvideos.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/playvideos/playvideos.php b/plugins/playvideos/playvideos.php index 9918453c..0a80aa58 100644 --- a/plugins/playvideos/playvideos.php +++ b/plugins/playvideos/playvideos.php | |||
@@ -1,12 +1,20 @@ | |||
1 | <?php | 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 | */ | ||
2 | 8 | ||
3 | /** | 9 | /** |
4 | * When linklist is displayed, add play videos to header's toolbar. | 10 | * When linklist is displayed, add play videos to header's toolbar. |
5 | * | 11 | * |
6 | * @param array $data - header data. | 12 | * @param array $data - header data. |
13 | * | ||
7 | * @return mixed - header data with playvideos toolbar item. | 14 | * @return mixed - header data with playvideos toolbar item. |
8 | */ | 15 | */ |
9 | function hook_playvideos_render_header($data) { | 16 | function hook_playvideos_render_header($data) |
17 | { | ||
10 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { | 18 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { |
11 | $data['buttons_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/playvideos/playvideos.html'); | 19 | $data['buttons_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/playvideos/playvideos.html'); |
12 | } | 20 | } |
@@ -18,9 +26,11 @@ function hook_playvideos_render_header($data) { | |||
18 | * When linklist is displayed, include playvideos JS files. | 26 | * When linklist is displayed, include playvideos JS files. |
19 | * | 27 | * |
20 | * @param array $data - footer data. | 28 | * @param array $data - footer data. |
29 | * | ||
21 | * @return mixed - footer data with playvideos JS files added. | 30 | * @return mixed - footer data with playvideos JS files added. |
22 | */ | 31 | */ |
23 | function hook_playvideos_render_footer($data) { | 32 | function hook_playvideos_render_footer($data) |
33 | { | ||
24 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { | 34 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { |
25 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js'; | 35 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js'; |
26 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js'; | 36 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js'; |