2021-08-18 19:42:30 +00:00
|
|
|
<?php
|
2021-09-02 21:44:01 +00:00
|
|
|
/**
|
|
|
|
* @brief translater, a plugin for Dotclear 2
|
2021-11-01 21:32:32 +00:00
|
|
|
*
|
2021-09-02 21:44:01 +00:00
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
2021-11-01 21:32:32 +00:00
|
|
|
*
|
2021-09-02 21:44:01 +00:00
|
|
|
* @author Jean-Christian Denis & contributors
|
2021-11-01 21:32:32 +00:00
|
|
|
*
|
2021-09-02 21:44:01 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2021-08-18 22:48:47 +00:00
|
|
|
if (!defined('DC_CONTEXT_ADMIN')) {
|
2021-09-17 22:42:35 +00:00
|
|
|
return null;
|
2021-09-24 23:58:59 +00:00
|
|
|
}
|
2021-11-01 21:32:32 +00:00
|
|
|
|
2021-08-18 22:48:47 +00:00
|
|
|
try {
|
2022-12-10 14:55:28 +00:00
|
|
|
if (!dcCore::app()->newVersion(
|
|
|
|
basename(__DIR__),
|
|
|
|
dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')
|
|
|
|
)) {
|
2021-09-17 22:42:35 +00:00
|
|
|
return null;
|
2021-08-18 22:48:47 +00:00
|
|
|
}
|
2022-11-13 17:40:31 +00:00
|
|
|
$translater = new dcTranslater(false);
|
2022-12-22 23:15:43 +00:00
|
|
|
if (!$translater->growUp()) {
|
|
|
|
$translater->writeSettings(false);
|
|
|
|
}
|
2021-09-24 23:58:59 +00:00
|
|
|
|
2021-08-18 22:48:47 +00:00
|
|
|
return true;
|
|
|
|
} catch (Exception $e) {
|
2022-11-13 17:40:31 +00:00
|
|
|
dcCore::app()->error->add($e->getMessage());
|
2021-08-18 19:42:30 +00:00
|
|
|
}
|
2021-11-01 21:32:32 +00:00
|
|
|
|
|
|
|
return false;
|