Merge branch '10304' into 10400

This commit is contained in:
Fred Tempez 2020-11-03 08:31:07 +01:00
commit 66c2546b7a
2 changed files with 8 additions and 20 deletions

View File

@ -21,6 +21,7 @@
- Thème : import d'un thème, nettoyage du dossier tmp.
- Thème administration : modification de l'appel du code CSS permettant une mise à jour du thème sans vider le cache.
- Thème du menu : alignement inopérant ; arrière-plan semi-transparent non uniforme.
- Supprime les warning lors d'une primo installation.
- Amélioration :
- Thème menu : couleurs du sous menu.
- Mise en page du corps des mails de notification.

View File

@ -102,29 +102,16 @@ class JsonDb extends \Prowebcraft\Dot
if ($this->data === null || $reload) {
// $this->db = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'];
$this->db = $this->config['dir'] . $this->config['name'];
/*
if (!file_exists($this->db)) {
$templateFile = $this->config['template'];
if (file_exists($templateFile)) {
copy($templateFile, $this->db);
} else {
file_put_contents($this->db, '{}');
}
} else {
if ($this->config['backup']) {
try {
//todo make backup of database
} catch (\Exception $e) {
}
if (!file_exists($this->db)) {
return null;
} else {
$this->data = json_decode(file_get_contents($this->db), true);
if (!$this->data === null) {
throw new \InvalidArgumentException('Database file ' . $this->db
. ' contains invalid json object. Please validate or remove file');
}
}
*/
$this->data = json_decode(file_get_contents($this->db), true);
if (!$this->data === null) {
throw new \InvalidArgumentException('Database file ' . $this->db
. ' contains invalid json object. Please validate or remove file');
}
}
return $this->data;
}