Corrige la string de caractère qui permet de mettre une majuscule au premier mots et supprime un fichier inutile

This commit is contained in:
Nigel Sheldon 2020-11-22 10:43:43 +01:00 committed by Gitea
parent fa20708cba
commit a2f62c1c1c
2 changed files with 1 additions and 32 deletions

View File

@ -20,7 +20,7 @@
*/ */
function smarty_modifier_ucfirst($chaine) function smarty_modifier_ucfirst($chaine)
{ {
$chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ"); $chaineS = strtr($chaine, "áàâäãéèêëẽíìîïĩóòôöõúùûüũýỳŷÿỹ", "ÁÀÂÄÃÉÈÊËẼÍÌÎÏĨÓÒÔÖÕÚÙÛÜŨÝỲŶŸỸ");
if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) { if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) {
return $chaineS[0].$chaineS[1].substr($chaine, 2); return $chaineS[0].$chaineS[1].substr($chaine, 2);
} else { } else {

View File

@ -1,31 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty capitalize modifier plugin
*
* Type: modifier<br>
* Name: capitalize<br>
* 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 <monte at ohrt dot com>
* @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);
}
?>