From 7b67951714fdb262c14538948622047d4bbbb0f9 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 18 Feb 2020 15:07:57 +0100 Subject: [PATCH] =?UTF-8?q?[10.0.036.dev]=20Aper=C3=A7u=20des=20polices=20?= =?UTF-8?q?dans=20les=20s=C3=A9lecteurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/template.class.php | 27 ++++++++++++++++++------ 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 ++++-- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/core/class/template.class.php b/core/class/template.class.php index 8c68199f..caa34d18 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -507,12 +507,19 @@ class template { 'id' => $nameId, 'label' => '', 'name' => $nameId, - 'selected' => '' + '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 @@ -533,12 +540,18 @@ class template { helper::sprintAttributes($attributes) ); foreach($options as $value => $text) { - $html .= sprintf( - '', - $value, - $attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string - $text - ); + $html .= $attributes['fonts'] === true ? sprintf( + '', + $value, + $attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string + str_replace('+',' ',$value), + $text + ) : sprintf( + '', + $value, + $attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string + $text + ); } // Fin sélection $html .= ''; 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 9a68ebc4..8d3b41cf 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 f23cc8ad..3050a550 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 ]); ?>