1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00
piwigo_ynh/sources/include/smarty/libs/plugins/modifiercompiler.upper.php

30 lines
683 B
PHP
Raw Normal View History

2014-07-06 13:21:10 +02:00
<?php
/**
* Smarty plugin
*
2016-08-27 21:53:29 +02:00
* @package Smarty
2014-07-06 13:21:10 +02:00
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty upper modifier plugin
* Type: modifier<br>
* Name: lower<br>
* Purpose: convert string to uppercase
2016-08-27 21:53:29 +02:00
*
* @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)
* @author Uwe Tews
*
2014-07-06 13:21:10 +02:00
* @param array $params parameters
2016-08-27 21:53:29 +02:00
*
2014-07-06 13:21:10 +02:00
* @return string with compiled code
*/
2016-08-27 21:53:29 +02:00
function smarty_modifiercompiler_upper($params)
2014-07-06 13:21:10 +02:00
{
if (Smarty::$_MBSTRING) {
2016-08-27 21:53:29 +02:00
return 'mb_strtoupper(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';
2014-07-06 13:21:10 +02:00
}
// no MBString fallback
return 'strtoupper(' . $params[0] . ')';
2016-08-27 21:53:29 +02:00
}