_getInfo($name, $value, $attribs, $options); extract($info); // name, id, value, attribs, options, listsep, disable // make sure attribs don't overwrite name and value unset($attribs['name']); unset($attribs['value']); // set up checked/unchecked options if (empty($options)) { $options = array(1, 0); } else { settype($options, 'array'); if (! isset($options[1])) { $options[1] = null; } } // build the element if ($disable) { // disabled. if ($value == $options[0]) { // checked $xhtml = $this->_hidden($name, $options[0]) . '[x]'; } else { // not checked $xhtml = $this->_hidden($name, $options[1]) . '[ ]'; } } else { // enabled. add the hidden "unchecked" option first, then // the the checkbox itself) next. this way, if not-checked, // the "unchecked" option is returned to the server instead. $xhtml = $this->_hidden($name, $options[1]) . '_htmlAttribs($attribs) . ' />'; } return $xhtml; } }