From 0da23149db80073fa4d42a684e1464a45a74f26f Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 22 Apr 2024 15:40:35 +0200 Subject: [PATCH] =?UTF-8?q?2.0.0=20corrige=20le=20warning=20blog=20vide=20?= =?UTF-8?q?+=20transmet=20tn=20param=C3=A8tre=20s=C3=A9curisant=20l'=C3=A9?= =?UTF-8?q?dition=20des=20espaces=20dans=20plusieurs=20onglets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/router.class.php | 8 -------- core/core.php | 5 +++-- core/module/page/page.php | 11 +++++------ core/module/page/view/cssEditor/cssEditor.php | 2 +- core/module/page/view/edit/edit.php | 4 ++-- core/module/page/view/jsEditor/jsEditor.php | 2 +- module/blog/view/config/config.php | 2 +- module/form/view/config/config.php | 2 +- module/gallery/view/config/config.php | 2 +- module/news/view/config/config.php | 2 +- module/redirection/view/config/config.php | 2 +- module/redirection/view/index/index.js.php | 2 +- module/search/view/config/config.php | 2 +- module/slider/view/config/config.php | 2 +- module/suscribe/view/config/config.php | 2 +- module/workshop/view/config/config.php | 2 +- 16 files changed, 22 insertions(+), 30 deletions(-) diff --git a/core/class/router.class.php b/core/class/router.class.php index 3d6e3ca..7c7860b 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -422,14 +422,6 @@ class core extends common || $this->getUser('id') !== $this->getData(['course', self::$siteContent, 'author']) ) ) { - // Stocke l'historique des pages vues - /* - $data = is_array($this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)])) - ? array_merge([time()], $this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)])) - : [time()]; - - $this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0), $data]); - */ // Stocke la dernière page vue et sa date de consultation $this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]); $this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'datePageView', time()]); diff --git a/core/core.php b/core/core.php index e062841..3cb6840 100644 --- a/core/core.php +++ b/core/core.php @@ -1105,8 +1105,9 @@ class common } // Articles du blog if ( - $this->getData(['page', $parentPageId, 'moduleId']) === 'blog' && - !empty($this->getData(['module', $parentPageId])) + $this->getData(['page', $parentPageId, 'moduleId']) === 'blog' + && !empty($this->getData(['module', $parentPageId])) + && $this->getData(['module', $parentPageId, 'posts']) ) { foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) { if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) { diff --git a/core/module/page/page.php b/core/module/page/page.php index b18c964..aa88845 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -93,8 +93,7 @@ class page extends common || $this->getData(['page', $page]) === null || $this->getUrl(3) != self::$siteContent - ) { - + ) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -121,7 +120,7 @@ class page extends common // Valeurs en sortie $this->addOutput([ - 'redirect' => helper::baseUrl() . 'page/edit/' . $pageId, + 'redirect' => helper::baseUrl() . 'page/edit/' . $pageId . '/' . self::$siteContent, 'notification' => $notification, 'state' => true ]); @@ -271,7 +270,7 @@ class page extends common elseif ($this->getHierarchy($page, null)) { // Valeurs en sortie $this->addOutput([ - 'redirect' => helper::baseUrl() . 'page/edit/' . $page, + 'redirect' => helper::baseUrl() . 'page/edit/' . $page . '/' . self::$siteContent, 'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants') ]); } @@ -642,7 +641,7 @@ class page extends common // Valeurs en sortie $this->addOutput([ 'notification' => helper::translate('Modifications enregistrées'), - 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent, 'state' => true ]); } @@ -677,7 +676,7 @@ class page extends common // Valeurs en sortie $this->addOutput([ 'notification' => helper::translate('Modifications enregistrées'), - 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent, 'state' => true ]); } diff --git a/core/module/page/view/cssEditor/cssEditor.php b/core/module/page/view/cssEditor/cssEditor.php index b9c62ae..a468bd3 100644 --- a/core/module/page/view/cssEditor/cssEditor.php +++ b/core/module/page/view/cssEditor/cssEditor.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index 21cd9ac..05bd890 100644 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -19,14 +19,14 @@
'buttonRed', - 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2), + 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent, 'value' => template::ico('trash'), 'help' => 'Effacer la page' ]); ?>
helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2), + 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent, 'value' => template::ico('clone'), 'help' => 'Dupliquer la page' ]); ?> diff --git a/core/module/page/view/jsEditor/jsEditor.php b/core/module/page/view/jsEditor/jsEditor.php index a14f269..a7dcf43 100644 --- a/core/module/page/view/jsEditor/jsEditor.php +++ b/core/module/page/view/jsEditor/jsEditor.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/blog/view/config/config.php b/module/blog/view/config/config.php index 3be3f75..d87cfea 100644 --- a/module/blog/view/config/config.php +++ b/module/blog/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'posts', + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 08865dd..dc3520f 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -53,7 +53,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/gallery/view/config/config.php b/module/gallery/view/config/config.php index a1f4ac2..58e89ff 100644 --- a/module/gallery/view/config/config.php +++ b/module/gallery/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 92f7e4b..3866ccf 100644 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts', + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0). '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/redirection/view/config/config.php b/module/redirection/view/config/config.php index 9309fb0..911398f 100644 --- a/module/redirection/view/config/config.php +++ b/module/redirection/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/redirection/view/index/index.js.php b/module/redirection/view/index/index.js.php index fe572c5..061da9c 100644 --- a/module/redirection/view/index/index.js.php +++ b/module/redirection/view/index/index.js.php @@ -19,7 +19,7 @@ core.confirm( message, function() { - $(location).attr("href", "page/edit/getUrl(0); ?>"); + $(location).attr("href", "page/edit/getUrl(0) . '/' . self::$siteContent; ?>"); }, function() { $(location).attr("href", "getUrl(); ?>/force"); diff --git a/module/search/view/config/config.php b/module/search/view/config/config.php index 0f515f1..09c698f 100644 --- a/module/search/view/config/config.php +++ b/module/search/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/slider/view/config/config.php b/module/slider/view/config/config.php index f3ef50c..6a445f2 100644 --- a/module/slider/view/config/config.php +++ b/module/slider/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>
diff --git a/module/suscribe/view/config/config.php b/module/suscribe/view/config/config.php index 5aa2f41..3d11892 100755 --- a/module/suscribe/view/config/config.php +++ b/module/suscribe/view/config/config.php @@ -4,7 +4,7 @@
'', - 'href' => helper::baseUrl() .'page/edit/' . $this->getUrl(0) , + 'href' => helper::baseUrl() .'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'ico' => 'left', 'value' => 'Retour' ]); ?> diff --git a/module/workshop/view/config/config.php b/module/workshop/view/config/config.php index c25c655..91b2444 100644 --- a/module/workshop/view/config/config.php +++ b/module/workshop/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'value' => template::ico('left') ]); ?>