adding some strings
[moodle-linuxchix.git] / lib / pear / HTML / QuickForm / password.php
bloba83d5053e38dc59bc809ce929585d246e62604bc
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
4 // | PHP version 4.0 |
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
17 // | Bertrand Mansion <bmansion@mamasam.com> |
18 // +----------------------------------------------------------------------+
20 // $Id$
22 require_once("HTML/QuickForm/input.php");
24 /**
25 * HTML class for a password type field
27 * @author Adam Daniel <adaniel1@eesus.jnj.com>
28 * @author Bertrand Mansion <bmansion@mamasam.com>
29 * @version 1.1
30 * @since PHP4.04pl1
31 * @access public
33 class HTML_QuickForm_password extends HTML_QuickForm_input
35 // {{{ constructor
37 /**
38 * Class constructor
40 * @param string $elementName (optional)Input field name attribute
41 * @param string $elementLabel (optional)Input field label
42 * @param mixed $attributes (optional)Either a typical HTML attribute string
43 * or an associative array
44 * @since 1.0
45 * @access public
46 * @return void
47 * @throws
49 function HTML_QuickForm_password($elementName=null, $elementLabel=null, $attributes=null)
51 HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
52 $this->setType('password');
53 } //end constructor
55 // }}}
56 // {{{ setSize()
58 /**
59 * Sets size of password element
61 * @param string $size Size of password field
62 * @since 1.0
63 * @access public
64 * @return void
66 function setSize($size)
68 $this->updateAttributes(array('size'=>$size));
69 } //end func setSize
71 // }}}
72 // {{{ setMaxlength()
74 /**
75 * Sets maxlength of password element
77 * @param string $maxlength Maximum length of password field
78 * @since 1.0
79 * @access public
80 * @return void
82 function setMaxlength($maxlength)
84 $this->updateAttributes(array('maxlength'=>$maxlength));
85 } //end func setMaxlength
87 // }}}
88 // {{{ getFrozenHtml()
90 /**
91 * Returns the value of field without HTML tags (in this case, value is changed to a mask)
93 * @since 1.0
94 * @access public
95 * @return string
96 * @throws
98 function getFrozenHtml()
100 $value = $this->getValue();
101 return ('' != $value? '**********': '&nbsp;') .
102 $this->_getPersistantData();
103 } //end func getFrozenHtml
105 // }}}
107 } //end class HTML_QuickForm_password