__('Settings'), 'tables' => __('Tables'), 'plugins' => __('Extensions'), 'themes' => __('Themes'), 'caches' => __('Cache'), 'versions' => __('Versions') ]; $combo_type = [ 'settings' => ['delete_global', 'delete_local', 'delete_all'], 'tables' => ['empty', 'delete'], 'plugins' => ['empty', 'delete'], 'themes' => ['empty', 'delete'], 'caches' => ['empty', 'delete'], 'versions' => ['delete'] ]; $combo_funcs = [ 'settings' => ['dcAdvancedCleaner', 'getSettings'], 'tables' => ['dcAdvancedCleaner', 'getTables'], 'plugins' => ['dcAdvancedCleaner', 'getPlugins'], 'themes' => ['dcAdvancedCleaner', 'getThemes'], 'caches' => ['dcAdvancedCleaner', 'getCaches'], 'versions' => ['dcAdvancedCleaner', 'getVersions'] ]; $combo_actions = [ 'settings' => [ __('delete global settings') => 'delete_global', __('delete blog settings') => 'delete_local', __('delete all settings') =>'delete_all' ], 'tables' => [ __('delete') => 'delete', __('empty') => 'empty' ], 'plugins' => [ __('delete') => 'delete', __('empty') => 'empty' ], 'themes' => [ __('delete') => 'delete', __('empty') => 'empty' ], 'caches' => [ __('delete') => 'delete', __('empty') => 'empty' ], 'versions' => [ __('delete') => 'delete' ] ]; $combo_help = [ 'settings' => __('Namespaces registered in dcSettings'), 'tables' => __('All database tables of Dotclear'), 'plugins' => __('Folders from plugins directories'), 'themes' => __('Folders from blog themes directory'), 'caches' => __('Folders from cache directory'), 'versions' => __('Versions registered in table "version" of Dotclear') ]; # Actions if (!empty($entries) && isset($combo_type[$part]) && in_array($action, $combo_type[$part]) ) { try { foreach($entries as $v) { dcAdvancedCleaner::execute($core, $part, $action, $v); } dcPage::addSuccessNotice(__('Action successfuly excecuted')); $core->adminurl->redirect( 'admin.plugin.dcAdvancedCleaner', ['part' => $part] ); } catch(Exception $e) { $core->error->add($e->getMessage()); } } echo '
' . $combo_help[$part] . '
'; $rs = call_user_func($combo_funcs[$part], $core); if (empty($rs)) { echo '' . sprintf(__('There is no %s'), __(substr($part, 0, -1))) . '
'; } else { echo ''; } } if ($core->blog->settings->dcAdvancedCleaner->dcAdvancedCleaner_dcproperty_hide) { echo '' . __('Default values of Dotclear are hidden. You can change this in settings') . '
'; } dcPage::helpBlock('dcAdvancedCleaner'); echo '';