aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/addlink_toolbar
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2015-11-08 13:29:32 +0100
committerArthur <arthur@hoa.ro>2015-11-08 13:29:32 +0100
commitfd006c630b64146edc402b68d8503c716f8a55d6 (patch)
treee53904cc6232c7f2fe8e1de6f23c9a5d6c5403ad /plugins/addlink_toolbar
parent70df947af60afb05529024bb2d3825eaf6cc7950 (diff)
parent056107ab4eae0a4867cf8d55de77d31f8868b899 (diff)
downloadShaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.gz
Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.zst
Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.zip
Merge pull request #275 from shaarli/plugin-proposition
Plugin proposition
Diffstat (limited to 'plugins/addlink_toolbar')
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.css4
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.html6
-rwxr-xr-xplugins/addlink_toolbar/addlink_toolbar.php38
3 files changed, 48 insertions, 0 deletions
diff --git a/plugins/addlink_toolbar/addlink_toolbar.css b/plugins/addlink_toolbar/addlink_toolbar.css
new file mode 100755
index 00000000..b6a612f0
--- /dev/null
+++ b/plugins/addlink_toolbar/addlink_toolbar.css
@@ -0,0 +1,4 @@
1#addlink_toolbar {
2 display: inline;
3 margin: 0 0 0 25px;
4} \ No newline at end of file
diff --git a/plugins/addlink_toolbar/addlink_toolbar.html b/plugins/addlink_toolbar/addlink_toolbar.html
new file mode 100755
index 00000000..f38c41a0
--- /dev/null
+++ b/plugins/addlink_toolbar/addlink_toolbar.html
@@ -0,0 +1,6 @@
1<div id="addlink_toolbar">
2 <form method="GET" action="" name="addform" class="addform">
3 <input type="text" name="post" placeholder="URI">
4 <input type="submit" value="Add link" class="bigbutton">
5 </form>
6</div> \ No newline at end of file
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