aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/demo_plugin
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-08-27 10:27:34 +0200
committerGitHub <noreply@github.com>2020-08-27 10:27:34 +0200
commitaf41d5ab5d2bd3ba64d052c997bc6afa6966a63c (patch)
tree8fad2829c55f94022e359fa8914e11f80a2afc2a /plugins/demo_plugin
parentb8e3630f2ecd142d397b1b062a346a667bb78595 (diff)
parent0c6fdbe12bbbb336348666b14b82096f24d5858b (diff)
downloadShaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.tar.gz
Shaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.tar.zst
Shaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.zip
Merge pull request #1511 from ArthurHoaro/wip-slim-routing
Diffstat (limited to 'plugins/demo_plugin')
-rw-r--r--plugins/demo_plugin/demo_plugin.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php
index 8ae1b479..defb01f7 100644
--- a/plugins/demo_plugin/demo_plugin.php
+++ b/plugins/demo_plugin/demo_plugin.php
@@ -16,7 +16,7 @@
16 16
17use Shaarli\Config\ConfigManager; 17use Shaarli\Config\ConfigManager;
18use Shaarli\Plugin\PluginManager; 18use Shaarli\Plugin\PluginManager;
19use Shaarli\Router; 19use Shaarli\Render\TemplatePage;
20 20
21/** 21/**
22 * In the footer hook, there is a working example of a translation extension for Shaarli. 22 * In the footer hook, there is a working example of a translation extension for Shaarli.
@@ -74,7 +74,7 @@ function demo_plugin_init($conf)
74function hook_demo_plugin_render_header($data) 74function hook_demo_plugin_render_header($data)
75{ 75{
76 // Only execute when linklist is rendered. 76 // Only execute when linklist is rendered.
77 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 77 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
78 // If loggedin 78 // If loggedin
79 if ($data['_LOGGEDIN_'] === true) { 79 if ($data['_LOGGEDIN_'] === true) {
80 /* 80 /*
@@ -118,7 +118,7 @@ function hook_demo_plugin_render_header($data)
118 $form = array( 118 $form = array(
119 'attr' => array( 119 'attr' => array(
120 'method' => 'GET', 120 'method' => 'GET',
121 'action' => '?', 121 'action' => $data['_BASE_PATH_'] . '/',
122 'class' => 'addform', 122 'class' => 'addform',
123 ), 123 ),
124 'inputs' => array( 124 'inputs' => array(
@@ -441,9 +441,9 @@ function hook_demo_plugin_delete_link($data)
441function hook_demo_plugin_render_feed($data) 441function hook_demo_plugin_render_feed($data)
442{ 442{
443 foreach ($data['links'] as &$link) { 443 foreach ($data['links'] as &$link) {
444 if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) { 444 if ($data['_PAGE_'] == TemplatePage::FEED_ATOM) {
445 $link['description'] .= ' - ATOM Feed' ; 445 $link['description'] .= ' - ATOM Feed' ;
446 } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) { 446 } elseif ($data['_PAGE_'] == TemplatePage::FEED_RSS) {
447 $link['description'] .= ' - RSS Feed'; 447 $link['description'] .= ' - RSS Feed';
448 } 448 }
449 } 449 }