2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
   5  * HTML class for a password type field
 
   9  * LICENSE: This source file is subject to version 3.01 of the PHP license
 
  10  * that is available through the world-wide-web at the following URI:
 
  11  * http://www.php.net/license/3_01.txt If you did not receive a copy of
 
  12  * the PHP License and are unable to obtain it through the web, please
 
  13  * send a note to license@php.net so we can mail you a copy immediately.
 
  16  * @package     HTML_QuickForm
 
  17  * @author      Adam Daniel <adaniel1@eesus.jnj.com>
 
  18  * @author      Bertrand Mansion <bmansion@mamasam.com>
 
  19  * @copyright   2001-2011 The PHP Group
 
  20  * @license     http://www.php.net/license/3_01.txt PHP License 3.01
 
  22  * @link        http://pear.php.net/package/HTML_QuickForm
 
  26  * Base class for <input /> form elements
 
  28 require_once 'HTML/QuickForm/input.php';
 
  31  * HTML class for a password type field
 
  34  * @package     HTML_QuickForm
 
  35  * @author      Adam Daniel <adaniel1@eesus.jnj.com>
 
  36  * @author      Bertrand Mansion <bmansion@mamasam.com>
 
  37  * @version     Release: 3.2.16
 
  40 class HTML_QuickForm_password extends HTML_QuickForm_input
 
  47      * @param     string    $elementName    (optional)Input field name attribute
 
  48      * @param     string    $elementLabel   (optional)Input field label
 
  49      * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
 
  50      *                                      or an associative array
 
  56     function HTML_QuickForm_password($elementName=null, $elementLabel=null, $attributes=null)
 
  58         HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
 
  59         $this->setType('password');
 
  66      * Sets size of password element
 
  68      * @param     string    $size  Size of password field
 
  73     function setSize($size)
 
  75         $this->updateAttributes(array('size'=>$size));
 
  82      * Sets maxlength of password element
 
  84      * @param     string    $maxlength  Maximum length of password field
 
  89     function setMaxlength($maxlength)
 
  91         $this->updateAttributes(array('maxlength'=>$maxlength));
 
  92     } //end func setMaxlength
 
  95     // {{{ getFrozenHtml()
 
  98      * Returns the value of field without HTML tags (in this case, value is changed to a mask)
 
 105     function getFrozenHtml()
 
 107         $value = $this->getValue();
 
 108         return ('' != $value? '**********': ' ') .
 
 109                $this->_getPersistantData();
 
 110     } //end func getFrozenHtml
 
 114 } //end class HTML_QuickForm_password