diff --git a/CHANGES.md b/CHANGES.md index fcbed38..092f702 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,16 @@ # Changelog +## Version 4.3.06 de Deltacms +- Corrections : + - Personnalisation des thémes : color picker absent du paramétrage de la bannière et du footer. + +## Version 4.3.05 de Deltacms +- Modifications : + - Form, Agenda, Gallery : les lexiques pour la langue d'administration sont déportés dans des dossiers 'lang', + - Modules du coeur, core.php, core.js.php : les lexiques pour la langue d'administration sont déportés dans des dossiers 'lang', + - Fichier sitemap.xml : exclusion des pages orphelines, + - Capture Opengraph : réduction du poids de l'image screenshot.jpg. + ## Version 4.3.04 de Deltacms - Modifications : - Fichiers .htaccess : Mise à jour vers Apache 2.4. Attention pour cette mise à jour vers la version Deltacms 4.3.04 diff --git a/README.md b/README.md index 6d46d0f..a3872de 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# DeltaCMS 4.3.04 +# DeltaCMS 4.3.06 DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes. diff --git a/core/core.js.php b/core/core.js.php index f71f59b..b18e680 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -65,14 +65,6 @@ core.colorVariants = function(rgba) { * Crée un message de confirmation */ core.confirm = function(text, yesCallback, noCallback) { - var textnon = ""; - var textoui = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'textnon = "Non"; textoui = "Oui";' ; - } - else{ - echo 'textnon = "No"; textoui = "Yes";' ; - } ?> var lightbox = lity(function($) { return $("
") .addClass("lightbox") @@ -83,7 +75,7 @@ core.confirm = function(text, yesCallback, noCallback) { .append( $("") .addClass("button grey") - .text(textnon) + .text(textConfirmNo) .on("click", function() { lightbox.options('button', true); lightbox.close(); @@ -93,7 +85,7 @@ core.confirm = function(text, yesCallback, noCallback) { }), $("") .addClass("button") - .text(textoui) + .text(textConfirmYes) .on("click", function() { lightbox.options('button', true); lightbox.close(); @@ -297,16 +289,9 @@ core.start = function() { // Mise à jour de l'affichage des champs d'upload $(".inputFileHidden").on("change", function() { var inputFileHiddenDOM = $(this); - var text = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Choisissez un fichier";' ; - } - else{ - echo 'text = "Select a file";' ; - } ?> var fileName = inputFileHiddenDOM.val(); if(fileName === "") { - fileName = text; + fileName = textSelectFile; $(inputFileHiddenDOM).addClass("disabled"); } else { @@ -324,27 +309,13 @@ core.start = function() { }); // Confirmation de mise à jour $("#barUpdate").on("click", function() { - var text = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Effectuer la mise à jour ?";' ; - } - else{ - echo 'text = "Updating ?";' ; - } ?> - return core.confirm( text, function() { + return core.confirm( textUpdating, function() { $(location).attr("href", $("#barUpdate").attr("href")); }); }); // Confirmation de déconnexion - var text = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Se déconnecter ?";' ; - } - else{ - echo 'text = "Logout ?";' ; - } ?> $("#barLogout").on("click", function() { - return core.confirm( text, function() { + return core.confirm( textLogout, function() { $(location).attr("href", $("#barLogout").attr("href")); }); }); @@ -364,20 +335,13 @@ core.start = function() { * Check adresse email */ $("[type=email]").on("change", function() { - var text = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Format incorrect";' ; - } - else{ - echo 'text = "Incorrect format";' ; - } ?> var _this = $(this); var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i; if(pattern.test(_this.val())) { core.noticeRemove(_this.attr("id")); } else { - core.noticeAdd(_this.attr("id"), text); + core.noticeAdd(_this.attr("id"), textCheckMail); } }); @@ -435,14 +399,7 @@ core.start(); */ $("#pageDelete").on("click", function() { var _this = $(this); - var text = ""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Êtes-vous sûr de vouloir supprimer cette page ?";' ; - } - else{ - echo 'text = "Are you sure you want to delete this page ?";' ; - } ?> - return core.confirm( text, function() { + return core.confirm( textPageDelete, function() { $(location).attr("href", _this.attr("href")); }); }); @@ -577,8 +534,9 @@ $(document).ready(function(){ */ var dataURL = {}; $('#screenshot').click(function() { - html2canvas(document.querySelector("#main_screenshot")).then(canvas => { - dataURL = canvas.toDataURL(); + html2canvas(document.querySelector("#main_screenshot")).then(canvas => { + dataURL = canvas.toDataURL('image/jpeg', 0.1); + console.log( dataURL); $.ajax({ type: "POST", contentType:"application/x-www-form-urlencoded", @@ -588,7 +546,7 @@ $(document).ready(function(){ }, dataType: "html" }); - }); + }); }); }); diff --git a/core/core.php b/core/core.php index 518ef62..5ac997a 100644 --- a/core/core.php +++ b/core/core.php @@ -48,7 +48,7 @@ class common { // Numéro de version const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/'; - const DELTA_VERSION = '4.3.04'; + const DELTA_VERSION = '4.3.06'; const DELTA_UPDATE_CHANNEL = "v4"; public static $actions = []; @@ -123,48 +123,7 @@ class common { ], 'view' => '' ]; - public static $groups = [ - self::GROUP_BANNED => 'Banni', - self::GROUP_VISITOR => 'Visiteur', - self::GROUP_MEMBER => 'Membre', - self::GROUP_MODERATOR => 'Éditeur', - self::GROUP_ADMIN => 'Administrateur' - ]; - public static $groupEdits = [ - self::GROUP_BANNED => 'Banni', - self::GROUP_MEMBER => 'Membre', - self::GROUP_MODERATOR => 'Éditeur', - self::GROUP_ADMIN => 'Administrateur' - ]; - public static $groupEdits_en = [ - self::GROUP_BANNED => 'Banned', - self::GROUP_MEMBER => 'Member', - self::GROUP_MODERATOR => 'Editor', - self::GROUP_ADMIN => 'Administrator' - ]; - public static $groupNews = [ - self::GROUP_MEMBER => 'Membre', - self::GROUP_MODERATOR => 'Éditeur', - self::GROUP_ADMIN => 'Administrateur' - ]; - public static $groupNews_en = [ - self::GROUP_MEMBER => 'Member', - self::GROUP_MODERATOR => 'Editor', - self::GROUP_ADMIN => 'Administrator' - ]; - public static $groupPublics = [ - self::GROUP_VISITOR => 'Visiteur', - self::GROUP_MEMBER => 'Membre', - self::GROUP_MODERATOR => 'Éditeur', - self::GROUP_ADMIN => 'Administrateur' - ]; - public static $groupPublics_en = [ - self::GROUP_VISITOR => 'Visitor', - self::GROUP_MEMBER => 'Member', - self::GROUP_MODERATOR => 'Editor', - self::GROUP_ADMIN => 'Administrator' - ]; - // Langues proposées + // Langues proposées, conserver ces 5 variables $i18nList... public static $i18nList = [ 'fr' => 'Français (fr)', 'de' => 'Allemand (de)', @@ -203,6 +162,10 @@ class common { 'eu' => 'Basque (eu)', 'none' => 'Other language' ]; + public static $i18nList_admin = [ + 'fr' => 'Français (fr)', + 'en' => 'English (en)' + ]; public static $i18nList_int = [ 'fr' => 'Français (fr)', 'da' => 'Dansk (da)', @@ -436,27 +399,18 @@ class common { */ public function addRequiredInputNotices($key) { // Lexique - $text = []; - $val = $this->getData(['config', 'i18n', 'langAdmin']); - switch ($val) { - case 'fr' : - $text[0] = 'Obligatoire'; - break; - case 'en' : - $text[0] = 'Mandatory'; - break; - } + include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php'); // La clef est un tableau if(preg_match('#\[(.*)\]#', $key, $secondKey)) { $firstKey = explode('[', $key)[0]; $secondKey = $secondKey[1]; if(empty($this->input['_POST'][$firstKey][$secondKey])) { - common::$inputNotices[$firstKey . '_' . $secondKey] = $text[0]; + common::$inputNotices[$firstKey . '_' . $secondKey] = $text['core']['addRequiredInputNotices'][0]; } } // La clef est une chaine elseif(empty($this->input['_POST'][$key])) { - common::$inputNotices[$key] = $text[0]; + common::$inputNotices[$key] = $text['core']['addRequiredInputNotices'][0]; } } @@ -928,9 +882,10 @@ class common { if ($this->getData(['config','seo', 'robots']) === true) { foreach($this->getHierarchy(null, null, null) as $parentPageId => $childrenPageIds) { - // Exclure les barres et les pages non publiques et les pages masquées + // Exclure les barres,les pages non publiques et les pages orphelines if ($this->getData(['page',$parentPageId,'group']) !== 0 || - $this->getData(['page', $parentPageId, 'block']) === 'bar' ) { + $this->getData(['page', $parentPageId, 'block']) === 'bar' || + $this->getData(['page', $parentPageId, 'position']) === 0 ) { continue; } // Page désactivée, traiter les sous-pages sans prendre en compte la page parente. @@ -1074,6 +1029,7 @@ class common { $layout = ob_get_clean(); $mail = new PHPMailer\PHPMailer\PHPMailer; $mail->CharSet = 'UTF-8'; + // Langage par défaut : en if( $this->getData(['config', 'i18n', 'langAdmin']) === 'fr')$mail->setLanguage('fr', 'core/class/phpmailer/phpmailer.lang-fr.php'); // Mail try{ @@ -1641,21 +1597,8 @@ class common { * Affiche le menu */ public function showMenu() { - // Lexique - $text = []; - $val = $this->getData(['config', 'i18n', 'langAdmin']); - switch ($val) { - case 'fr' : - $text[0] = 'Gérer les fichiers'; - $text[1] = 'Gérer mon compte'; - $text[2] = 'Me déconnecter'; - break; - case 'en' : - $text[0] = 'Manage files'; - $text[1] = 'Manage my account'; - $text[2] = 'Logout'; - break; - } + // Lexique + include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php'); // Met en forme les items du menu $itemsLeft = ''; $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); @@ -1828,9 +1771,9 @@ class common { || $this->getData(['theme','footer','displayMemberBar']) === false ) ) { - if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $itemsRight .= '
  • ' . template::ico('folder') . '
  • '; - $itemsRight .= '
  • ' . template::ico('user', 'right') . '
  • '; - $itemsRight .= '
  • ' . template::ico('logout') . '
  • '; + if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $itemsRight .= '
  • ' . template::ico('folder') . '
  • '; + $itemsRight .= '
  • ' . template::ico('user', 'right') . '
  • '; + $itemsRight .= '
  • ' . template::ico('logout') . '
  • '; } // Retourne les items du menu echo '