82 lines
1.8 KiB
PHP
82 lines
1.8 KiB
PHP
<?php
|
|
## some constants ########################
|
|
$Smarty->assign('UI_BROWSER', UI_BROWSER);
|
|
$Smarty->assign('UI_HANDLER', UI_HANDLER);
|
|
|
|
// --- Smarty Extensions ---
|
|
/**
|
|
* str_repeat
|
|
*
|
|
* Repeate given string.
|
|
*
|
|
* @param str string, string to repeate
|
|
* @param count numeric, how often to repeate (converted to type integer)
|
|
* @return string, repeated string
|
|
*/
|
|
function S_str_repeat($param)
|
|
{
|
|
extract($param);
|
|
return str_repeat($str, intval($count));
|
|
|
|
}
|
|
$Smarty->register_function('str_repeat', 'S_str_repeat');
|
|
|
|
/**
|
|
* urlencode
|
|
*
|
|
* Encode given string to use in URL.
|
|
*
|
|
* @param str string, string to encode
|
|
* @return string, encoded string
|
|
*/
|
|
function S_urlencode($param)
|
|
{
|
|
extract($param);
|
|
return urlencode($str);
|
|
}
|
|
$Smarty->register_function('urlencode', 'S_urlencode');
|
|
|
|
/**
|
|
* htmlspecialchars
|
|
*
|
|
* convert special chars in given string to html-entitys.
|
|
*
|
|
* @param str string, string to convert
|
|
* @return string, converted string
|
|
*/
|
|
function S_htmlspecialchars($param)
|
|
{
|
|
extract($param);
|
|
return htmlspecialchars($str);
|
|
}
|
|
$Smarty->register_function('htmlspecialchars', 'S_htmlspecialchars');
|
|
|
|
/**
|
|
* system
|
|
*
|
|
* Execute some PHP-code.
|
|
*
|
|
* @param code string, code to execute
|
|
*/
|
|
function S_system($param)
|
|
{
|
|
extract($param);
|
|
eval($code);
|
|
}
|
|
$Smarty->register_function('system', 'S_system');
|
|
|
|
/**
|
|
* tra
|
|
*
|
|
* Translate given string.
|
|
*
|
|
* @param void array, array of strings to be outputted translated
|
|
*/
|
|
function S_tra($param)
|
|
{
|
|
global $uiBrowser;
|
|
|
|
echo $uiBrowser->tra($param[0], $param[1], $param[2], $param[3], $param[4], $param[5], $param[6], $param[7], $param[8], $param[9]);
|
|
}
|
|
$Smarty->register_function('tra', 'S_tra');
|
|
?>
|