From 059efebddd5661f7a5d6f83ac33891d2c2b93cb1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 7 Mar 2022 11:31:52 +0100 Subject: [PATCH] Fontes websafe + cdfonts en option --- core/core.php | 44 ++++++------------- core/include/update.inc.php | 37 ++++++++++++++-- core/module/install/ressource/defaultdata.php | 23 +++++++++- 3 files changed, 70 insertions(+), 34 deletions(-) diff --git a/core/core.php b/core/core.php index 08a9e3ae..d1e969b2 100644 --- a/core/core.php +++ b/core/core.php @@ -185,41 +185,25 @@ class common { // Fontes public static $fonts = [ - 'arimo' => 'Arimo', - 'arvo' => 'Arvo', - 'dancing-script' => 'Dancing Script', - 'droid-sans-2' => 'Droid Sans', - 'droid-serif-2' => 'Droid Serif', - 'indie-flower' => 'Indie Flower', - 'liberation-sans' => 'Liberation Sans', - 'liberation-serif' => 'Liberation Serif', - 'lobster-2' => 'Lobster', - 'lora' => 'Lora', - 'lato' => 'Lato', - 'old-standard-tt-3' => 'Old Standard TT', - 'open-sans' => 'Open Sans', - 'oswald-4' => 'Oswald', - 'pt-mono' => 'PT Mono', - 'pt-serif' => 'PT Serif', - 'rancho' => 'Rancho', - 'roboto' => 'Roboto', - 'ubuntu' => 'Ubuntu', - 'vollkorn' => 'Vollkorn' ]; public static $fontsWebSafe = [ - 'georgia' => 'Georgia, DejaVu Serif, Norasi, serif;', - 'times' => 'Times, Times New Roman, Liberation Serif, FreeSerif, serif;', - 'arial' => 'Arial, Helvetica, Liberation Sans, FreeSans, sans-serif;', - 'trebuchet' => 'Trebuchet MS, Arial, Helvetica, sans-serif;', - 'lucida' => 'Lucida Sans, Lucida Grande, Lucida Sans Unicode, Luxi Sans, sans-serif;', - 'tahoma' => 'Tahoma, Geneva, Kalimati, sans-serif;', - 'verdana' => 'Verdana, DejaVu Sans, Bitstream Vera Sans, Geneva, sans-serif;', - 'impact' => 'Impact, Arial Black, sans-serif;', - 'courrier' => 'Courier, Courier New, FreeMono, Liberation Mono, monospace;', - 'monaco' => 'Monaco, DejaVu Sans Mono, Lucida Console, Andale Mono, monospace;' + 'arial' => 'Arial, Helvetica, sans-serif;', + 'arial-black' => 'Arial Black, Gadget, sans-serif;', + 'courrier' => 'Courier, Liberation Mono, monospace;', + 'courrier-new' => 'Courier New, Courier, monospace', + 'garamond' => 'Garamond, serif', + 'georgia' => 'Georgia, serif;', + 'impact' => 'Impact, Charcoal, sans-serif;', + 'lucida' => 'Lucida Sans Unicode, Lucida Grande, sans-serif', + 'tahoma' => 'Tahoma, Geneva, sans-serif;', + 'times-new-roman' => 'Times New Roman, Liberation Serif, serif;', + 'trebuchet' => 'Trebuchet MS, Arial, Helvetica, sans-serif;', + 'tahoma' => 'Tahoma, Geneva, sans-serif;', + 'verdana' => 'Verdana, Geneva, sans-serif;', ]; + /** * Constructeur commun */ diff --git a/core/include/update.inc.php b/core/include/update.inc.php index ebe8a045..5500164a 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -714,7 +714,7 @@ if ($this->getData(['core', 'dataVersion']) < 11200) { // Option de dévoilement du mdp $this->setData(['config', 'connect', 'showPassword', true]); - + // Mise à jour $this->setData(['core', 'dataVersion', 11200]); } @@ -722,7 +722,7 @@ if ($this->getData(['core', 'dataVersion']) < 11200) { // Version 11.2.02 if ($this->getData(['core', 'dataVersion']) < 11202) { - // Renommer les champs + // Renommer les champs $this->setData(['locale', 'cookies', 'mainLabel', $this->getData(['locale', 'cookies', 'cookiesZwiiText']) ]); $this->setData(['locale', 'cookies', 'gaLabel', $this->getData(['locale', 'cookies', 'cookiesGaText']) ]); $this->setData(['locale', 'cookies', 'titleLabel', $this->getData(['locale', 'cookies', 'cookiesTitleText']) ]); @@ -784,7 +784,7 @@ if ($this->getData(['core', 'dataVersion']) < 11300) { $this->setData(['theme', 'title', 'font', $fonts[ $this->getData (['theme', 'title', 'font' ]) ] ]); $this->setData(['admin', 'fontTitle', $fonts[ $this->getData (['admin', 'fontTitle' ]) ] ]); $this->setData(['admin', 'fontText', $fonts[$this->getData (['admin','fontText' ]) ] ]); - + unlink(self::DATA_DIR . 'admin.css'); unlink(self::DATA_DIR . 'theme.css'); @@ -808,3 +808,34 @@ if ($this->getData(['core', 'dataVersion']) < 11303) { // Mise à jour $this->setData(['core', 'dataVersion', 11303]); } + +// Version 11.4.00 +if ($this->getData(['core', 'dataVersion']) < 11400) { + + $fonts = [ + 'arimo' => 'Arimo', + 'arvo' => 'Arvo', + 'dancing-script' => 'Dancing Script', + 'droid-sans-2' => 'Droid Sans', + 'droid-serif-2' => 'Droid Serif', + 'indie-flower' => 'Indie Flower', + 'liberation-sans' => 'Liberation Sans', + 'liberation-serif' => 'Liberation Serif', + 'lobster-2' => 'Lobster', + 'lora' => 'Lora', + 'lato' => 'Lato', + 'old-standard-tt-3' => 'Old Standard TT', + 'open-sans' => 'Open Sans', + 'oswald-4' => 'Oswald', + 'pt-mono' => 'PT Mono', + 'pt-serif' => 'PT Serif', + 'rancho' => 'Rancho', + 'roboto' => 'Roboto', + 'ubuntu' => 'Ubuntu', + 'vollkorn' => 'Vollkorn' + ]; + $this->setData(['fonts', 'imported', $fonts]); + + // Mise à jour + $this->setData(['core', 'dataVersion', 11400]); +} diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 197d69b5..8cf73dbd 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -87,7 +87,28 @@ class init extends common { ], 'fonts' => [ 'files' => [], - 'imported' => [] + 'imported'=> [ + 'arimo'=> 'Arimo', + 'arvo'=> 'Arvo', + 'dancing-script' => 'Dancing Script', + 'droid-sans-2'=> 'Droid Sans', + 'droid-serif-2'=> 'Droid Serif', + 'indie-flower'=> 'Indie Flower', + 'liberation-sans'=> 'Liberation Sans', + 'liberation-serif'=> 'Liberation Serif', + 'lobster-2'=> 'Lobster', + 'lora'=> 'Lora', + 'lato'=> 'Lato', + 'old-standard-tt-3'=> 'Old Standard TT', + 'open-sans'=> 'Open Sans', + 'oswald-4'=> 'Oswald', + 'pt-mono'=> 'PT Mono', + 'pt-serif'=> 'PT Serif', + 'rancho'=> 'Rancho', + 'roboto'=> 'Roboto', + 'ubuntu'=> 'Ubuntu', + 'vollkorn'=> 'Vollkorn' + ] ], 'page' => [ 'accueil' => [