1 | <?php |
||
34 | * @since 3.3 |
||
35 | */ |
||
36 | class TJuiDatePicker extends TActiveTextBox implements INamingContainer, IJuiOptions |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The static variable is used to determine if this is the first instance of TJuiDatePicker. If true, |
||
41 | * it will register an additional clientscript to set the language specific global default settings. |
||
42 | * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise |
||
43 | */ |
||
44 | private static $_first = true; |
||
45 | |||
46 | /** |
||
47 | * Creates a new callback control, sets the adapter to |
||
48 | * TActiveControlAdapter. If you override this class, be sure to set the |
||
49 | * adapter appropriately by, for example, by calling this constructor. |
||
50 | */ |
||
51 | public function __construct() |
||
56 | |||
57 | /** |
||
58 | * @return string the name of the jQueryUI widget method |
||
59 | */ |
||
60 | public function getWidget() |
||
64 | |||
65 | /** |
||
66 | * @return string the clientid of the jQueryUI widget element |
||
67 | */ |
||
68 | public function getWidgetID() |
||
72 | |||
73 | /** |
||
74 | * Object containing defined javascript options |
||
75 | * @return TJuiControlOptions |
||
76 | */ |
||
77 | public function getOptions() |
||
86 | |||
87 | /** |
||
88 | * Array containing valid javascript options |
||
89 | * @return array() |
||
|
|||
90 | */ |
||
91 | public function getValidOptions() |
||
101 | |||
102 | /** |
||
103 | * Array containing valid javascript events |
||
104 | * @return array() |
||
105 | */ |
||
106 | public function getValidEvents() |
||
110 | |||
111 | /** |
||
112 | * Ensure that the ID attribute is rendered and registers the javascript code |
||
113 | * for initializing the active control. Also registers language specific global |
||
114 | * settings for the first used date picker. |
||
115 | */ |
||
116 | protected function addAttributesToRender($writer) |
||
130 | |||
131 | /** |
||
132 | * @return TTextBoxMode the behavior mode of the underlying {@link TTextBox} component. |
||
133 | * Fixed to TTextBoxMode::SingleLine for the TJuiDatePicker. |
||
134 | */ |
||
135 | public function getTextMode() |
||
139 | |||
140 | /** |
||
141 | * Setting the behavior mode of the underlying TTextBox component is NOT supported. |
||
142 | * @param TTextBoxMode the text mode |
||
143 | * @throws TNotSupportedException not supported, fixed to TTextBoxMode::SingleLine. |
||
144 | */ |
||
145 | public function setTextMode($value) |
||
149 | |||
150 | /** |
||
151 | * Gets the current culture. |
||
152 | * @return string current culture, e.g. en_AU. |
||
153 | */ |
||
154 | public function getCulture() |
||
158 | |||
159 | /** |
||
160 | * Sets the culture/language for the date picker. |
||
161 | * @param string a culture string, e.g. en_AU. |
||
162 | */ |
||
163 | public function setCulture($value) |
||
167 | |||
168 | /** |
||
169 | * @return string the current culture, falls back to application if culture is not set. |
||
170 | */ |
||
171 | protected function getCurrentCulture() |
||
177 | |||
178 | /** |
||
179 | * @return string the format of the date string |
||
180 | */ |
||
181 | public function getDateFormat() |
||
185 | |||
186 | /** |
||
187 | * Sets the format of the date string. |
||
188 | * @param string the format of the date string |
||
189 | */ |
||
190 | public function setDateFormat($value) |
||
194 | |||
195 | /** |
||
196 | * Returns the timestamp selected by the user. |
||
197 | * This method is required by {@link IDataRenderer}. |
||
198 | * It is the same as {@link getTimeStamp()}. |
||
199 | * @return integer the timestamp of the TDatePicker control. |
||
200 | * @see getTimeStamp |
||
201 | * @since 3.1.2 |
||
202 | */ |
||
203 | public function getData() |
||
207 | |||
208 | /** |
||
209 | * Sets the timestamp represented by this control. |
||
210 | * This method is required by {@link IDataRenderer}. |
||
211 | * It is the same as {@link setTimeStamp()}. |
||
212 | * @param integer the timestamp of the TDatePicker control. |
||
213 | * @see setTimeStamp |
||
214 | * @since 3.1.2 |
||
215 | */ |
||
216 | public function setData($value) |
||
220 | |||
221 | /** |
||
222 | * @return string the date string. |
||
223 | */ |
||
224 | public function getDate() |
||
228 | |||
229 | /** |
||
230 | * @param string date string |
||
231 | */ |
||
232 | public function setDate($value) |
||
236 | |||
237 | /** |
||
238 | * @return integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously. |
||
239 | */ |
||
240 | public function getTimeStamp() |
||
247 | |||
248 | /** |
||
249 | * Sets the date for the date picker using timestamp. |
||
250 | * @param float time stamp for the date picker |
||
251 | */ |
||
252 | public function setTimeStamp($value) |
||
263 | |||
264 | /** |
||
265 | * Gets the date from the text input using TSimpleDateFormatter |
||
266 | * @return integer current selected date timestamp |
||
267 | */ |
||
268 | protected function getTimeStampFromText() |
||
275 | |||
276 | /** |
||
277 | * Returns the value to be validated. |
||
278 | * This methid is required by IValidatable interface. |
||
279 | * @return integer the interger timestamp if valid, otherwise the original text. |
||
280 | */ |
||
281 | public function getValidationPropertyValue() |
||
288 | |||
289 | } |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.