diff --git a/_config.php b/_config.php new file mode 100644 index 0000000..647f8e6 --- /dev/null +++ b/_config.php @@ -0,0 +1,65 @@ +auth->isSuperAdmin()) { + return null; +} +if (!empty($_POST['save'])) { + try { + $core->blog->settings->dcAdvancedCleaner->dropEvery( + 'dcAdvancedCleaner_behavior_active' + ); + $core->blog->settings->dcAdvancedCleaner->put( + 'dcAdvancedCleaner_behavior_active', + !empty($_POST['behavior_active']), + 'boolean', + null, + true, + true + ); + $core->blog->settings->dcAdvancedCleaner->dropEvery( + 'dcAdvancedCleaner_dcproperty_hide' + ); + $core->blog->settings->dcAdvancedCleaner->put( + 'dcAdvancedCleaner_dcproperty_hide', + !empty($_POST['dcproperty_hide']), + 'boolean', + null, + true, + true + ); + dcPage::addSuccessNotice( + __('Configuration successfully updated.') + ); + $core->adminurl->redirect( + 'admin.plugins', + [ + 'module' => 'dcAdvancedCleaner', + 'conf' => 1, + 'redir' => empty($_REQUEST['redir']) ? $list->getURL() . '#plugins' : $_REQUEST['redir'] + ] + ); + } + catch(Exception $e) { + $core->error->add($e->getMessage()); + } +} +echo ' +
+' . __('Enable actions set in _uninstall.php files.') . '
+ +' . +__('Prevent from deleting Dotclear important properties.') . '
'; \ No newline at end of file diff --git a/index.php b/index.php index 3707a02..81461d0 100644 --- a/index.php +++ b/index.php @@ -168,20 +168,6 @@ $combo_type = [ 'versions' => ['delete'] ]; -# This plugin settings -if ($tab == 'dcac' && $action == 'dcadvancedcleaner_settings') { - try { - $s->put('dcAdvancedCleaner_behavior_active', isset($_POST['dcadvancedcleaner_behavior_active']), 'boolean'); - $s->put('dcAdvancedCleaner_dcproperty_hide', isset($_POST['dcadvancedcleaner_dcproperty_hide']), 'boolean'); - - dcPage::addSuccessNotice(__('Settings successfuly updated')); - $core->adminurl->redirect('admin.plugin.dcAdvancedCleaner', ['tab' => 'dcac', 'part' => '']); - } - catch(Exception $e) { - $core->error->add($e->getMessage()); - } -} - # Actions if ($tab == 'lists' && !empty($entries) && isset($combo_type[$type]) @@ -241,36 +227,6 @@ echo ''; # --BEHAVIOR-- dcAdvancedCleanerAdminTabs $core->callBehavior('dcAdvancedCleanerAdminTabs', $core, $core->adminurl->get('admin.plugin.dcAdvancedCleaner', ['tab' => $tab, 'part' => $part])); -echo ' -