2021-09-07 06:48:58 +00:00
|
|
|
<?php
|
2021-09-07 08:31:22 +00:00
|
|
|
/**
|
|
|
|
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
|
2021-11-06 15:19:49 +00:00
|
|
|
*
|
2021-09-07 08:31:22 +00:00
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
2021-11-06 15:19:49 +00:00
|
|
|
*
|
2021-09-07 08:31:22 +00:00
|
|
|
* @author Jean-Christian Denis and Contributors
|
2021-11-06 15:19:49 +00:00
|
|
|
*
|
2021-09-07 08:31:22 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2021-09-07 06:48:58 +00:00
|
|
|
if (!defined('DC_CONTEXT_MODULE')) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-10-28 21:07:17 +00:00
|
|
|
|
|
|
|
if (!$core->auth->isSuperAdmin()) {
|
2021-09-07 06:48:58 +00:00
|
|
|
return null;
|
|
|
|
}
|
2021-10-28 21:07:17 +00:00
|
|
|
|
2021-09-07 06:48:58 +00:00
|
|
|
if (!empty($_POST['save'])) {
|
|
|
|
try {
|
|
|
|
$core->blog->settings->dcAdvancedCleaner->dropEvery(
|
|
|
|
'dcAdvancedCleaner_behavior_active'
|
|
|
|
);
|
|
|
|
$core->blog->settings->dcAdvancedCleaner->put(
|
2021-11-06 15:19:49 +00:00
|
|
|
'dcAdvancedCleaner_behavior_active',
|
|
|
|
!empty($_POST['behavior_active']),
|
2021-09-07 06:48:58 +00:00
|
|
|
'boolean',
|
|
|
|
null,
|
|
|
|
true,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$core->blog->settings->dcAdvancedCleaner->dropEvery(
|
|
|
|
'dcAdvancedCleaner_dcproperty_hide'
|
|
|
|
);
|
|
|
|
$core->blog->settings->dcAdvancedCleaner->put(
|
2021-11-06 15:19:49 +00:00
|
|
|
'dcAdvancedCleaner_dcproperty_hide',
|
|
|
|
!empty($_POST['dcproperty_hide']),
|
2021-09-07 06:48:58 +00:00
|
|
|
'boolean',
|
|
|
|
null,
|
|
|
|
true,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
dcPage::addSuccessNotice(
|
|
|
|
__('Configuration successfully updated.')
|
|
|
|
);
|
|
|
|
$core->adminurl->redirect(
|
2021-11-06 15:19:49 +00:00
|
|
|
'admin.plugins',
|
2021-09-07 06:48:58 +00:00
|
|
|
[
|
2021-11-06 15:19:49 +00:00
|
|
|
'module' => 'dcAdvancedCleaner',
|
|
|
|
'conf' => 1,
|
|
|
|
'redir' => empty($_REQUEST['redir']) ? $list->getURL() . '#plugins' : $_REQUEST['redir']
|
2021-09-07 06:48:58 +00:00
|
|
|
]
|
|
|
|
);
|
2021-11-06 15:19:49 +00:00
|
|
|
} catch (Exception $e) {
|
2021-09-07 06:48:58 +00:00
|
|
|
$core->error->add($e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '
|
|
|
|
<p><label class="classic" for="behavior_active">' .
|
|
|
|
form::checkbox(
|
2021-11-06 15:19:49 +00:00
|
|
|
'behavior_active',
|
|
|
|
1,
|
2021-09-07 06:48:58 +00:00
|
|
|
$core->blog->settings->dcAdvancedCleaner->dcAdvancedCleaner_behavior_active
|
|
|
|
) . ' ' . __('Activate behaviors') . '</label></p>
|
|
|
|
<p class="form-note">' . __('Enable actions set in _uninstall.php files.') . '</p>
|
|
|
|
<p><label class="classic" for="dcproperty_hide">' .
|
|
|
|
form::checkbox(
|
2021-11-06 15:19:49 +00:00
|
|
|
'dcproperty_hide',
|
|
|
|
1,
|
2021-09-07 06:48:58 +00:00
|
|
|
$core->blog->settings->dcAdvancedCleaner->dcAdvancedCleaner_dcproperty_hide
|
|
|
|
) . ' ' . __('Hide Dotclear default properties in actions tabs') . '</label></p>
|
2021-11-06 15:19:49 +00:00
|
|
|
<p class="form-note">' .
|
|
|
|
__('Prevent from deleting Dotclear important properties.') . '</p>';
|