Move modules dialogues download

This commit is contained in:
Fred Tempez 2023-01-23 14:22:29 +01:00
parent 946a18a389
commit 1c92141f71
1 changed files with 8 additions and 12 deletions

View File

@ -457,18 +457,6 @@ class common
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
}
self::$dialog = json_decode(file_get_contents(self::I18N_DIR . self::$i18nUI . '.json'), true);
// Dialogue du module
if ($this->getData(['page', $this->getUrl(0), 'moduleId'])) {
$moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']);
if (
is_dir(self::MODULE_DIR . $moduleId . '/i18n')
&& file_exists(self::MODULE_DIR . $moduleId . '/i18n/' . self::$i18nUI . '.json')
) {
$d = json_decode(file_get_contents(self::MODULE_DIR . $moduleId . '/i18n/' . self::$i18nUI . '.json'), true);
self::$dialog = array_merge(self::$dialog, $d);
}
}
// Mise à jour des données core
if ($this->getData(['core', 'dataVersion']) !== intval(str_replace('.', '', self::ZWII_VERSION))) include('core/include/update.inc.php');
@ -3059,6 +3047,14 @@ class core extends common
if (array_key_exists($action, $module::$actions)) {
$module->$action();
$output = $module->output;
// Dialogues du module
if (
is_dir(self::MODULE_DIR . $moduleId . '/i18n')
&& file_exists(self::MODULE_DIR . $moduleId . '/i18n/' . self::$i18nUI . '.json')
) {
$d = json_decode(file_get_contents(self::MODULE_DIR . $moduleId . '/i18n/' . self::$i18nUI . '.json'), true);
self::$dialog = array_merge(self::$dialog, $d);
}
// Check le groupe de l'utilisateur
if (
($module::$actions[$action] === self::GROUP_VISITOR