2018-02-19 18:10:58 +00:00
|
|
|
<?php
|
2021-09-06 22:09:09 +00:00
|
|
|
/**
|
|
|
|
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
|
|
|
|
*
|
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
|
|
|
*
|
|
|
|
* @author Jean-Christian Denis and Contributors
|
|
|
|
*
|
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2018-02-19 18:10:58 +00:00
|
|
|
|
2021-09-06 23:39:52 +00:00
|
|
|
if (!defined('DC_CONTEXT_ADMIN')) {
|
|
|
|
return null;
|
|
|
|
}
|
2018-02-19 18:10:58 +00:00
|
|
|
|
2021-09-06 23:39:52 +00:00
|
|
|
$new_version = $core->plugins->moduleInfo('dcAdvancedCleaner', 'version');
|
2018-02-19 18:10:58 +00:00
|
|
|
$old_version = $core->getVersion('dcAdvancedCleaner');
|
|
|
|
|
2021-09-06 23:39:52 +00:00
|
|
|
if (version_compare($old_version, $new_version, '>=')) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-09-06 22:09:09 +00:00
|
|
|
|
2021-09-06 23:39:52 +00:00
|
|
|
try {
|
2021-09-06 22:09:09 +00:00
|
|
|
$core->blog->settings->addNamespace('dcAdvancedCleaner');
|
|
|
|
|
2021-09-06 23:39:52 +00:00
|
|
|
$core->blog->settings->dcAdvancedCleaner->put(
|
|
|
|
'dcAdvancedCleaner_behavior_active',
|
|
|
|
true,
|
|
|
|
'boolean',
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$core->blog->settings->dcAdvancedCleaner->put(
|
|
|
|
'dcAdvancedCleaner_dcproperty_hide',
|
|
|
|
true,
|
|
|
|
'boolean',
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
$core->setVersion('dcAdvancedCleaner', $new_version);
|
2021-09-06 22:09:09 +00:00
|
|
|
|
|
|
|
return true;
|
2021-09-06 23:39:52 +00:00
|
|
|
} catch (Exception $e) {
|
2021-09-06 22:09:09 +00:00
|
|
|
$core->error->add($e->getMessage());
|
|
|
|
return false;
|
2018-02-19 18:10:58 +00:00
|
|
|
}
|