auth->isSuperAdmin() && My::phpCompliant(); return static::$init; } public static function process(): bool { if (!static::$init) { return false; } dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { $favs->register( My::id(), [ 'title' => My::name(), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . My::id()), 'small-icon' => dcPage::getPF(My::id() . '/icon.svg'), 'large-icon' => dcPage::getPF(My::id() . '/icon.svg'), //'permissions' => null, ] ); }); dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( My::name(), dcCore::app()->adminurl->get('admin.plugin.' . My::id()), dcPage::getPF(My::id() . '/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . My::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->isSuperAdmin() ); $dir = __DIR__ . DIRECTORY_SEPARATOR . 'module' . DIRECTORY_SEPARATOR; $ns = __NAMESPACE__ . '\\Module\\'; dcCore::app()->autoload->addNamespace($ns, $dir); foreach (Files::scandir($dir) as $file) { if (str_ends_with($file, '.php') && is_file($dir . $file)) { dcCore::app()->addBehavior('improveAddAction', [$ns . basename($file, '.php'), 'create']); /* @phpstan-ignore-line */ } } return true; } }