From da78ef3a1999aa418156504d9439bedd82020110 Mon Sep 17 00:00:00 2001 From: Nigel Sheldon Date: Sun, 22 Nov 2020 10:43:43 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Corrige=20la=20string=20de=20caract=C3=A8re?= =?UTF-8?q?=20qui=20permet=20de=20mettre=20une=20majuscule=20au=20premier?= =?UTF-8?q?=20mots=20et=20supprime=20un=20fichier=20inutile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smarty/plugins/modifier.ucfirst.php | 2 +- .../smarty/plugins/modifier.ucfirst.php3 | 31 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3 diff --git a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php b/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php index bb8ff9e..ea14477 100644 --- a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php +++ b/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php @@ -20,7 +20,7 @@ */ function smarty_modifier_ucfirst($chaine) { - $chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ"); + $chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ"); if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) { return $chaineS[0].$chaineS[1].substr($chaine, 2); } else { diff --git a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3 b/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3 deleted file mode 100644 index ea01fe6..0000000 --- a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3 +++ /dev/null @@ -1,31 +0,0 @@ - - * Name: capitalize
- * Purpose: capitalize words in the string - * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE - * capitalize (Smarty online manual) - * @author Monte Ohrt - * @param string - * @return string - */ -function smarty_modifier_ucfirst($chaine) -{ - $chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ"); - if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) - return $chaineS[0].$chaineS[1].substr($chaine, 2); - else - return ucfirst($chaine); -} - - -?> -- 2.45.2 From a94289dd2a5d6768872479fdf9b373032b332c68 Mon Sep 17 00:00:00 2001 From: Nigel Sheldon Date: Sun, 22 Nov 2020 11:02:59 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Utilisation=20de=20fonction=20c=C5=93ur=20d?= =?UTF-8?q?e=20PHP=20pour=20la=20gestion=20des=20accents=20majuscules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/templates/smarty/plugins/modifier.ucfirst.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php b/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php index ea14477..c625363 100644 --- a/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php +++ b/onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php @@ -20,10 +20,5 @@ */ function smarty_modifier_ucfirst($chaine) { - $chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ"); - if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) { - return $chaineS[0].$chaineS[1].substr($chaine, 2); - } else { - return ucfirst($chaine); - } + return mb_convert_case($chaine, MB_CASE_TITLE, 'UTF-8'); } -- 2.45.2