diff --git a/NEWS b/NEWS
index 8cd29626..7a5b4599 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+ - add assign attribute to html_checkboxes and html_radios
+ (pcg, Monte)
+ - remove non-xhtml conformant tag from mailto function
+ (tacker, Monte)
+ - handle date_format codes %e, %T and %D for windows (tip,
+ Monte)
- fix unnecessary call to smarty_core_get_include_path() inside
Smarty::_get_auto_filename() (c960657, messju)
- add error-messages when anything else than an identifier is passed
diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php
index 6fd272a0..f4f5957d 100644
--- a/libs/plugins/function.html_checkboxes.php
+++ b/libs/plugins/function.html_checkboxes.php
@@ -20,7 +20,8 @@
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie
or
- * - output (optional) - without this one the buttons don't have names
+ * - output (optional) - the output next to each checkbox
+ * - assign (optional) - assign the output as an array to this variable
* Examples:
*
* {html_checkboxes values=$ids output=$names} @@ -95,23 +96,27 @@ function smarty_function_html_checkboxes($params, &$smarty) return ''; /* raise error here? */ settype($selected, 'array'); - $_html_result = ''; + $_html_result = array(); if (is_array($options)) { foreach ($options as $_key=>$_val) - $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); } else { foreach ($values as $_i=>$_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); } } - return $_html_result; + if(!empty($params['assign'])) { + $smarty->assign($params['assign'], $_html_result); + } else { + return implode("\n",$_html_result); + } } @@ -127,7 +132,7 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte } $_output .= $extra . ' />' . $output; if ($labels) $_output .= ''; - $_output .= $separator . "\n"; + $_output .= $separator; return $_output; } diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php index f74688f1..e6a94660 100644 --- a/libs/plugins/function.html_radios.php +++ b/libs/plugins/function.html_radios.php @@ -20,7 +20,8 @@ * - options (optional) - associative array * - checked (optional) - array default not set * - separator (optional) - ie
or - * - output (optional) - without this one the buttons don't have names + * - output (optional) - the output next to each radio button + * - assign (optional) - assign the output as an array to this variable * Examples: ** {html_radios values=$ids output=$names} @@ -98,23 +99,27 @@ function smarty_function_html_radios($params, &$smarty) if (!isset($options) && !isset($values)) return ''; /* raise error here? */ - $_html_result = ''; + $_html_result = array(); if (isset($options) && is_array($options)) { foreach ((array)$options as $_key=>$_val) - $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); } else { foreach ((array)$values as $_i=>$_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); } } - return $_html_result; + if(!empty($params['assign'])) { + $smarty->assign($params['assign'], $_html_result); + } else { + return implode("\n",$_html_result); + } } @@ -130,7 +135,7 @@ function smarty_function_html_radios_output($name, $value, $output, $selected, $ } $_output .= $extra . ' />' . $output; if ($labels) $_output .= ''; - $_output .= $separator . "\n"; + $_output .= $separator; return $_output; } diff --git a/libs/plugins/function.mailto.php b/libs/plugins/function.mailto.php index 6def8252..a4f4d2d5 100644 --- a/libs/plugins/function.mailto.php +++ b/libs/plugins/function.mailto.php @@ -105,7 +105,7 @@ function smarty_function_mailto($params, &$smarty) $js_encode .= '%' . bin2hex($string[$x]); } - return ''; + return ''; } elseif ($encode == 'hex') {