diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/addlink_toolbar/addlink_toolbar.html | 6 | ||||
-rw-r--r-- | plugins/addlink_toolbar/addlink_toolbar.php | 20 | ||||
-rw-r--r-- | plugins/demo_plugin/custom_demo.css | 4 | ||||
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 74 | ||||
-rw-r--r-- | plugins/playvideos/playvideos.html | 1 | ||||
-rw-r--r-- | plugins/playvideos/playvideos.php | 8 |
6 files changed, 93 insertions, 20 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; |
diff --git a/plugins/demo_plugin/custom_demo.css b/plugins/demo_plugin/custom_demo.css index af5e8bf9..95019e28 100644 --- a/plugins/demo_plugin/custom_demo.css +++ b/plugins/demo_plugin/custom_demo.css | |||
@@ -2,10 +2,6 @@ | |||
2 | color: red; | 2 | color: red; |
3 | } | 3 | } |
4 | 4 | ||
5 | .upper_plugin_demo { | ||
6 | float: left; | ||
7 | } | ||
8 | |||
9 | #demo_marquee { | 5 | #demo_marquee { |
10 | background: darkmagenta; | 6 | background: darkmagenta; |
11 | color: white; | 7 | color: white; |
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index 18834e53..8f675cc4 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php | |||
@@ -33,15 +33,62 @@ function hook_demo_plugin_render_header($data) | |||
33 | 33 | ||
34 | // If loggedin | 34 | // If loggedin |
35 | if ($data['_LOGGEDIN_'] === true) { | 35 | if ($data['_LOGGEDIN_'] === true) { |
36 | // Buttons in toolbar | 36 | /* |
37 | $data['buttons_toolbar'][] = '<li><a href="#">DEMO_buttons_toolbar</a></li>'; | 37 | * Links in toolbar: |
38 | * A link is an array of its attributes (key="value"), | ||
39 | * and a mandatory `html` key, which contains its value. | ||
40 | */ | ||
41 | $button = array( | ||
42 | 'href' => '#', | ||
43 | 'class' => 'mybutton', | ||
44 | 'title' => 'hover me', | ||
45 | 'html' => 'DEMO buttons toolbar', | ||
46 | ); | ||
47 | $data['buttons_toolbar'][] = $button; | ||
38 | } | 48 | } |
39 | 49 | ||
40 | // Fields in toolbar | 50 | /* |
41 | $data['fields_toolbar'][] = 'DEMO_fields_toolbar'; | 51 | * Add additional input fields in the tools. |
52 | * A field is an array containing: | ||
53 | * [ | ||
54 | * 'form-attribute-1' => 'form attribute 1 value', | ||
55 | * 'form-attribute-2' => 'form attribute 2 value', | ||
56 | * 'inputs' => [ | ||
57 | * [ | ||
58 | * 'input-1-attribute-1 => 'input 1 attribute 1 value', | ||
59 | * 'input-1-attribute-2 => 'input 1 attribute 2 value', | ||
60 | * ], | ||
61 | * [ | ||
62 | * 'input-2-attribute-1 => 'input 2 attribute 1 value', | ||
63 | * ], | ||
64 | * ], | ||
65 | * ] | ||
66 | * This example renders as: | ||
67 | * <form form-attribute-1="form attribute 1 value" form-attribute-2="form attribute 2 value"> | ||
68 | * <input input-1-attribute-1="input 1 attribute 1 value" input-1-attribute-2="input 1 attribute 2 value"> | ||
69 | * <input input-2-attribute-1="input 2 attribute 1 value"> | ||
70 | * </form> | ||
71 | */ | ||
72 | $form = array( | ||
73 | 'method' => 'GET', | ||
74 | 'action' => '?', | ||
75 | 'class' => 'addform', | ||
76 | 'inputs' => array( | ||
77 | array( | ||
78 | 'type' => 'text', | ||
79 | 'name' => 'demo', | ||
80 | 'placeholder' => 'demo', | ||
81 | ) | ||
82 | ) | ||
83 | ); | ||
84 | $data['fields_toolbar'][] = $form; | ||
42 | } | 85 | } |
43 | // Another button always displayed | 86 | // Another button always displayed |
44 | $data['buttons_toolbar'][] = '<li><a href="#">DEMO</a></li>'; | 87 | $button = array( |
88 | 'href' => '#', | ||
89 | 'html' => 'Demo', | ||
90 | ); | ||
91 | $data['buttons_toolbar'][] = $button; | ||
45 | 92 | ||
46 | return $data; | 93 | return $data; |
47 | } | 94 | } |
@@ -126,8 +173,17 @@ function hook_demo_plugin_render_footer($data) | |||
126 | */ | 173 | */ |
127 | function hook_demo_plugin_render_linklist($data) | 174 | function hook_demo_plugin_render_linklist($data) |
128 | { | 175 | { |
129 | // action_plugin | 176 | /* |
130 | $data['action_plugin'][] = '<div class="upper_plugin_demo"><a href="?up" title="Uppercase!">←</a></div>'; | 177 | * Action links (action_plugin): |
178 | * A link is an array of its attributes (key="value"), | ||
179 | * and a mandatory `html` key, which contains its value. | ||
180 | * It's also recommended to add key 'on' or 'off' for theme rendering. | ||
181 | */ | ||
182 | $action = array( | ||
183 | 'href' => '?up', | ||
184 | 'title' => 'Uppercase!', | ||
185 | 'html' => '←', | ||
186 | ); | ||
131 | 187 | ||
132 | if (isset($_GET['up'])) { | 188 | if (isset($_GET['up'])) { |
133 | // Manipulate link data | 189 | // Manipulate link data |
@@ -135,7 +191,11 @@ function hook_demo_plugin_render_linklist($data) | |||
135 | $value['description'] = strtoupper($value['description']); | 191 | $value['description'] = strtoupper($value['description']); |
136 | $value['title'] = strtoupper($value['title']); | 192 | $value['title'] = strtoupper($value['title']); |
137 | } | 193 | } |
194 | $action['on'] = true; | ||
195 | } else { | ||
196 | $action['off'] = true; | ||
138 | } | 197 | } |
198 | $data['action_plugin'][] = $action; | ||
139 | 199 | ||
140 | // link_plugin (for each link) | 200 | // link_plugin (for each link) |
141 | foreach ($data['links'] as &$value) { | 201 | foreach ($data['links'] as &$value) { |
diff --git a/plugins/playvideos/playvideos.html b/plugins/playvideos/playvideos.html deleted file mode 100644 index fda3d54f..00000000 --- a/plugins/playvideos/playvideos.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | <a href="#" id="playvideos">► Play Videos</a> \ No newline at end of file | ||
diff --git a/plugins/playvideos/playvideos.php b/plugins/playvideos/playvideos.php index 7645b778..2f4b0a31 100644 --- a/plugins/playvideos/playvideos.php +++ b/plugins/playvideos/playvideos.php | |||
@@ -16,7 +16,13 @@ | |||
16 | function hook_playvideos_render_header($data) | 16 | function hook_playvideos_render_header($data) |
17 | { | 17 | { |
18 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { | 18 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { |
19 | $data['buttons_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/playvideos/playvideos.html'); | 19 | $playvideo = array( |
20 | 'href' => '#', | ||
21 | 'title' => 'Video player', | ||
22 | 'id' => 'playvideos', | ||
23 | 'html' => '► Play Videos' | ||
24 | ); | ||
25 | $data['buttons_toolbar'][] = $playvideo; | ||
20 | } | 26 | } |
21 | 27 | ||
22 | return $data; | 28 | return $data; |