blog->settings->addNamespace('improve'); } private static function addAdminBehaviors(): void { dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { $favs->register( 'improve', [ 'title' => __('improve'), 'url' => dcCore::app()->adminurl->get('admin.plugin.improve'), 'small-icon' => dcPage::getPF('improve/icon.svg'), 'large-icon' => dcPage::getPF('improve/icon.svg'), //'permissions' => null, ] ); }); } private static function addAdminMenu(): void { dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( __('improve'), dcCore::app()->adminurl->get('admin.plugin.improve'), dcPage::getPF('improve/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.improve')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->isSuperAdmin() ); } private static function addImproveActions(): void { foreach (files::scandir(prepend::getActionsDir()) as $file) { if (is_file(prepend::getActionsDir() . $file) && '.php' == substr($file, -4)) { Clearbricks::lib()->autoload([prepend::getActionsNS() . substr($file, 0, -4) => prepend::getActionsDir() . $file]); dcCore::app()->addBehavior('improveAddAction', [prepend::getActionsNS() . substr($file, 0, -4), 'create']); /* @phpstan-ignore-line */ } } } } /* process */ admin::process();