Merge remote-tracking branch 'origin/114_dev' into 12_dev

This commit is contained in:
fredtempez 2022-03-29 13:09:35 +02:00
commit 1fa2bab090
2 changed files with 20 additions and 2 deletions

View File

@ -546,7 +546,6 @@ class common {
if ( if (
$this->getData(['page', $page, 'content']) !== '' $this->getData(['page', $page, 'content']) !== ''
&& file_exists(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content'])) && file_exists(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']))
&& is_file(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']))
) { ) {
return file_get_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content'])); return file_get_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']));
} else { } else {

View File

@ -1005,7 +1005,6 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
} }
} }
// Rafraichir les thèmes // Rafraichir les thèmes
if (file_exists(self::DATA_DIR . 'admin.css')) { if (file_exists(self::DATA_DIR . 'admin.css')) {
unlink (self::DATA_DIR . 'admin.css'); unlink (self::DATA_DIR . 'admin.css');
@ -1014,6 +1013,26 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
unlink (self::DATA_DIR . 'theme.css'); unlink (self::DATA_DIR . 'theme.css');
} }
// Transforme les URL en références relatives
$baseUrl = $this->getData(['core', 'baseUrl']);
$baseUrl2 = str_replace('?', '', $baseUrl);
foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) {
$pageList [] = $parentKey;
foreach ($parentValue as $childKey) {
$pageList [] = $childKey;
}
}
foreach ($pageList as $parentKey => $parent) {
$s = $this->getPage( $parent, self::$i18n);
// Suppression des sous-dossiers
$s = str_replace ($baseUrl, './', $s);
$s = str_replace ($baseUrl2, './', $s);
$this->setPage( $parent, $s, self::$i18n);
}
// Suppression de la variable URL dans core
//$this->deleteData(['core', 'baseUrl']);
// Mise à jour // Mise à jour
$this->setData(['core', 'dataVersion', 11400]); $this->setData(['core', 'dataVersion', 11400]);
} }