upgrade to Dotclear 2.27
This commit is contained in:
parent
7e82d4d552
commit
a969f1b66a
@ -15,26 +15,24 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\saba;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use dcSettings;
|
||||
use Dotclear\Core\Process;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Label,
|
||||
Para
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -15,28 +15,26 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\saba;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
class Frontend extends dcNsProcess
|
||||
class Frontend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_RC_PATH');
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::FRONTEND));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_null(dcCore::app()->blog) || !dcCore::app()->blog->settings->get(My::id())->get('active')) {
|
||||
if (My::settings()->get('active')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dcCore::app()->blog->settings->get(My::id())->get('error')) {
|
||||
if (My::settings()->get('error')) {
|
||||
dcCore::app()->url->registerError([UrlHandler::class, 'error']);
|
||||
}
|
||||
|
||||
|
29
src/My.php
29
src/My.php
@ -14,36 +14,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\saba;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\Module\MyPlugin;
|
||||
|
||||
/**
|
||||
* This module definitions.
|
||||
*/
|
||||
class My
|
||||
class My extends MyPlugin
|
||||
{
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
public static function id(): string
|
||||
{
|
||||
return basename(dirname(__DIR__));
|
||||
}
|
||||
|
||||
/**
|
||||
* This module name.
|
||||
*/
|
||||
public static function name(): string
|
||||
{
|
||||
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
|
||||
|
||||
return __(is_string($name) ? $name : self::id());
|
||||
}
|
||||
|
||||
/**
|
||||
* This module path.
|
||||
*/
|
||||
public static function path(): string
|
||||
{
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
}
|
||||
|
@ -15,25 +15,23 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\saba;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
use Dotclear\Plugin\activityReport\{
|
||||
Action,
|
||||
ActivityReport,
|
||||
Group
|
||||
};
|
||||
|
||||
class Prepend extends dcNsProcess
|
||||
class Prepend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_RC_PATH');
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::PREPEND));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -15,21 +15,19 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\saba;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
use Dotclear\Plugin\Uninstaller\Uninstaller;
|
||||
|
||||
class Uninstall extends dcNsProcess
|
||||
class Uninstall extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN');
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::UNINSTALL));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
|
||||
if (!self::status() || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user