X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Fdemo_plugin%2Fdemo_plugin.php;h=22d27b6827f306ad3a3230ffd8361cd543a5bd6b;hb=302662797cb5e8ac6579a99297ceae301f7927a6;hp=bdbc719bc778c98c4a2396e8dc1049ecc20a26eb;hpb=a0ab3c3f68ed3bca7d218e6e5847820b82b086ca;p=github%2Fshaarli%2FShaarli.git
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php
index bdbc719b..22d27b68 100644
--- a/plugins/demo_plugin/demo_plugin.php
+++ b/plugins/demo_plugin/demo_plugin.php
@@ -1,9 +1,10 @@
array (
+ $button = [
+ 'attr' => [
'href' => '#',
'class' => 'mybutton',
'title' => 'hover me',
- ),
+ ],
'html' => 'DEMO buttons toolbar',
- );
+ ];
$data['buttons_toolbar'][] = $button;
}
@@ -108,34 +111,34 @@ function hook_demo_plugin_render_header($data)
* ],
* ]
* This example renders as:
- *
+ *
*/
- $form = array(
- 'attr' => array(
+ $form = [
+ 'attr' => [
'method' => 'GET',
- 'action' => '?',
+ 'action' => $data['_BASE_PATH_'] . '/',
'class' => 'addform',
- ),
- 'inputs' => array(
- array(
+ ],
+ 'inputs' => [
+ [
'type' => 'text',
'name' => 'demo',
'placeholder' => 'demo',
- )
- )
- );
+ ]
+ ]
+ ];
$data['fields_toolbar'][] = $form;
}
// Another button always displayed
- $button = array(
- 'attr' => array(
+ $button = [
+ 'attr' => [
'href' => '#',
- ),
+ ],
'html' => 'Demo',
- );
+ ];
$data['buttons_toolbar'][] = $button;
return $data;
@@ -143,7 +146,7 @@ function hook_demo_plugin_render_header($data)
/**
* Hook render_includes.
- * Executed on every page redering.
+ * Executed on every page render.
*
* Template placeholders:
* - css_files
@@ -167,7 +170,7 @@ function hook_demo_plugin_render_includes($data)
/**
* Hook render_footer.
- * Executed on every page redering.
+ * Executed on every page render.
*
* Template placeholders:
* - text
@@ -184,8 +187,8 @@ function hook_demo_plugin_render_includes($data)
*/
function hook_demo_plugin_render_footer($data)
{
- // footer text
- $data['text'][] = '
'. demo_plugin_t('Shaarli is now enhanced by the awesome demo_plugin.');
+ // Footer text
+ $data['text'][] = '
' . demo_plugin_t('Shaarli is now enhanced by the awesome demo_plugin.');
// Free elements at the end of the page.
$data['endofpage'][] = '