From 01c71be0beaadd2e06a3de6df02567d63d42c599 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 18 Feb 2020 15:20:21 +0100 Subject: [PATCH] =?UTF-8?q?[9.2.22]=20aper=C3=A7u=20de=20la=20police=20dan?= =?UTF-8?q?s=20les=20s=C3=A9lecteurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 + core/core.php | 119 +++++++++++++---------- core/module/theme/view/footer/footer.php | 3 +- core/module/theme/view/header/header.php | 3 +- core/module/theme/view/menu/menu.php | 3 +- core/module/theme/view/site/site.php | 6 +- 6 files changed, 80 insertions(+), 58 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fb92a98d..3c455075 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## version 9.2.22 +- Modification : + - Aperçu de la police dans les sélecteurs. + ## version 9.2.21 - Correction : - Footer / Texte personnalisé : suppression des sauts de ligne et de paragraphe. diff --git a/core/core.php b/core/core.php index 551c4a26..5566620e 100644 --- a/core/core.php +++ b/core/core.php @@ -33,7 +33,7 @@ class common { const TEMP_DIR = 'site/tmp/'; // Numéro de version - const ZWII_VERSION = '9.2.21'; + const ZWII_VERSION = '9.2.22'; public static $actions = []; public static $coreModuleIds = [ @@ -3157,58 +3157,71 @@ class template { * @param array $attributes Attributs ($key => $value) * @return string */ - public static function select($nameId, array $options, array $attributes = []) { - // Attributs par défaut - $attributes = array_merge([ - 'before' => true, - 'class' => '', - 'classWrapper' => '', - 'noDirty' => false, - 'disabled' => false, - 'help' => '', - 'id' => $nameId, - 'label' => '', - 'name' => $nameId, - 'selected' => '' - ], $attributes); - // Sauvegarde des données en cas d'erreur - if($attributes['before'] AND array_key_exists($attributes['id'], common::$inputBefore)) { - $attributes['selected'] = common::$inputBefore[$attributes['id']]; - } - // Début du wrapper - $html = '
'; - // Label - if($attributes['label']) { - $html .= self::label($attributes['id'], $attributes['label'], [ - 'help' => $attributes['help'] - ]); - } - // Notice - $notice = ''; - if(array_key_exists($attributes['id'], common::$inputNotices)) { - $notice = common::$inputNotices[$attributes['id']]; - $attributes['class'] .= ' notice'; - } - $html .= self::notice($attributes['id'], $notice); - // Début sélection - $html .= sprintf(''; - // Fin du wrapper - $html .= '
'; - // Retourne le html - return $html; - } + public static function select($nameId, array $options, array $attributes = []) { + // Attributs par défaut + $attributes = array_merge([ + 'before' => true, + 'class' => '', + 'classWrapper' => '', + 'noDirty' => false, + 'disabled' => false, + 'help' => '', + 'id' => $nameId, + 'label' => '', + 'name' => $nameId, + 'selected' => '', + 'fonts' => false + ], $attributes); + // Sauvegarde des données en cas d'erreur + if($attributes['before'] AND array_key_exists($attributes['id'], common::$inputBefore)) { + $attributes['selected'] = common::$inputBefore[$attributes['id']]; + } + // Liste des polices à intégrer + if ($attributes['fonts'] === true) { + foreach ($options as $fontId) { + echo "\n"; + } + } + // Début du wrapper + $html = '
'; + // Label + if($attributes['label']) { + $html .= self::label($attributes['id'], $attributes['label'], [ + 'help' => $attributes['help'] + ]); + } + // Notice + $notice = ''; + if(array_key_exists($attributes['id'], common::$inputNotices)) { + $notice = common::$inputNotices[$attributes['id']]; + $attributes['class'] .= ' notice'; + } + $html .= self::notice($attributes['id'], $notice); + // Début sélection + $html .= sprintf(''; + // Fin du wrapper + $html .= '
'; + // Retourne le html + return $html; + } /** * Crée une bulle de dialogue diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 839389a1..47347007 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -103,7 +103,8 @@
'Police', - 'selected' => $this->getData(['theme', 'footer', 'font']) + 'selected' => $this->getData(['theme', 'footer', 'font']), + 'fonts' => true ]); ?>
diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index 135cdfb6..ee034abb 100755 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -143,7 +143,8 @@
'Police', - 'selected' => $this->getData(['theme', 'header', 'font']) + 'selected' => $this->getData(['theme', 'header', 'font']), + 'fonts' => true ]); ?>
diff --git a/core/module/theme/view/menu/menu.php b/core/module/theme/view/menu/menu.php index bb55a627..e4f56025 100755 --- a/core/module/theme/view/menu/menu.php +++ b/core/module/theme/view/menu/menu.php @@ -82,7 +82,8 @@
'Police', - 'selected' => $this->getData(['theme', 'menu', 'font']) + 'selected' => $this->getData(['theme', 'menu', 'font']), + 'fonts' => true ]); ?>
diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index d30e334e..ea2d1bd3 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -71,7 +71,8 @@
'Police', - 'selected' => $this->getData(['theme', 'text', 'font']) + 'selected' => $this->getData(['theme', 'text', 'font']), + 'fonts' => true ]); ?>
@@ -91,7 +92,8 @@
'Police', - 'selected' => $this->getData(['theme', 'title', 'font']) + 'selected' => $this->getData(['theme', 'title', 'font']), + 'fonts' => true ]); ?>