forked from ZwiiCMS-Team/ZwiiCMS
Nouvelle gestion des barres avec chemin de fer dans le titre
This commit is contained in:
parent
304033e069
commit
f54c4e9fbb
@ -81,7 +81,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Accueil',
|
'title' => 'Accueil',
|
||||||
'blocks' => '100'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'enfant' => [
|
'enfant' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -98,7 +98,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Enfant',
|
'title' => 'Enfant',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'cachee' => [
|
'cachee' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -115,7 +115,7 @@ class common {
|
|||||||
'group' => self::GROUP_MEMBER,
|
'group' => self::GROUP_MEMBER,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Cachée',
|
'title' => 'Cachée',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'mise_en_page' => [
|
'mise_en_page' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -132,7 +132,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Mise en page',
|
'title' => 'Mise en page',
|
||||||
'blocks' => '3-6-3'
|
'block' => '3-6-3'
|
||||||
],
|
],
|
||||||
'blog' => [
|
'blog' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -149,7 +149,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Blog',
|
'title' => 'Blog',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'galeries' => [
|
'galeries' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -166,7 +166,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Galeries',
|
'title' => 'Galeries',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'site-de-zwii' => [
|
'site-de-zwii' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -183,7 +183,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => true,
|
'targetBlank' => true,
|
||||||
'title' => 'Site de Zwii',
|
'title' => 'Site de Zwii',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'contact' => [
|
'contact' => [
|
||||||
'typeMenu' => 'text',
|
'typeMenu' => 'text',
|
||||||
@ -200,7 +200,7 @@ class common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Contact',
|
'title' => 'Contact',
|
||||||
'blocks' => '12'
|
'block' => '12'
|
||||||
],
|
],
|
||||||
'blockRight' => [
|
'blockRight' => [
|
||||||
'typeMenu' => '',
|
'typeMenu' => '',
|
||||||
@ -425,7 +425,8 @@ class common {
|
|||||||
];
|
];
|
||||||
private $hierarchy = [
|
private $hierarchy = [
|
||||||
'all' => [],
|
'all' => [],
|
||||||
'visible' => []
|
'visible' => [],
|
||||||
|
'bar' => []
|
||||||
];
|
];
|
||||||
private $input = [
|
private $input = [
|
||||||
'_COOKIE' => [],
|
'_COOKIE' => [],
|
||||||
@ -546,6 +547,9 @@ class common {
|
|||||||
if($pagePosition !== 0) {
|
if($pagePosition !== 0) {
|
||||||
$this->hierarchy['visible'][$pageId] = [];
|
$this->hierarchy['visible'][$pageId] = [];
|
||||||
}
|
}
|
||||||
|
if($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||||
|
$this->hierarchy['bar'][$pageId] = [];
|
||||||
|
}
|
||||||
$this->hierarchy['all'][$pageId] = [];
|
$this->hierarchy['all'][$pageId] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -570,6 +574,9 @@ class common {
|
|||||||
if($pagePosition !== 0) {
|
if($pagePosition !== 0) {
|
||||||
$this->hierarchy['visible'][$parentId][] = $pageId;
|
$this->hierarchy['visible'][$parentId][] = $pageId;
|
||||||
}
|
}
|
||||||
|
if($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||||
|
$this->hierarchy['bar'][$pageId] = [];
|
||||||
|
}
|
||||||
$this->hierarchy['all'][$parentId][] = $pageId;
|
$this->hierarchy['all'][$parentId][] = $pageId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -757,10 +764,12 @@ class common {
|
|||||||
* Accède à la liste des pages parents et de leurs enfants ou aux enfants d'une page parent
|
* Accède à la liste des pages parents et de leurs enfants ou aux enfants d'une page parent
|
||||||
* @param int $parentId Id de la page parent
|
* @param int $parentId Id de la page parent
|
||||||
* @param bool $onlyVisible Affiche seulement les pages visibles
|
* @param bool $onlyVisible Affiche seulement les pages visibles
|
||||||
|
* @param bool $onlyBlock Affcihe seulement les page de type barre
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getHierarchy($parentId = null, $onlyVisible = true) {
|
public function getHierarchy($parentId = null, $onlyVisible = true, $onlyBlock = false) {
|
||||||
$hierarchy = $onlyVisible ? $this->hierarchy['visible'] : $this->hierarchy['all'];
|
$hierarchy = $onlyVisible ? $this->hierarchy['visible'] : $this->hierarchy['all'];
|
||||||
|
$hierarchy = $onlyBlock ? $this->hierarchy['bar'] : $hierarchy;
|
||||||
// Enfants d'un parent
|
// Enfants d'un parent
|
||||||
if($parentId) {
|
if($parentId) {
|
||||||
if(array_key_exists($parentId, $hierarchy)) {
|
if(array_key_exists($parentId, $hierarchy)) {
|
||||||
@ -776,6 +785,7 @@ class common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accède à une valeur des variables http (ordre de recherche en l'absence de type : _COOKIE, _POST)
|
* Accède à une valeur des variables http (ordre de recherche en l'absence de type : _COOKIE, _POST)
|
||||||
* @param string $key Clé de la valeur
|
* @param string $key Clé de la valeur
|
||||||
@ -1065,7 +1075,7 @@ class common {
|
|||||||
}
|
}
|
||||||
// Version 9.0.0
|
// Version 9.0.0
|
||||||
if($this->getData(['core', 'dataVersion']) < 900) {
|
if($this->getData(['core', 'dataVersion']) < 900) {
|
||||||
$this->setData(['theme', 'site', 'blocks','100']);
|
$this->setData(['theme', 'site', 'block','12']);
|
||||||
if ($this->getData(['theme','menu','position']) === 'body-top') {
|
if ($this->getData(['theme','menu','position']) === 'body-top') {
|
||||||
$this->setData(['theme','menu','position','top']);
|
$this->setData(['theme','menu','position','top']);
|
||||||
}
|
}
|
||||||
@ -1970,6 +1980,7 @@ class layout extends common {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Affiche le contenu
|
* Affiche le contenu
|
||||||
|
* @param Page par défaut
|
||||||
*/
|
*/
|
||||||
public function showContent() {
|
public function showContent() {
|
||||||
if(
|
if(
|
||||||
@ -1979,11 +1990,22 @@ class layout extends common {
|
|||||||
OR $this->getData(['page', $this->getUrl(0), 'hideTitle']) === false
|
OR $this->getData(['page', $this->getUrl(0), 'hideTitle']) === false
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
echo '<h1 id="sectionTitle">' . $this->core->output['title'] . '</h1>';
|
// echo '<h1 id="sectionTitle">' . $this->core->output['title'] . '</h1>';
|
||||||
|
// Chemin de fer pour le titre avec des enfants
|
||||||
|
echo '<h2 id="sectionTitle">';
|
||||||
|
if ($this->getData(['page', $this->getUrl(0), 'parentPageId']) !== '' ) {
|
||||||
|
echo '<a href="' . helper::baseUrl() . $this->getData(['page', $this->getUrl(0), 'parentPageId']) .'">';
|
||||||
|
echo ucfirst($this->getData(['page', $this->getUrl(0), 'parentPageId'])) . '</a> > ';
|
||||||
|
|
||||||
|
}
|
||||||
|
echo $this->core->output['title'] . '</h2>';
|
||||||
|
// Fin modif
|
||||||
}
|
}
|
||||||
echo $this->core->output['content'];
|
echo $this->core->output['content'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Affiche le copyright
|
* Affiche le copyright
|
||||||
*/
|
*/
|
||||||
@ -2217,15 +2239,11 @@ class layout extends common {
|
|||||||
$leftItems .= '<option value="">Choisissez une page</option>';
|
$leftItems .= '<option value="">Choisissez une page</option>';
|
||||||
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
|
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
|
||||||
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) {
|
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) {
|
||||||
if ($parentPageId === 'blockLeft'
|
|
||||||
OR $parentPageId === 'blockRight') { continue; }
|
|
||||||
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
|
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
|
||||||
foreach($childrenPageIds as $childKey) {
|
foreach($childrenPageIds as $childKey) {
|
||||||
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '> ' . $this->getData(['page', $childKey, 'title']) . '</option>';
|
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '> ' . $this->getData(['page', $childKey, 'title']) . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$leftItems .= '<option value="">-------------------</option>';
|
|
||||||
$leftItems .= '<option value="' . helper::baseUrl() . 'page/block">Édition des barres latérales</option>';
|
|
||||||
$leftItems .= '</select></li>';
|
$leftItems .= '</select></li>';
|
||||||
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" title="Créer une page">' . template::ico('plus') . '</a></li>';
|
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" title="Créer une page">' . template::ico('plus') . '</a></li>';
|
||||||
if(
|
if(
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
<?php
|
<?php
|
||||||
// Gabarit :
|
// Gabarit :
|
||||||
// Récupérer la config de la page courante
|
// Récupérer la config de la page courante
|
||||||
$blocks = explode('-',$this->getData(['page',$this->getUrl(0),'blocks']));
|
$blocks = explode('-',$this->getData(['page',$this->getUrl(0),'block']));
|
||||||
// Initialiser
|
// Initialiser
|
||||||
$blockleft=$blockright="";
|
$blockleft=$blockright="";
|
||||||
switch (sizeof($blocks)) {
|
switch (sizeof($blocks)) {
|
||||||
@ -156,9 +156,14 @@
|
|||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php if ($blockleft !== "") :?> <div class="<?php echo $blockleft; ?>" id="contentleft"><?php echo $this->getData(['page','blockLeft','content']);?></div> <?php endif; ?>
|
<?php if ($blockleft !== "") :?> <div class="<?php echo $blockleft; ?>" id="contentleft">
|
||||||
|
<?php
|
||||||
|
echo $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']);
|
||||||
|
?></div> <?php endif; ?>
|
||||||
<div class="<?php echo $content; ?>" id="contentsite"><?php $layout->showContent(); ?></div>
|
<div class="<?php echo $content; ?>" id="contentsite"><?php $layout->showContent(); ?></div>
|
||||||
<?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',$this->getData(['page',$this->getUrl(0),'barRight']),'content']);
|
||||||
|
?></div> <?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</section>
|
</section>
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
*
|
*
|
||||||
* @author Rémi Jean <remi.jean@outlook.com>
|
* @author Rémi Jean <remi.jean@outlook.com>
|
||||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||||
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||||
|
* @copyright Copyright (C) 2018-2019, Frédéric Tempez
|
||||||
* @license GNU General Public License, version 3
|
* @license GNU General Public License, version 3
|
||||||
* @link http://zwiicms.com/
|
* @link http://zwiicms.com/
|
||||||
*/
|
*/
|
||||||
@ -17,12 +19,14 @@ class page extends common {
|
|||||||
public static $actions = [
|
public static $actions = [
|
||||||
'add' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_MODERATOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_MODERATOR,
|
||||||
'edit' => self::GROUP_MODERATOR,
|
'edit' => self::GROUP_MODERATOR
|
||||||
'block' => self::GROUP_ADMIN
|
|
||||||
];
|
];
|
||||||
public static $pagesNoParentId = [
|
public static $pagesNoParentId = [
|
||||||
'' => 'Aucune'
|
'' => 'Aucune'
|
||||||
];
|
];
|
||||||
|
public static $pagesBarId = [
|
||||||
|
'' => 'Aucune'
|
||||||
|
];
|
||||||
public static $moduleIds = [];
|
public static $moduleIds = [];
|
||||||
|
|
||||||
public static $typeMenu = [
|
public static $typeMenu = [
|
||||||
@ -37,12 +41,13 @@ class page extends common {
|
|||||||
'free' => 'Libre'
|
'free' => 'Libre'
|
||||||
];
|
];
|
||||||
public static $pageBlocks = [
|
public static $pageBlocks = [
|
||||||
'12' => 'Pleine page',
|
'12' => 'Pleine page - sans barre latérale',
|
||||||
'4-8' => 'Barre latérale 1/3 - Page 2/3',
|
'4-8' => 'Barre latérale 1/3 - Page 2/3',
|
||||||
'8-4' => 'Page 2/3 - Barre latérale 1/3',
|
'8-4' => 'Page 2/3 - Barre latérale 1/3',
|
||||||
'3-9' => 'Barre latérale 1/4 - Page 3/4',
|
'3-9' => 'Barre latérale 1/4 - Page 3/4',
|
||||||
'9-3' => 'Page 3/4 - Barre latérale 1/4',
|
'9-3' => 'Page 3/4 - Barre latérale 1/4',
|
||||||
'3-6-3' => 'Barre latérale 1/4 - Page 1/2 - Barre latérale 1/4'
|
'3-6-3' => 'Barre latérale 1/4 - Page 1/2 - Barre latérale 1/4',
|
||||||
|
'bar' => 'Barre latérale'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,7 +74,9 @@ class page extends common {
|
|||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => $pageTitle,
|
'title' => $pageTitle,
|
||||||
'blocks' => '100'
|
'block' => '12',
|
||||||
|
'barLeft' => '',
|
||||||
|
'barRight' => ''
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -137,64 +144,6 @@ 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)) ? "<p></p>" : $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)) ? "<p></p>" : $this->getInput('pageBlockRightContent', null))]
|
|
||||||
]);
|
|
||||||
$this->addOutput([
|
|
||||||
'redirect' => helper::baseUrl(),
|
|
||||||
'notification' => 'Modifications enregistrées',
|
|
||||||
'state' => true
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Valeurs en sortie
|
|
||||||
$this->addOutput([
|
|
||||||
'title' => 'Édition des barres latérales',
|
|
||||||
'vendor' => [
|
|
||||||
'tinymce'
|
|
||||||
],
|
|
||||||
'view' => 'block'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Édition
|
* Édition
|
||||||
@ -256,7 +205,14 @@ class page extends common {
|
|||||||
// Incrémente pour la prochaine position
|
// Incrémente pour la prochaine position
|
||||||
$lastPosition++;
|
$lastPosition++;
|
||||||
}
|
}
|
||||||
// Modifie la page ou en crée une nouvelle si l'id à changée
|
if ($this->getinput('pageEditBlock') !== 'bar') {
|
||||||
|
$barLeft = $this->getinput('pageEditBarLeft');
|
||||||
|
$barRight = $this->getinput('pageEditBarRight');
|
||||||
|
} else {
|
||||||
|
$barLeft = "";
|
||||||
|
$barRight = "";
|
||||||
|
}
|
||||||
|
// Modifie la page ou en crée une nouvelle si l'id a changé
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'page',
|
'page',
|
||||||
$pageId,
|
$pageId,
|
||||||
@ -275,7 +231,9 @@ class page extends common {
|
|||||||
'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'),
|
'block' => $this->getinput('pageEditBlock'),
|
||||||
|
'barLeft' => $barLeft,
|
||||||
|
'barRight' => $barRight
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Redirection vers la configuration
|
// Redirection vers la configuration
|
||||||
@ -313,6 +271,13 @@ class page extends common {
|
|||||||
self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Pages barre latérales
|
||||||
|
foreach($this->getHierarchy(null,false,true) as $parentPageId => $childrenPageIds) {
|
||||||
|
if($parentPageId !== $this->getUrl(2) &&
|
||||||
|
$this->getData(['page', $parentPageId, 'block']) === 'bar') {
|
||||||
|
self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => $this->getData(['page', $this->getUrl(2), 'title']),
|
'title' => $this->getData(['page', $this->getUrl(2), 'title']),
|
||||||
|
@ -22,6 +22,7 @@ $("#pageEditDelete").on("click", function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Bloque/Débloque le bouton de configuration au changement de module
|
* Bloque/Débloque le bouton de configuration au changement de module
|
||||||
|
* Affiche ou masque la position du module selon le call_user_func
|
||||||
*/
|
*/
|
||||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||||
pageEditModuleIdDOM.on("change", function() {
|
pageEditModuleIdDOM.on("change", function() {
|
||||||
@ -35,6 +36,34 @@ pageEditModuleIdDOM.on("change", function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Masquer et affiche le contenu pour les modules form et gallery
|
||||||
|
*/
|
||||||
|
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||||
|
pageEditModuleIdDOM.on("change", function() {
|
||||||
|
if($(this).val() === "form" ||
|
||||||
|
$(this).val() === "gallery") {
|
||||||
|
$("#configModulePositionWrapper").addClass("disabled");
|
||||||
|
$("#configModulePositionWrapper").slideDown();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#configModulePositionWrapper").removeClass("disabled");
|
||||||
|
$("#configModulePositionWrapper").slideUp();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if($("#pageEditModuleId").val() === "form" ||
|
||||||
|
$("#pageEditModuleId").val() === "gallery") {
|
||||||
|
console.log('ok');
|
||||||
|
$("#configModulePositionWrapper").addClass("disabled");
|
||||||
|
$("#configModulePositionWrapper").slideDown();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('pas ok');
|
||||||
|
$("#configModulePositionWrapper").removeClass("disabled");
|
||||||
|
$("#configModulePositionWrapper").slideUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Masquer et démasquer le contenu pour les modules code et redirection
|
* Masquer et démasquer le contenu pour les modules code et redirection
|
||||||
*/
|
*/
|
||||||
@ -66,7 +95,8 @@ if($("#pageEditModuleId").val() === "code" ||
|
|||||||
*/
|
*/
|
||||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||||
pageEditModuleIdDOM.on("change", function() {
|
pageEditModuleIdDOM.on("change", function() {
|
||||||
if($(this).val() === "redirection") {
|
if($(this).val() === "redirection" ||
|
||||||
|
$(this).val() === "code") {
|
||||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||||
$("#pageEditHideTitleWrapper").slideUp();
|
$("#pageEditHideTitleWrapper").slideUp();
|
||||||
}
|
}
|
||||||
@ -75,7 +105,8 @@ pageEditModuleIdDOM.on("change", function() {
|
|||||||
$("#pageEditHideTitleWrapper").slideDown();
|
$("#pageEditHideTitleWrapper").slideDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if($("#pageEditModuleId").val() === "redirection") {
|
if($("#pageEditModuleId").val() === "redirection" ||
|
||||||
|
$("#pageEditModuleId").val() === "code") {
|
||||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||||
$("#pageEditHideTitleWrapper").slideUp();
|
$("#pageEditHideTitleWrapper").slideUp();
|
||||||
}
|
}
|
||||||
@ -84,6 +115,78 @@ if($("#pageEditModuleId").val() === "redirection") {
|
|||||||
$("#pageEditHideTitleWrapper").slideDown();
|
$("#pageEditHideTitleWrapper").slideDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Masquer et démasquer la sélection des barres
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var pageEditBlockDOM = $("#pageEditBlock");
|
||||||
|
pageEditBlockDOM.on("change", function() {
|
||||||
|
switch ($(this).val()) {
|
||||||
|
case "bar":
|
||||||
|
case "12":
|
||||||
|
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideUp();
|
||||||
|
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideUp();
|
||||||
|
break;
|
||||||
|
case "3-9":
|
||||||
|
case "4-8":
|
||||||
|
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideDown();
|
||||||
|
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideUp();
|
||||||
|
break;
|
||||||
|
case "9-3":
|
||||||
|
case "8-4":
|
||||||
|
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideUp();
|
||||||
|
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideDown();
|
||||||
|
break;
|
||||||
|
case "3-6-3":
|
||||||
|
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideDown();
|
||||||
|
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideDown();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
switch ($("#pageEditBlock").val()) {
|
||||||
|
case "bar":
|
||||||
|
case "12":
|
||||||
|
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideUp();
|
||||||
|
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideUp();
|
||||||
|
break;
|
||||||
|
case "3-9":
|
||||||
|
case "4-8":
|
||||||
|
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideDown();
|
||||||
|
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideUp();
|
||||||
|
break;
|
||||||
|
case "9-3":
|
||||||
|
case "8-4":
|
||||||
|
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideUp();
|
||||||
|
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideDown();
|
||||||
|
break;
|
||||||
|
case "3-6-3":
|
||||||
|
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarLeftWrapper").slideDown();
|
||||||
|
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||||
|
$("#pageEditBarRightWrapper").slideDown();
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Soumission du formulaire pour éditer le module
|
* Soumission du formulaire pour éditer le module
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col10">
|
<div class="col10">
|
||||||
@ -54,6 +53,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::checkbox('pageEditHideTitle', true, 'Cacher le titre dans la page', [
|
||||||
|
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
|
||||||
|
]); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::select('configModulePosition', $module::$modulePosition,[
|
||||||
|
'help' => 'En position libre ajoutez manuellement le module en plaçant deux crochets [] à l\'endroit voulu dans votre page.',
|
||||||
|
'label' => 'Position du module dans la page',
|
||||||
|
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('pageTypeMenu', $module::$typeMenu,[
|
<?php echo template::select('pageTypeMenu', $module::$typeMenu,[
|
||||||
@ -102,11 +116,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Mise en page</h4>
|
<h4>Mise en page</h4>
|
||||||
<?php echo template::select('pageEditBlocks', $module::$pageBlocks, [
|
<?php echo template::select('pageEditBlock', $module::$pageBlocks, [
|
||||||
'label' => 'Gabarit :',
|
'label' => 'Gabarit de page :',
|
||||||
'help' => 'Pour éditer le contenu des encarts, sélectionnez \'Édition des encarts\' dans la liste des pages.',
|
'help' => 'Une page définie comme barre latérale est utilisée pour la pagination d\'une page standard.',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2) , 'blocks'])
|
'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
|
||||||
]); ?>
|
]); ?>
|
||||||
|
<!-- Sélection des barres latérales -->
|
||||||
|
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
|
||||||
|
<?php echo template::hidden('pageEditBarLeft', [
|
||||||
|
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||||
|
]); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
|
||||||
|
'label' => 'Barre latérale gauche :',
|
||||||
|
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||||
|
]); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
|
||||||
|
<?php echo template::hidden('pageEditBarRight', [
|
||||||
|
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||||
|
]); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
|
||||||
|
'label' => 'Barre latérale droite :',
|
||||||
|
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||||
|
]); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -125,16 +160,6 @@
|
|||||||
'maxlength' => '500',
|
'maxlength' => '500',
|
||||||
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php if (($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'form') or ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'gallery')) {
|
|
||||||
echo template::select('configModulePosition', $module::$modulePosition,[
|
|
||||||
'help' => 'En position libre ajoutez manuellement le module en plaçant deux crochets [] à l\'endroit voulu dans votre page.',
|
|
||||||
'label' => 'Position du module dans la page',
|
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
|
|
||||||
]);
|
|
||||||
} ?>
|
|
||||||
<?php echo template::checkbox('pageEditHideTitle', true, 'Cacher le titre', [
|
|
||||||
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user