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 ]); ?>