web/lib/Zend/View/Helper/FormReset.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_View
    16  * @package    Zend_View
    17  * @subpackage Helper
    17  * @subpackage Helper
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: FormReset.php 20096 2010-01-06 02:05:09Z bkarwin $
    20  * @version    $Id: FormReset.php 24750 2012-05-05 01:24:21Z adamlundrigan $
    21  */
    21  */
    22 
    22 
    23 
    23 
    24 /**
    24 /**
    25  * Abstract class for extension
    25  * Abstract class for extension
    31  * Helper to generate a "reset" button
    31  * Helper to generate a "reset" button
    32  *
    32  *
    33  * @category   Zend
    33  * @category   Zend
    34  * @package    Zend_View
    34  * @package    Zend_View
    35  * @subpackage Helper
    35  * @subpackage Helper
    36  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    38  */
    38  */
    39 class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement
    39 class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement
    40 {
    40 {
    41     /**
    41     /**
    62         $disabled = '';
    62         $disabled = '';
    63         if ($disable) {
    63         if ($disable) {
    64             $disabled = ' disabled="disabled"';
    64             $disabled = ' disabled="disabled"';
    65         }
    65         }
    66 
    66 
    67         // get closing tag
       
    68         $endTag = '>';
       
    69         if ($this->view->doctype()->isXhtml()) {
       
    70             $endTag = ' />';
       
    71         }
       
    72 
       
    73         // Render button
    67         // Render button
    74         $xhtml = '<input type="reset"'
    68         $xhtml = '<input type="reset"'
    75                . ' name="' . $this->view->escape($name) . '"'
    69                . ' name="' . $this->view->escape($name) . '"'
    76                . ' id="' . $this->view->escape($id) . '"'
    70                . ' id="' . $this->view->escape($id) . '"'
    77                . $disabled;
    71                . $disabled;
    80         if (! empty($value)) {
    74         if (! empty($value)) {
    81             $xhtml .= ' value="' . $this->view->escape($value) . '"';
    75             $xhtml .= ' value="' . $this->view->escape($value) . '"';
    82         }
    76         }
    83 
    77 
    84         // add attributes, close, and return
    78         // add attributes, close, and return
    85         $xhtml .= $this->_htmlAttribs($attribs) . $endTag;
    79         $xhtml .= $this->_htmlAttribs($attribs) . $this->getClosingBracket();
    86         return $xhtml;
    80         return $xhtml;
    87     }
    81     }
    88 }
    82 }