aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-11-08 12:40:14 +0100
committerArthurHoaro <arthur@hoa.ro>2015-11-08 12:40:14 +0100
commitff5bda8238b1914ac80c45ffb3fcb910c4b4568c (patch)
tree7350feed42eee7d581542c3443f5e88171c19023 /plugins
parent1b2b44f4bd4457a3dc7b559d3e86cd38644ffe6f (diff)
downloadShaarli-ff5bda8238b1914ac80c45ffb3fcb910c4b4568c.tar.gz
Shaarli-ff5bda8238b1914ac80c45ffb3fcb910c4b4568c.tar.zst
Shaarli-ff5bda8238b1914ac80c45ffb3fcb910c4b4568c.zip
unit test for addlink_toolbar + coding style
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/addlink_toolbar/addlink_toolbar.php b/plugins/addlink_toolbar/addlink_toolbar.php
index 826a0922..ba3849cf 100755
--- a/plugins/addlink_toolbar/addlink_toolbar.php
+++ b/plugins/addlink_toolbar/addlink_toolbar.php
@@ -1,12 +1,19 @@
1<?php 1<?php
2 2
3/** 3/**
4 * Plugin addlink_toolbar.
5 * Adds the addlink input on the linklist page.
6 */
7
8/**
4 * When linklist is displayed, add play videos to header's toolbar. 9 * When linklist is displayed, add play videos to header's toolbar.
5 * 10 *
6 * @param array $data - header data. 11 * @param array $data - header data.
12 *
7 * @return mixed - header data with addlink toolbar item. 13 * @return mixed - header data with addlink toolbar item.
8 */ 14 */
9function hook_addlink_toolbar_render_header($data) { 15function hook_addlink_toolbar_render_header($data)
16{
10 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) { 17 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
11 $data['fields_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.html'); 18 $data['fields_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.html');
12 } 19 }
@@ -18,9 +25,11 @@ function hook_addlink_toolbar_render_header($data) {
18 * When link list is displayed, include markdown CSS. 25 * When link list is displayed, include markdown CSS.
19 * 26 *
20 * @param array $data - includes data. 27 * @param array $data - includes data.
28 *
21 * @return mixed - includes data with markdown CSS file added. 29 * @return mixed - includes data with markdown CSS file added.
22 */ 30 */
23function hook_addlink_toolbar_render_includes($data) { 31function hook_addlink_toolbar_render_includes($data)
32{
24 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) { 33 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
25 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css'; 34 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
26 } 35 }