~sylar-developers/sylar/dev

« back to all changes in this revision

Viewing changes to sylar/classes/presentation/html/components/FormInputPassword.php

  • Committer: g.giusti at giano-solutions
  • Date: 2008-05-21 19:55:11 UTC
  • Revision ID: g.giusti@giano-solutions.com-20080521195511-t4ga5dfh6d55q5db
New Html Componenents Presentation layer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of Sylar.
 
4
 *
 
5
 * Sylar is free software: you can redistribute it and/or modify
 
6
 * it under the terms of the GNU Lesser General Public License as published by
 
7
 * the Free Software Foundation, either version 3 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * Sylar is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public License
 
16
 * along with Sylar.  If not, see <http://www.gnu.org/licenses/>.
 
17
 * 
 
18
 * @copyright Copyright Sylar Development Team
 
19
 * @license http://www.gnu.org/licenses/ GNU Public License V2.0
 
20
 * @see https://launchpad.net/sylar/
 
21
 * @see http://www.giano-solutions.com
 
22
 */
 
23
 
 
24
 
 
25
import('sylar.presentation.html.components.FormComponent');
 
26
 
 
27
 
 
28
 
 
29
/**
 
30
 * Implements the INPUT TYPE=PASSWORD html tag
 
31
 * 
 
32
 * @package Sylar
 
33
 * @version 1.0
 
34
 * @since 14/mag/08
 
35
 * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
 
36
 * @copyright Sylar Development Team
 
37
 */
 
38
 
 
39
class Sylar_FormInputPassword extends Sylar_FormComponent{
 
40
 
 
41
        
 
42
        function __construct($sId=null, $sName=null, $Value=null){
 
43
                
 
44
                $this->setAttribute("type", "password");        
 
45
                
 
46
                if(!is_null($sId)){
 
47
                        $this->setId($sId);
 
48
                }
 
49
                
 
50
                if(!is_null($sName)){
 
51
                        $this->setName($sName);
 
52
                }
 
53
                
 
54
                if(!is_null($Value)){
 
55
                        $this->setValue($Value);
 
56
                }
 
57
        }
 
58
        
 
59
        
 
60
        function __destruct(){
 
61
                // nothing to do at the moment
 
62
        }
 
63
 
 
64
 
 
65
        //                                                                                                 Getter and Setter Methods
 
66
        //__________________________________________________________________________
 
67
 
 
68
        
 
69
        public function setValue($sValue){
 
70
                $this->setAttribute("value", $sValue);
 
71
        }       
 
72
        public function getValue(){
 
73
                return $this->getAttribute("value");
 
74
        }       
 
75
                
 
76
        
 
77
        public function setSize($sSize){
 
78
                $this->setAttribute("size", $sSize);
 
79
        }
 
80
        public function getSize(){
 
81
                return $this->getAttribute("size");
 
82
        }
 
83
                
 
84
 
 
85
        public function setMaxLen($sMaxLen){
 
86
                $this->setAttribute("maxlength", $sMaxLen);
 
87
        }       
 
88
        public function getMaxLen(){
 
89
                $this->getAttribute("maxlength");
 
90
        }       
 
91
        
 
92
        
 
93
        
 
94
        
 
95
        /**
 
96
         * Set RedOnly on or off
 
97
         * @param boolean $fReadOnly
 
98
         */
 
99
        public function setReadOnly($fReadOnly){
 
100
                if($fReadOnly){
 
101
                        $this->setAttribute("readonly", "readonly");
 
102
                }else{
 
103
                        $this->removeAttribute("readonly");
 
104
                }
 
105
        }
 
106
 
 
107
        
 
108
        
 
109
        
 
110
        //                                                                                                                        Public Methods
 
111
        //__________________________________________________________________________
 
112
                
 
113
        
 
114
        
 
115
        /**
 
116
         * return the Html source
 
117
         * it return html code of entire object
 
118
         * 
 
119
         * implements the abstract method
 
120
         * 
 
121
         * @return string
 
122
         */
 
123
        public function getHtmlSource(){
 
124
                return $this->render();
 
125
        }
 
126
        
 
127
        
 
128
        /**
 
129
         * Display the page
 
130
         * it prints the object Html source on screen
 
131
         * 
 
132
         * implements the abstract method
 
133
         * 
 
134
         * @return void
 
135
         */
 
136
        public function show(){
 
137
                echo $this->render();
 
138
        }       
 
139
                
 
140
        
 
141
        
 
142
        
 
143
        //                                                                                                                 Protected Methods
 
144
        //__________________________________________________________________________
 
145
        
 
146
        
 
147
        /**
 
148
         * Design Html INPUT tag
 
149
         * Using parent method
 
150
         * 
 
151
         * @return string
 
152
         * @see Sylar_Html::provideTagWithAttributes()
 
153
         */
 
154
        protected function render(){    
 
155
                return parent::provideTagWithAttributes("input");
 
156
        }       
 
157
        
 
158
        
 
159
        
 
160
        
 
161
        
 
162
        
 
163
        //                                                                                                                       Private Methods
 
164
        //__________________________________________________________________________
 
165
 
 
166
        
 
167
        
 
168
}
 
169
 
 
170
 
 
171
 
 
172
 
 
173
 
 
174
?>
 
 
b'\\ No newline at end of file'