diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-02 16:34:10 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-11-05 14:29:56 +0100 |
commit | c8f0a06d801d1e6405f5d86b45ba5967a6569c8c (patch) | |
tree | 173523374b5ac660ace025181acb817125ede482 /plugins/addlink_toolbar | |
parent | cac0ea87be6326271993c958788afbd244815ef1 (diff) | |
download | Shaarli-c8f0a06d801d1e6405f5d86b45ba5967a6569c8c.tar.gz Shaarli-c8f0a06d801d1e6405f5d86b45ba5967a6569c8c.tar.zst Shaarli-c8f0a06d801d1e6405f5d86b45ba5967a6569c8c.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
Diffstat (limited to 'plugins/addlink_toolbar')
-rw-r--r-- | plugins/addlink_toolbar/addlink_toolbar.html | 6 | ||||
-rw-r--r-- | plugins/addlink_toolbar/addlink_toolbar.php | 20 |
2 files changed, 19 insertions, 7 deletions
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..c96a891e 100644 --- a/plugins/addlink_toolbar/addlink_toolbar.php +++ b/plugins/addlink_toolbar/addlink_toolbar.php | |||
@@ -15,7 +15,25 @@ | |||
15 | function hook_addlink_toolbar_render_header($data) | 15 | function 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 | 'method' => 'GET', | ||
20 | 'action' => '', | ||
21 | 'name' => 'addform', | ||
22 | 'class' => 'addform', | ||
23 | 'inputs' => array( | ||
24 | array( | ||
25 | 'type' => 'text', | ||
26 | 'name' => 'post', | ||
27 | 'placeholder' => 'URI', | ||
28 | ), | ||
29 | array( | ||
30 | 'type' => 'submit', | ||
31 | 'value' => 'Add link', | ||
32 | 'class' => 'bigbutton', | ||
33 | ), | ||
34 | ), | ||
35 | ); | ||
36 | $data['fields_toolbar'][] = $form; | ||
19 | } | 37 | } |
20 | 38 | ||
21 | return $data; | 39 | return $data; |