XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
Password.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
namespace
Xoops\Form
;
13
26
class
Password
extends
Element
27
{
33
//private $size;
34
40
//private $maxlength;
41
48
//public $autoComplete = false;
49
56
//private $placeholder;
57
69
public
function
__construct
(
70
$caption
,
71
$name
,
72
$size,
73
$maxlength,
74
$value
=
''
,
75
$autoComplete =
false
,
76
$placeholder =
''
77
) {
78
$this->
setCaption
(
$caption
);
79
$this->
setAttribute
(
'type'
,
'password'
);
80
$this->
setAttribute
(
'name'
,
$name
);
81
$this->
setAttribute
(
'size'
, intval($size));
82
$this->
setAttribute
(
'maxlength'
, intval($maxlength));
83
$this->
setValue
(
$value
);
84
$this->
setAttribute
(
'autocomplete'
, $autoComplete ?
'yes'
:
'no'
);
85
if
(!empty($placeholder)) {
86
$this->
setAttribute
(
'placeholder'
, $placeholder);
87
}
88
}
89
95
public
function
getSize
()
96
{
97
return
(
int
) $this->
getAttribute
(
'size'
);
98
}
99
105
public
function
getMaxlength
()
106
{
107
return
(
int
) $this->
getAttribute
(
'maxlength'
);
108
}
109
115
public
function
getPlaceholder
()
116
{
117
return
(
string
) $this->
setAttribute
(
'placeholder'
);
118
}
119
125
public
function
render
()
126
{
127
if
($this->
getSize
() > $this->
getMaxcols
()) {
128
$maxcols
= $this->
getMaxcols
();
129
}
else
{
130
$maxcols
= $this->
getSize
();
131
}
132
$this->
addAttribute
(
'class'
,
'span'
.
$maxcols
);
133
134
$attributes
= $this->
renderAttributeString
();
135
return
'<input '
.
$attributes
.
'value="'
136
. $this->
getValue
() .
'" '
. $this->
getExtra
() .
' >'
;
137
}
138
}
Xoops\Form\Element\setValue
setValue($value)
Definition:
Element.php:199
Xoops\Form\Element\getValue
getValue($encode=false)
Definition:
Element.php:180
Xoops\Form\Password\getSize
getSize()
Definition:
Password.php:95
Xoops\Form\Element\setCaption
setCaption($caption)
Definition:
Element.php:396
Xoops\Form
Definition:
BlockForm.php:12
Xoops\Form\Element\renderAttributeString
renderAttributeString()
Definition:
Element.php:156
Xoops\Html\Attributes\setAttribute
setAttribute($name, $value=null)
Definition:
Attributes.php:42
Xoops\Form\Password\getPlaceholder
getPlaceholder()
Definition:
Password.php:115
Xoops\Html\Attributes\getAttribute
getAttribute($name)
Definition:
Attributes.php:86
Xoops\Form\Element\getMaxcols
getMaxcols()
Definition:
Element.php:585
Xoops\Form\Element\getExtra
getExtra($encode=false)
Definition:
Element.php:539
Xoops\Form\Element
Definition:
Element.php:28
Xoops\Form\Element\$caption
$caption
Definition:
Element.php:55
Xoops\Html\Attributes\addAttribute
addAttribute($name, $value)
Definition:
Attributes.php:117
Xoops\Form\Password\getMaxlength
getMaxlength()
Definition:
Password.php:105
$name
$name
Definition:
force_download.php:15
Xoops\Form\Element\$value
$value
Definition:
Element.php:131
Xoops\Html\Attributes\$attributes
$attributes
Definition:
Attributes.php:32
Xoops\Form\Element\$maxcols
$maxcols
Definition:
Element.php:139
Xoops\Form\Password\render
render()
Definition:
Password.php:125
Xoops\Form\Password
Definition:
Password.php:26
Xoops\Form\Password\__construct
__construct($caption, $name, $size, $maxlength, $value= '', $autoComplete=false, $placeholder= '')
Definition:
Password.php:69
usr64
htdocs
xoops_lib
Xoops
Form
Password.php
Generated on Fri May 22 2015 03:07:05 for XOOPS by
1.8.9.1