From 3222aaf7d5d7d666f258e6fc09668bbf1ef8d699 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 2 Jan 2019 23:55:43 +0100 Subject: [PATCH 01/15] mise en place editeur dans site --- core/core.php | 7 +++++-- core/module/page/page.php | 9 +++------ core/module/theme/theme.php | 20 +++++++++++++++++--- core/module/theme/view/site/site.php | 27 +++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/core/core.php b/core/core.php index 12ff46a6..54fad575 100644 --- a/core/core.php +++ b/core/core.php @@ -349,7 +349,8 @@ class common { 'backgroundColor' => 'rgba(255, 255, 255, 1)', 'radius' => '0', 'shadow' => '0', - 'width' => '1170px' + 'width' => '1170px', + 'blocks' => '100' ], 'text' => [ 'font' => 'Open+Sans', @@ -994,7 +995,9 @@ class common { } // Version 9.0.0 if($this->getData(['core', 'dataVersion']) < 900) { - + $this->setData(['theme', 'site', 'blocks','100']); + $this->setData(['theme', 'site', 'contentLeft','']); + $this->setData(['theme', 'site', 'contentRight','']); $this->setData(['core', 'dataVersion', 900]); $this->SaveData(); } diff --git a/core/module/page/page.php b/core/module/page/page.php index cccf8a38..bad7b1d4 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -24,19 +24,18 @@ class page extends common { ]; public static $moduleIds = []; - // Menu image public static $typeMenu = [ 'text' => 'Texte', 'icon' => 'Icône', 'icontitle' => 'Icône et bulle' ]; - // menu image // Position du module public static $modulePosition = [ 'bottom' => 'En bas', 'top' => 'En haut', 'free' => 'Libre' ]; + /** * Création */ @@ -46,12 +45,10 @@ class page extends common { $this->setData([ 'page', $pageId, - [ - // Menu icon + [ 'typeMenu' => 'text', 'iconUrl' => '', - 'disable' => false, - // Menu icon + 'disable' => false, 'content' => 'Contenu de votre nouvelle page.', 'hideTitle' => false, 'metaDescription' => '', diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 7ee58d26..e7d0b5c0 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -201,9 +201,18 @@ class theme extends common { 'contain' => 'Image entière', 'cover' => 'Largeur adaptée au fond', '100% 100%' => 'Taille adaptée au fond' - ]; + public static $siteBlocks = [ + '100' => 'Une colonne', + '33-66' => 'Deux colonnes : 1/3 - 2/3', + '66-33' => 'Deux colonnes : 2/3 - 1/3', + '25-75' => 'Deux colonnes : 1/4 - 3/4', + '75-25' => 'Deux colonnes : 3/4 - 1/2', + '25-50-25' => 'Trois colonnes : 1/4 - 1/2 - 1/4' + ]; + + /** * Mode avancé */ @@ -424,7 +433,11 @@ class theme extends common { 'backgroundColor' => $this->getInput('themeSiteBackgroundColor'), 'radius' => $this->getInput('themeSiteRadius'), 'shadow' => $this->getInput('themeSiteShadow'), - 'width' => $this->getInput('themeSiteWidth') + 'width' => $this->getInput('themeSiteWidth'), + 'blocks' => $this->getInput('themeSiteBlocks'), + 'contentLeft' => (empty($this->getInput('themeSiteContentleft', null)) ? "

" : $this->getInput('themeSiteContentleft', null)), + 'contentRight' => (empty($this->getInput('themeSiteContentright', null)) ? "

" : $this->getInput('themeSiteContentright', null)) + ]]); // Valeurs en sortie $this->addOutput([ @@ -437,7 +450,8 @@ class theme extends common { $this->addOutput([ 'title' => 'Personnalisation du site', 'vendor' => [ - 'tinycolorpicker' + 'tinycolorpicker', + 'tinymce' ], 'view' => 'site' ]); diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index bf1e9f0f..2ae87269 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -131,4 +131,31 @@ +
+
+

Mise en page

+
+
+ 'Colonnes', + 'selected' => $this->getData(['theme', 'site', 'blocks']) + ]); ?> +
+
+
+
+ 'editorWysiwyg', + 'value' => $this->getData(['theme', 'site', 'contentRight']) + ]); ?> +
+
+ 'editorWysiwyg', + 'value' => $this->getData(['theme', 'site', 'contentLeft']) + ]); ?> +
+
+
+
\ No newline at end of file From 90d31b142b8c7f026816c97111edcc62971e39fd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 14:10:36 +0100 Subject: [PATCH 02/15] faille cerf delete page --- core/module/page/page.php | 68 ++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/core/module/page/page.php b/core/module/page/page.php index bad7b1d4..f2cd8f2b 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -74,39 +74,41 @@ class page extends common { * Suppression */ public function delete() { - // La page n'existe pas - if($this->getData(['page', $this->getUrl(2)]) === null) { - // Valeurs en sortie - $this->addOutput([ - 'access' => false - ]); - } - // Impossible de supprimer la page d'accueil - elseif($this->getUrl(2) === $this->getData(['config', 'homePageId'])) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), - 'notification' => 'Impossible de supprimer la page d\'accueil' - ]); - } - // Impossible de supprimer une page contenant des enfants - elseif($this->getHierarchy($this->getUrl(2))) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), - 'notification' => 'Impossible de supprimer une page contenant des enfants' - ]); - } - // Suppression - else { - $this->deleteData(['page', $this->getUrl(2)]); - $this->deleteData(['module', $this->getUrl(2)]); - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl(false), - 'notification' => 'Page supprimée', - 'state' => true - ]); + if($this->isPost()) { + // La page n'existe pas + if($this->getData(['page', $this->getUrl(2)]) === null) { + // Valeurs en sortie + $this->addOutput([ + 'access' => false + ]); + } + // Impossible de supprimer la page d'accueil + elseif($this->getUrl(2) === $this->getData(['config', 'homePageId'])) { + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'notification' => 'Impossible de supprimer la page d\'accueil' + ]); + } + // Impossible de supprimer une page contenant des enfants + elseif($this->getHierarchy($this->getUrl(2))) { + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), + 'notification' => 'Impossible de supprimer une page contenant des enfants' + ]); + } + // Suppression + else { + $this->deleteData(['page', $this->getUrl(2)]); + $this->deleteData(['module', $this->getUrl(2)]); + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl(false), + 'notification' => 'Page supprimée', + 'state' => true + ]); + } } } From e0e683f8905e7179ddc1b5280aec73b52c5f0eda Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 14:18:23 +0100 Subject: [PATCH 03/15] acces false --- core/module/page/page.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/module/page/page.php b/core/module/page/page.php index f2cd8f2b..2f3d0cdf 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -109,6 +109,11 @@ class page extends common { 'state' => true ]); } + } else { + // Valeurs en sortie + $this->addOutput([ + 'access' => false + ]); } } From d90bfd0253548c6f7b18e3bc1176beb5eca0c93b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 15:07:11 +0100 Subject: [PATCH 04/15] =?UTF-8?q?donn=C3=A9es=20des=20blocs=20dans=20confi?= =?UTF-8?q?g=20plut=C3=B4t=20que=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 8 +++++--- core/module/theme/theme.php | 7 ++++--- core/module/theme/view/site/site.php | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/core.php b/core/core.php index 54fad575..68e2b719 100644 --- a/core/core.php +++ b/core/core.php @@ -56,7 +56,9 @@ class common { ], 'timezone' => 'Europe/Paris', 'title' => 'Zwii, votre site en quelques clics !', - 'itemsperPage' => 10 + 'itemsperPage' => 10, + 'contenLeft' => '', + 'contentRight' => '' ], 'core' => [ 'dataVersion' => 0, @@ -996,8 +998,8 @@ class common { // Version 9.0.0 if($this->getData(['core', 'dataVersion']) < 900) { $this->setData(['theme', 'site', 'blocks','100']); - $this->setData(['theme', 'site', 'contentLeft','']); - $this->setData(['theme', 'site', 'contentRight','']); + $this->setData(['config', 'contentLeft','']); + $this->setData(['config', 'contentRight','']); $this->setData(['core', 'dataVersion', 900]); $this->SaveData(); } diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index e7d0b5c0..304692da 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -435,9 +435,10 @@ class theme extends common { 'shadow' => $this->getInput('themeSiteShadow'), 'width' => $this->getInput('themeSiteWidth'), 'blocks' => $this->getInput('themeSiteBlocks'), - 'contentLeft' => (empty($this->getInput('themeSiteContentleft', null)) ? "

" : $this->getInput('themeSiteContentleft', null)), - 'contentRight' => (empty($this->getInput('themeSiteContentright', null)) ? "

" : $this->getInput('themeSiteContentright', null)) - + ]]); + $this->setData(['config', [ + 'contentLeft' => (empty($this->getInput('configContentleft', null)) ? "

" : $this->getInput('configContentleft', null)), + 'contentRight' => (empty($this->getInput('configContentright', null)) ? "

" : $this->getInput('configContentright', null)) ]]); // Valeurs en sortie $this->addOutput([ diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index 2ae87269..83f34a40 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -144,15 +144,15 @@
- 'editorWysiwyg', - 'value' => $this->getData(['theme', 'site', 'contentRight']) + 'value' => $this->getData(['config', 'contentRight']) ]); ?>
- 'editorWysiwyg', - 'value' => $this->getData(['theme', 'site', 'contentLeft']) + 'value' => $this->getData(['config', 'contentLeft']) ]); ?>
From e821fe2d8ad856ca50ef763e3d03e5b0eeb919d2 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 15:29:57 +0100 Subject: [PATCH 05/15] Mise en place du test de mise en place --- core/core.php | 2 +- core/layout/main.php | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/core/core.php b/core/core.php index 68e2b719..2b5092a2 100644 --- a/core/core.php +++ b/core/core.php @@ -57,7 +57,7 @@ class common { 'timezone' => 'Europe/Paris', 'title' => 'Zwii, votre site en quelques clics !', 'itemsperPage' => 10, - 'contenLeft' => '', + 'contentLeft' => '', 'contentRight' => '' ], 'core' => [ diff --git a/core/layout/main.php b/core/layout/main.php index 3a86ee70..fcffc5c5 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -33,11 +33,9 @@ getData(['theme', 'header', 'position']) === 'body'): ?> - getData(['theme','header','linkHome'])){ echo "" ;} ?> -
getUrl(0) === 'theme' AND $this->getUrl(1) === 'header') ): ?> - -
getData(['config', 'title']); ?>
- - -
- + getData(['theme','header','linkHome'])){echo "
";} - ?> - - + ?> + getData(['theme', 'menu', 'position']) === 'body-second'): ?> -
showContent(); ?>
+ getData(['theme','site','blocks'])) { + case '33-66' : + break; + case '25-75' : + break; + case '25-50-25' : + break; + } + ?> +
showContent(); ?>
+ getData(['theme','site','blocks'])) { + case '66-33' : + break; + case '75-25' : + break; + case '25-50-25' : + break; + } + ?> + + getData(['theme', 'footer', 'position']) === 'site' // Affiche toujours le pied de page pour l'édition du thème From 61ff4dc49a7ceaf05b60ad802ae834b00be92583 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 17:11:26 +0100 Subject: [PATCH 06/15] Modification du timezone RFM --- core/vendor/filemanager/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vendor/filemanager/config/config.php b/core/vendor/filemanager/config/config.php index fd6b13fa..cb063909 100755 --- a/core/vendor/filemanager/config/config.php +++ b/core/vendor/filemanager/config/config.php @@ -8,7 +8,7 @@ mb_http_input('UTF-8'); mb_language('uni'); mb_regex_encoding('UTF-8'); ob_start('mb_output_handler'); -date_default_timezone_set('Europe/Rome'); +date_default_timezone_set('Europe/Paris'); setlocale(LC_CTYPE, 'fr_FR'); //correct transliteration /* From 7c30cbe4e813ef59c913189789b840081ed5832b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 19:54:44 +0100 Subject: [PATCH 07/15] Display block ok --- core/core.php | 12 ++++--- core/layout/main.php | 54 +++++++++++++++++----------- core/module/theme/theme.php | 20 +++++------ core/module/theme/view/site/site.php | 18 +++++----- 4 files changed, 59 insertions(+), 45 deletions(-) diff --git a/core/core.php b/core/core.php index 2b5092a2..0b6930bc 100644 --- a/core/core.php +++ b/core/core.php @@ -56,9 +56,7 @@ class common { ], 'timezone' => 'Europe/Paris', 'title' => 'Zwii, votre site en quelques clics !', - 'itemsperPage' => 10, - 'contentLeft' => '', - 'contentRight' => '' + 'itemsperPage' => 10 ], 'core' => [ 'dataVersion' => 0, @@ -364,6 +362,10 @@ class common { 'fontWeight' => 'normal', 'textColor' => 'rgba(74, 105, 189, 1)', 'textTransform' => 'none' + ], + 'block' => [ + 'contentLeft' => '', + 'contentRight' => '' ] ] ]; @@ -998,8 +1000,8 @@ class common { // Version 9.0.0 if($this->getData(['core', 'dataVersion']) < 900) { $this->setData(['theme', 'site', 'blocks','100']); - $this->setData(['config', 'contentLeft','']); - $this->setData(['config', 'contentRight','']); + $this->setData(['theme', 'block', 'contentLeft','']); + $this->setData(['theme', 'block', 'contentRight','']); $this->setData(['core', 'dataVersion', 900]); $this->SaveData(); } diff --git a/core/layout/main.php b/core/layout/main.php index fcffc5c5..9ecd3899 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -116,28 +116,40 @@ - getData(['theme','site','blocks'])) { - case '33-66' : + getUrl(0) === 'theme' OR + $this->getUrl(0) === 'config' OR + $this->getUrl(0) === 'user' ) { ?> +
showContent(); ?>
+ getData(['theme','site','blocks'])); + $blockleft=$blockright=""; + switch (sizeof($blocks)) { + case 1 : // une colonne + $content = 'col'. $blocks[0] ; + break; + case 2 : // 2 blocks + if ($blocks[0] < $blocks[1]) { // détermine la position de la colonne + $blockright = 'col'. $blocks[0]; + $content = 'col'. $blocks[1] ; + } else { + $content = 'col' . $blocks[0]; + $blockleft = 'col' . $blocks[1]; + } break; - case '25-75' : - break; - case '25-50-25' : - break; - } - ?> -
showContent(); ?>
- getData(['theme','site','blocks'])) { - case '66-33' : - break; - case '75-25' : - break; - case '25-50-25' : - break; - } - ?> - + case 3 : // 3 blocks + $blockleft = 'col' . $blocks[0]; + $content = 'col' . $blocks[1]; + $blockright = 'col' . $blocks[2]; + } + ?> +
+
+
getData(['theme','block','contentLeft']);?>
+
showContent(); ?>
+
getData(['theme','block','contentRight']);?>
+
+
+ getData(['theme', 'footer', 'position']) === 'site' diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 304692da..139f34c5 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -204,12 +204,12 @@ class theme extends common { ]; public static $siteBlocks = [ - '100' => 'Une colonne', - '33-66' => 'Deux colonnes : 1/3 - 2/3', - '66-33' => 'Deux colonnes : 2/3 - 1/3', - '25-75' => 'Deux colonnes : 1/4 - 3/4', - '75-25' => 'Deux colonnes : 3/4 - 1/2', - '25-50-25' => 'Trois colonnes : 1/4 - 1/2 - 1/4' + '12' => 'Une colonne', + '4-8' => 'Deux colonnes : 1/3 - 2/3', + '8-4' => 'Deux colonnes : 2/3 - 1/3', + '3-9' => 'Deux colonnes : 1/4 - 3/4', + '9-3' => 'Deux colonnes : 3/4 - 1/2', + '3-6-3' => 'Trois colonnes : 1/4 - 1/2 - 1/4' ]; @@ -434,11 +434,11 @@ class theme extends common { 'radius' => $this->getInput('themeSiteRadius'), 'shadow' => $this->getInput('themeSiteShadow'), 'width' => $this->getInput('themeSiteWidth'), - 'blocks' => $this->getInput('themeSiteBlocks'), + 'blocks' => $this->getInput('themeSiteBlocks') ]]); - $this->setData(['config', [ - 'contentLeft' => (empty($this->getInput('configContentleft', null)) ? "

" : $this->getInput('configContentleft', null)), - 'contentRight' => (empty($this->getInput('configContentright', null)) ? "

" : $this->getInput('configContentright', null)) + $this->setData(['theme','block', [ + 'contentLeft' => (empty($this->getInput('themeBlockContentLeft', null)) ? "

" : $this->getInput('themeBlockContentLeft', null)), + 'contentRight' => (empty($this->getInput('themeBlockContentRight', null)) ? "

" : $this->getInput('themeBlockContentRight', null)) ]]); // Valeurs en sortie $this->addOutput([ diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index 83f34a40..2dfaa2bd 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -143,17 +143,17 @@
-
- + 'editorWysiwyg', - 'value' => $this->getData(['config', 'contentRight']) - ]); ?> -
-
- 'editorWysiwyg', - 'value' => $this->getData(['config', 'contentLeft']) + 'value' => $this->getData(['theme','block', 'contentLeft']) ]); ?> +
+
+ 'editorWysiwyg', + 'value' => $this->getData(['theme','block', 'contentRight']) + ]); ?>
From 95d81bc83e02a90b9b13649165da6cbe2d8b5708 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 20:21:21 +0100 Subject: [PATCH 08/15] =?UTF-8?q?Exclure=20blocks=20des=20param=C3=A8tres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/layout/main.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/layout/main.php b/core/layout/main.php index 9ecd3899..74ed943e 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -118,6 +118,8 @@ getUrl(0) === 'theme' OR $this->getUrl(0) === 'config' OR + $this->getUrl(0) === 'install' OR + $this->getUrl(0) === 'maintenance' OR $this->getUrl(0) === 'user' ) { ?>
showContent(); ?>
-
-
getData(['theme','block','contentLeft']);?>
-
showContent(); ?>
-
getData(['theme','block','contentRight']);?>
+
+
getData(['theme','block','contentLeft']);?>
+
showContent(); ?>
+
getData(['theme','block','contentRight']);?>
From 617bf3b9f642a123fd2b2ccfdd113a01da52ff07 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 3 Jan 2019 20:46:32 +0100 Subject: [PATCH 09/15] Ajustements des messages --- site/file/source/screenshot.png | Bin 3939 -> 3937 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/site/file/source/scre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0%2tid&a`INWc_9mBdgbJba*Dd!U3uR7Hw Date: Thu, 3 Jan 2019 20:47:00 +0100 Subject: [PATCH 10/15] ajustement des messages --- core/layout/main.php | 4 ++-- core/module/theme/theme.php | 12 ++++++------ core/module/theme/view/site/site.php | 13 ++++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/core/layout/main.php b/core/layout/main.php index 74ed943e..0472ce7d 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -131,11 +131,11 @@ break; case 2 : // 2 blocks if ($blocks[0] < $blocks[1]) { // détermine la position de la colonne - $blockright = 'col'. $blocks[0]; + $blockleft = 'col'. $blocks[0]; $content = 'col'. $blocks[1] ; } else { $content = 'col' . $blocks[0]; - $blockleft = 'col' . $blocks[1]; + $blockright = 'col' . $blocks[1]; } break; case 3 : // 3 blocks diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 139f34c5..987db8e9 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -204,12 +204,12 @@ class theme extends common { ]; public static $siteBlocks = [ - '12' => 'Une colonne', - '4-8' => 'Deux colonnes : 1/3 - 2/3', - '8-4' => 'Deux colonnes : 2/3 - 1/3', - '3-9' => 'Deux colonnes : 1/4 - 3/4', - '9-3' => 'Deux colonnes : 3/4 - 1/2', - '3-6-3' => 'Trois colonnes : 1/4 - 1/2 - 1/4' + '12' => 'Un seul bloc, uniquement le site', + '4-8' => 'Deux blocs : 1/3 - 2/3', + '8-4' => 'Deux blocs : 2/3 - 1/3', + '3-9' => 'Deux blocs : 1/4 - 3/4', + '9-3' => 'Deux blocs : 3/4 - 1/2', + '3-6-3' => 'Trois blocs : 1/4 - 1/2 - 1/4' ]; diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index 2dfaa2bd..a657af2f 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -133,24 +133,27 @@ -
-
-

Mise en page

-
-
- 'Répartition des blocs :', - 'help' => 'Le bloc la plus large abrite le contenu du site', - 'selected' => $this->getData(['theme', 'site', 'blocks']) - ]); ?> -
-
-
-
- 'Contenu du bloc à gauche :', - 'class' => 'editorWysiwyg', - 'value' => $this->getData(['theme','block', 'contentLeft']) - ]); ?> -
-
- 'Contenu du bloc à droite :', - 'class' => 'editorWysiwyg', - 'value' => $this->getData(['theme','block', 'contentRight']) - ]); ?> -
-
-
-
\ No newline at end of file From acd65e7e2d093044e1631153d64298075dd442ca Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 4 Jan 2019 18:58:11 +0100 Subject: [PATCH 13/15] =?UTF-8?q?blocs=20=C3=A0=20gauche=20et=20=C3=A0=20d?= =?UTF-8?q?roite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.MD b/CHANGES.MD index 81d55457..bfa822bb 100644 --- a/CHANGES.MD +++ b/CHANGES.MD @@ -5,6 +5,7 @@ - Stockage distinct du thème et des autres données (core, config, page, module et users ) avec import des données d'une version 8 - Exporter un thème (avec les images) sous forme d'une archive ZIP à télécharger ou stocker dans Fichiers. - Importer un thème à partir des fichiers + - Deux blocs (colonnes) à droite ou à gauche contenant des informations fixes, le paramétage est dans le thème, mais les contenus sont stockés dans les pages. ## Verison 8.5.3 * Modification : From 418173956b0f3f41d1a9e5d01a1d5639537d7a7b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 4 Jan 2019 21:51:21 +0100 Subject: [PATCH 14/15] =?UTF-8?q?filtre=20liste=20de=20page=20=C3=A0=20?= =?UTF-8?q?=C3=A9diter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 38 ++++++++++++++++++++++++++--- core/module/page/page.php | 7 ------ core/module/page/view/edit/edit.php | 4 +-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/core/core.php b/core/core.php index 7fb63773..3ce62f5d 100644 --- a/core/core.php +++ b/core/core.php @@ -176,6 +176,38 @@ class common { 'group' => self::GROUP_VISITOR, 'targetBlank' => false, 'title' => 'Contact' + ], + 'blockRight' => [ + 'typeMenu' => 'text', + 'iconUrl' => '', + 'disable' => false, + 'content' => '

Bloc à droite du site

', + 'hideTitle' => false, + 'metaDescription' => '', + 'metaTitle' => '', + 'moduleId' => '', + 'modulePosition' => '', + 'parentPageId' => '', + 'position' => 0, + 'group' => self::GROUP_VISITOR, + 'targetBlank' => false, + 'title' => 'blockRight' + ], + 'blockLeft' => [ + 'typeMenu' => 'text', + 'iconUrl' => '', + 'disable' => false, + 'content' => '

Bloc à gauche du site

', + 'hideTitle' => false, + 'metaDescription' => '', + 'metaTitle' => '', + 'moduleId' => '', + 'modulePosition' => '', + 'parentPageId' => '', + 'position' => 0, + 'group' => self::GROUP_VISITOR, + 'targetBlank' => false, + 'title' => 'blockLeft' ] ], 'module' => [ @@ -996,8 +1028,6 @@ class common { // Version 9.0.0 if($this->getData(['core', 'dataVersion']) < 900) { $this->setData(['theme', 'site', 'blocks','100']); - $this->setData(['page', 'blockLeft', 'content','']); - $this->setData(['page', 'blockRight', 'content','']); $this->setData(['core', 'dataVersion', 900]); $this->SaveData(); } @@ -2136,8 +2166,8 @@ class layout extends common { $leftItems .= ''; $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) { - if ($this->getData(['page', $parentPageId, 'title']) === 'blockLeft' - OR $this->getData(['page', $parentPageId, 'title']) === 'blockRight') { continue; } + if ($this->getData(['page', $parentPageId]) === 'blockLeft' + OR $this->getData(['page', $parentPageId]) === 'blockRight') { continue; } $leftItems .= ''; foreach($childrenPageIds as $childKey) { $leftItems .= ''; diff --git a/core/module/page/page.php b/core/module/page/page.php index 8f3b92c6..4acad103 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -75,7 +75,6 @@ class page extends common { * Suppression */ public function delete() { - if($this->isPost()) { // La page n'existe pas if($this->getData(['page', $this->getUrl(2)]) === null) { // Valeurs en sortie @@ -110,12 +109,6 @@ class page extends common { 'state' => true ]); } - } else { - // Valeurs en sortie - $this->addOutput([ - 'access' => false - ]); - } } diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index 2092d534..e9bc02e8 100755 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -55,8 +55,7 @@
-
- +
'Sélectionnez le type de menu.', 'label' => 'Type de menu', @@ -64,7 +63,6 @@ ]); ?>
- 'Icône', 'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl']) From 1481cc5aca3276111c882b6f130dc477f1d9cae6 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 4 Jan 2019 22:08:18 +0100 Subject: [PATCH 15/15] =?UTF-8?q?filtrage=20bloc=20dans=20les=20page=20?= =?UTF-8?q?=C3=A0=20=C3=A9diter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/core.php b/core/core.php index 3ce62f5d..3d8958dc 100644 --- a/core/core.php +++ b/core/core.php @@ -178,7 +178,7 @@ class common { 'title' => 'Contact' ], 'blockRight' => [ - 'typeMenu' => 'text', + 'typeMenu' => '', 'iconUrl' => '', 'disable' => false, 'content' => '

Bloc à droite du site

', @@ -194,7 +194,7 @@ class common { 'title' => 'blockRight' ], 'blockLeft' => [ - 'typeMenu' => 'text', + 'typeMenu' => '', 'iconUrl' => '', 'disable' => false, 'content' => '

Bloc à gauche du site

', @@ -2032,8 +2032,6 @@ class layout extends common { $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : ''; // Mise en page du sous-item - // Menu Image - if ( $this->getData(['page',$childKey,'disable']) === true AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) @@ -2166,15 +2164,15 @@ class layout extends common { $leftItems .= ''; $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) { - if ($this->getData(['page', $parentPageId]) === 'blockLeft' - OR $this->getData(['page', $parentPageId]) === 'blockRight') { continue; } + if ($parentPageId === 'blockLeft' + OR $parentPageId === 'blockRight') { continue; } $leftItems .= ''; foreach($childrenPageIds as $childKey) { $leftItems .= ''; } } $leftItems .= ''; - $leftItems .= ''; + $leftItems .= ''; $leftItems .= ''; $leftItems .= '
  • ' . template::ico('plus') . '
  • '; if(
    -

    Mise en page

    +

    Mise en page

    'Colonnes', - 'selected' => $this->getData(['theme', 'site', 'blocks']) - ]); ?> + 'label' => 'Répartition des blocs :', + 'help' => 'Le bloc la plus large abrite le contenu du site', + 'selected' => $this->getData(['theme', 'site', 'blocks']) + ]); ?>
    -
    +
    'Contenu du bloc à gauche :', 'class' => 'editorWysiwyg', 'value' => $this->getData(['theme','block', 'contentLeft']) ]); ?>
    'Contenu du bloc à droite :', 'class' => 'editorWysiwyg', 'value' => $this->getData(['theme','block', 'contentRight']) ]); ?> From 5cdb96d25f013ad4026b96f5262be949f467fc19 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 4 Jan 2019 09:00:48 +0100 Subject: [PATCH 11/15] Id pour chaque bloc --- core/layout/main.php | 6 +++--- core/module/theme/resource/custom.css | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/layout/main.php b/core/layout/main.php index 0472ce7d..c4ad95c9 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -146,9 +146,9 @@ ?>
    -
    getData(['theme','block','contentLeft']);?>
    -
    showContent(); ?>
    -
    getData(['theme','block','contentRight']);?>
    +
    getData(['theme','block','contentLeft']);?>
    +
    showContent(); ?>
    +
    getData(['theme','block','contentRight']);?>
    diff --git a/core/module/theme/resource/custom.css b/core/module/theme/resource/custom.css index 872f75c9..417491bc 100755 --- a/core/module/theme/resource/custom.css +++ b/core/module/theme/resource/custom.css @@ -15,6 +15,14 @@ body { #site { } +/* Blocs dans le site */ +#contentleft { +} +#contentright { +} +#contentsite { +} + /* Bannière */ header { } From 01b4acddf64d258a75077d1547899cb14375902d Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 4 Jan 2019 18:53:24 +0100 Subject: [PATCH 12/15] Stockage des blocs avec les pages --- core/core.php | 14 ++-- core/layout/main.php | 5 +- core/module/page/page.php | 69 ++++++++++++++- core/module/page/view/block/block.js.php | 102 +++++++++++++++++++++++ core/module/page/view/block/block.php | 33 ++++++++ core/module/theme/theme.php | 4 - core/module/theme/view/site/site.php | 41 +++------ 7 files changed, 220 insertions(+), 48 deletions(-) create mode 100644 core/module/page/view/block/block.js.php create mode 100644 core/module/page/view/block/block.php diff --git a/core/core.php b/core/core.php index 0b6930bc..7fb63773 100644 --- a/core/core.php +++ b/core/core.php @@ -362,10 +362,6 @@ class common { 'fontWeight' => 'normal', 'textColor' => 'rgba(74, 105, 189, 1)', 'textTransform' => 'none' - ], - 'block' => [ - 'contentLeft' => '', - 'contentRight' => '' ] ] ]; @@ -1000,8 +996,8 @@ class common { // Version 9.0.0 if($this->getData(['core', 'dataVersion']) < 900) { $this->setData(['theme', 'site', 'blocks','100']); - $this->setData(['theme', 'block', 'contentLeft','']); - $this->setData(['theme', 'block', 'contentRight','']); + $this->setData(['page', 'blockLeft', 'content','']); + $this->setData(['page', 'blockRight', 'content','']); $this->setData(['core', 'dataVersion', 900]); $this->SaveData(); } @@ -2138,13 +2134,17 @@ class layout extends common { if($this->getUser('group') >= self::GROUP_MODERATOR) { $leftItems .= '
  • '; $leftItems .= '
  • ' . template::ico('plus') . '
  • '; if( diff --git a/core/layout/main.php b/core/layout/main.php index c4ad95c9..48babb48 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -120,6 +120,7 @@ $this->getUrl(0) === 'config' OR $this->getUrl(0) === 'install' OR $this->getUrl(0) === 'maintenance' OR + $this->getUrl(0) === 'page' OR $this->getUrl(0) === 'user' ) { ?>
    showContent(); ?>
    -
    getData(['theme','block','contentLeft']);?>
    +
    getData(['page','blockLeft','content']);?>
    showContent(); ?>
    -
    getData(['theme','block','contentRight']);?>
    +
    getData(['page','blockRight','content']);?>
    diff --git a/core/module/page/page.php b/core/module/page/page.php index 2f3d0cdf..8f3b92c6 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -17,7 +17,8 @@ class page extends common { public static $actions = [ 'add' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR, - 'edit' => self::GROUP_MODERATOR + 'edit' => self::GROUP_MODERATOR, + 'block' => self::GROUP_ADMIN ]; public static $pagesNoParentId = [ '' => 'Aucune' @@ -31,9 +32,9 @@ class page extends common { ]; // Position du module public static $modulePosition = [ - 'bottom' => 'En bas', - 'top' => 'En haut', - 'free' => 'Libre' + 'bottom' => 'En bas', + 'top' => 'En haut', + 'free' => 'Libre' ]; /** @@ -117,6 +118,66 @@ class page extends common { } } + + /** + * Édition des blocs + */ + public function block () { + if($this->isPost()) { + $this->setData([ + 'page', + 'blockLeft', [ + 'typeMenu' => 'text', + 'iconUrl' => '', + 'disable' => true, + 'hideTitle' => false, + 'metaDescription' => '', + 'metaTitle' => '', + 'moduleId' => '', + 'parentPageId' => '', + 'modulePosition' => 'bottom', + 'position' => 0, + 'group' => self::GROUP_VISITOR, + 'targetBlank' => false, + 'title' => 'blockLeft', + 'content' => (empty($this->getInput('pageBlockLeftContent', null)) ? "

    " : $this->getInput('pageBlockLeftContent', null))] + ]); + $this->setData([ + 'page', + 'blockRight', [ + 'typeMenu' => 'text', + 'iconUrl' => '', + 'disable' => true, + 'hideTitle' => false, + 'metaDescription' => '', + 'metaTitle' => '', + 'moduleId' => '', + 'parentPageId' => '', + 'modulePosition' => 'bottom', + 'position' => 0, + 'group' => self::GROUP_VISITOR, + 'targetBlank' => false, + 'title' => 'blockRight', + 'content' => (empty($this->getInput('pageBlockRightContent', null)) ? "

    " : $this->getInput('pageBlockRightContent', null))] + ]); + $this->addOutput([ + 'redirect' => helper::baseUrl(), + 'notification' => 'Modifications enregistrées', + 'state' => true + ]); + } + + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Édition des blocs', + 'vendor' => [ + 'tinymce' + ], + 'view' => 'block' + ]); + } + + /** * Édition */ diff --git a/core/module/page/view/block/block.js.php b/core/module/page/view/block/block.js.php new file mode 100644 index 00000000..d21cf5f7 --- /dev/null +++ b/core/module/page/view/block/block.js.php @@ -0,0 +1,102 @@ +/** + * 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 + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @license GNU General Public License, version 3 + * @link http://zwiicms.com/ + */ + +/** + * Confirmation de suppression + */ +$("#pageEditDelete").on("click", function() { + var _this = $(this); + return core.confirm("Êtes-vous sûr de vouloir supprimer cette page ?", function() { + $(location).attr("href", _this.attr("href")); + }); +}); + +/** + * Bloque/Débloque le bouton de configuration au changement de module + */ +var pageEditModuleIdDOM = $("#pageEditModuleId"); +pageEditModuleIdDOM.on("change", function() { + if($(this).val() === "") { + $("#pageEditModuleConfig").addClass("disabled"); + $("#pageEditContentContainer").slideDown(); + } + else { + $("#pageEditModuleConfig").removeClass("disabled"); + $("#pageEditContentContainer").slideUp(); + } +}); + +/** + * Soumission du formulaire pour éditer le module + */ +$("#pageEditModuleConfig").on("click", function() { + $("#pageEditModuleRedirect").val(1); + $("#pageEditForm").trigger("submit"); +}); + +/** + * Affiche les pages en fonction de la page parent dans le choix de la position + */ +var hierarchy = getHierarchy()); ?>; +var pages = getData(['page'])); ?>; +$("#pageEditParentPageId").on("change", function() { + var positionDOM = $("#pageEditPosition"); + positionDOM.empty().append( + $("
    -
    +
    'colorPicker', 'label' => 'Boutons', @@ -82,6 +82,15 @@ ]); ?>
    +
    +
    + 'Répartition des blocs :', + 'help' => 'Pour éditer le contenu des blocs, sélectionnez \'Édition des blocs\' dans la liste des pages.', + 'selected' => $this->getData(['theme', 'site', 'blocks']) + ]); ?> +
    +
    @@ -131,34 +140,4 @@