X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Fdemo_plugin%2Fdemo_plugin.php;h=defb01f7e4457d05f95f0f95e939297300033904;hb=865f0a0e014bb114cc2f528be10a023de4057ff4;hp=8ae1b47969e15dafa1b142c68e98aaf19d8813b4;hpb=ef028857531a6abe2d7180538b8510502ee2a467;p=github%2Fshaarli%2FShaarli.git 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 @@ 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) { /* @@ -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( @@ -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'; } }