diff options
Diffstat (limited to 'plugins/addlink_toolbar')
-rwxr-xr-x | plugins/addlink_toolbar/addlink_toolbar.css | 4 | ||||
-rwxr-xr-x | plugins/addlink_toolbar/addlink_toolbar.html | 6 | ||||
-rwxr-xr-x | plugins/addlink_toolbar/addlink_toolbar.php | 29 |
3 files changed, 39 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..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 | */ | ||
9 | function 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 | */ | ||
23 | function 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 | ||