X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Fdemo_plugin%2Fdemo_plugin.php;h=d89765cfcb2ca20bfbf34a4cda8a592669b73524;hb=refs%2Fpull%2F1698%2Fhead;hp=defb01f7e4457d05f95f0f95e939297300033904;hpb=af41d5ab5d2bd3ba64d052c997bc6afa6966a63c;p=github%2Fshaarli%2FShaarli.git
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php
index defb01f7..d89765cf 100644
--- a/plugins/demo_plugin/demo_plugin.php
+++ b/plugins/demo_plugin/demo_plugin.php
@@ -1,4 +1,5 @@
'GET',
+ 'route' => '/custom',
+ 'callable' => 'Shaarli\DemoPlugin\DemoPluginController:index',
+ ],
+ ];
+}
+
/**
* Hook render_header.
* Executed on every page render.
@@ -82,14 +97,14 @@ function hook_demo_plugin_render_header($data)
* A link is an array of its attributes (key="value"),
* and a mandatory `html` key, which contains its value.
*/
- $button = array(
- 'attr' => array (
+ $button = [
+ 'attr' => [
'href' => '#',
'class' => 'mybutton',
'title' => 'hover me',
- ),
+ ],
'html' => 'DEMO buttons toolbar',
- );
+ ];
$data['buttons_toolbar'][] = $button;
}
@@ -115,29 +130,29 @@ function hook_demo_plugin_render_header($data)
*
*
*/
- $form = array(
- 'attr' => array(
+ $form = [
+ 'attr' => [
'method' => 'GET',
'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;
@@ -187,7 +202,7 @@ 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.');
+ $data['text'][] = '
' . demo_plugin_t('Shaarli is now enhanced by the awesome demo_plugin.');
// Free elements at the end of the page.
$data['endofpage'][] = '