aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/addlink_toolbar/addlink_toolbar.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-10-15 12:25:38 +0200
committerArthurHoaro <arthur@hoa.ro>2015-11-08 12:20:20 +0100
commit1b2b44f4bd4457a3dc7b559d3e86cd38644ffe6f (patch)
treec9fcc56310363e53a9fe4457051c7e448ff062ed /plugins/addlink_toolbar/addlink_toolbar.php
parenta52e8435939c641f964939f1df55cf7ceddcc0fd (diff)
downloadShaarli-1b2b44f4bd4457a3dc7b559d3e86cd38644ffe6f.tar.gz
Shaarli-1b2b44f4bd4457a3dc7b559d3e86cd38644ffe6f.tar.zst
Shaarli-1b2b44f4bd4457a3dc7b559d3e86cd38644ffe6f.zip
PLUGIN: addlink_toolbar
Add a field in linklist page to paste a new link. Displayed in fields toolbar.
Diffstat (limited to 'plugins/addlink_toolbar/addlink_toolbar.php')
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.php29
1 files changed, 29 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..826a0922
--- /dev/null
+++ b/plugins/addlink_toolbar/addlink_toolbar.php
@@ -0,0 +1,29 @@
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 addlink toolbar item.
8 */
9function hook_addlink_toolbar_render_header($data) {
10 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
11 $data['fields_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.html');
12 }
13
14 return $data;
15}
16
17/**
18 * When link list is displayed, include markdown CSS.
19 *
20 * @param array $data - includes data.
21 * @return mixed - includes data with markdown CSS file added.
22 */
23function hook_addlink_toolbar_render_includes($data) {
24 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
25 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
26 }
27
28 return $data;
29} \ No newline at end of file