2021-09-08 22:53:13 +00:00
|
|
|
<?php
|
2021-09-08 23:02:10 +00:00
|
|
|
/**
|
2021-09-08 23:05:05 +00:00
|
|
|
* @brief noodles, a plugin for Dotclear 2
|
2021-09-08 23:02:10 +00:00
|
|
|
*
|
|
|
|
* @package Dotclear
|
2021-09-08 23:05:05 +00:00
|
|
|
* @subpackage Plugin
|
2021-09-08 23:02:10 +00:00
|
|
|
*
|
2021-09-08 23:05:05 +00:00
|
|
|
* @author Jean-Christian Denis and contributors
|
2021-09-08 23:02:10 +00:00
|
|
|
*
|
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2021-09-08 22:53:13 +00:00
|
|
|
|
2021-09-09 07:12:31 +00:00
|
|
|
if (!defined('DC_CONTEXT_ADMIN')) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-09-08 22:53:13 +00:00
|
|
|
|
2021-09-09 07:12:31 +00:00
|
|
|
$new_version = $core->plugins->moduleInfo('noodles', 'version');
|
2021-09-08 22:53:13 +00:00
|
|
|
$old_version = $core->getVersion('noodles');
|
|
|
|
|
2021-09-09 07:12:31 +00:00
|
|
|
if (version_compare($old_version, $new_version, '>=')) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
try {
|
2021-09-08 23:02:10 +00:00
|
|
|
$core->blog->settings->addNamespace('noodles');
|
2021-09-09 07:12:31 +00:00
|
|
|
$core->blog->settings->noodles->put(
|
|
|
|
'noodles_active', false, 'boolean', 'Enable extension', false, true
|
|
|
|
);
|
2021-09-09 20:28:17 +00:00
|
|
|
$core->blog->settings->noodles->put(
|
|
|
|
'noodles_image', '', 'string', 'Image filename', false, true
|
|
|
|
);
|
|
|
|
$core->blog->settings->noodles->put(
|
|
|
|
'noodles_object', '', 'string', 'Noodles behaviors', false, true
|
|
|
|
);
|
2021-09-09 07:12:31 +00:00
|
|
|
$core->setVersion('noodles', $new_version);
|
2021-09-08 23:02:10 +00:00
|
|
|
return true;
|
2021-09-09 07:12:31 +00:00
|
|
|
} catch (Exception $e) {
|
2021-09-08 23:02:10 +00:00
|
|
|
$core->error->add($e->getMessage());
|
2021-09-08 22:53:13 +00:00
|
|
|
}
|
2021-09-08 23:02:10 +00:00
|
|
|
return false;
|