|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Dojo |
|
17 * @subpackage Form_Element |
|
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
20 */ |
|
21 |
|
22 /** Zend_Dojo_Form_Element_Dijit */ |
|
23 require_once 'Zend/Dojo/Form/Element/Dijit.php'; |
|
24 |
|
25 /** |
|
26 * TextBox dijit |
|
27 * |
|
28 * @category Zend |
|
29 * @package Zend_Dojo |
|
30 * @subpackage Form_Element |
|
31 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
32 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
33 * @version $Id: TextBox.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
34 */ |
|
35 class Zend_Dojo_Form_Element_TextBox extends Zend_Dojo_Form_Element_Dijit |
|
36 { |
|
37 /** |
|
38 * Use TextBox dijit view helper |
|
39 * @var string |
|
40 */ |
|
41 public $helper = 'TextBox'; |
|
42 |
|
43 /** |
|
44 * Set lowercase flag |
|
45 * |
|
46 * @param bool $lowercase |
|
47 * @return Zend_Dojo_Form_Element_TextBox |
|
48 */ |
|
49 public function setLowercase($flag) |
|
50 { |
|
51 $this->setDijitParam('lowercase', (bool) $flag); |
|
52 return $this; |
|
53 } |
|
54 |
|
55 /** |
|
56 * Retrieve lowercase flag |
|
57 * |
|
58 * @return bool |
|
59 */ |
|
60 public function getLowercase() |
|
61 { |
|
62 if (!$this->hasDijitParam('lowercase')) { |
|
63 return false; |
|
64 } |
|
65 return $this->getDijitParam('lowercase'); |
|
66 } |
|
67 |
|
68 /** |
|
69 * Set propercase flag |
|
70 * |
|
71 * @param bool $propercase |
|
72 * @return Zend_Dojo_Form_Element_TextBox |
|
73 */ |
|
74 public function setPropercase($flag) |
|
75 { |
|
76 $this->setDijitParam('propercase', (bool) $flag); |
|
77 return $this; |
|
78 } |
|
79 |
|
80 /** |
|
81 * Retrieve propercase flag |
|
82 * |
|
83 * @return bool |
|
84 */ |
|
85 public function getPropercase() |
|
86 { |
|
87 if (!$this->hasDijitParam('propercase')) { |
|
88 return false; |
|
89 } |
|
90 return $this->getDijitParam('propercase'); |
|
91 } |
|
92 |
|
93 /** |
|
94 * Set uppercase flag |
|
95 * |
|
96 * @param bool $uppercase |
|
97 * @return Zend_Dojo_Form_Element_TextBox |
|
98 */ |
|
99 public function setUppercase($flag) |
|
100 { |
|
101 $this->setDijitParam('uppercase', (bool) $flag); |
|
102 return $this; |
|
103 } |
|
104 |
|
105 /** |
|
106 * Retrieve uppercase flag |
|
107 * |
|
108 * @return bool |
|
109 */ |
|
110 public function getUppercase() |
|
111 { |
|
112 if (!$this->hasDijitParam('uppercase')) { |
|
113 return false; |
|
114 } |
|
115 return $this->getDijitParam('uppercase'); |
|
116 } |
|
117 |
|
118 /** |
|
119 * Set trim flag |
|
120 * |
|
121 * @param bool $trim |
|
122 * @return Zend_Dojo_Form_Element_TextBox |
|
123 */ |
|
124 public function setTrim($flag) |
|
125 { |
|
126 $this->setDijitParam('trim', (bool) $flag); |
|
127 return $this; |
|
128 } |
|
129 |
|
130 /** |
|
131 * Retrieve trim flag |
|
132 * |
|
133 * @return bool |
|
134 */ |
|
135 public function getTrim() |
|
136 { |
|
137 if (!$this->hasDijitParam('trim')) { |
|
138 return false; |
|
139 } |
|
140 return $this->getDijitParam('trim'); |
|
141 } |
|
142 |
|
143 /** |
|
144 * Set maxLength |
|
145 * |
|
146 * @param int $length |
|
147 * @return Zend_Dojo_Form_Element_TextBox |
|
148 */ |
|
149 public function setMaxLength($length) |
|
150 { |
|
151 $this->setDijitParam('maxLength', (int) $length); |
|
152 return $this; |
|
153 } |
|
154 |
|
155 /** |
|
156 * Retrieve maxLength |
|
157 * |
|
158 * @return int|null |
|
159 */ |
|
160 public function getMaxLength() |
|
161 { |
|
162 return $this->getDijitParam('maxLength'); |
|
163 } |
|
164 } |