nouvelle présentation de l'édition d'une page

This commit is contained in:
fredtempez 2019-02-02 12:04:01 +01:00
parent 6127f0ca15
commit 83ef586a09
3 changed files with 84 additions and 33 deletions

View File

@ -47,7 +47,7 @@ class page extends common {
'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' 'bar' => 'Cette page est une barre latérale'
]; ];
/** /**
@ -208,9 +208,13 @@ class page extends common {
if ($this->getinput('pageEditBlock') !== 'bar') { if ($this->getinput('pageEditBlock') !== 'bar') {
$barLeft = $this->getinput('pageEditBarLeft'); $barLeft = $this->getinput('pageEditBarLeft');
$barRight = $this->getinput('pageEditBarRight'); $barRight = $this->getinput('pageEditBarRight');
} else { } else {
// Une barre ne peut pas avoir de barres
$barLeft = ""; $barLeft = "";
$barRight = ""; $barRight = "";
// Une barre est masquée
$position = 0;
} }
// Modifie la page ou en crée une nouvelle si l'id a changé // Modifie la page ou en crée une nouvelle si l'id a changé
$this->setData([ $this->setData([

View File

@ -53,12 +53,10 @@ pageEditModuleIdDOM.on("change", function() {
}); });
if($("#pageEditModuleId").val() === "form" || if($("#pageEditModuleId").val() === "form" ||
$("#pageEditModuleId").val() === "gallery") { $("#pageEditModuleId").val() === "gallery") {
console.log('ok');
$("#configModulePositionWrapper").addClass("disabled"); $("#configModulePositionWrapper").addClass("disabled");
$("#configModulePositionWrapper").slideDown(); $("#configModulePositionWrapper").slideDown();
} }
else { else {
console.log('pas ok');
$("#configModulePositionWrapper").removeClass("disabled"); $("#configModulePositionWrapper").removeClass("disabled");
$("#configModulePositionWrapper").slideUp(); $("#configModulePositionWrapper").slideUp();
} }
@ -123,12 +121,12 @@ if($("#pageEditModuleId").val() === "redirection" ||
var pageEditBlockDOM = $("#pageEditBlock"); var pageEditBlockDOM = $("#pageEditBlock");
pageEditBlockDOM.on("change", function() { pageEditBlockDOM.on("change", function() {
switch ($(this).val()) { switch ($(this).val()) {
case "bar": case "bar":
case "12": case "12":
$("#pageEditBarLeftWrapper").removeClass("disabled"); $("#pageEditBarLeftWrapper").removeClass("disabled");
$("#pageEditBarLeftWrapper").slideUp(); $("#pageEditBarLeftWrapper").slideUp();
$("#pageEditBarRightWrapper").removeClass("disabled"); $("#pageEditBarRightWrapper").removeClass("disabled");
$("#pageEditBarRightWrapper").slideUp(); $("#pageEditBarRightWrapper").slideUp();
break; break;
case "3-9": case "3-9":
case "4-8": case "4-8":
@ -149,8 +147,27 @@ pageEditBlockDOM.on("change", function() {
$("#pageEditBarLeftWrapper").slideDown(); $("#pageEditBarLeftWrapper").slideDown();
$("#pageEditBarRightWrapper").addClass("disabled"); $("#pageEditBarRightWrapper").addClass("disabled");
$("#pageEditBarRightWrapper").slideDown(); $("#pageEditBarRightWrapper").slideDown();
break; break;
} }
if ($(this).val() === "bar") {
$("#pageEditPositionWrapper").removeClass("disabled");
$("#pageEditPositionWrapper").slideUp();
$("#pageEditTargetBlank").removeClass("disabled");
$("#pageEditTargetBlank").slideUp();
$("#pageDisableWrapper").removeClass("disabled");
$("#pageDisableWrapper").slideUp();
$("#pageEditTargetBlankWrapper").removeClass("disabled");
$("#pageEditTargetBlankWrapper").slideUp();
} else {
$("#pageEditPositionWrapper").addClass("disabled");
$("#pageEditPositionWrapper").slideDown();
$("#pageEditTargetBlank").addClass("disabled");
$("#pageEditTargetBlank").slideDown();
$("#pageDisableWrapper").addClass("disabled");
$("#pageDisableWrapper").slideDown();
$("#pageEditTargetBlankWrapper").addClass("disabled");
$("#pageEditTargetBlankWrapper").slideDown();
}
}); });
switch ($("#pageEditBlock").val()) { switch ($("#pageEditBlock").val()) {
case "bar": case "bar":
@ -181,7 +198,25 @@ switch ($("#pageEditBlock").val()) {
$("#pageEditBarRightWrapper").slideDown(); $("#pageEditBarRightWrapper").slideDown();
break; break;
}; };
if ($("#pageEditBlock").val() === "bar") {
$("#pageEditPositionWrapper").removeClass("disabled");
$("#pageEditPositionWrapper").slideUp();
$("#pageEditTargetBlank").removeClass("disabled");
$("#pageEditTargetBlank").slideUp();
$("#pageDisableWrapper").removeClass("disabled");
$("#pageDisableWrapper").slideUp();
$("#pageEditTargetBlankWrapper").removeClass("disabled");
$("#pageEditTargetBlankWrapper").slideUp();
} else {
$("#pageEditPositionWrapper").addClass("disabled");
$("#pageEditPositionWrapper").slideDown();
$("#pageEditTargetBlank").addClass("disabled");
$("#pageEditTargetBlank").slideDown();
$("#pageDisableWrapper").addClass("disabled");
$("#pageDisableWrapper").slideDown();
$("#pageEditTargetBlankWrapper").addClass("disabled");
$("#pageEditTargetBlankWrapper").slideDown();
}

View File

@ -107,19 +107,27 @@
<?php echo template::select('pageEditPosition', [], [ <?php echo template::select('pageEditPosition', [], [
'label' => 'Position' 'label' => 'Position'
]); ?> ]); ?>
<?php echo template::checkbox('pageEditTargetBlank', true, 'Ouvrir dans un nouvel onglet', [ <div class="row">
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank']) <div class="col6">
]); ?> <?php echo template::checkbox('pageEditTargetBlank', true, 'Nouvel onglet', [
<?php echo template::checkbox('pageDisable', true, 'Page inactive', [ 'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']) ]); ?>
]); ?> </div>
<div class="col6">
<?php echo template::checkbox('pageDisable', true, 'Page inactive', [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable'])
]); ?>
</div>
</div>
</div> </div>
</div>
<div class="col6">
<div class="block"> <div class="block">
<h4>Mise en page</h4> <h4>Mise en page</h4>
<?php echo template::select('pageEditBlock', $module::$pageBlocks, [ <?php echo template::select('pageEditBlock', $module::$pageBlocks, [
'label' => 'Gabarit de mise en page :', 'label' => 'Gabarit de mise en page :',
'help' => 'Une page définie comme barre latérale est utilisée pour la pagination d\'une page standard > Cette page sera définie comme barre latérale. 'help' => 'Une page définie comme barre latérale est utilisée pour la pagination d\'une page standard.',
<br>N\'oubliez pas de masquer cette barre latérale dans le menu.',
'selected' => $this->getData(['page', $this->getUrl(2) , 'block']) 'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
]); ?> ]); ?>
<!-- Sélection des barres latérales --> <!-- Sélection des barres latérales -->
@ -143,25 +151,29 @@
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight']) 'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?> ]); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<div class="col6"> </div>
<div class="block"> <div class='row'>
<h4>Options avancées</h4> <div class="block">
<?php echo template::select('pageEditGroup', self::$groupPublics, [ <h4>Options avancées</h4>
'label' => 'Groupe requis pour accéder à la page', <div class='col6'>
'selected' => $this->getData(['page', $this->getUrl(2), 'group']) <?php echo template::select('pageEditGroup', self::$groupPublics, [
]); ?> 'label' => 'Groupe requis pour accéder à la page :',
<?php echo template::text('pageEditMetaTitle', [ 'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
'label' => 'Méta-titre', ]); ?>
'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle']) </div>
]); ?> <div class='col12'>
<?php echo template::textarea('pageEditMetaDescription', [ <?php echo template::text('pageEditMetaTitle', [
'label' => 'Méta-description', 'label' => 'Méta-titre',
'maxlength' => '500', 'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle'])
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription']) ]); ?>
]); ?> <?php echo template::textarea('pageEditMetaDescription', [
</div> 'label' => 'Méta-description',
'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
]); ?>
</div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>