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

View File

@ -116,19 +116,10 @@
</nav>
<?php endif; ?>
<?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
$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="";
switch (sizeof($blocks)) {
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; ?>
</div>
</section>
<?php } ?>
<!-- footer -->
<?php if(
$this->getData(['theme', 'footer', 'position']) === 'site'

View File

@ -36,6 +36,14 @@ class page extends common {
'top' => 'En haut',
'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
@ -60,7 +68,8 @@ class page extends common {
'position' => 0,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => $pageTitle
'title' => $pageTitle,
'blocks' => '100'
]
]);
// Valeurs en sortie
@ -265,7 +274,8 @@ class page extends common {
'position' => $position,
'group' => $this->getInput('pageEditGroup', helper::FILTER_INT),
'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

View File

@ -96,11 +96,14 @@
<?php echo template::checkbox('pageEditTargetBlank', true, 'Ouvrir dans un nouvel onglet', [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?>
<!-- menu image -->
<?php echo template::checkbox('pageDisable', true, 'Page inactive', [
'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 class="col6">

View File

@ -203,15 +203,6 @@ class theme extends common {
'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é
@ -433,8 +424,7 @@ class theme extends common {
'backgroundColor' => $this->getInput('themeSiteBackgroundColor'),
'radius' => $this->getInput('themeSiteRadius'),
'shadow' => $this->getInput('themeSiteShadow'),
'width' => $this->getInput('themeSiteWidth'),
'blocks' => $this->getInput('themeSiteBlocks')
'width' => $this->getInput('themeSiteWidth')
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -82,15 +82,6 @@
]); ?>
</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>