XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formpassword.php
Go to the documentation of this file.
1 <?php
21 defined('XOOPS_ROOT_PATH') or die('Restricted access');
22 
27 {
34  var $_size;
35 
43 
50  var $_value;
51 
59  var $autoComplete = false;
60 
72  function XoopsFormPassword($caption, $name, $size, $maxlength, $value = '', $autoComplete = false)
73  {
74  $this->setCaption($caption);
75  $this->setName($name);
76  $this->_size = intval($size);
77  $this->_maxlength = intval($maxlength);
78  $this->setValue($value);
79  $this->autoComplete = ! empty($autoComplete);
80  }
81 
87  function getSize()
88  {
89  return $this->_size;
90  }
91 
97  function getMaxlength()
98  {
99  return $this->_maxlength;
100  }
101 
108  function getValue($encode = false)
109  {
110  return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
111  }
112 
118  function setValue($value)
119  {
120  $this->_value = $value;
121  }
122 
128  function render()
129  {
130  return '<input type="password" name="' . $this->getName() . '" id="' . $this->getName() . '" size="' . $this->getSize() . '" maxlength="' . $this->getMaxlength() . '" value="' . $this->getValue() . '"' . $this->getExtra() . ' ' . ($this->autoComplete ? '' : 'autocomplete="off" ') . '/>';
131  }
132 }
133 
134 ?>