use namespace

This commit is contained in:
Jean-Christian Paul Denis 2022-12-23 11:27:35 +01:00
parent e322b2da16
commit 7506fdb918
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -10,8 +10,47 @@
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_CONTEXT_ADMIN')) { declare(strict_types=1);
return null;
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( dcCore::app()->addBehavior(
@ -106,3 +145,12 @@ dcCore::app()->addBehavior(
http::redirect($list->getURL()); http::redirect($list->getURL());
} }
); );
return true;
}
}
/* process */
if (Admin::init()) {
Admin::process();
}