Merge branches '11303-dev' and '11303-dev' of https://forge.chapril.org/fredtempez/ZwiiCMS into 11303-dev

This commit is contained in:
fredtempez 2022-02-24 09:37:54 +01:00
commit 79c22bef27
2 changed files with 9 additions and 20 deletions

View File

@ -4,6 +4,7 @@
## Version 11.3.03 ## Version 11.3.03
### Modifications : ### Modifications :
- Suppression de l'application du thème administration à la page d'accueil du thème. - Suppression de l'application du thème administration à la page d'accueil du thème.
- Position d'une page dans le menu accessoire, ordre des pages dans ce menu.
## Version 11.3.02 ## Version 11.3.02

View File

@ -15,7 +15,7 @@
/** /**
* Confirmation de suppression * Confirmation de suppression
*/ */
$("#pageEditDelete").on("click", function() { $("#pageEditDelete").on("click", function() {
var _this = $(this); var _this = $(this);
return core.confirm("Confirmez-vous la suppression de cette page ?", function() { return core.confirm("Confirmez-vous la suppression de cette page ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
@ -240,10 +240,7 @@ $( document ).ready(function() {
if ($("#pageEditExtraPosition").val() == 1 ) { if ($("#pageEditExtraPosition").val() == 1 ) {
var positionDOM = $("#pageEditPosition"); var positionDOM = $("#pageEditPosition");
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>; var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
positionDOM.empty().append( buildPagesList(true);
$("<option>").val(0).text("Ne pas afficher"),
$("<option>").val(1).text("Au début")
);
$("#pageEditPosition").val(positionInitial); $("#pageEditPosition").val(positionInitial);
} }
@ -525,18 +522,9 @@ pageTypeMenuDOM.on("change", function() {
$("#pageEditExtraPosition").on("change", function() { $("#pageEditExtraPosition").on("change", function() {
if ($("#pageEditExtraPosition").val() == 1 ) { if ($("#pageEditExtraPosition").val() == 1 ) {
buildPagesList(true);
var positionDOM = $("#pageEditPosition");
/*
positionDOM.empty().append(
$("<option>").val(0).text("Ne pas afficher"),
$("<option>").val(1).text("Au début")
);
$("#pageEditPosition").val(1);
*/
getPages(true);
} else { } else {
getPages(false); buildPagesList(false);
//$("#pageEditParentPageId").trigger("change"); //$("#pageEditParentPageId").trigger("change");
} }
}); });
@ -552,14 +540,14 @@ $("#pageEditModuleConfig").on("click", function() {
* Affiche les pages en fonction de la page parent dans le choix de la position * Affiche les pages en fonction de la page parent dans le choix de la position
*/ */
$("#pageEditParentPageId").on("change", function() { $("#pageEditParentPageId").on("change", function() {
getPages(false); buildPagesList(false);
}).trigger("change"); }).trigger("change");
/** /**
* Construit un select contenant la liste des pages du site. * Construit un select contenant la liste des pages du site.
*/ */
function getPages(extra) { function buildPagesList(extraPosition) {
var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>; var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>;
var pages = <?php echo json_encode($this->getData(['page'])); ?>; var pages = <?php echo json_encode($this->getData(['page'])); ?>;
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>; var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
@ -577,8 +565,8 @@ function getPages(extra) {
if(parentSelected === "") { if(parentSelected === "") {
// Liste des pages sans parents // Liste des pages sans parents
for(var key in hierarchy) { for(var key in hierarchy) {
if(hierarchy.hasOwnProperty(key) && if(hierarchy.hasOwnProperty(key)
extra === false ) { && extraPosition === pages[key].extraPosition) {
// Sélectionne la page avant s'il s'agit de la page courante // Sélectionne la page avant s'il s'agit de la page courante
if(key === "<?php echo $this->getUrl(2); ?>") { if(key === "<?php echo $this->getUrl(2); ?>") {
positionSelected = positionPrevious; positionSelected = positionPrevious;