Bugs divers

This commit is contained in:
Fred Tempez 2021-06-07 10:57:03 +02:00
parent fb6245fd0a
commit 5ce8eefa6b
5 changed files with 44 additions and 15 deletions

View File

@ -429,7 +429,9 @@ class addon extends common {
// Parcourir les pages utilisant le module
foreach (array_keys($inPages,$this->getUrl(2)) as $pageId) {
// Export des pages hébergeant le module
$pageContent[$pageId] = $this->getData(['page',$pageId]);
$pageParam[$pageId] = $this->getData(['page',$pageId]);
// Export du contenu de la page
$pageContent[$pageId] = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $pageId, 'content']));
// Export de fr/module.json
$moduleId = 'fr/module.json';
$moduleDir = str_replace('site/data/','',$infoModules[$this->getUrl(2)]['dataDirectory']);
@ -467,7 +469,9 @@ class addon extends common {
}
// Enregistrement des pages dans le dossier de langue identique à module
if (!file_exists($tmpFolder . '/' . $lang . '/page.json')) {
file_put_contents($tmpFolder . '/' . $lang . '/page.json', json_encode($pageContent));
file_put_contents($tmpFolder . '/' . $lang . '/page.json', json_encode($pageParam));
mkdir ($tmpFolder . '/' . $lang . '/content');
file_put_contents($tmpFolder . '/' . $lang . '/content/' . $this->getData(['page', $pageId, 'content']), $pageContent);
}
// création du zip
$fileName = $this->getUrl(2) . '.zip';

View File

@ -1 +1,20 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -181,11 +181,13 @@ class gallery extends common {
// Mise à jour 3.1
if (version_compare($versionData, '3.1', '<') ) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
$style = $this->getData(['module', $this->getUrl(0), 'theme', 'style']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', str_replace('pages/', '', $style)]);
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
$style = $this->getData(['module', $this->getUrl(0), 'theme', 'style']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', str_replace('pages/', '', $style)]);
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.1' ]);
}

View File

@ -494,11 +494,13 @@ class news extends common {
}
// Mise à jour 3.3
if (version_compare($versionData, '3.3', '<') ) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/' );
$style = $this->getData(['module', $this->getUrl(0), 'theme', 'style']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', str_replace('pages/', '', $style)]);
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/' );
$style = $this->getData(['module', $this->getUrl(0), 'theme', 'style']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', str_replace('pages/', '', $style)]);
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.3' ]);
}

View File

@ -92,9 +92,11 @@ class search extends common {
// Mise à jour 2.2
if (version_compare($versionData, '2.2', '<') ) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '2.2' ]);
}