From 1a8ac737e52cb25a5c346232ee398f5908cee7d7 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 6 Jul 2020 08:04:35 +0200 Subject: Process main page (linklist) through Slim controller Including a bunch of improvements on the container, and helper used across new controllers. --- plugins/demo_plugin/demo_plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/demo_plugin') diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index 8ae1b479..dd73d6a2 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php @@ -16,7 +16,7 @@ use Shaarli\Config\ConfigManager; use Shaarli\Plugin\PluginManager; -use Shaarli\Router; +use Shaarli\Render\TemplatePage; /** * In the footer hook, there is a working example of a translation extension for Shaarli. @@ -74,7 +74,7 @@ function demo_plugin_init($conf) function hook_demo_plugin_render_header($data) { // Only execute when linklist is rendered. - if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { + if ($data['_PAGE_'] == TemplatePage::LINKLIST) { // If loggedin if ($data['_LOGGEDIN_'] === true) { /* @@ -441,9 +441,9 @@ function hook_demo_plugin_delete_link($data) function hook_demo_plugin_render_feed($data) { foreach ($data['links'] as &$link) { - if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) { + if ($data['_PAGE_'] == TemplatePage::FEED_ATOM) { $link['description'] .= ' - ATOM Feed' ; - } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) { + } elseif ($data['_PAGE_'] == TemplatePage::FEED_RSS) { $link['description'] .= ' - RSS Feed'; } } -- cgit v1.2.3 From 9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 26 Jul 2020 14:43:10 +0200 Subject: New basePath: fix officiel plugin paths and vintage template --- plugins/demo_plugin/demo_plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/demo_plugin') diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index dd73d6a2..defb01f7 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php @@ -118,7 +118,7 @@ function hook_demo_plugin_render_header($data) $form = array( 'attr' => array( 'method' => 'GET', - 'action' => '?', + 'action' => $data['_BASE_PATH_'] . '/', 'class' => 'addform', ), 'inputs' => array( -- cgit v1.2.3