aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/addlink_toolbar/addlink_toolbar.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2015-11-08 12:45:07 +0100
committerArthur <arthur@hoa.ro>2015-11-08 12:45:07 +0100
commit00c25040c523104e1b845fd71d1cd134a1a5e7ff (patch)
treea1b4f4cb5a5f7ec677acf2c8b495ae514cb8fe96 /plugins/addlink_toolbar/addlink_toolbar.php
parent245432e796a6e520ec830bd1d486420e115853d8 (diff)
parentff5bda8238b1914ac80c45ffb3fcb910c4b4568c (diff)
downloadShaarli-00c25040c523104e1b845fd71d1cd134a1a5e7ff.tar.gz
Shaarli-00c25040c523104e1b845fd71d1cd134a1a5e7ff.tar.zst
Shaarli-00c25040c523104e1b845fd71d1cd134a1a5e7ff.zip
Merge pull request #279 from ArthurHoaro/plugin-addlink_toolbar
PLUGIN: addlink_toolbar
Diffstat (limited to 'plugins/addlink_toolbar/addlink_toolbar.php')
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/addlink_toolbar/addlink_toolbar.php b/plugins/addlink_toolbar/addlink_toolbar.php
new file mode 100755
index 00000000..ba3849cf
--- /dev/null
+++ b/plugins/addlink_toolbar/addlink_toolbar.php
@@ -0,0 +1,38 @@
1<?php
2
3/**
4 * Plugin addlink_toolbar.
5 * Adds the addlink input on the linklist page.
6 */
7
8/**
9 * When linklist is displayed, add play videos to header's toolbar.
10 *
11 * @param array $data - header data.
12 *
13 * @return mixed - header data with addlink toolbar item.
14 */
15function hook_addlink_toolbar_render_header($data)
16{
17 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
18 $data['fields_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.html');
19 }
20
21 return $data;
22}
23
24/**
25 * When link list is displayed, include markdown CSS.
26 *
27 * @param array $data - includes data.
28 *
29 * @return mixed - includes data with markdown CSS file added.
30 */
31function hook_addlink_toolbar_render_includes($data)
32{
33 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
34 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
35 }
36
37 return $data;
38} \ No newline at end of file