Update Smarty und RedBean
Smarty: 3.1.30 - Redbean: 5.0.0
This commit is contained in:
parent
eb0835ff74
commit
0795a87ecd
193 changed files with 22035 additions and 14455 deletions
|
@ -90,19 +90,21 @@ function smarty_function_html_checkboxes($params, $template)
|
|||
if (method_exists($_sel, "__toString")) {
|
||||
$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
|
||||
} else {
|
||||
trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE);
|
||||
trigger_error("html_checkboxes: selected attribute contains an object of class '" .
|
||||
get_class($_sel) . "' without __toString() method", E_USER_NOTICE);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$_sel = smarty_function_escape_special_chars((string) $_sel);
|
||||
}
|
||||
$selected[$_sel] = true;
|
||||
$selected[ $_sel ] = true;
|
||||
}
|
||||
} elseif (is_object($_val)) {
|
||||
if (method_exists($_val, "__toString")) {
|
||||
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
|
||||
} else {
|
||||
trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE);
|
||||
trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) .
|
||||
"' without __toString() method", E_USER_NOTICE);
|
||||
}
|
||||
} else {
|
||||
$selected = smarty_function_escape_special_chars((string) $_val);
|
||||
|
@ -110,7 +112,8 @@ function smarty_function_html_checkboxes($params, $template)
|
|||
break;
|
||||
|
||||
case 'checkboxes':
|
||||
trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
|
||||
trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead',
|
||||
E_USER_WARNING);
|
||||
$options = (array) $_val;
|
||||
break;
|
||||
|
||||
|
@ -122,9 +125,10 @@ function smarty_function_html_checkboxes($params, $template)
|
|||
|
||||
case 'disabled':
|
||||
case 'readonly':
|
||||
if (!empty($params['strict'])) {
|
||||
if (!empty($params[ 'strict' ])) {
|
||||
if (!is_scalar($_val)) {
|
||||
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
|
||||
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute",
|
||||
E_USER_NOTICE);
|
||||
}
|
||||
|
||||
if ($_val === true || $_val === $_key) {
|
||||
|
@ -153,23 +157,28 @@ function smarty_function_html_checkboxes($params, $template)
|
|||
|
||||
if (isset($options)) {
|
||||
foreach ($options as $_key => $_val) {
|
||||
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
|
||||
$_html_result[] =
|
||||
smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,
|
||||
$label_ids, $escape);
|
||||
}
|
||||
} 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, $label_ids, $escape);
|
||||
$_val = isset($output[ $_i ]) ? $output[ $_i ] : '';
|
||||
$_html_result[] =
|
||||
smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,
|
||||
$label_ids, $escape);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($params['assign'])) {
|
||||
$template->assign($params['assign'], $_html_result);
|
||||
if (!empty($params[ 'assign' ])) {
|
||||
$template->assign($params[ 'assign' ], $_html_result);
|
||||
} else {
|
||||
return implode("\n", $_html_result);
|
||||
}
|
||||
}
|
||||
|
||||
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true)
|
||||
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels,
|
||||
$label_ids, $escape = true)
|
||||
{
|
||||
$_output = '';
|
||||
|
||||
|
@ -177,7 +186,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
|
|||
if (method_exists($value, "__toString")) {
|
||||
$value = (string) $value->__toString();
|
||||
} else {
|
||||
trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE);
|
||||
trigger_error("html_options: value is an object of class '" . get_class($value) .
|
||||
"' without __toString() method", E_USER_NOTICE);
|
||||
|
||||
return '';
|
||||
}
|
||||
|
@ -189,7 +199,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
|
|||
if (method_exists($output, "__toString")) {
|
||||
$output = (string) $output->__toString();
|
||||
} else {
|
||||
trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE);
|
||||
trigger_error("html_options: output is an object of class '" . get_class($output) .
|
||||
"' without __toString() method", E_USER_NOTICE);
|
||||
|
||||
return '';
|
||||
}
|
||||
|
@ -199,7 +210,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
|
|||
|
||||
if ($labels) {
|
||||
if ($label_ids) {
|
||||
$_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value));
|
||||
$_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_',
|
||||
$name . '_' . $value));
|
||||
$_output .= '<label for="' . $_id . '">';
|
||||
} else {
|
||||
$_output .= '<label>';
|
||||
|
@ -219,7 +231,7 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
|
|||
}
|
||||
|
||||
if (is_array($selected)) {
|
||||
if (isset($selected[$value])) {
|
||||
if (isset($selected[ $value ])) {
|
||||
$_output .= ' checked="checked"';
|
||||
}
|
||||
} elseif ($value === $selected) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue