topWriter/src/Backend.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2023-03-21 19:35:05 +00:00
<?php
/**
* @brief topWriter, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis, Pierre Van Glabeke
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1);
namespace Dotclear\Plugin\topWriter;
use dcCore;
use dcNsProcess;
class Backend extends dcNsProcess
{
public static function init(): bool
{
static::$init = defined('DC_CONTEXT_ADMIN');
return static::$init;
}
public static function process(): bool
{
if (!static::$init) {
return false;
}
dcCore::app()->addBehaviors([
'adminDashboardItemsV2' => [BackendBehaviors::class, 'adminDashboardItemsV2'],
'adminDashboardOptionsFormV2' => [BackendBehaviors::class, 'adminDashboardOptionsFormV2'],
'adminAfterDashboardOptionsUpdate' => [BackendBehaviors::class, 'adminAfterDashboardOptionsUpdate'],
'initWidgets' => [Widgets::class, 'initWidgets'],
]);
return true;
}
}