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']) + ]); ?>