From 3d4be63df858e728950d2da3cbc1854e1a66c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Tue, 26 Apr 2022 18:46:09 +0200 Subject: [PATCH] =?UTF-8?q?Fontes=20locales=20okay=20+=20boutons=20petits?= =?UTF-8?q?=20dans=20le=20th=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 8 +++----- core/module/theme/theme.php | 12 ++++++++---- core/module/theme/view/fontAdd/fontAdd.php | 12 +++++------- core/module/theme/view/fontEdit/fontEdit.php | 12 +++++------- core/module/theme/view/fonts/fonts.php | 12 +++++------- 5 files changed, 26 insertions(+), 30 deletions(-) diff --git a/core/core.php b/core/core.php index db82eef8..c0742f6e 100644 --- a/core/core.php +++ b/core/core.php @@ -189,11 +189,6 @@ class common { 'font-family' => 'Arial, Helvetica, sans-serif', 'resource' => 'websafe' ], - 'arial-black' => [ - 'name' => 'Arial Black', - 'font-family' => '\'Arial Black\', Gadget, sans-serif', - 'resource' => 'websafe' - ], 'arvo'=> [ 'name' => 'Arvo', 'font-family' => 'Arvo, sans-serif', @@ -2178,6 +2173,9 @@ class common { if ( file_exists(self::DATA_DIR . 'fonts/fonts.html') ){ include_once(self::DATA_DIR . 'fonts/fonts.html'); } + if ( file_exists(self::DATA_DIR . 'fonts/fonts.css') ){ + echo ''; + } } /** diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index ff4f7065..11040563 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -1189,12 +1189,14 @@ class theme extends common { * Chargement des polices en ligne dans un fichier fonts.html inclus dans main.php */ $gf = false; - $fileContent = ''; + $fileContent = ''; foreach ($this->getData(['fonts', 'imported']) as $fontId => $fontValue) { if ( ( $scope === 'user' && in_array($fontId, $fontsInstalled) ) || $scope === 'all' ) { + //Pré chargement à revoir + //$fileContent .= ''; $fileContent .= ''; // Pré connect pour api.google $gf = strpos($fontValue['resource'], 'fonts.googleapis.com') === false ? $gf || false : $gf || true; @@ -1217,13 +1219,15 @@ class theme extends common { || $scope === 'all' ) { if (file_exists(self::DATA_DIR . 'fonts/' . $fontValue['resource']) ) { + // Extension + $path_parts = pathinfo(helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontValue['resource']); // Chargement de la police $fileContentCss .= '@font-face {' ; - $fileContentCss .= 'font-family:"' . $fontValue['font-family'] . '";'; - $fileContentCss .= 'src: local("' . $fontValue['name'] . '"), url("' . $fontValue['resource'] . '") format("woff");'; + $fileContentCss .= 'font-family:"' . $fontId . '";'; + $fileContentCss .= 'src: url("' . $fontValue['resource'] . '") format("' . $path_parts['extension'] . '");'; $fileContentCss .= '}' ; // Préchargement - $fileContent = '' . $fileContent; + //$fileContent = '' . $fileContent; } } } diff --git a/core/module/theme/view/fontAdd/fontAdd.php b/core/module/theme/view/fontAdd/fontAdd.php index 804b3674..cddc03fe 100644 --- a/core/module/theme/view/fontAdd/fontAdd.php +++ b/core/module/theme/view/fontAdd/fontAdd.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme/fonts', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/fontes#add', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
'Valider', 'uniqueSubmission' => true diff --git a/core/module/theme/view/fontEdit/fontEdit.php b/core/module/theme/view/fontEdit/fontEdit.php index 21bf456c..15b7a535 100644 --- a/core/module/theme/view/fontEdit/fontEdit.php +++ b/core/module/theme/view/fontEdit/fontEdit.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme/fonts', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/fontes#add', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
'Valider', 'uniqueSubmission' => true diff --git a/core/module/theme/view/fonts/fonts.php b/core/module/theme/view/fonts/fonts.php index 87c28836..27ebd056 100644 --- a/core/module/theme/view/fonts/fonts.php +++ b/core/module/theme/view/fonts/fonts.php @@ -1,22 +1,20 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/fontes', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
helper::baseUrl() . $this->getUrl(0) . '/fontAdd', 'ico' => 'plus',