From 28e8af3f1f3bb58aff49b1a61d8d856f7a606ef0 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 22 Apr 2023 18:49:02 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20:=20cr=C3=A9ation=20du?= =?UTF-8?q?=20fichier=20.default=20dans=20la=20langue=20de=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 8 ++------ core/include/update.inc.php | 20 +++++++++++++++++++ core/module/install/ressource/defaultdata.php | 3 ++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/core/core.php b/core/core.php index fc2f53f3..f69c3bd4 100644 --- a/core/core.php +++ b/core/core.php @@ -55,8 +55,6 @@ class common // Numéro de version et branche pour l'auto-update const ZWII_VERSION = '12.3.08'; - const ZWII_DATAVERSION = 12301; - // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; const ZWII_UPDATE_CHANNEL = "v12"; @@ -413,10 +411,8 @@ class common } } - // Mise à jour des données core selon la version du jeu de données - if ($this->getData(['core', 'dataVersion']) < common::ZWII_DATAVERSION) { - include('core/include/update.inc.php'); - } + // Mise à jour des données core + include('core/include/update.inc.php'); // Données de proxy diff --git a/core/include/update.inc.php b/core/include/update.inc.php index f76ea082..2a4276ed 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -944,4 +944,24 @@ if ($this->getData(['core', 'dataVersion']) < 12301) { // Mise à jour $this->setData(['core', 'dataVersion', 12301]); +} + +// Version 12.3.08 +if ($this->getData(['core', 'dataVersion']) < 12308) { + + // Langue par défaut + $l = [ + 'fr_FR' => 'Français', + 'en_EN' => 'English', + 'es' => 'Español', + ]; + foreach ($l as $key => $value) { + if (is_dir(self::DATA_DIR . $key )) { + touch(self::DATA_DIR . $key . '/.default'); + break; + } + } + + // Mise à jour + $this->setData(['core', 'dataVersion', 12308]); } \ No newline at end of file diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 282d9675..29a023b0 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -5,6 +5,7 @@ class init extends common 'config' => [ 'autoBackup' => true, 'autoUpdate' => true, + 'autoUpdateDelay' => 86400, 'autoUpdateHtaccess' => false, 'favicon' => 'favicon.ico', 'faviconDark' => 'faviconDark.ico', @@ -44,7 +45,7 @@ class init extends common ] ], 'core' => [ - 'dataVersion' => 12300, + 'dataVersion' => 12301, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0,