fix static init

main
Jean-Christian Paul Denis 2023-03-26 21:11:26 +02:00
parent e1129e39d6
commit de3f675e33
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 18 additions and 19 deletions

View File

@ -25,14 +25,14 @@ class Backend extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_CONTEXT_ADMIN');
static::$init = defined('DC_CONTEXT_ADMIN');
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}

View File

@ -22,14 +22,14 @@ class Install extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}

View File

@ -30,20 +30,19 @@ class Manage extends dcNsProcess
{
public static function init(): bool
{
if (defined('DC_CONTEXT_ADMIN')) {
dcPage::check(dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_CONTENT_ADMIN,
]));
static::$init = defined('DC_CONTEXT_ADMIN')
&& dcCore:app()->auth->check(
dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id
);
self::$init = true;
}
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}
@ -117,7 +116,7 @@ class Manage extends dcNsProcess
public static function render(): void
{
if (!self::$init) {
if (!static::$init) {
return;
}

View File

@ -20,14 +20,14 @@ class Prepend extends dcNsProcess
{
public static function init(): bool
{
self::$init = true;
static::$init = true;
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}