web/lib/Zend/View/Helper/FormPassword.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: FormPassword.php 20096 2010-01-06 02:05:09Z bkarwin $
    20  * @version    $Id: FormPassword.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 "password" element
    31  * Helper to generate a "password" element
    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_FormPassword extends Zend_View_Helper_FormElement
    39 class Zend_View_Helper_FormPassword extends Zend_View_Helper_FormElement
    40 {
    40 {
    41     /**
    41     /**
    72                 $valueString = ' value="' . $this->view->escape($value) . '"';
    72                 $valueString = ' value="' . $this->view->escape($value) . '"';
    73             }
    73             }
    74             unset($attribs['renderPassword']);
    74             unset($attribs['renderPassword']);
    75         }
    75         }
    76 
    76 
    77         // XHTML or HTML end tag?
       
    78         $endTag = ' />';
       
    79         if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
       
    80             $endTag= '>';
       
    81         }
       
    82 
       
    83         // render the element
    77         // render the element
    84         $xhtml = '<input type="password"'
    78         $xhtml = '<input type="password"'
    85                 . ' name="' . $this->view->escape($name) . '"'
    79                 . ' name="' . $this->view->escape($name) . '"'
    86                 . ' id="' . $this->view->escape($id) . '"'
    80                 . ' id="' . $this->view->escape($id) . '"'
    87                 . $valueString
    81                 . $valueString
    88                 . $disabled
    82                 . $disabled
    89                 . $this->_htmlAttribs($attribs)
    83                 . $this->_htmlAttribs($attribs)
    90                 . $endTag;
    84                 . $this->getClosingBracket();
    91 
    85 
    92         return $xhtml;
    86         return $xhtml;
    93     }
    87     }
    94 
    88 
    95 }
    89 }