Zend Framework

Zend_View_Helper_FormReset doesn't allow for disabled

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.0RC1
  • Fix Version/s: 1.5.2
  • Component/s: Zend_View
  • Labels:
    None
  • Fix Version Priority:
    Should Have

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.

Activity

Hide
Matthew Weier O'Phinney added a comment -

Scheduling for next mini release.

Show
Matthew Weier O'Phinney added a comment - Scheduling for next mini release.
Hide
Matthew Weier O'Phinney added a comment -

Resolved in trunk and 1.5 release branch

Show
Matthew Weier O'Phinney added a comment - Resolved in trunk and 1.5 release branch

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified