From 7b12fb3087757be20280140aff7e94815491185b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 13 Aug 2023 18:17:07 +0200 Subject: [PATCH] upgrade to Dotclear 2.27 --- src/Backend.php | 10 ++++------ src/Frontend.php | 10 ++++------ src/My.php | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 src/My.php diff --git a/src/Backend.php b/src/Backend.php index c9b4029..1934edc 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\postInfoWidget; use dcCore; -use dcNsProcess; +use Dotclear\Core\Process; -class Backend extends dcNsProcess +class Backend extends Process { public static function init(): bool { - static::$init = defined('DC_CONTEXT_ADMIN'); - - return static::$init; + return self::status(My::checkContext(My::BACKEND)); } public static function process(): bool { - if (!static::$init) { + if (!self::status()) { return false; } diff --git a/src/Frontend.php b/src/Frontend.php index ac18ed0..bf4bd24 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\postInfoWidget; use dcCore; -use dcNsProcess; +use Dotclear\Core\Process; -class Frontend extends dcNsProcess +class Frontend extends Process { public static function init(): bool { - static::$init = true; - - return static::$init; + return self::status(My::checkContext(My::FRONTEND)); } public static function process(): bool { - if (!static::$init) { + if (!self::status()) { return false; } diff --git a/src/My.php b/src/My.php new file mode 100644 index 0000000..cd98333 --- /dev/null +++ b/src/My.php @@ -0,0 +1,21 @@ +