From ed0cd3b8363f0bca12d77b2ad08f0c78bcedf336 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 5 Feb 2019 21:24:32 +0100 Subject: [PATCH] =?UTF-8?q?Breadcumb=20param=C3=A9table=20la=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 16 ++++++++------- core/module/page/page.php | 2 ++ core/module/page/view/edit/edit.js.php | 27 +++++++++++++++++++++++++- core/module/page/view/edit/edit.php | 15 +++++++++++--- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/core/core.php b/core/core.php index 60519ae3..17c33557 100644 --- a/core/core.php +++ b/core/core.php @@ -1992,15 +1992,17 @@ class layout extends common { ) ) { // Chemin de fer pour le titre avec des enfants - echo '

' . $this->core->output['title'] . '

'; + // echo '

' . $this->core->output['title'] . '

'; // remplacé par : - //echo '

'; - //if ($this->getData(['page', $this->getUrl(0), 'parentPageId']) !== '' ) { - // echo ''; - // echo ucfirst($this->getData(['page', $this->getUrl(0), 'parentPageId'])) . ' > '; - //} - // echo $this->core->output['title'] . '

'; + echo '

'; + if ( !empty($this->getData(['page', $this->getUrl(0), 'parentPageId'])) && + $this->getData(['page', $this->getUrl(0), 'includeParent'])) { + echo ''; + echo ucfirst($this->getData(['page', $this->getUrl(0), 'parentPageId'])) . ' > '; + } + echo $this->core->output['title'] . '

'; // Fin modif + } echo $this->core->output['content']; } diff --git a/core/module/page/page.php b/core/module/page/page.php index 823febe6..178221b9 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -65,6 +65,7 @@ class page extends common { 'disable' => false, 'content' => 'Contenu de votre nouvelle page.', 'hideTitle' => false, + 'includeParent' => false, 'metaDescription' => '', 'metaTitle' => '', 'moduleId' => '', @@ -226,6 +227,7 @@ class page extends common { 'disable'=> $this->getinput('pageDisable', helper::FILTER_BOOLEAN), 'content' => (empty($this->getInput('pageEditContent', null)) ? "

" : $this->getInput('pageEditContent', null)) , 'hideTitle' => $this->getInput('pageEditHideTitle', helper::FILTER_BOOLEAN), + 'includeParent' => $this->getInput('pageEditIncludeParent', helper::FILTER_BOOLEAN), 'metaDescription' => $this->getInput('pageEditMetaDescription', helper::FILTER_STRING_LONG), 'metaTitle' => $this->getInput('pageEditMetaTitle'), 'moduleId' => $this->getInput('pageEditModuleId'), diff --git a/core/module/page/view/edit/edit.js.php b/core/module/page/view/edit/edit.js.php index 64d292c0..ede93222 100755 --- a/core/module/page/view/edit/edit.js.php +++ b/core/module/page/view/edit/edit.js.php @@ -217,8 +217,33 @@ if ($("#pageEditBlock").val() === "bar") { $("#pageEditTargetBlankWrapper").addClass("disabled"); $("#pageEditTargetBlankWrapper").slideDown(); } + +/** + * Masquer ou afficher le chemin de fer + */ - +var pageEditHideTitleDOM = $("#pageEditHideTitle"); +pageEditHideTitleDOM.on("change", function() { + if ($(this).is(':checked')) { + $("#pageEditIncludeParentWrapper").removeClass("disabled"); + $("#pageEditIncludeParentWrapper").slideUp(); + } else { + $("#pageEditIncludeParentWrapper").addClass("disabled"); + $("#pageEditIncludeParentWrapper").slideDown(); + } +}); +var pageEditParentPageIdDOM = $("#pageEditParentPageId"); +pageEditParentPageIdDOM.on("change", function() { + if ($(this).val() === "") { + console.log('true'); + $("#pageEditIncludeParentWrapper").removeClass("disabled"); + $("#pageEditIncludeParentWrapper").slideUp(); + } else { + console.log('faux'); + $("#pageEditIncludeParentWrapper").addClass("disabled"); + $("#pageEditIncludeParentWrapper").slideDown(); + } +}); diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index 07924687..f64693e6 100755 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -55,9 +55,6 @@
- $this->getData(['page', $this->getUrl(2), 'hideTitle']) - ]); ?>
@@ -119,6 +116,18 @@ ]); ?>
+
+
+ $this->getData(['page', $this->getUrl(2), 'hideTitle']) + ]); ?> +
+
+ $this->getData(['page', $this->getUrl(2), 'includeParent']) + ]); ?> +
+