v9.0.0 : import du thème ok + correction readData

This commit is contained in:
fredtempez 2018-12-30 18:33:37 +01:00
parent 9f60b97a62
commit 6a3150ef2c
2 changed files with 11 additions and 22 deletions

View File

@ -526,7 +526,6 @@ class common {
} }
public function readData() { public function readData() {
if($this->data === []) {
// Trois tentatives // Trois tentatives
for($i = 0; $i < 3; $i++) { for($i = 0; $i < 3; $i++) {
$this->setData([json_decode(file_get_contents('site/data/core.json'), true) + json_decode(file_get_contents('site/data/theme.json'), true)]); $this->setData([json_decode(file_get_contents('site/data/core.json'), true) + json_decode(file_get_contents('site/data/theme.json'), true)]);
@ -540,7 +539,6 @@ class common {
usleep(10000); usleep(10000);
} }
} }
}
/** /**
* Import des données du la version 8 * Import des données du la version 8
@ -1244,11 +1242,9 @@ class core extends common {
'content' => $this->getData(['page', $this->getUrl(0), 'content']), 'content' => $this->getData(['page', $this->getUrl(0), 'content']),
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
// Menu image
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']) 'disable' => $this->getData(['page', $this->getUrl(0), 'disable'])
// Menu Image
]); ]);
} }
// Importe le module // Importe le module
@ -1260,11 +1256,9 @@ class core extends common {
'title' => $this->getData(['page', $this->getUrl(0), 'title']), 'title' => $this->getData(['page', $this->getUrl(0), 'title']),
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
// Menu image
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']) 'disable' => $this->getData(['page', $this->getUrl(0), 'disable'])
// Menu image
]); ]);
$pageContent = $this->getData(['page', $this->getUrl(0), 'content']); $pageContent = $this->getData(['page', $this->getUrl(0), 'content']);
} }

View File

@ -454,14 +454,9 @@ class theme extends common {
if ($zip->open('site/file/source/'.$zipFilename) === TRUE) { if ($zip->open('site/file/source/'.$zipFilename) === TRUE) {
$zip->extractTo('.'); $zip->extractTo('.');
$zip->close(); $zip->close();
file_put_contents('site/data/custom.css', file_get_contents('core/module/theme/resource/custom.css'));
// Import du thème
die();
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => 'Le thème <b>'.$zipFilename.'</b> a été importé', 'redirect' => helper::baseUrl() . 'theme'
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]); ]);
} else { } else {
$this->addOutput([ $this->addOutput([