forked from ZwiiCMS-Team/ZwiiCMS
Amélioration aperçu mnu vs header
This commit is contained in:
parent
ec1d7807dd
commit
c946a07369
@ -18,12 +18,12 @@
|
|||||||
<?php $layout->showStyle(); ?>
|
<?php $layout->showStyle(); ?>
|
||||||
<?php $layout->showBar(); ?>
|
<?php $layout->showBar(); ?>
|
||||||
<?php $layout->showNotification(); ?>
|
<?php $layout->showNotification(); ?>
|
||||||
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'body-top' ): ?>
|
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
|
||||||
<!-- Menu dans le fond du site avant la bannière -->
|
<!-- Menu dans le fond du site avant la bannière -->
|
||||||
<nav>
|
<nav>
|
||||||
<div id="toggle"><?php echo template::ico('menu'); ?></div>
|
<div id="toggle"><?php echo template::ico('menu'); ?></div>
|
||||||
<div id="menu" class="
|
<div id="menu" class="
|
||||||
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-top'){echo 'container-large';}else{echo'container';}
|
<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';}
|
||||||
?>">
|
?>">
|
||||||
|
|
||||||
<?php $layout->showMenu(); ?>
|
<?php $layout->showMenu(); ?>
|
||||||
|
@ -136,14 +136,14 @@ class theme extends common {
|
|||||||
public static $menuPositionsSite = [
|
public static $menuPositionsSite = [
|
||||||
'site-first' => 'Dans le site avant la bannière',
|
'site-first' => 'Dans le site avant la bannière',
|
||||||
'site-second' => 'Dans le site après la bannière',
|
'site-second' => 'Dans le site après la bannière',
|
||||||
'body-top' => 'Au-dessus et en-dehors du site',
|
'top' => 'Au-dessus et en-dehors du site',
|
||||||
'hide' => 'Caché'
|
'hide' => 'Caché'
|
||||||
|
|
||||||
];
|
];
|
||||||
public static $menuPositionsBody = [
|
public static $menuPositionsBody = [
|
||||||
'body-first' => 'Au dessus du site avant la bannière',
|
'body-first' => 'Au dessus du site avant la bannière',
|
||||||
'body-second' => 'Au dessus du site après la bannière',
|
'body-second' => 'Au dessus du site après la bannière',
|
||||||
'body-top' => 'Au-dessus et en-dehors du site',
|
'top' => 'Au-dessus et en-dehors du site',
|
||||||
'hide' => 'Caché'
|
'hide' => 'Caché'
|
||||||
|
|
||||||
];
|
];
|
||||||
@ -317,7 +317,39 @@ class theme extends common {
|
|||||||
'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN),
|
'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN),
|
||||||
'imageContainer' => $this->getInput('themeHeaderImageContainer')
|
'imageContainer' => $this->getInput('themeHeaderImageContainer')
|
||||||
]]);
|
]]);
|
||||||
|
// Modification de la position du menu selon la position de la bannière
|
||||||
|
switch ($this->getInput('themeHeaderPosition')) {
|
||||||
|
case 'site' :
|
||||||
|
$this->setData(['theme', 'menu',
|
||||||
|
['position' => str_replace ('site','body',$this->getData(['theme','menu','position'])) ],
|
||||||
|
'backgroundColor' => $this->getData('themeMenuBackgroundColor'),
|
||||||
|
'font' => $this->getData('themeMenuFont'),
|
||||||
|
'fontSize' => $this->getData('themeMenuFontSize'),
|
||||||
|
'fontWeight' => $this->getData('themeMenuFontWeight'),
|
||||||
|
'height' => $this->getData('themeMenuHeight'),
|
||||||
|
'loginLink' => $this->getData('themeMenuLoginLink'),
|
||||||
|
'margin' => $this->getData('themeMenuMargin', helper::FILTER_BOOLEAN),
|
||||||
|
'textAlign' => $this->getData('themeMenuTextAlign'),
|
||||||
|
'textColor' => $this->getData('themeMenuTextColor'),
|
||||||
|
'textTransform' => $this->getData('themeMenuTextTransform'),
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'body' :
|
||||||
|
$this->setData(['theme', 'menu',
|
||||||
|
['position' => str_replace ('body','site',$this->getData(['theme','menu','position'])) ],
|
||||||
|
'backgroundColor' => $this->getData('themeMenuBackgroundColor'),
|
||||||
|
'font' => $this->getData('themeMenuFont'),
|
||||||
|
'fontSize' => $this->getData('themeMenuFontSize'),
|
||||||
|
'fontWeight' => $this->getData('themeMenuFontWeight'),
|
||||||
|
'height' => $this->getData('themeMenuHeight'),
|
||||||
|
'loginLink' => $this->getData('themeMenuLoginLink'),
|
||||||
|
'margin' => $this->getData('themeMenuMargin', helper::FILTER_BOOLEAN),
|
||||||
|
'textAlign' => $this->getData('themeMenuTextAlign'),
|
||||||
|
'textColor' => $this->getData('themeMenuTextColor'),
|
||||||
|
'textTransform' => $this->getData('themeMenuTextTransform'),
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => 'Modifications enregistrées',
|
'notification' => 'Modifications enregistrées',
|
||||||
|
@ -77,6 +77,9 @@ $("input, select").on("change", function() {
|
|||||||
else {
|
else {
|
||||||
$("header").show().insertAfter("#bar");
|
$("header").show().insertAfter("#bar");
|
||||||
}
|
}
|
||||||
|
if(<?php echo json_encode($this->getData(['theme', 'menu', 'position']) === 'top'); ?>) {
|
||||||
|
$("header").show().insertAfter("nav");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Ajout du css au DOM
|
// Ajout du css au DOM
|
||||||
|
@ -49,6 +49,7 @@ $("input, select").on("change", function() {
|
|||||||
.attr("id", "themePreview")
|
.attr("id", "themePreview")
|
||||||
.text(css)
|
.text(css)
|
||||||
.appendTo("head");
|
.appendTo("head");
|
||||||
|
|
||||||
// Position du menu
|
// Position du menu
|
||||||
switch($("#themeMenuPosition").val()) {
|
switch($("#themeMenuPosition").val()) {
|
||||||
case 'hide':
|
case 'hide':
|
||||||
@ -70,11 +71,6 @@ $("input, select").on("change", function() {
|
|||||||
$("#menu").removeClass('container-large');
|
$("#menu").removeClass('container-large');
|
||||||
$("#menu").addClass('container');
|
$("#menu").addClass('container');
|
||||||
break;
|
break;
|
||||||
case 'body-top':
|
|
||||||
$("nav").show().insertAfter("#bar");
|
|
||||||
$("#menu").removeClass('container');
|
|
||||||
$("#menu").addClass('container-large');
|
|
||||||
break;
|
|
||||||
case 'body-second':
|
case 'body-second':
|
||||||
if(<?php echo json_encode($this->getData(['theme', 'header', 'position']) === 'body'); ?>) {
|
if(<?php echo json_encode($this->getData(['theme', 'header', 'position']) === 'body'); ?>) {
|
||||||
$("nav").show().insertAfter("header");
|
$("nav").show().insertAfter("header");
|
||||||
@ -83,6 +79,11 @@ $("input, select").on("change", function() {
|
|||||||
$("nav").show().insertAfter("#bar");
|
$("nav").show().insertAfter("#bar");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'top':
|
||||||
|
$("nav").show().insertAfter("#bar");
|
||||||
|
$("#menu").removeClass('container');
|
||||||
|
$("#menu").addClass('container-large');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Lien de connexion (addClass() et removeClass() au lieu de hide() et show() car ils ne conservent pas le display-inline: block; de #themeMenuLoginLink)
|
// Lien de connexion (addClass() et removeClass() au lieu de hide() et show() car ils ne conservent pas le display-inline: block; de #themeMenuLoginLink)
|
||||||
|
Loading…
Reference in New Issue
Block a user