From 1cfc2e689859d47f32b52b57e7f3363c9964f57a Mon Sep 17 00:00:00 2001 From: animaux Date: Mon, 17 Jun 2024 16:11:29 +0200 Subject: [PATCH] fix plugin info --- index.php | 333 +++++++++++++++++++++++++++--------------------------- 1 file changed, 167 insertions(+), 166 deletions(-) mode change 100644 => 100755 index.php diff --git a/index.php b/index.php old mode 100644 new mode 100755 index 1cfca5c..82de746 --- a/index.php +++ b/index.php @@ -2,189 +2,190 @@ $debug = ''; -Kirby::plugin('animaux/devkit', [ +Kirby::plugin( name: 'animaux/devkit', - version: '0.4.1', + version: '0.4.3', info: [ 'description' => 'Get easily accessible info on variables and data in frontend for template development.', 'homepage' => 'https://github.com/animaux/kirby-devkit', 'license' => 'MIT', ], - - 'hooks' => [ - 'page.render:after' => function (string $contentType, array $data, $html, Kirby\Cms\Page $page) { - - $kirby = $this; - $user = $this->user(); - $site = $this->site(); - $files = $page->files(); - $content = $page->content(); - global $debug; - - function addVar($name, $value) { - global $debug; - $debug .= '
  • ' . $name . '' . $value . '
  • '; - } + extends: [ + 'hooks' => [ + 'page.render:after' => function (string $contentType, array $data, $html, Kirby\Cms\Page $page) { - /* Check for ?devkit or ?dev, debug mode and logged in user */ - if ($kirby->option('debug') === true && $user && $user->isLoggedIn() && (isset($_GET['dev']) or isset($_GET['devkit']))) { - - $debug .= ''; - $debug .= ''; - } - - /* Page Controllers abgrasen? */ - //$debug .= $kirby->controller($page->intendedTemplate()->name()); - - - /* Output */ - return $debug . $html; - - } + + /* Page Controllers abgrasen? */ + //$debug .= $kirby->controller($page->intendedTemplate()->name()); + + + /* Output */ + return $debug . $html; + + } + ] ] -]); \ No newline at end of file +); \ No newline at end of file