diff --git a/_admin.php b/_admin.php index 8810160..b69111e 100644 --- a/_admin.php +++ b/_admin.php @@ -29,30 +29,29 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) { $favs->register(basename(__DIR__), [ - 'title' => __('Advanced cleaner'), - 'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), - 'small-icon' => dcPage::getPF(basename(__DIR__) . '/icon.png'), - 'large-icon' => dcPage::getPF(basename(__DIR__) . '/icon-big.png'), + 'title' => __('Advanced cleaner'), + 'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), + 'small-icon' => dcPage::getPF(basename(__DIR__) . '/icon.png'), + 'large-icon' => dcPage::getPF(basename(__DIR__) . '/icon-big.png'), //'permissions' => dcCore::app()->auth->isSuperAdmin(), ]); }); dcCore::app()->addBehavior('pluginsToolsTabsV2', function () { - $path = DC_PLUGINS_ROOT; - $redir = dcCore::app()->adminurl->get('admin.plugins', [], '#uninstaller'); - $title = ''; - if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) { return null; } - $title = empty($title) ? __('Advanced uninstall') : $title; + + $path = DC_PLUGINS_ROOT; + $redir = dcCore::app()->adminurl->get('admin.plugins', [], '#uninstaller'); + $title = ''; $uninstaller = new dcUninstaller(); $uninstaller->loadModules($path); $modules = $uninstaller->getModules(); $props = $uninstaller->getAllowedActions(); - echo '

' . __($title) . '

'; + echo '

' . __('Advanced uninstall') . '

'; if (!count($modules)) { echo '

' . __('There is no module with uninstall features') . '

'; @@ -207,11 +206,12 @@ dcCore::app()->addBehavior('themeBeforeDelete', function ($theme) { function dcAdvancedCleanerModuleBeforeDelete($module) { - $done = false; - if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) { return null; } + + $done = false; + $uninstaller = new dcUninstaller(); $uninstaller->loadModule($module['root']); diff --git a/_install.php b/_install.php index ad38e51..fe226a2 100644 --- a/_install.php +++ b/_install.php @@ -16,7 +16,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { try { if (!dcCore::app()->newVersion( - basename(__DIR__), + basename(__DIR__), dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') )) { return null;