1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

BC Fix for userclass checkboxes.

This commit is contained in:
Cameron
2014-01-06 01:03:58 -08:00
parent f2ff881639
commit 0976668360
2 changed files with 21 additions and 4 deletions

View File

@@ -973,12 +973,23 @@ class e_form
* @param string $name
* @param mixed $value
* @param boolean $checked
* @param array $options
* @param mixed $options query-string or array or string for a label. eg. label=Hello&foo=bar or array('label'=>Hello') or 'Hello'
* @return void
*/
function checkbox($name, $value, $checked = false, $options = array())
{
if(!is_array($options)) parse_str($options, $options);
if(!is_array($options))
{
if(strpos($options,"=")!==false)
{
parse_str($options, $options);
}
else // Assume it's a label.
{
$options = array('label'=>$options);
}
}
$options = $this->format_options('checkbox', $name, $options);
$options['checked'] = $checked; //comes as separate argument just for convenience