use namespace
This commit is contained in:
parent
e322b2da16
commit
7506fdb918
52
_admin.php
52
_admin.php
@ -10,8 +10,47 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
return null;
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\tinyPacker;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
|
||||
/* clearbricks */
|
||||
use files;
|
||||
use fileZip;
|
||||
use html;
|
||||
use http;
|
||||
use path;
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* tinyPacker admin class
|
||||
*
|
||||
* Add action and button to modules lists.
|
||||
*/
|
||||
class Admin
|
||||
{
|
||||
private static $init = false;
|
||||
|
||||
public static function init(): bool
|
||||
{
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
dcPage::checkSuper();
|
||||
self::$init = true;
|
||||
}
|
||||
|
||||
return self::$init;
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!self::$init) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dcCore::app()->addBehavior(
|
||||
@ -106,3 +145,12 @@ dcCore::app()->addBehavior(
|
||||
http::redirect($list->getURL());
|
||||
}
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* process */
|
||||
if (Admin::init()) {
|
||||
Admin::process();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user