upgrade to Dotclear 2.27
This commit is contained in:
parent
2d5baa1440
commit
0dc0756f4b
@ -15,20 +15,18 @@ declare(strict_types=1);
|
|||||||
namespace Dotclear\Plugin\shortArchives;
|
namespace Dotclear\Plugin\shortArchives;
|
||||||
|
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use dcNsProcess;
|
use Dotclear\Core\Process;
|
||||||
|
|
||||||
class Backend extends dcNsProcess
|
class Backend extends Process
|
||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN');
|
return self::status(My::checkContext(My::BACKEND));
|
||||||
|
|
||||||
return static::$init;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function process(): bool
|
public static function process(): bool
|
||||||
{
|
{
|
||||||
if (!static::$init) {
|
if (!self::status()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,21 +15,18 @@ declare(strict_types=1);
|
|||||||
namespace Dotclear\Plugin\shortArchives;
|
namespace Dotclear\Plugin\shortArchives;
|
||||||
|
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use dcNsProcess;
|
use Dotclear\Core\Process;
|
||||||
use dcUtils;
|
|
||||||
|
|
||||||
class Frontend extends dcNsProcess
|
class Frontend extends Process
|
||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_RC_PATH');
|
return self::status(My::checkContext(My::FRONTEND));
|
||||||
|
|
||||||
return static::$init;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function process(): bool
|
public static function process(): bool
|
||||||
{
|
{
|
||||||
if (!static::$init) {
|
if (!self::status()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,8 +34,8 @@ class Frontend extends dcNsProcess
|
|||||||
'initWidgets' => [Widgets::class, 'initWidgets'],
|
'initWidgets' => [Widgets::class, 'initWidgets'],
|
||||||
'publicHeadContent' => function (): void {
|
'publicHeadContent' => function (): void {
|
||||||
echo
|
echo
|
||||||
dcUtils::jsModuleLoad(My::id() . '/js/accordion.js') .
|
My::jsLoad('accordion') .
|
||||||
dcUtils::cssModuleLoad(My::id() . '/css/frontend.css');
|
My::cssLoad('frontend');
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
29
src/My.php
29
src/My.php
@ -14,36 +14,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Dotclear\Plugin\shortArchives;
|
namespace Dotclear\Plugin\shortArchives;
|
||||||
|
|
||||||
use dcCore;
|
use Dotclear\Module\MyPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module definitions.
|
* 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__);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user