aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/addlink_toolbar
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-12-01 11:38:21 +0100
committerArthurHoaro <arthur@hoa.ro>2016-12-01 11:38:21 +0100
commitba0fd80732acbff0fcda57a0b31e4edfaa337001 (patch)
tree34eab231241e1c7b72f5b069fa132bdcedc830e0 /plugins/addlink_toolbar
parent849d1650c1af853162b749af896c20bb25d4a4e8 (diff)
downloadShaarli-ba0fd80732acbff0fcda57a0b31e4edfaa337001.tar.gz
Shaarli-ba0fd80732acbff0fcda57a0b31e4edfaa337001.tar.zst
Shaarli-ba0fd80732acbff0fcda57a0b31e4edfaa337001.zip
Improve theme dependent plugin placeholders:
- buttons_toolbar: now expect links represented by an array instead of HTML content - fields_toolbar: now expect a form represented by an array instead of HTML content - action_plugin: now expect links represented by an array instead of HTML content Default templates updated accordingly mprove theme dependent plugin placeholders:
Diffstat (limited to 'plugins/addlink_toolbar')
-rw-r--r--plugins/addlink_toolbar/addlink_toolbar.css4
-rw-r--r--plugins/addlink_toolbar/addlink_toolbar.html6
-rw-r--r--plugins/addlink_toolbar/addlink_toolbar.php22
3 files changed, 21 insertions, 11 deletions
diff --git a/plugins/addlink_toolbar/addlink_toolbar.css b/plugins/addlink_toolbar/addlink_toolbar.css
deleted file mode 100644
index b6a612f0..00000000
--- a/plugins/addlink_toolbar/addlink_toolbar.css
+++ /dev/null
@@ -1,4 +0,0 @@
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
deleted file mode 100644
index f38c41a0..00000000
--- a/plugins/addlink_toolbar/addlink_toolbar.html
+++ /dev/null
@@ -1,6 +0,0 @@
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
index cfd74207..bf8a198a 100644
--- a/plugins/addlink_toolbar/addlink_toolbar.php
+++ b/plugins/addlink_toolbar/addlink_toolbar.php
@@ -15,7 +15,27 @@
15function hook_addlink_toolbar_render_header($data) 15function hook_addlink_toolbar_render_header($data)
16{ 16{
17 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) { 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'); 18 $form = array(
19 'attr' => array(
20 'method' => 'GET',
21 'action' => '',
22 'name' => 'addform',
23 'class' => 'addform',
24 ),
25 'inputs' => array(
26 array(
27 'type' => 'text',
28 'name' => 'post',
29 'placeholder' => 'URI',
30 ),
31 array(
32 'type' => 'submit',
33 'value' => 'Add link',
34 'class' => 'bigbutton',
35 ),
36 ),
37 );
38 $data['fields_toolbar'][] = $form;
19 } 39 }
20 40
21 return $data; 41 return $data;