Details
Description
Zend_View_Helper_FormReset doesn't allow for being disabled. It is commented with
//always enabled
but I'm not sure why. Another odd comment in Zend_View_Helper_FormSubmit: says
// ignore disable/enable, always show the button.
but allows for disable. So that comment should be removed. The following would take care of Zend_View_Helper_FormReset:
public function formReset($name = '', $value = 'Reset', $attribs = null) { $info = $this->_getInfo($name, $value, $attribs); extract($info); // name, value, attribs, options, listsep, disable $xhtml = '<input type="reset"' . ' name="' . $this->view->escape($name) . '"' . ' id="' . $this->view->escape($id) . '"'; // add a value if one is given if (! empty($value)) { $xhtml .= ' value="' . $this->view->escape($value) . '"'; } // add if disable if ($disable) { $xhtml .= ' disabled="disabled"'; } // add attributes, close, and return $xhtml .= $this->_htmlAttribs($attribs) . ' />'; return $xhtml; }
I assume that would be sufficient in the current code.
All of the Zend_View_Helper_? in respect to disabling needs to be addressed. The overall scheme seems to want to disable based on seeing the attribs['disable'] key while disregarding any corresponding value. This is an issue if you disable all the elements in a form and then later wish to enable an individual element. Also, Zend_View_Helper_FormElement has some disable code in _getInfo that seems to complicate things unnecessarily.
Scheduling for next mini release.