Merge branch '10400' into 11000

This commit is contained in:
fredtempez 2020-12-10 14:05:50 +01:00
commit 4c0811ccb6
2 changed files with 16 additions and 16 deletions

View File

@ -206,7 +206,7 @@ class common {
// Constructeur JsonDB
$this->dataFiles[$keys] = new \Prowebcraft\JsonDb([
'name' => $keys . '.json',
'dir' => $this->dirData ($keys,self::$i18nSite)
'dir' => $this->dataPath ($keys,self::$i18nCurrent)
]);;
}
@ -226,7 +226,7 @@ class common {
// Installation fraîche, initialisation des modules manquants
// La langue d'installation par défaut est fr
foreach ($this->dataFiles as $stageId => $item) {
$folder = $this->dirData ($stageId, self::$i18nSite);
$folder = $this->dataPath ($stageId, self::$i18nCurrent);
if (file_exists($folder . $stageId .'.json') === false) {
$this->initData($stageId,self::$i18nSite);
common::$coreNotices [] = $stageId ;
@ -706,7 +706,7 @@ class common {
* @param $lang langue des pages
* @return string du dossier à créer
*/
public function dirData($id, $lang) {
public function dataPath($id, $lang) {
// Sauf pour les pages et les modules
if ($id === 'page' ||
$id === 'module' ||

View File

@ -108,19 +108,19 @@ class translate extends common {
// Créer les données absentes
if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
mkdir( self::DATA_DIR . $keyi18n);
// Charger les modèles
require_once('core/module/install/ressource/defaultdata.php');
// Nouvelle instance page, module, locale
$files = ['page','module','locale'];
foreach ($files as $keyFile) {
echo $keyFile;
$e = new \Prowebcraft\JsonDb([
'name' => $keyFile . '.json',
'dir' => $this->dirData ($keyFile,$keyi18n)
]);;
$e->set($keyFile, init::$defaultData[$keyFile]);
$e->save();
}
}
// Charger les modèles
require_once('core/module/install/ressource/defaultdata.php');
// Nouvelle instance des pages, module, locale
$files = ['page','module','locale'];
foreach ($files as $keyFile) {
echo $keyFile;
$e = new \Prowebcraft\JsonDb([
'name' => $keyFile . '.json',
'dir' => $this->dataPath ($keyFile,$keyi18n)
]);;
$e->set($keyFile, init::$defaultData[$keyFile]);
$e->save();
}
}
// Active le script si une langue est en trad auto