Compare commits
No commits in common. "664a7220f96c596116c8b6d1791091683001ff09" and "fa20708cbaec3d6b66816f92fb1498cff7dbb493" have entirely different histories.
664a7220f9
...
fa20708cba
2 changed files with 37 additions and 1 deletions
|
|
@ -20,5 +20,10 @@
|
|||
*/
|
||||
function smarty_modifier_ucfirst($chaine)
|
||||
{
|
||||
return mb_convert_case($chaine, MB_CASE_TITLE, 'UTF-8');
|
||||
$chaineS = strtr($chaine, "áà âäãéèêëẽÃìîïĩóòôöõúùûüũýỳŷÿỹ", "ÃÃÃÃÃÃÃÃÃẼÃÃÃÃĨÃÃÃÃÃÃÃÃÃŨÃỲŶŸỸ");
|
||||
if ($chaineS[0].$chaineS[1] != $chaine[0].$chaine[1]) {
|
||||
return $chaineS[0].$chaineS[1].substr($chaine, 2);
|
||||
} else {
|
||||
return ucfirst($chaine);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
31
onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3
Normal file
31
onyx2/modules/templates/smarty/plugins/modifier.ucfirst.php3
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?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);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue