fix dasboard icon, fix #2

This commit is contained in:
Jean-Christian Paul Denis 2023-01-30 19:15:12 +01:00
parent 949041f081
commit 02813085c2
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -14,8 +14,6 @@ if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }
dcCore::app()->blog->settings->addNamespace(basename(__DIR__));
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
__('Advanced cleaner'), __('Advanced cleaner'),
dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)),
@ -27,17 +25,18 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
dcCore::app()->auth->isSuperAdmin() dcCore::app()->auth->isSuperAdmin()
); );
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) { dcCore::app()->addBehaviors([
'adminDashboardFavoritesV2' => function ($favs) {
$favs->register(basename(__DIR__), [ $favs->register(basename(__DIR__), [
'title' => __('Advanced cleaner'), 'title' => __('Advanced cleaner'),
'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)),
'small-icon' => dcPage::getPF(basename(__DIR__) . '/icon.png'), 'small-icon' => dcPage::getPF(basename(__DIR__) . '/icon.svg'),
'large-icon' => dcPage::getPF(basename(__DIR__) . '/icon-big.png'), 'large-icon' => dcPage::getPF(basename(__DIR__) . '/icon-big.svg'),
//'permissions' => dcCore::app()->auth->isSuperAdmin(), //'permissions' => dcCore::app()->auth->isSuperAdmin(),
]); ]);
}); },
dcCore::app()->addBehavior('pluginsToolsTabsV2', function () { 'pluginsToolsTabsV2' => function () {
if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) { if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) {
return null; return null;
} }
@ -140,9 +139,9 @@ dcCore::app()->addBehavior('pluginsToolsTabsV2', function () {
'</form>'; '</form>';
echo '</div>'; echo '</div>';
}); },
dcCore::app()->addBehavior('adminModulesListDoActions', function ($list, $modules, $type) { 'adminModulesListDoActions' => function ($list, $modules, $type) {
if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) { if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) {
return null; return null;
} }
@ -194,15 +193,16 @@ dcCore::app()->addBehavior('adminModulesListDoActions', function ($list, $module
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());
} }
}); },
dcCore::app()->addBehavior('pluginsBeforeDelete', function ($plugin) { 'pluginsBeforeDelete' => function ($plugin) {
dcAdvancedCleanerModuleBeforeDelete($plugin); dcAdvancedCleanerModuleBeforeDelete($plugin);
}); },
dcCore::app()->addBehavior('themeBeforeDelete', function ($theme) { 'themeBeforeDelete' => function ($theme) {
dcAdvancedCleanerModuleBeforeDelete($theme); dcAdvancedCleanerModuleBeforeDelete($theme);
}); },
]);
function dcAdvancedCleanerModuleBeforeDelete($module) function dcAdvancedCleanerModuleBeforeDelete($module)
{ {