Merge branch '11200' into 11200_vendors

This commit is contained in:
fredtempez 2021-12-02 14:24:23 +01:00
commit 3279ead197
18 changed files with 1511 additions and 1604 deletions

View File

@ -45,7 +45,7 @@ class common {
// Numéro de version
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
const ZWII_VERSION = '11.2.00.12';
const ZWII_VERSION = '11.2.00.14';
const ZWII_UPDATE_CHANNEL = "test";
public static $actions = [];

View File

@ -337,9 +337,13 @@ td>.col12 {
/* Notice */
.notice {
display: block; /* au lieu de inline-block notamment dans les input file*/
display: inline-block;
color: #E74C3C;
}
/* Mauvaise position dans les champs File*/
.inputFile.notice {
display: block;
}
/* Container */
.container {

View File

@ -208,8 +208,9 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index',
'notification' => $successSitemap ? 'Mises à jour des fichiers sitemap et robots.txt' : 'Echec d\'écriture, le site map n\'a pas été mis à jour',
'redirect' => helper::baseUrl() . 'config/advanced',
'state' => $successSitemap
]);
}
@ -275,8 +276,9 @@ class config extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index',
'notification' => $success === false ? 'Service inaccessible ou erreur d\'écriture de l\'image' : 'Image générée avec succès',
'redirect' => helper::baseUrl() . 'config/advanced',
'state' => $success === false ? false : true
]);
}
@ -299,8 +301,9 @@ class config extends common {
if ($file_parts['extension'] !== 'zip') {
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore',
'notification' => 'Le fichier n\'est pas une archive valide',
'redirect' => helper::baseUrl() . 'config/restore',
'state' => false
]);
}
@ -308,8 +311,9 @@ class config extends common {
if ($successOpen === FALSE) {
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore',
'notification' => 'Impossible de lire l\'archive',
'redirect' => helper::baseUrl() . 'config/restore',
'state' => false
]);
}
@ -350,8 +354,9 @@ class config extends common {
} elseif ($version === 0) { // Version invalide
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore',
'notification' => 'Cette archive n\'est pas une sauvegarde valide',
'redirect' => helper::baseUrl() . 'config/restore',
'state' => false
]);
}
@ -375,12 +380,13 @@ class config extends common {
}
}
// Message de notification
$notification = $success === true ? 'Restauration effectuée avec succès' : 'Erreur inconnue';
$notification = $success === true ? 'Restaurer effectuée avec succès' : 'Erreur inconnue';
$redirect = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/restore' : helper::baseUrl() . 'user/login/';
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore',
'notification' => $notification,
'redirect' =>$redirect,
'state' => $success
]);
}
@ -574,7 +580,8 @@ class config extends common {
$this->generateFiles();
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Modifications enregistrées ' ,
'state' => true
]);
@ -616,8 +623,11 @@ class config extends common {
}
// Valeurs en sortie
$this->addOutput([
'notification' => 'Modifications enregistrées',
'redirect' => helper::baseUrl() . 'config/script/'. $this->geturl(2),
'title' => 'Éditeur de script dans ' . ucfirst($this->geturl(2)) ,
'vendor' => [
'codemirror'
],
'view' => 'script',
'state' => true
]);
}
@ -677,8 +687,9 @@ class config extends common {
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
// Valeurs en sortie
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore',
'notification' => $success ? $c3. ' conversion' . ($c3 > 1 ? 's' : '') . ' effectuée' . ($c3 > 1 ? 's' : '') : 'Aucune conversion',
'redirect' => helper::baseUrl() . 'config/restore',
'state' => $success ? true : false
]);
}
@ -695,14 +706,16 @@ class config extends common {
file_put_contents(self::DATA_DIR . 'journal.log',$d);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Journal réinitialisé avec succès',
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Aucun journal à effacer',
'state' => false
]);
@ -729,7 +742,8 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Aucun fichier journal à télécharger',
'state' => false
]);
@ -765,7 +779,8 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Aucune liste noire à télécharger',
'state' => false
]);
@ -781,14 +796,16 @@ class config extends common {
$this->setData(['blacklist',[]]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Liste noire réinitialisée avec succès',
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Pas de liste à effacer',
'state' => false
]);
@ -806,7 +823,8 @@ class config extends common {
$this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup' );
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'title' => 'Configuration',
'view' => 'index',
'notification' => 'Copie terminée',
'state' => true
]);

View File

