Version 1.14a

This commit is contained in:
nemunaire 2020-11-15 16:12:32 +01:00
commit dc48225dc9
1094 changed files with 189052 additions and 13889 deletions

View file

@ -2,7 +2,7 @@
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
@ -14,14 +14,6 @@
* Name: html_checkboxes<br>
* Date: 24.Feb.2003<br>
* Purpose: Prints out a list of checkbox input types<br>
* Input:<br>
* - name (optional) - string default "checkbox"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each checkbox
* - assign (optional) - assign the output as an array to this variable
* Examples:
* <pre>
* {html_checkboxes values=$ids output=$names}
@ -33,14 +25,24 @@
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param array
* @param Smarty
* @param array $params parameters
* Input:<br>
* - name (optional) - string default "checkbox"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each checkbox
* - assign (optional) - assign the output as an array to this variable
* @param object $smarty Smarty object
* @param object $template template object
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_checkboxes($params, &$smarty)
function smarty_function_html_checkboxes($params, $smarty, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
//$smarty->loadPlugin('Smarty_shared_escape_special_chars');
$name = 'checkbox';
$values = null;
@ -78,7 +80,7 @@ function smarty_function_html_checkboxes($params, &$smarty)
break;
case 'checkboxes':
$smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
throw new Exception ('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
$options = (array)$_val;
break;
@ -89,7 +91,7 @@ function smarty_function_html_checkboxes($params, &$smarty)
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
throw new Exception ("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
@ -116,7 +118,7 @@ function smarty_function_html_checkboxes($params, &$smarty)
}
if(!empty($params['assign'])) {
$smarty->assign($params['assign'], $_html_result);
$template->assign($params['assign'], $_html_result);
} else {
return implode("\n",$_html_result);
}