This commit is contained in:
Jean-Christian Paul Denis 2022-12-10 18:08:16 +01:00
parent 05a74d8f8a
commit 5354e21c02
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 13 additions and 13 deletions

View File

@ -38,21 +38,20 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) {
}); });
dcCore::app()->addBehavior('pluginsToolsTabsV2', function () { 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) { if (!dcCore::app()->blog->settings->__get(basename(__DIR__))->dcAdvancedCleaner_behavior_active) {
return null; 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 = new dcUninstaller();
$uninstaller->loadModules($path); $uninstaller->loadModules($path);
$modules = $uninstaller->getModules(); $modules = $uninstaller->getModules();
$props = $uninstaller->getAllowedActions(); $props = $uninstaller->getAllowedActions();
echo '<div class="multi-part" id="uninstaller" title="' . __($title) . '"><h3>' . __($title) . '</h3>'; echo '<div class="multi-part" id="uninstaller" title="' . __('Advanced uninstall') . '"><h3>' . __('Advanced uninstall') . '</h3>';
if (!count($modules)) { if (!count($modules)) {
echo '<p>' . __('There is no module with uninstall features') . '</p></div>'; echo '<p>' . __('There is no module with uninstall features') . '</p></div>';
@ -207,11 +206,12 @@ dcCore::app()->addBehavior('themeBeforeDelete', function ($theme) {
function dcAdvancedCleanerModuleBeforeDelete($module) function dcAdvancedCleanerModuleBeforeDelete($module)
{ {
$done = false;
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;
} }
$done = false;
$uninstaller = new dcUninstaller(); $uninstaller = new dcUninstaller();
$uninstaller->loadModule($module['root']); $uninstaller->loadModule($module['root']);