@ -12,7 +12,7 @@
$( document).ready(function() {
$("#configBackupForm").submit( function(e){
$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
//$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
e.preventDefault();
var url = "<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup";
$.ajax({
@ -29,6 +29,9 @@ $( document).ready(function() {
},
complete: function(){
$("#configBackupSubmit").removeClass("disabled").prop("disabled", false);
$("#configBackupSubmit").removeClass("uniqueSubmission").prop("uniqueSubmission", false);
$("#configBackupSubmit span").removeClass("zwiico-spin animate-spin");
$("#configBackupSubmit span").addClass("zwiico-check zwiico-margin-right").text("Sauvegarder");
}
});
});

View File

@ -3,14 +3,15 @@
<div class="col2">
<?php echo template::button('configBackupBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config/advanced',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configBackupSubmit',[
'value' => 'Sauvegarder'
'value' => 'Sauvegarder',
'uniqueSubmission' => true
]); ?>
</div>
</div>

View File

@ -22,26 +22,5 @@
}
.activeButton {
filter : brightness(125%);
filter : brightness(150%);
}
/** Div d'aide
.helpDisplayContainer {
position: sticky;
background-color: white;
display: none;
width: 100%;
padding: 10px 10px;
-webkit-box-shadow: 5px 5px 11px 0px #222222;
box-shadow: 5px 5px 11px 0px #222222;
border-radius: 5px;
z-index: 30;
}
/** Bouton d'aide et croix de fermeture
.zwiico-cancel, .helpDisplayButton {
cursor: pointer;
}
*/

View File

@ -38,20 +38,32 @@ $( document).ready(function() {
$("#SmtpAuthParam").slideUp();
}
/**
* Cookie
*/
/*
if ($("input[name=configCookieConsent]").is(':checked')) {
$("#cookieContainer").slideDown();
} else {
$("#cookieContainer").slideUp();
var configLayout = getCookie("configLayout");
if (configLayout == null) {
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").show();
$("#configSetupButton").addClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
setCookie("configLayout","setup");
}
*/
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").hide();
$("#" + configLayout + "Container" ).show();
$("#config" + capitalizeFirstLetter(configLayout) + "Button").addClass("activeButton");
// Gestion des événements
//---------------------------------------------------------------------------------------------------------------------
/**
* Afficher et masquer options SMTP
*/
@ -128,20 +140,20 @@ $( document).ready(function() {
$("#networkContainer").hide();
$("#setupContainer").show();
$("#configSetupButton").addClass("activeButton");
$("#configLocalButton").removeClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
setCookie("configLayout","setup");
});
$("#configLocalButton").on("click", function() {
$("#configLocaleButton").on("click", function() {
$("#setupContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#localeContainer").show();
$("#configSetupButton").removeClass("activeButton");
$("#configLocalButton").addClass("activeButton");
$("#configLocaleButton").addClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
@ -154,7 +166,7 @@ $( document).ready(function() {
$("#networkContainer").hide();
$("#socialContainer").show();
$("#configSetupButton").removeClass("activeButton");
$("#configLocalButton").removeClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").addClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
@ -167,7 +179,7 @@ $( document).ready(function() {
$("#networkContainer").hide();
$("#connectContainer").show();
$("#configSetupButton").removeClass("activeButton");
$("#configLocalButton").removeClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").addClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
@ -180,46 +192,13 @@ $( document).ready(function() {
$("#connectContainer").hide();
$("#networkContainer").show();
$("#configSetupButton").removeClass("activeButton");
$("#configLocalButton").removeClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").addClass("activeButton");
setCookie("configLayout","network");
});
/**
* Options des cookies
*/
/*
$("input[name=configCookieConsent]").on("change", function() {
if ($("input[name=configCookieConsent]").is(':checked')) {
$("#cookieContainer").slideDown();
} else {
$("#cookieContainer").slideUp();
}
});
*/
var configLayout = getCookie("configLayout");
if (configLayout == null) {
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").show();
$("#configSetupButton").addClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
setCookie("configLayout","setup");
}
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").hide();
$("#" + configLayout + "Container" ).show();
});
@ -231,7 +210,7 @@ function setCookie(name,value,days) {
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
}
function getCookie(name) {
@ -244,3 +223,8 @@ function getCookie(name) {
}
return null;
}
// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

View File

@ -30,7 +30,7 @@
]); ?>
</div>
<div class="col2">
<?php echo template::button('configLocalButton', [
<?php echo template::button('configLocaleButton', [
'value' => 'Localisation'
]); ?>
</div>

View File

@ -3,14 +3,15 @@
<div class="col2">
<?php echo template::button('configRestoreBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config/advanced',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configRestoreSubmit',[
'value' => 'Restaurer'
'value' => 'Restaurer',
'uniqueSubmission' => true,
]); ?>
</div>
</div>

View File

@ -3,7 +3,7 @@
<div class="col2">
<?php echo template::button('configManageBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config/advanced',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
]); ?>

View File

@ -16,26 +16,3 @@
* admin.css
*/
#seo > .blockContainer,
#advanced > .blockContainer {
display: none;
}
#info .zwiico-minus-circled,
#layout .zwiico-minus-circled,
#location .zwiico-minus-circled {
display: inline;
}
.zwiico-minus-circled,
#info .zwiico-plus-circled,
#layout .zwiico-plus-circled,
#location .zwiico-plus-circled {
display: none;
}
.zwiico-minus-circled,
.zwiico-plus-circled {
cursor: pointer;
}

View File

@ -52,40 +52,6 @@ function protectModule() {
*/
$( document ).ready(function() {
/**
* Initialisation des blocs
*/
var i = ["info", "layout", "setup", "location", "advanced", "seo" ];
$.each(i,function(e) {
if (getCookie(i[e]) === "true") {
$("#" + i[e]).find(".zwiico-plus-circled").hide();
$("#" + i[e]).find(".zwiico-minus-circled").show();
$("#" + i[e]).find(".blockContainer").show();
}
});
/**
* Blocs dépliants
*
* Sauvegarder la position des blocs
* true = bloc déplié
*/
$("div .block").click(function(e) {
$(this).find(".zwiico-plus-circled").toggle();
$(this).find(".zwiico-minus-circled").toggle();
$(this).find(".blockContainer").slideToggle();
/*
* Sauvegarder la position des blocs
* true = bloc déplié
*/
document.cookie = $(this).attr('id') + "=" + $(this).find(".zwiico-minus").is(":visible") + ";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;SameSite=Lax";
}).on("click", "span > input, input, textarea, label, option, button, a:not(.inputFile) , .blockContainer", function(e) {
// Empêcher les déclenchements dans les blocs
e.stopPropagation();
});
/*
* Enleve le menu fixe en édition de page
@ -472,14 +438,6 @@ pageEditBlockDOM.on("change", function() {
/**
* Lire un cookie s'il existe
*/
function getCookie(name) {
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
return v ? v[2] : null;
}
/**
* Masquer ou afficher le chemin de fer

View File

@ -35,7 +35,9 @@
]); ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit'); ?>
<?php echo template::submit('pageEditSubmit', [
'uniqueSubmission' => true
]); ?>
</div>
</div>
<div class="row">
@ -122,19 +124,13 @@
</div>
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="block" id="layout">
<div class="block">
<h4>Mise en page
<span id="layoutHelpButton" class="helpDisplayButton">
<a href="https://doc.zwiicms.fr/les-barres-laterales" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
@ -184,19 +180,13 @@
</div>
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="block" id="location">
<div class="block">
<h4>Emplacement dans le menu
<span id="positionHelpButton" class="helpDisplayButton">
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
@ -252,19 +242,13 @@
</div>
<div class='row' id="pageEditAdvancedWrapper">
<div class="col12">
<div class="block" id="advanced">
<div class="block">
<h4>Options d'emplacement avancées
<span id="advancedHelpButton" class="helpDisplayButton">
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
@ -286,19 +270,13 @@
</div>
<div class='row' id="pageEditSeoWrapper">
<div class="col12">
<div class="block" id="seo">
<div class="block">
<h4>Permission et référencement
<span id="seoHelpButton" class="helpDisplayButton">
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">

View File

@ -19,7 +19,8 @@
</div>
<div class="col2">
<?php echo template::submit('blogAddPublish', [
'value' => 'Publier'
'value' => 'Publier',
'uniqueSubmission' => true
]); ?>
</div>
</div>

View File

@ -19,7 +19,8 @@
</div>
<div class="col2">
<?php echo template::submit('blogEditSubmit', [
'value' => 'Publier'
'value' => 'Publier',
'uniqueSubmission' => true,
]); ?>
</div>
</div>

View File

@ -19,7 +19,8 @@
</div>
<div class="col2">
<?php echo template::submit('newsAddPublish', [
'value' => 'Publier'
'value' => 'Publier',
'uniqueSubmission' => true
]); ?>
</div>
</div>

View File

@ -19,7 +19,8 @@
</div>
<div class="col2">
<?php echo template::submit('newsEditSubmit', [
'value' => 'Publier'
'value' => 'Publier',
'uniqueSubmission' => true
]); ?>
</div>
</div>