diff --git a/CHANGES.md b/CHANGES.md index 8f59c424..018959b2 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ - Suppression des appels Google Analytics lors du chargement du gestionnaire de fichiers (RFM) dans TUI-image. - Mauvais affichage du script ou du CSS déclarés dans une page. - Choix de la langue dans TinyMCE et CodeMirror. +- Mauvaise application des fontes dans l'administration du thème. - Correction de petits bugs. ### Nouveautés : - Remplacement du sélecteur de date Flatpickr par le sélecteur HTML 5 qui autorise les formats suivants : date, time, week, month, datetime-local. diff --git a/core/core.php b/core/core.php index 694cdd18..13d6bf94 100644 --- a/core/core.php +++ b/core/core.php @@ -261,7 +261,7 @@ class common 'resource' => 'websafe' ], 'georgia' => [ - 'name' => 'Geogia', + 'name' => 'Georgia', 'font-family' => 'Georgia, serif', 'resource' => 'websafe' ], @@ -345,7 +345,7 @@ class common // Langue de l'administration if ($this->getData(['user']) !== []) { // Langue sélectionnée dans le compte, la langue du cookie sinon celle du compte ouvert - self::$i18nUI = $this->getData(['user', $this->getUser('id'), 'language']) ? $this->getData(['user', $this->getUser('id'), 'language']) : $this->getInput('ZWII_UI'); + self::$i18nUI = $this->getData(['user', $this->getUser('id'), 'language']) ? $this->getData(['user', $this->getUser('id'), 'language']) : $this->getInput('ZWII_UI'); // Validation de la langue self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI)) && !file_exists(self::I18N_DIR . self::$i18nUI . '.json') @@ -353,7 +353,7 @@ class common : self::$i18nUI; } else { // Installation - self::$i18nUI = $this->getInput('ZWII_UI') ? $this->getInput('ZWII_UI') : 'fr_FR' ; + self::$i18nUI = $this->getInput('ZWII_UI') ? $this->getInput('ZWII_UI') : 'fr_FR'; } // Stocker le cookie de langue pour l'éditeur de texte @@ -2076,7 +2076,7 @@ class common $notificationClass = 'notificationError'; } if (common::$coreNotices) { - $notification = sprintf('%s

| ', helper::translate( 'Restauration des bases de données absentes')); + $notification = sprintf('%s

| ', helper::translate('Restauration des bases de données absentes')); foreach (common::$coreNotices as $item) $notification .= $item . ' | '; $notificationClass = 'notificationError'; @@ -2285,7 +2285,7 @@ class common * Affiche le script */ public function showScript() - { + { ob_start(); require 'core/core.js.php'; $coreScript = ob_get_clean(); @@ -2293,7 +2293,7 @@ class common if ($this->output['inlineScript']) { $inlineScript = implode($this->output['inlineScript']); } - echo ''; + echo ''; } /** @@ -2322,7 +2322,7 @@ class common if ($style) { echo ''; } - + } } } @@ -2751,6 +2751,11 @@ class core extends common // Version $css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/'; + // Fonts disponibles + $fontsAvailable['files'] = $this->getData(['fonts', 'files']); + $fontsAvailable['imported'] = $this->getData(['fonts', 'imported']); + $fontsAvailable['websafe'] = self::$fontsWebSafe; + /** * Import des polices de caractères * A partir du CDN ou dans le dossier site/file/source/fonts @@ -2808,7 +2813,8 @@ class core extends common // Thème Administration $colors = helper::colorVariants($this->getData(['admin', 'backgroundColor'])); $css .= '#site{background-color:' . $colors['normal'] . ';}'; - $css .= '.row > div {font:' . $fonts[$this->getData(['admin', 'fontText'])] . ';font-size:' . $this->getData(['admin', 'fontSize']) . '}'; + $css .= 'p, div, label, select, input, table, span {font-family:' . $fonts[$this->getData(['admin', 'fontText'])] . '}'; + $css .= 'body,.row > div {font-size:' . $this->getData(['admin', 'fontSize']) . '}'; $css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $fonts[$this->getData(['admin', 'fontTitle'])] . ';color:' . $this->getData(['admin', 'colorTitle']) . ';}'; // TinyMCE diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 4bd06014..f6bd0c67 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -253,7 +253,6 @@ class theme extends common 'backgroundColor' => $this->getInput('adminBackgroundColor'), 'colorTitle' => $this->getInput('adminColorTitle'), 'colorText' => $this->getInput('adminColorText'), - 'colorButtonText' => $this->getInput('adminColorButtonText'), 'backgroundColorButton' => $this->getInput('adminColorButton'), 'backgroundColorButtonGrey' => $this->getInput('adminColorGrey'), 'backgroundColorButtonRed' => $this->getInput('adminColorRed'), diff --git a/core/module/theme/view/admin/admin.js.php b/core/module/theme/view/admin/admin.js.php index 29d2e564..ecb7b5aa 100644 --- a/core/module/theme/view/admin/admin.js.php +++ b/core/module/theme/view/admin/admin.js.php @@ -9,4 +9,19 @@ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @link http://zwiicms.fr/ */ -$("input, select").on("change",(function(){var titleFont=$("#adminFontTitle").val(),textFont=$("#adminFontText").val(),css="@import url('https://fonts.cdnfonts.com/css/"+titleFont+"');",css="@import url('https://fonts.cdnfonts.com/css/"+textFont+"');",colors,css="#site{background-color:"+(colors=core.colorVariants($("#adminBackgroundColor").val())).normal+";}",colors,colors,colors,colors;css+="body, .row > div {font:"+$("#adminFontTextSize").val()+" '"+textFont+"', sans-serif;}",css+="body h1, h2, h3, h4, h5, h6 {font-family:'"+titleFont+"', sans-serif; color:"+$("#adminColorTitle").val()+";}",css+="body:not(.editorWysiwyg),span .zwiico-help {color:"+$("#adminColorText").val()+";}",css+="input[type='checkbox']:checked + label::before,.speechBubble{ background-color:"+(colors=core.colorVariants($("#adminColorButton").val())).normal+"; color:"+$("#adminColorButtonText").val()+";}",css+=".speechBubble::before {border-color:"+colors.normal+" transparent transparent transparent;}",css+=".button {background-color:"+colors.normal+";color:"+colors.text+";}.button:hover {background-color:"+colors.darken+";color:"+colors.text+";}.button:active {background-color:"+colors.veryDarken+";color:"+colors.text+";}",css+=".button.buttonGrey {background-color: "+(colors=core.colorVariants($("#adminColorGrey").val())).normal+";color:"+colors.text+";}.button.buttonGrey:hover {background-color:"+colors.darken+";color:"+colors.text+"}.button.buttonGrey:active {background-color:"+colors.veryDarken+";color:"+colors.text+";}",css+=".button.buttonRed {background-color: "+(colors=core.colorVariants($("#adminColorRed").val())).normal+";color:"+colors.text+";}.button.buttonRed:hover {background-color:"+colors.darken+";color:"+colors.text+"}.button.buttonRed:active {background-color:"+colors.veryDarken+";color:"+colors.text+"}",css+=".button.buttonGreen, button[type=submit] {background-color: "+(colors=core.colorVariants($("#adminColorGreen").val())).normal+";color: ;color:"+colors.text+"}.button.buttonGreen:hover, button[type=submit]:hover {background-color: "+colors.darken+";color:"+colors.text+";}.button.buttonGreen:active, button[type=submit]:active {background-color:"+colors.veryDarken+";color:"+colors.text+"}";var colors=core.colorVariants($("#adminBackGroundBlockColor").val());css+=".block {border: 1px solid "+$("#adminBorderBlockColor").val()+";}.block h4 {background-color: "+colors.normal+";color:"+colors.text+";}",css+="input[type=email],input[type=text],input[type=password],select:not(#bar select),textarea:not(.editorWysiwyg),.inputFile{background-color: "+colors.normal+";color:"+colors.text+";border: 1px solid "+$("#adminBorderBlockColor").val()+";}",$("#themePreview").remove(),$("