Gabarits dans la conf des pages

This commit is contained in:
fredtempez 2019-01-14 20:54:55 +01:00
parent d7560b5a4d
commit e03434a81a
6 changed files with 39 additions and 49 deletions

View File

@ -78,7 +78,8 @@ class common {
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Accueil' 'title' => 'Accueil',
'blocks' => '100'
], ],
'enfant' => [ 'enfant' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -94,7 +95,8 @@ class common {
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Enfant' 'title' => 'Enfant',
'blocks' => '100'
], ],
'cachee' => [ 'cachee' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -111,7 +113,8 @@ class common {
'position' => 2, 'position' => 2,
'group' => self::GROUP_MEMBER, 'group' => self::GROUP_MEMBER,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Cachée' 'title' => 'Cachée',
'blocks' => '100'
], ],
'blog' => [ 'blog' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -127,7 +130,8 @@ class common {
'position' => 3, 'position' => 3,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Blog' 'title' => 'Blog',
'blocks' => '100'
], ],
'galeries' => [ 'galeries' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -143,7 +147,8 @@ class common {
'position' => 4, 'position' => 4,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Galeries' 'title' => 'Galeries',
'blocks' => '100'
], ],
'site-de-zwii' => [ 'site-de-zwii' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -159,7 +164,8 @@ class common {
'position' => 5, 'position' => 5,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => true, 'targetBlank' => true,
'title' => 'Site de Zwii' 'title' => 'Site de Zwii',
'blocks' => '100'
], ],
'contact' => [ 'contact' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
@ -175,7 +181,8 @@ class common {
'position' => 6, 'position' => 6,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Contact' 'title' => 'Contact',
'blocks' => '100'
], ],
'blockRight' => [ 'blockRight' => [
'typeMenu' => '', 'typeMenu' => '',
@ -381,8 +388,7 @@ class common {
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',
'radius' => '0', 'radius' => '0',
'shadow' => '0', 'shadow' => '0',
'width' => '960px', 'width' => '960px'
'blocks' => '100'
], ],
'text' => [ 'text' => [
'font' => 'Open+Sans', 'font' => 'Open+Sans',

View File

@ -116,19 +116,10 @@
</nav> </nav>
<?php endif; ?> <?php endif; ?>
<?php <?php
// Multi colonne uniquement pour les pages du site hors config, theme etc..
if (
$this->getUrl(0) === 'user' OR
$this->getUrl(0) === 'theme' OR
$this->getUrl(0) === 'config' OR
$this->getUrl(0) === 'page' OR
$this->getUrl(1) === 'config' OR
$this->getUrl(1) === 'edit'
) { ?>
<section><?php $layout->showContent(); ?></section>
<?php } else {
// multi-colonnes // multi-colonnes
$blocks = explode('-',$this->getData(['theme','site','blocks'])); // Récupérer la config de la page courante
$blocks = explode('-',$this->getData(['page',$this->getUrl(0),'blocks']));
// Initialiser
$blockleft=$blockright=""; $blockleft=$blockright="";
switch (sizeof($blocks)) { switch (sizeof($blocks)) {
case 1 : // une colonne case 1 : // une colonne
@ -156,7 +147,6 @@
<?php if ($blockright !== "") :?> <div class="<?php echo $blockright; ?>" id="contentright"><?php echo $this->getData(['page','blockRight','content']);?></div> <?php endif; ?> <?php if ($blockright !== "") :?> <div class="<?php echo $blockright; ?>" id="contentright"><?php echo $this->getData(['page','blockRight','content']);?></div> <?php endif; ?>
</div> </div>
</section> </section>
<?php } ?>
<!-- footer --> <!-- footer -->
<?php if( <?php if(
$this->getData(['theme', 'footer', 'position']) === 'site' $this->getData(['theme', 'footer', 'position']) === 'site'

View File

@ -36,6 +36,14 @@ class page extends common {
'top' => 'En haut', 'top' => 'En haut',
'free' => 'Libre' 'free' => 'Libre'
]; ];
public static $pageBlocks = [
'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'
];
/** /**
* Création * Création
@ -60,7 +68,8 @@ class page extends common {
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => $pageTitle 'title' => $pageTitle,
'blocks' => '100'
] ]
]); ]);
// Valeurs en sortie // Valeurs en sortie
@ -265,7 +274,8 @@ class page extends common {
'position' => $position, 'position' => $position,
'group' => $this->getInput('pageEditGroup', helper::FILTER_INT), 'group' => $this->getInput('pageEditGroup', helper::FILTER_INT),
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN), 'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT, true) 'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT, true),
'blocks' => $this->getinput('pageEditBlocks'),
] ]
]); ]);
// Redirection vers la configuration // Redirection vers la configuration

View File

@ -96,11 +96,14 @@
<?php echo template::checkbox('pageEditTargetBlank', true, 'Ouvrir dans un nouvel onglet', [ <?php echo template::checkbox('pageEditTargetBlank', true, 'Ouvrir dans un nouvel onglet', [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank']) 'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?> ]); ?>
<!-- menu image -->
<?php echo template::checkbox('pageDisable', true, 'Page inactive', [ <?php echo template::checkbox('pageDisable', true, 'Page inactive', [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']) 'checked' => $this->getData(['page', $this->getUrl(2), 'disable'])
]); ?> ]); ?>
<!-- menu image --> <?php echo template::select('pageEditBlocks', $module::$pageBlocks, [
'label' => 'Gabarits :',
'help' => 'Pour éditer le contenu des blocs, sélectionnez \'Édition des blocs\' dans la liste des pages.',
'selected' => $this->getData(['page', $this->getUrl(2) , 'blocks'])
]); ?>
</div> </div>
</div> </div>
<div class="col6"> <div class="col6">

View File

@ -203,15 +203,6 @@ class theme extends common {
'100% 100%' => 'Taille adaptée au fond' '100% 100%' => 'Taille adaptée au fond'
]; ];
public static $siteBlocks = [
'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'
];
/** /**
* Mode avancé * Mode avancé
@ -433,8 +424,7 @@ class theme extends common {
'backgroundColor' => $this->getInput('themeSiteBackgroundColor'), 'backgroundColor' => $this->getInput('themeSiteBackgroundColor'),
'radius' => $this->getInput('themeSiteRadius'), 'radius' => $this->getInput('themeSiteRadius'),
'shadow' => $this->getInput('themeSiteShadow'), 'shadow' => $this->getInput('themeSiteShadow'),
'width' => $this->getInput('themeSiteWidth'), 'width' => $this->getInput('themeSiteWidth')
'blocks' => $this->getInput('themeSiteBlocks')
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -82,15 +82,6 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class='row'>
<div class="col4 offset4">
<?php echo template::select('themeSiteBlocks', $module::$siteBlocks, [
'label' => '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'])
]); ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>