addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { $favs->register( 'improve', [ 'title' => __('improve'), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . Core::id()), 'small-icon' => dcPage::getPF(Core::id() . '/icon.svg'), 'large-icon' => dcPage::getPF(Core::id() . '/icon.svg'), //'permissions' => null, ] ); }); dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( __('improve'), dcCore::app()->adminurl->get('admin.plugin.' . Core::id()), dcPage::getPF(Core::id() . '/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . Core::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->isSuperAdmin() ); 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 */ } } } }