@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getWidgetID() |
74 | 74 | { |
75 | - return $this->getClientID() . '_0'; |
|
75 | + return $this->getClientID().'_0'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getOptions() |
83 | 83 | { |
84 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
84 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
85 | 85 | { |
86 | 86 | $options=new TJuiControlOptions($this); |
87 | 87 | $this->setViewState('JuiOptions', $options); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function getPostBackOptions() |
114 | 114 | { |
115 | - $options = $this->getOptions()->toArray(); |
|
115 | + $options=$this->getOptions()->toArray(); |
|
116 | 116 | // overload the "OnStop" event to add information about the current selected items |
117 | 117 | if(isset($options['stop'])) |
118 | 118 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | protected function addAttributesToRender($writer) |
129 | 129 | { |
130 | 130 | parent::addAttributesToRender($writer); |
131 | - $writer->addAttribute('id',$this->getClientID()); |
|
131 | + $writer->addAttribute('id', $this->getClientID()); |
|
132 | 132 | $options=TJavaScript::encode($this->getPostBackOptions()); |
133 | 133 | $cs=$this->getPage()->getClientScript(); |
134 | 134 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * Raises the OnCreate event |
150 | 150 | * @param object $params event parameters |
151 | 151 | */ |
152 | - public function onCreate ($params) |
|
152 | + public function onCreate($params) |
|
153 | 153 | { |
154 | 154 | $this->raiseEvent('OnCreate', $this, $params); |
155 | 155 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Raises the OnSelected event |
159 | 159 | * @param object $params event parameters |
160 | 160 | */ |
161 | - public function onSelected ($params) |
|
161 | + public function onSelected($params) |
|
162 | 162 | { |
163 | 163 | $this->raiseEvent('OnSelected', $this, $params); |
164 | 164 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * Raises the OnSelecting event |
168 | 168 | * @param object $params event parameters |
169 | 169 | */ |
170 | - public function onSelecting ($params) |
|
170 | + public function onSelecting($params) |
|
171 | 171 | { |
172 | 172 | $this->raiseEvent('OnSelecting', $this, $params); |
173 | 173 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * Raises the OnStart event |
177 | 177 | * @param object $params event parameters |
178 | 178 | */ |
179 | - public function onStart ($params) |
|
179 | + public function onStart($params) |
|
180 | 180 | { |
181 | 181 | $this->raiseEvent('OnStart', $this, $params); |
182 | 182 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Raises the OnStop event |
186 | 186 | * @param object $params event parameters |
187 | 187 | */ |
188 | - public function onStop ($params) |
|
188 | + public function onStop($params) |
|
189 | 189 | { |
190 | 190 | $this->raiseEvent('OnStop', $this, $params); |
191 | 191 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * Raises the OnUnselected event |
195 | 195 | * @param object $params event parameters |
196 | 196 | */ |
197 | - public function onUnselected ($params) |
|
197 | + public function onUnselected($params) |
|
198 | 198 | { |
199 | 199 | $this->raiseEvent('OnUnselected', $this, $params); |
200 | 200 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * Raises the OnUnselecting event |
204 | 204 | * @param object $params event parameters |
205 | 205 | */ |
206 | - public function onUnselecting ($params) |
|
206 | + public function onUnselecting($params) |
|
207 | 207 | { |
208 | 208 | $this->raiseEvent('OnUnselecting', $this, $params); |
209 | 209 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | public function getSelectables() |
239 | 239 | { |
240 | 240 | if($this->_repeater===null) |
241 | - $this->_repeater = $this->createRepeater(); |
|
241 | + $this->_repeater=$this->createRepeater(); |
|
242 | 242 | return $this->_repeater; |
243 | 243 | } |
244 | 244 | |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | */ |
248 | 248 | protected function createRepeater() |
249 | 249 | { |
250 | - $repeater = new TRepeater; |
|
250 | + $repeater=new TRepeater; |
|
251 | 251 | $repeater->setHeaderTemplate(new TJuiSelectableTemplate('<ul id="'.$this->getWidgetID().'">')); |
252 | 252 | $repeater->setFooterTemplate(new TJuiSelectableTemplate('</ul>')); |
253 | - $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>',null)); |
|
253 | + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>', null)); |
|
254 | 254 | $repeater->setEmptyTemplate(new TJuiSelectableTemplate('<ul></ul>')); |
255 | 255 | $this->getControls()->add($repeater); |
256 | 256 | return $repeater; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getOptions() |
133 | 133 | { |
134 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
134 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
135 | 135 | { |
136 | 136 | $options=new TJuiControlOptions($this); |
137 | 137 | $this->setViewState('JuiOptions', $options); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function getMinChars() |
214 | 214 | { |
215 | - return $this->getViewState('minChars',''); |
|
215 | + return $this->getViewState('minChars', ''); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function raiseCallbackEvent($param) |
238 | 238 | { |
239 | - $token = $param->getCallbackParameter(); |
|
240 | - if(is_array($token) && count($token) == 2) |
|
239 | + $token=$param->getCallbackParameter(); |
|
240 | + if(is_array($token) && count($token)==2) |
|
241 | 241 | { |
242 | - if($token[1] === '__TJuiAutoComplete_onSuggest__') |
|
242 | + if($token[1]==='__TJuiAutoComplete_onSuggest__') |
|
243 | 243 | { |
244 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
244 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
245 | 245 | $this->onSuggest($parameter); |
246 | 246 | } |
247 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
247 | + else if($token[1]==='__TJuiAutoComplete_onSuggestionSelected__') |
|
248 | 248 | { |
249 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
249 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
250 | 250 | $this->onSuggestionSelected($parameter); |
251 | 251 | } |
252 | 252 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | public function getResultPanel() |
304 | 304 | { |
305 | 305 | if($this->_resultPanel===null) |
306 | - $this->_resultPanel = $this->createResultPanel(); |
|
306 | + $this->_resultPanel=$this->createResultPanel(); |
|
307 | 307 | return $this->_resultPanel; |
308 | 308 | } |
309 | 309 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | protected function createResultPanel() |
314 | 314 | { |
315 | - $panel = new TPanel; |
|
315 | + $panel=new TPanel; |
|
316 | 316 | $this->getControls()->add($panel); |
317 | 317 | $panel->setID('result'); |
318 | 318 | return $panel; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function getSuggestions() |
325 | 325 | { |
326 | 326 | if($this->_repeater===null) |
327 | - $this->_repeater = $this->createRepeater(); |
|
327 | + $this->_repeater=$this->createRepeater(); |
|
328 | 328 | return $this->_repeater; |
329 | 329 | } |
330 | 330 | |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | */ |
334 | 334 | protected function createRepeater() |
335 | 335 | { |
336 | - $repeater = new TRepeater; |
|
337 | - $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null)); |
|
336 | + $repeater=new TRepeater; |
|
337 | + $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>', null)); |
|
338 | 338 | $this->getControls()->add($repeater); |
339 | 339 | return $repeater; |
340 | 340 | } |
@@ -376,12 +376,12 @@ discard block |
||
376 | 376 | { |
377 | 377 | $data=array(); |
378 | 378 | $items=$this->getSuggestions()->getItems(); |
379 | - $writer = new TTextWriter; |
|
380 | - for($i=0; $i<$items->Count; $i++) |
|
379 | + $writer=new TTextWriter; |
|
380 | + for($i=0; $i < $items->Count; $i++) |
|
381 | 381 | { |
382 | 382 | $items->itemAt($i)->render($writer); |
383 | 383 | $item=$writer->flush(); |
384 | - $data[]=array( 'id' => $i, 'label' => $item); |
|
384 | + $data[]=array('id' => $i, 'label' => $item); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -393,25 +393,25 @@ discard block |
||
393 | 393 | */ |
394 | 394 | protected function getPostBackOptions() |
395 | 395 | { |
396 | - $options = $this->getOptions()->toArray(); |
|
396 | + $options=$this->getOptions()->toArray(); |
|
397 | 397 | |
398 | - if(strlen($separator = $this->getSeparator())) |
|
399 | - $options['Separators'] = $separator; |
|
398 | + if(strlen($separator=$this->getSeparator())) |
|
399 | + $options['Separators']=$separator; |
|
400 | 400 | |
401 | 401 | if($this->getAutoPostBack()) |
402 | 402 | { |
403 | - $options = array_merge($options,parent::getPostBackOptions()); |
|
404 | - $options['AutoPostBack'] = true; |
|
403 | + $options=array_merge($options, parent::getPostBackOptions()); |
|
404 | + $options['AutoPostBack']=true; |
|
405 | 405 | } |
406 | - if(strlen($textCssClass = $this->getTextCssClass())) |
|
407 | - $options['textCssClass'] = $textCssClass; |
|
408 | - $options['minLength'] = $this->getMinChars(); |
|
409 | - $options['delay'] = $this->getFrequency()*1000.0; |
|
410 | - $options['appendTo'] = '#'.$this->getResultPanel()->getClientID(); |
|
411 | - $options['ID'] = $this->getClientID(); |
|
412 | - $options['EventTarget'] = $this->getUniqueID(); |
|
413 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
414 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
406 | + if(strlen($textCssClass=$this->getTextCssClass())) |
|
407 | + $options['textCssClass']=$textCssClass; |
|
408 | + $options['minLength']=$this->getMinChars(); |
|
409 | + $options['delay']=$this->getFrequency() * 1000.0; |
|
410 | + $options['appendTo']='#'.$this->getResultPanel()->getClientID(); |
|
411 | + $options['ID']=$this->getClientID(); |
|
412 | + $options['EventTarget']=$this->getUniqueID(); |
|
413 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
414 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
415 | 415 | return $options; |
416 | 416 | } |
417 | 417 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function getWidgetID() |
71 | 71 | { |
72 | - return $this->getClientID() . '_0'; |
|
72 | + return $this->getClientID().'_0'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getOptions() |
80 | 80 | { |
81 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
81 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
82 | 82 | { |
83 | 83 | $options=new TJuiControlOptions($this); |
84 | 84 | $this->setViewState('JuiOptions', $options); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected function getPostBackOptions() |
111 | 111 | { |
112 | - $options = $this->getOptions()->toArray(); |
|
112 | + $options=$this->getOptions()->toArray(); |
|
113 | 113 | // overload some events to add information about the items order |
114 | 114 | foreach($options as $event => $implementation) |
115 | 115 | { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | protected function addAttributesToRender($writer) |
127 | 127 | { |
128 | 128 | parent::addAttributesToRender($writer); |
129 | - $writer->addAttribute('id',$this->getClientID()); |
|
129 | + $writer->addAttribute('id', $this->getClientID()); |
|
130 | 130 | $options=TJavaScript::encode($this->getPostBackOptions()); |
131 | 131 | $cs=$this->getPage()->getClientScript(); |
132 | 132 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * Raises the OnActivate event |
148 | 148 | * @param object $params event parameters |
149 | 149 | */ |
150 | - public function onActivate ($params) |
|
150 | + public function onActivate($params) |
|
151 | 151 | { |
152 | 152 | $this->raiseEvent('OnActivate', $this, $params); |
153 | 153 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * Raises the OnBeforeStop event |
157 | 157 | * @param object $params event parameters |
158 | 158 | */ |
159 | - public function onBeforeStop ($params) |
|
159 | + public function onBeforeStop($params) |
|
160 | 160 | { |
161 | 161 | $this->raiseEvent('OnBeforeStop', $this, $params); |
162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * Raises the OnChange event |
166 | 166 | * @param object $params event parameters |
167 | 167 | */ |
168 | - public function onChange ($params) |
|
168 | + public function onChange($params) |
|
169 | 169 | { |
170 | 170 | $this->raiseEvent('OnChange', $this, $params); |
171 | 171 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * Raises the OnCreate event |
175 | 175 | * @param object $params event parameters |
176 | 176 | */ |
177 | - public function onCreate ($params) |
|
177 | + public function onCreate($params) |
|
178 | 178 | { |
179 | 179 | $this->raiseEvent('OnCreate', $this, $params); |
180 | 180 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * Raises the OnDeactivate event |
184 | 184 | * @param object $params event parameters |
185 | 185 | */ |
186 | - public function onDeactivate ($params) |
|
186 | + public function onDeactivate($params) |
|
187 | 187 | { |
188 | 188 | $this->raiseEvent('OnDeactivate', $this, $params); |
189 | 189 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * Raises the OnOut event |
193 | 193 | * @param object $params event parameters |
194 | 194 | */ |
195 | - public function onOut ($params) |
|
195 | + public function onOut($params) |
|
196 | 196 | { |
197 | 197 | $this->raiseEvent('OnOut', $this, $params); |
198 | 198 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * Raises the OnOver event |
202 | 202 | * @param object $params event parameters |
203 | 203 | */ |
204 | - public function onOver ($params) |
|
204 | + public function onOver($params) |
|
205 | 205 | { |
206 | 206 | $this->raiseEvent('OnOver', $this, $params); |
207 | 207 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * Raises the OnReceive event |
211 | 211 | * @param object $params event parameters |
212 | 212 | */ |
213 | - public function onReceive ($params) |
|
213 | + public function onReceive($params) |
|
214 | 214 | { |
215 | 215 | $this->raiseEvent('OnReceive', $this, $params); |
216 | 216 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * Raises the OnRemove event |
220 | 220 | * @param object $params event parameters |
221 | 221 | */ |
222 | - public function onRemove ($params) |
|
222 | + public function onRemove($params) |
|
223 | 223 | { |
224 | 224 | $this->raiseEvent('OnRemove', $this, $params); |
225 | 225 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * Raises the OnSort event |
229 | 229 | * @param object $params event parameters |
230 | 230 | */ |
231 | - public function onSort ($params) |
|
231 | + public function onSort($params) |
|
232 | 232 | { |
233 | 233 | $this->raiseEvent('OnSort', $this, $params); |
234 | 234 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * Raises the OnStart event |
238 | 238 | * @param object $params event parameters |
239 | 239 | */ |
240 | - public function onStart ($params) |
|
240 | + public function onStart($params) |
|
241 | 241 | { |
242 | 242 | $this->raiseEvent('OnStart', $this, $params); |
243 | 243 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * Raises the OnStop event |
247 | 247 | * @param object $params event parameters |
248 | 248 | */ |
249 | - public function OnStop ($params) |
|
249 | + public function OnStop($params) |
|
250 | 250 | { |
251 | 251 | $this->raiseEvent('OnStop', $this, $params); |
252 | 252 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * Raises the OnUpdate event |
256 | 256 | * @param object $params event parameters |
257 | 257 | */ |
258 | - public function onUpdate ($params) |
|
258 | + public function onUpdate($params) |
|
259 | 259 | { |
260 | 260 | $this->raiseEvent('OnUpdate', $this, $params); |
261 | 261 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public function getSortables() |
291 | 291 | { |
292 | 292 | if($this->_repeater===null) |
293 | - $this->_repeater = $this->createRepeater(); |
|
293 | + $this->_repeater=$this->createRepeater(); |
|
294 | 294 | return $this->_repeater; |
295 | 295 | } |
296 | 296 | |
@@ -299,10 +299,10 @@ discard block |
||
299 | 299 | */ |
300 | 300 | protected function createRepeater() |
301 | 301 | { |
302 | - $repeater = new TRepeater; |
|
302 | + $repeater=new TRepeater; |
|
303 | 303 | $repeater->setHeaderTemplate(new TJuiSortableTemplate('<ul id="'.$this->getWidgetID().'">')); |
304 | 304 | $repeater->setFooterTemplate(new TJuiSortableTemplate('</ul>')); |
305 | - $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>',null)); |
|
305 | + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>', null)); |
|
306 | 306 | $repeater->setEmptyTemplate(new TJuiSortableTemplate('<ul></ul>')); |
307 | 307 | $this->getControls()->add($repeater); |
308 | 308 | return $repeater; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * it will register an additional clientscript to set the language specific global default settings. |
44 | 44 | * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise |
45 | 45 | */ |
46 | - private static $_first = true; |
|
46 | + private static $_first=true; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Creates a new callback control, sets the adapter to |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getOptions() |
80 | 80 | { |
81 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
81 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
82 | 82 | { |
83 | 83 | $options=new TJuiControlOptions($this); |
84 | 84 | $this->setViewState('JuiOptions', $options); |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function getCurrentCulture() |
174 | 174 | { |
175 | - $app = $this->getApplication()->getGlobalization(false); |
|
176 | - return $this->getCulture() == '' ? |
|
175 | + $app=$this->getApplication()->getGlobalization(false); |
|
176 | + return $this->getCulture()=='' ? |
|
177 | 177 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
178 | 178 | } |
179 | 179 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getDateFormat() |
184 | 184 | { |
185 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
185 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function setDateFormat($value) |
193 | 193 | { |
194 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
194 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | $this->setText(''); |
258 | 258 | else |
259 | 259 | { |
260 | - $date = TPropertyValue::ensureFloat($value); |
|
261 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
260 | + $date=TPropertyValue::ensureFloat($value); |
|
261 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
262 | 262 | $this->setText($formatter->format($date)); |
263 | 263 | } |
264 | 264 | } |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | */ |
270 | 270 | protected function getTimeStampFromText() |
271 | 271 | { |
272 | - $pattern = $this->getDateFormat(); |
|
273 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
274 | - $formatter = new TSimpleDateFormatter($pattern); |
|
272 | + $pattern=$this->getDateFormat(); |
|
273 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
274 | + $formatter=new TSimpleDateFormatter($pattern); |
|
275 | 275 | return $formatter->parse($this->getText()); |
276 | 276 | } |
277 | 277 | |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | */ |
283 | 283 | public function getValidationPropertyValue() |
284 | 284 | { |
285 | - if(($text = $this->getText()) === '') |
|
285 | + if(($text=$this->getText())==='') |
|
286 | 286 | return ''; |
287 | - $date = $this->getTimeStamp(); |
|
288 | - return $date == null ? $text : $date; |
|
287 | + $date=$this->getTimeStamp(); |
|
288 | + return $date==null ? $text : $date; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | } |
292 | 292 | \ No newline at end of file |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function setID($value) |
90 | 90 | { |
91 | - if(!preg_match(TControl::ID_FORMAT,$value)) |
|
92 | - throw new TInvalidDataValueException('datagridcolumn_id_invalid',get_class($this),$value); |
|
91 | + if(!preg_match(TControl::ID_FORMAT, $value)) |
|
92 | + throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value); |
|
93 | 93 | $this->_id=$value; |
94 | 94 | } |
95 | 95 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function getHeaderText() |
100 | 100 | { |
101 | - return $this->getViewState('HeaderText',''); |
|
101 | + return $this->getViewState('HeaderText', ''); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function setHeaderText($value) |
108 | 108 | { |
109 | - $this->setViewState('HeaderText',$value,''); |
|
109 | + $this->setViewState('HeaderText', $value, ''); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function getHeaderImageUrl() |
116 | 116 | { |
117 | - return $this->getViewState('HeaderImageUrl',''); |
|
117 | + return $this->getViewState('HeaderImageUrl', ''); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function setHeaderImageUrl($value) |
124 | 124 | { |
125 | - $this->setViewState('HeaderImageUrl',$value,''); |
|
125 | + $this->setViewState('HeaderImageUrl', $value, ''); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getHeaderRenderer() |
133 | 133 | { |
134 | - return $this->getViewState('HeaderRenderer',''); |
|
134 | + return $this->getViewState('HeaderRenderer', ''); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setHeaderRenderer($value) |
148 | 148 | { |
149 | - $this->setViewState('HeaderRenderer',$value,''); |
|
149 | + $this->setViewState('HeaderRenderer', $value, ''); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getHeaderStyle($createStyle=true) |
157 | 157 | { |
158 | - if(($style=$this->getViewState('HeaderStyle',null))===null && $createStyle) |
|
158 | + if(($style=$this->getViewState('HeaderStyle', null))===null && $createStyle) |
|
159 | 159 | { |
160 | 160 | $style=new TTableItemStyle; |
161 | - $this->setViewState('HeaderStyle',$style,null); |
|
161 | + $this->setViewState('HeaderStyle', $style, null); |
|
162 | 162 | } |
163 | 163 | return $style; |
164 | 164 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getFooterText() |
170 | 170 | { |
171 | - return $this->getViewState('FooterText',''); |
|
171 | + return $this->getViewState('FooterText', ''); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setFooterText($value) |
178 | 178 | { |
179 | - $this->setViewState('FooterText',$value,''); |
|
179 | + $this->setViewState('FooterText', $value, ''); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function getFooterRenderer() |
187 | 187 | { |
188 | - return $this->getViewState('FooterRenderer',''); |
|
188 | + return $this->getViewState('FooterRenderer', ''); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function setFooterRenderer($value) |
202 | 202 | { |
203 | - $this->setViewState('FooterRenderer',$value,''); |
|
203 | + $this->setViewState('FooterRenderer', $value, ''); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function getFooterStyle($createStyle=true) |
211 | 211 | { |
212 | - if(($style=$this->getViewState('FooterStyle',null))===null && $createStyle) |
|
212 | + if(($style=$this->getViewState('FooterStyle', null))===null && $createStyle) |
|
213 | 213 | { |
214 | 214 | $style=new TTableItemStyle; |
215 | - $this->setViewState('FooterStyle',$style,null); |
|
215 | + $this->setViewState('FooterStyle', $style, null); |
|
216 | 216 | } |
217 | 217 | return $style; |
218 | 218 | } |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function getItemStyle($createStyle=true) |
225 | 225 | { |
226 | - if(($style=$this->getViewState('ItemStyle',null))===null && $createStyle) |
|
226 | + if(($style=$this->getViewState('ItemStyle', null))===null && $createStyle) |
|
227 | 227 | { |
228 | 228 | $style=new TTableItemStyle; |
229 | - $this->setViewState('ItemStyle',$style,null); |
|
229 | + $this->setViewState('ItemStyle', $style, null); |
|
230 | 230 | } |
231 | 231 | return $style; |
232 | 232 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function getSortExpression() |
238 | 238 | { |
239 | - return $this->getViewState('SortExpression',''); |
|
239 | + return $this->getViewState('SortExpression', ''); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function setSortExpression($value) |
246 | 246 | { |
247 | - $this->setViewState('SortExpression',$value,''); |
|
247 | + $this->setViewState('SortExpression', $value, ''); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function getEnableCellGrouping() |
255 | 255 | { |
256 | - return $this->getViewState('EnableCellGrouping',false); |
|
256 | + return $this->getViewState('EnableCellGrouping', false); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function setEnableCellGrouping($value) |
264 | 264 | { |
265 | - $this->setViewState('EnableCellGrouping',TPropertyValue::ensureBoolean($value),false); |
|
265 | + $this->setViewState('EnableCellGrouping', TPropertyValue::ensureBoolean($value), false); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function getVisible($checkParents=true) |
272 | 272 | { |
273 | - return $this->getViewState('Visible',true); |
|
273 | + return $this->getViewState('Visible', true); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function setVisible($value) |
280 | 280 | { |
281 | - $this->setViewState('Visible',TPropertyValue::ensureBoolean($value),true); |
|
281 | + $this->setViewState('Visible', TPropertyValue::ensureBoolean($value), true); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
289 | 289 | * @return mixed the viewstate value corresponding to $key |
290 | 290 | */ |
291 | - protected function getViewState($key,$defaultValue=null) |
|
291 | + protected function getViewState($key, $defaultValue=null) |
|
292 | 292 | { |
293 | - return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue; |
|
293 | + return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * @param mixed the viewstate value to be set |
302 | 302 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
303 | 303 | */ |
304 | - protected function setViewState($key,$value,$defaultValue=null) |
|
304 | + protected function setViewState($key, $value, $defaultValue=null) |
|
305 | 305 | { |
306 | 306 | if($value===$defaultValue) |
307 | 307 | unset($this->_viewState[$key]); |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | * @return mixed data value at the specified field |
365 | 365 | * @throws TInvalidDataValueException if the data or the field is invalid. |
366 | 366 | */ |
367 | - protected function getDataFieldValue($data,$field) |
|
367 | + protected function getDataFieldValue($data, $field) |
|
368 | 368 | { |
369 | - return TDataFieldAccessor::getDataFieldValue($data,$field); |
|
369 | + return TDataFieldAccessor::getDataFieldValue($data, $field); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | |
@@ -381,12 +381,12 @@ discard block |
||
381 | 381 | * @param integer the index to the Columns property that the cell resides in. |
382 | 382 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
383 | 383 | */ |
384 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
384 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
385 | 385 | { |
386 | 386 | if($itemType===TListItemType::Header) |
387 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
387 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
388 | 388 | else if($itemType===TListItemType::Footer) |
389 | - $this->initializeFooterCell($cell,$columnIndex); |
|
389 | + $this->initializeFooterCell($cell, $columnIndex); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | /** |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | * @param TTableCell the cell to be initialized |
415 | 415 | * @param integer the index to the Columns property that the cell resides in. |
416 | 416 | */ |
417 | - protected function initializeHeaderCell($cell,$columnIndex) |
|
417 | + protected function initializeHeaderCell($cell, $columnIndex) |
|
418 | 418 | { |
419 | 419 | $text=$this->getHeaderText(); |
420 | 420 | |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $sortExpression=$this->getSortExpression(); |
439 | 439 | if(($url=$this->getHeaderImageUrl())!=='') |
440 | 440 | { |
441 | - $button= new TImageButton; |
|
441 | + $button=new TImageButton; |
|
442 | 442 | $button->setImageUrl($url); |
443 | 443 | $button->setCommandName(TDataGrid::CMD_SORT); |
444 | 444 | $button->setCommandParameter($sortExpression); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | else if($text!=='') |
451 | 451 | { |
452 | - $button= new TLinkButton; |
|
452 | + $button=new TLinkButton; |
|
453 | 453 | $button->setText($text); |
454 | 454 | $button->setCommandName(TDataGrid::CMD_SORT); |
455 | 455 | $button->setCommandParameter($sortExpression); |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | { |
464 | 464 | if(($url=$this->getHeaderImageUrl())!=='') |
465 | 465 | { |
466 | - $image= new TImage; |
|
466 | + $image=new TImage; |
|
467 | 467 | $image->setImageUrl($url); |
468 | 468 | if($text!=='') |
469 | 469 | $image->setAlternateText($text); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | * @param TTableCell the cell to be initialized |
487 | 487 | * @param integer the index to the Columns property that the cell resides in. |
488 | 488 | */ |
489 | - protected function initializeFooterCell($cell,$columnIndex) |
|
489 | + protected function initializeFooterCell($cell, $columnIndex) |
|
490 | 490 | { |
491 | 491 | $text=$this->getFooterText(); |
492 | 492 | if(($classPath=$this->getFooterRenderer())!=='') |
@@ -522,13 +522,13 @@ discard block |
||
522 | 522 | * @param mixed the data to be formatted |
523 | 523 | * @return string the formatted result |
524 | 524 | */ |
525 | - protected function formatDataValue($formatString,$value) |
|
525 | + protected function formatDataValue($formatString, $value) |
|
526 | 526 | { |
527 | 527 | if($formatString==='') |
528 | 528 | return TPropertyValue::ensureString($value); |
529 | 529 | else if($formatString[0]==='#') |
530 | 530 | { |
531 | - $expression=strtr(substr($formatString,1),array('{0}'=>'$value')); |
|
531 | + $expression=strtr(substr($formatString, 1), array('{0}'=>'$value')); |
|
532 | 532 | try |
533 | 533 | { |
534 | 534 | if(eval("\$result=$expression;")===false) |
@@ -537,10 +537,10 @@ discard block |
||
537 | 537 | } |
538 | 538 | catch(Exception $e) |
539 | 539 | { |
540 | - throw new TInvalidDataValueException('datagridcolumn_expression_invalid',get_class($this),$expression,$e->getMessage()); |
|
540 | + throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage()); |
|
541 | 541 | } |
542 | 542 | } |
543 | 543 | else |
544 | - return sprintf($formatString,$value); |
|
544 | + return sprintf($formatString, $value); |
|
545 | 545 | } |
546 | 546 | } |
547 | 547 | \ No newline at end of file |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getItemRenderer() |
53 | 53 | { |
54 | - return $this->getViewState('ItemRenderer',''); |
|
54 | + return $this->getViewState('ItemRenderer', ''); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function setItemRenderer($value) |
72 | 72 | { |
73 | - $this->setViewState('ItemRenderer',$value,''); |
|
73 | + $this->setViewState('ItemRenderer', $value, ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getEditItemRenderer() |
81 | 81 | { |
82 | - return $this->getViewState('EditItemRenderer',''); |
|
82 | + return $this->getViewState('EditItemRenderer', ''); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function setEditItemRenderer($value) |
100 | 100 | { |
101 | - $this->setViewState('EditItemRenderer',$value,''); |
|
101 | + $this->setViewState('EditItemRenderer', $value, ''); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function getDataField() |
108 | 108 | { |
109 | - return $this->getViewState('DataField',''); |
|
109 | + return $this->getViewState('DataField', ''); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function setDataField($value) |
116 | 116 | { |
117 | - $this->setViewState('DataField',$value,''); |
|
117 | + $this->setViewState('DataField', $value, ''); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getDataFormatString() |
124 | 124 | { |
125 | - return $this->getViewState('DataFormatString',''); |
|
125 | + return $this->getViewState('DataFormatString', ''); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function setDataFormatString($value) |
132 | 132 | { |
133 | - $this->setViewState('DataFormatString',$value,''); |
|
133 | + $this->setViewState('DataFormatString', $value, ''); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function getReadOnly() |
140 | 140 | { |
141 | - return $this->getViewState('ReadOnly',false); |
|
141 | + return $this->getViewState('ReadOnly', false); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setReadOnly($value) |
148 | 148 | { |
149 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
149 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param integer the index to the Columns property that the cell resides in. |
161 | 161 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
162 | 162 | */ |
163 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
163 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
164 | 164 | { |
165 | 165 | $item=$cell->getParent(); |
166 | 166 | switch($itemType) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | else |
182 | 182 | $control=$cell; |
183 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
183 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
184 | 184 | break; |
185 | 185 | case TListItemType::EditItem: |
186 | 186 | if(!$this->getReadOnly()) |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | $control->setItemType($item->getItemType()); |
195 | 195 | } |
196 | 196 | $cell->getControls()->add($control); |
197 | - $cell->registerObject('EditControl',$control); |
|
197 | + $cell->registerObject('EditControl', $control); |
|
198 | 198 | } |
199 | 199 | else |
200 | 200 | { |
201 | - $control= new TTextBox; |
|
201 | + $control=new TTextBox; |
|
202 | 202 | $cell->getControls()->add($control); |
203 | - $cell->registerObject('TextBox',$control); |
|
203 | + $cell->registerObject('TextBox', $control); |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | else |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | else |
219 | 219 | $control=$cell; |
220 | 220 | } |
221 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
221 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
222 | 222 | break; |
223 | 223 | default: |
224 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
224 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
225 | 225 | break; |
226 | 226 | } |
227 | 227 | } |
@@ -231,15 +231,15 @@ discard block |
||
231 | 231 | * This method is invoked when datagrid performs databinding. |
232 | 232 | * It populates the content of the cell with the relevant data from data source. |
233 | 233 | */ |
234 | - public function dataBindColumn($sender,$param) |
|
234 | + public function dataBindColumn($sender, $param) |
|
235 | 235 | { |
236 | 236 | $item=$sender->getNamingContainer(); |
237 | 237 | $data=$item->getData(); |
238 | 238 | $formatString=$this->getDataFormatString(); |
239 | 239 | if(($field=$this->getDataField())!=='') |
240 | - $value=$this->formatDataValue($formatString,$this->getDataFieldValue($data,$field)); |
|
240 | + $value=$this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
|
241 | 241 | else |
242 | - $value=$this->formatDataValue($formatString,$data); |
|
242 | + $value=$this->formatDataValue($formatString, $data); |
|
243 | 243 | $sender->setData($value); |
244 | 244 | } |
245 | 245 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @var boolean tells if the decoration uses state in its templates. If there are no templates |
70 | 70 | * in the instance of the decoration this variable is unused. |
71 | 71 | */ |
72 | - private $_usestate = false; |
|
72 | + private $_usestate=false; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @var TWebControl the control to decorate |
@@ -90,19 +90,19 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @var string the text that goes before the open tag |
92 | 92 | */ |
93 | - private $_pretagtext = ''; |
|
93 | + private $_pretagtext=''; |
|
94 | 94 | /** |
95 | 95 | * @var string the text that goes after the open tag |
96 | 96 | */ |
97 | - private $_precontentstext = ''; |
|
97 | + private $_precontentstext=''; |
|
98 | 98 | /** |
99 | 99 | * @var string the text that goes before the close tag |
100 | 100 | */ |
101 | - private $_postcontentstext = ''; |
|
101 | + private $_postcontentstext=''; |
|
102 | 102 | /** |
103 | 103 | * @var string the text that goes after the close tag |
104 | 104 | */ |
105 | - private $_posttagtext = ''; |
|
105 | + private $_posttagtext=''; |
|
106 | 106 | |
107 | 107 | |
108 | 108 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param TWebControl The control that is to be decorated. |
130 | 130 | * @param boolean whether decoration is just around the inner content |
131 | 131 | */ |
132 | - public function __construct($control, $onlyinternal = false) { |
|
133 | - $this->_control = $control; |
|
134 | - $this->_internalonly = $onlyinternal; |
|
132 | + public function __construct($control, $onlyinternal=false) { |
|
133 | + $this->_control=$control; |
|
134 | + $this->_internalonly=$onlyinternal; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function setUseState($value) |
150 | 150 | { |
151 | - $this->_usestate = TPropertyValue::ensureBoolean($value); |
|
151 | + $this->_usestate=TPropertyValue::ensureBoolean($value); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function setPreTagText($value) { |
165 | 165 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
166 | - $this->_pretagtext = TPropertyValue::ensureString($value); |
|
166 | + $this->_pretagtext=TPropertyValue::ensureString($value); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function setPreContentsText($value) { |
181 | 181 | if(!$this->_control->getIsSkinApplied()) |
182 | - $this->_precontentstext = TPropertyValue::ensureString($value); |
|
182 | + $this->_precontentstext=TPropertyValue::ensureString($value); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setPostContentsText($value) { |
197 | 197 | if(!$this->_control->getIsSkinApplied()) |
198 | - $this->_postcontentstext = TPropertyValue::ensureString($value); |
|
198 | + $this->_postcontentstext=TPropertyValue::ensureString($value); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function setPostTagText($value) { |
213 | 213 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
214 | - $this->_posttagtext = TPropertyValue::ensureString($value); |
|
214 | + $this->_posttagtext=TPropertyValue::ensureString($value); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function setPreTagTemplate($value) { |
229 | 229 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
230 | - $this->_pretagtemplate = $value; |
|
230 | + $this->_pretagtemplate=$value; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function setPreContentsTemplate($value) { |
245 | 245 | if(!$this->_control->getIsSkinApplied()) |
246 | - $this->_precontentstemplate = $value; |
|
246 | + $this->_precontentstemplate=$value; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function setPostContentsTemplate($value) { |
261 | 261 | if(!$this->_control->getIsSkinApplied()) |
262 | - $this->_postcontentstemplate = $value; |
|
262 | + $this->_postcontentstemplate=$value; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function setPostTagTemplate($value) { |
277 | 277 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
278 | - $this->_posttagtemplate = $value; |
|
278 | + $this->_posttagtemplate=$value; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -284,15 +284,15 @@ discard block |
||
284 | 284 | * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so |
285 | 285 | * these controls don't have page states. This is as close to not influencing the page as possible. |
286 | 286 | */ |
287 | - public function instantiate($outercontrol = null) { |
|
287 | + public function instantiate($outercontrol=null) { |
|
288 | 288 | if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || |
289 | 289 | $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { |
290 | 290 | |
291 | - $this->_outercontrol = $outercontrol; |
|
291 | + $this->_outercontrol=$outercontrol; |
|
292 | 292 | if($this->getUseState()) |
293 | 293 | $this->ensureTemplateDecoration(); |
294 | 294 | else |
295 | - $this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration'); |
|
295 | + $this->_control->getPage()->onSaveStateComplete[]=array($this, 'ensureTemplateDecoration'); |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 | |
@@ -307,26 +307,26 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function ensureTemplateDecoration($sender=null, $param=null) { |
309 | 309 | |
310 | - $control = $this->_control; |
|
311 | - $outercontrol = $this->_outercontrol; |
|
312 | - if($outercontrol === null) |
|
313 | - $outercontrol = $control; |
|
310 | + $control=$this->_control; |
|
311 | + $outercontrol=$this->_outercontrol; |
|
312 | + if($outercontrol===null) |
|
313 | + $outercontrol=$control; |
|
314 | 314 | |
315 | 315 | if($this->_addedTemplateDecoration) |
316 | 316 | return $this->_addedTemplateDecoration; |
317 | 317 | |
318 | - $this->_addedTemplateDecoration = true; |
|
318 | + $this->_addedTemplateDecoration=true; |
|
319 | 319 | |
320 | 320 | if($this->getPreContentsTemplate()) |
321 | 321 | { |
322 | - $precontents = new TCompositeControl; |
|
322 | + $precontents=new TCompositeControl; |
|
323 | 323 | $this->getPreContentsTemplate()->instantiateIn($precontents); |
324 | 324 | $control->getControls()->insertAt(0, $precontents); |
325 | 325 | } |
326 | 326 | |
327 | 327 | if($this->getPostContentsTemplate()) |
328 | 328 | { |
329 | - $postcontents = new TCompositeControl; |
|
329 | + $postcontents=new TCompositeControl; |
|
330 | 330 | $this->getPostContentsTemplate()->instantiateIn($postcontents); |
331 | 331 | $control->getControls()->add($postcontents); |
332 | 332 | } |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | |
338 | 338 | if($this->getPreTagTemplate()) |
339 | 339 | { |
340 | - $pretag = new TCompositeControl; |
|
340 | + $pretag=new TCompositeControl; |
|
341 | 341 | $this->getPreTagTemplate()->instantiateIn($pretag); |
342 | 342 | $outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag); |
343 | 343 | } |
344 | 344 | |
345 | 345 | if($this->getPostTagTemplate()) |
346 | 346 | { |
347 | - $posttag = new TCompositeControl; |
|
347 | + $posttag=new TCompositeControl; |
|
348 | 348 | $this->getPostTagTemplate()->instantiateIn($posttag); |
349 | 349 | $outercontrol->getParent()->getControls()->insertAfter($outercontrol, $posttag); |
350 | 350 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * Script path relative to the TClientScriptManager::SCRIPT_PATH |
87 | 87 | */ |
88 | - const SCRIPT_PATH = 'prado/datepicker'; |
|
88 | + const SCRIPT_PATH='prado/datepicker'; |
|
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @var TDatePickerClientScript validator client-script options. |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getDateFormat() |
107 | 107 | { |
108 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
108 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function setDateFormat($value) |
116 | 116 | { |
117 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
117 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getShowCalendar() |
124 | 124 | { |
125 | - return $this->getViewState('ShowCalendar',true); |
|
125 | + return $this->getViewState('ShowCalendar', true); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setShowCalendar($value) |
133 | 133 | { |
134 | - $this->setViewState('ShowCalendar',TPropertyValue::ensureBoolean($value),true); |
|
134 | + $this->setViewState('ShowCalendar', TPropertyValue::ensureBoolean($value), true); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function setFromYear($value) |
255 | 255 | { |
256 | - $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))-5); |
|
256 | + $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) - 5); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function getFromYear() |
263 | 263 | { |
264 | - return $this->getViewState('FromYear', intval(@date('Y'))-5); |
|
264 | + return $this->getViewState('FromYear', intval(@date('Y')) - 5); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function setUpToYear($value) |
271 | 271 | { |
272 | - $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10); |
|
272 | + $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) + 10); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | public function getUpToYear() |
279 | 279 | { |
280 | - return $this->getViewState('UpToYear', intval(@date('Y'))+10); |
|
280 | + return $this->getViewState('UpToYear', intval(@date('Y')) + 10); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | $this->setText(''); |
318 | 318 | else |
319 | 319 | { |
320 | - $date = TPropertyValue::ensureFloat($value); |
|
321 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
320 | + $date=TPropertyValue::ensureFloat($value); |
|
321 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
322 | 322 | $this->setText($formatter->format($date)); |
323 | 323 | } |
324 | 324 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | public function getClientSide() |
379 | 379 | { |
380 | 380 | if($this->_clientScript===null) |
381 | - $this->_clientScript = $this->createClientScript(); |
|
381 | + $this->_clientScript=$this->createClientScript(); |
|
382 | 382 | return $this->_clientScript; |
383 | 383 | } |
384 | 384 | |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | */ |
398 | 398 | public function getValidationPropertyValue() |
399 | 399 | { |
400 | - if(($text = $this->getText()) === '') |
|
400 | + if(($text=$this->getText())==='') |
|
401 | 401 | return ''; |
402 | - $date = $this->getTimeStamp(); |
|
403 | - return $date == null ? $text : $date; |
|
402 | + $date=$this->getTimeStamp(); |
|
403 | + return $date==null ? $text : $date; |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | /** |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function render($writer) |
423 | 423 | { |
424 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
424 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
425 | 425 | { |
426 | 426 | parent::render($writer); |
427 | 427 | $this->renderDatePickerButtons($writer); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | { |
445 | 445 | if($this->getShowCalendar()) |
446 | 446 | { |
447 | - switch ($this->getMode()) |
|
447 | + switch($this->getMode()) |
|
448 | 448 | { |
449 | 449 | case TDatePickerMode::Button: |
450 | 450 | $this->renderButtonDatePicker($writer); |
@@ -464,11 +464,11 @@ discard block |
||
464 | 464 | * @param array the input data collection |
465 | 465 | * @return boolean whether the data of the component has been changed |
466 | 466 | */ |
467 | - public function loadPostData($key,$values) |
|
467 | + public function loadPostData($key, $values) |
|
468 | 468 | { |
469 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
469 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
470 | 470 | return parent::loadPostData($key, $values); |
471 | - $value = $this->getDateFromPostData($key, $values); |
|
471 | + $value=$this->getDateFromPostData($key, $values); |
|
472 | 472 | if(!$this->getReadOnly() && $this->getText()!==$value) |
473 | 473 | { |
474 | 474 | $this->setText($value); |
@@ -486,40 +486,40 @@ discard block |
||
486 | 486 | */ |
487 | 487 | protected function getDateFromPostData($key, $values) |
488 | 488 | { |
489 | - $date = @getdate(); |
|
489 | + $date=@getdate(); |
|
490 | 490 | |
491 | - $pattern = $this->getDateFormat(); |
|
492 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
493 | - $formatter = new TSimpleDateFormatter($pattern); |
|
491 | + $pattern=$this->getDateFormat(); |
|
492 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
493 | + $formatter=new TSimpleDateFormatter($pattern); |
|
494 | 494 | |
495 | - $order = $formatter->getDayMonthYearOrdering(); |
|
495 | + $order=$formatter->getDayMonthYearOrdering(); |
|
496 | 496 | |
497 | 497 | if(isset($values[$key.'$day'])) { |
498 | - $day = intval($values[$key.'$day']); |
|
498 | + $day=intval($values[$key.'$day']); |
|
499 | 499 | } elseif(in_array('day', $order)) { |
500 | - $day = $date['mday']; |
|
500 | + $day=$date['mday']; |
|
501 | 501 | } else { |
502 | - $day = 1; |
|
502 | + $day=1; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | if(isset($values[$key.'$month'])) |
506 | - $month = intval($values[$key.'$month']) + 1; |
|
506 | + $month=intval($values[$key.'$month']) + 1; |
|
507 | 507 | else |
508 | - $month = $date['mon']; |
|
508 | + $month=$date['mon']; |
|
509 | 509 | |
510 | 510 | if(isset($values[$key.'$year'])) |
511 | - $year = intval($values[$key.'$year']); |
|
511 | + $year=intval($values[$key.'$year']); |
|
512 | 512 | else |
513 | - $year = $date['year']; |
|
513 | + $year=$date['year']; |
|
514 | 514 | |
515 | - $s = new TDateTimeStamp; |
|
516 | - $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
515 | + $s=new TDateTimeStamp; |
|
516 | + $date=$s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
517 | 517 | //$date = @mktime(0, 0, 0, $month, $day, $year); |
518 | 518 | |
519 | - $pattern = $this->getDateFormat(); |
|
520 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
519 | + $pattern=$this->getDateFormat(); |
|
520 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
521 | 521 | |
522 | - $formatter = new TSimpleDateFormatter($pattern); |
|
522 | + $formatter=new TSimpleDateFormatter($pattern); |
|
523 | 523 | return $formatter->format($date); |
524 | 524 | } |
525 | 525 | |
@@ -529,31 +529,31 @@ discard block |
||
529 | 529 | */ |
530 | 530 | protected function getDatePickerOptions() |
531 | 531 | { |
532 | - $options['ID'] = $this->getClientID(); |
|
533 | - $options['InputMode'] = $this->getInputMode(); |
|
534 | - $options['Format'] = $this->getDateFormat(); |
|
535 | - $options['FirstDayOfWeek'] = $this->getFirstDayOfWeek(); |
|
532 | + $options['ID']=$this->getClientID(); |
|
533 | + $options['InputMode']=$this->getInputMode(); |
|
534 | + $options['Format']=$this->getDateFormat(); |
|
535 | + $options['FirstDayOfWeek']=$this->getFirstDayOfWeek(); |
|
536 | 536 | if(($cssClass=$this->getCssClass())!=='') |
537 | - $options['ClassName'] = $cssClass; |
|
538 | - $options['CalendarStyle'] = $this->getCalendarStyle(); |
|
539 | - $options['FromYear'] = $this->getFromYear(); |
|
540 | - $options['UpToYear'] = $this->getUpToYear(); |
|
537 | + $options['ClassName']=$cssClass; |
|
538 | + $options['CalendarStyle']=$this->getCalendarStyle(); |
|
539 | + $options['FromYear']=$this->getFromYear(); |
|
540 | + $options['UpToYear']=$this->getUpToYear(); |
|
541 | 541 | switch($this->getMode()) |
542 | 542 | { |
543 | 543 | case TDatePickerMode::Basic: |
544 | 544 | break; |
545 | 545 | case TDatePickerMode::Clickable: |
546 | - $options['TriggerEvent'] = "click"; |
|
546 | + $options['TriggerEvent']="click"; |
|
547 | 547 | break; |
548 | 548 | default: |
549 | - $options['Trigger'] = $this->getDatePickerButtonID(); |
|
549 | + $options['Trigger']=$this->getDatePickerButtonID(); |
|
550 | 550 | break; |
551 | 551 | } |
552 | - $options['PositionMode'] = $this->getPositionMode(); |
|
552 | + $options['PositionMode']=$this->getPositionMode(); |
|
553 | 553 | |
554 | - $options = array_merge($options, $this->getCulturalOptions()); |
|
554 | + $options=array_merge($options, $this->getCulturalOptions()); |
|
555 | 555 | if($this->_clientScript!==null) |
556 | - $options = array_merge($options, |
|
556 | + $options=array_merge($options, |
|
557 | 557 | $this->_clientScript->getOptions()->toArray()); |
558 | 558 | return $options; |
559 | 559 | } |
@@ -564,13 +564,13 @@ discard block |
||
564 | 564 | */ |
565 | 565 | protected function getCulturalOptions() |
566 | 566 | { |
567 | - if($this->getCurrentCulture() == 'en') |
|
567 | + if($this->getCurrentCulture()=='en') |
|
568 | 568 | return array(); |
569 | 569 | |
570 | - $date = $this->getLocalizedCalendarInfo(); |
|
571 | - $options['MonthNames'] = $date->getMonthNames(); |
|
572 | - $options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames(); |
|
573 | - $options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames(); |
|
570 | + $date=$this->getLocalizedCalendarInfo(); |
|
571 | + $options['MonthNames']=$date->getMonthNames(); |
|
572 | + $options['AbbreviatedMonthNames']=$date->getAbbreviatedMonthNames(); |
|
573 | + $options['ShortWeekDayNames']=$date->getAbbreviatedDayNames(); |
|
574 | 574 | |
575 | 575 | return $options; |
576 | 576 | } |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | */ |
581 | 581 | protected function getCurrentCulture() |
582 | 582 | { |
583 | - $app = $this->getApplication()->getGlobalization(false); |
|
584 | - return $this->getCulture() == '' ? |
|
583 | + $app=$this->getApplication()->getGlobalization(false); |
|
584 | + return $this->getCulture()=='' ? |
|
585 | 585 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
586 | 586 | } |
587 | 587 | |
@@ -591,8 +591,8 @@ discard block |
||
591 | 591 | protected function getLocalizedCalendarInfo() |
592 | 592 | { |
593 | 593 | //expensive operations |
594 | - $culture = $this->getCurrentCulture(); |
|
595 | - $info = new CultureInfo($culture); |
|
594 | + $culture=$this->getCurrentCulture(); |
|
595 | + $info=new CultureInfo($culture); |
|
596 | 596 | return $info->getDateTimeFormat(); |
597 | 597 | } |
598 | 598 | |
@@ -601,19 +601,19 @@ discard block |
||
601 | 601 | */ |
602 | 602 | protected function renderDropDownListCalendar($writer) |
603 | 603 | { |
604 | - if($this->getMode() == TDatePickerMode::Basic) |
|
604 | + if($this->getMode()==TDatePickerMode::Basic) |
|
605 | 605 | $this->setMode(TDatePickerMode::ImageButton); |
606 | 606 | parent::addAttributesToRender($writer); |
607 | 607 | $writer->removeAttribute('name'); |
608 | 608 | $writer->removeAttribute('type'); |
609 | 609 | $writer->addAttribute('id', $this->getClientID()); |
610 | 610 | |
611 | - if(strlen($class = $this->getCssClass()) > 0) |
|
611 | + if(strlen($class=$this->getCssClass()) > 0) |
|
612 | 612 | $writer->addAttribute('class', $class); |
613 | 613 | $writer->renderBeginTag('span'); |
614 | 614 | |
615 | - $s = new TDateTimeStamp; |
|
616 | - $date = $s->getDate($this->getTimeStampFromText()); |
|
615 | + $s=new TDateTimeStamp; |
|
616 | + $date=$s->getDate($this->getTimeStampFromText()); |
|
617 | 617 | //$date = @getdate($this->getTimeStampFromText()); |
618 | 618 | |
619 | 619 | $this->renderCalendarSelections($writer, $date); |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | |
631 | 631 | protected function hasDayPattern() |
632 | 632 | { |
633 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
633 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
634 | 634 | return ($formatter->getDayPattern()!==null); |
635 | 635 | } |
636 | 636 | |
@@ -641,16 +641,16 @@ discard block |
||
641 | 641 | */ |
642 | 642 | protected function renderCalendarSelections($writer, $date) |
643 | 643 | { |
644 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
644 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
645 | 645 | |
646 | 646 | foreach($formatter->getDayMonthYearOrdering() as $type) |
647 | 647 | { |
648 | - if($type == 'day') |
|
649 | - $this->renderCalendarDayOptions($writer,$date['mday']); |
|
650 | - elseif($type == 'month') |
|
651 | - $this->renderCalendarMonthOptions($writer,$date['mon']); |
|
652 | - elseif($type == 'year') |
|
653 | - $this->renderCalendarYearOptions($writer,$date['year']); |
|
648 | + if($type=='day') |
|
649 | + $this->renderCalendarDayOptions($writer, $date['mday']); |
|
650 | + elseif($type=='month') |
|
651 | + $this->renderCalendarMonthOptions($writer, $date['mon']); |
|
652 | + elseif($type=='year') |
|
653 | + $this->renderCalendarYearOptions($writer, $date['year']); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | |
@@ -660,9 +660,9 @@ discard block |
||
660 | 660 | */ |
661 | 661 | protected function getTimeStampFromText() |
662 | 662 | { |
663 | - $pattern = $this->getDateFormat(); |
|
664 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
665 | - $formatter = new TSimpleDateFormatter($pattern); |
|
663 | + $pattern=$this->getDateFormat(); |
|
664 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
665 | + $formatter=new TSimpleDateFormatter($pattern); |
|
666 | 666 | return $formatter->parse($this->getText()); |
667 | 667 | } |
668 | 668 | |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | * @param array list of selection options |
673 | 673 | * @param mixed selected key. |
674 | 674 | */ |
675 | - private function renderDropDownListOptions($writer,$options,$selected=null) |
|
675 | + private function renderDropDownListOptions($writer, $options, $selected=null) |
|
676 | 676 | { |
677 | 677 | foreach($options as $k => $v) |
678 | 678 | { |
679 | 679 | $writer->addAttribute('value', $k); |
680 | - if($k == $selected) |
|
680 | + if($k==$selected) |
|
681 | 681 | $writer->addAttribute('selected', 'selected'); |
682 | 682 | $writer->renderBeginTag('option'); |
683 | 683 | $writer->write($v); |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | */ |
693 | 693 | protected function renderCalendarDayOptions($writer, $selected=null) |
694 | 694 | { |
695 | - $days = $this->getDropDownDayOptions(); |
|
695 | + $days=$this->getDropDownDayOptions(); |
|
696 | 696 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day'); |
697 | 697 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day'); |
698 | 698 | $writer->addAttribute('class', 'datepicker_day_options'); |
@@ -708,12 +708,12 @@ discard block |
||
708 | 708 | */ |
709 | 709 | protected function getDropDownDayOptions() |
710 | 710 | { |
711 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
712 | - $days = array(); |
|
713 | - $requiresPadding = $formatter->getDayPattern() === 'dd'; |
|
714 | - for($i=1;$i<=31;$i++) |
|
711 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
712 | + $days=array(); |
|
713 | + $requiresPadding=$formatter->getDayPattern()==='dd'; |
|
714 | + for($i=1; $i <= 31; $i++) |
|
715 | 715 | { |
716 | - $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
716 | + $days[$i]=$requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
717 | 717 | } |
718 | 718 | return $days; |
719 | 719 | } |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | */ |
726 | 726 | protected function renderCalendarMonthOptions($writer, $selected=null) |
727 | 727 | { |
728 | - $info = $this->getLocalizedCalendarInfo(); |
|
728 | + $info=$this->getLocalizedCalendarInfo(); |
|
729 | 729 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month'); |
730 | 730 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month'); |
731 | 731 | $writer->addAttribute('class', 'datepicker_month_options'); |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $writer->addAttribute('disabled', 'disabled'); |
734 | 734 | $writer->renderBeginTag('select'); |
735 | 735 | $this->renderDropDownListOptions($writer, |
736 | - $this->getLocalizedMonthNames($info), $selected-1); |
|
736 | + $this->getLocalizedMonthNames($info), $selected - 1); |
|
737 | 737 | $writer->renderEndTag(); |
738 | 738 | } |
739 | 739 | |
@@ -746,17 +746,17 @@ discard block |
||
746 | 746 | */ |
747 | 747 | protected function getLocalizedMonthNames($info) |
748 | 748 | { |
749 | - $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
|
749 | + $formatter=new TSimpleDateFormatter($this->getDateFormat()); |
|
750 | 750 | switch($formatter->getMonthPattern()) |
751 | 751 | { |
752 | 752 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
753 | 753 | case 'MM': |
754 | - $array = array(); |
|
755 | - for($i=1;$i<=12;$i++) |
|
756 | - $array[$i-1] = $i < 10 ? '0'.$i : $i; |
|
754 | + $array=array(); |
|
755 | + for($i=1; $i <= 12; $i++) |
|
756 | + $array[$i - 1]=$i < 10 ? '0'.$i : $i; |
|
757 | 757 | return $array; |
758 | 758 | case 'M': |
759 | - $array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i; |
|
759 | + $array=array(); for($i=1; $i <= 12; $i++) $array[$i - 1]=$i; |
|
760 | 760 | return $array; |
761 | 761 | default : return $info->getMonthNames(); |
762 | 762 | } |
@@ -769,9 +769,9 @@ discard block |
||
769 | 769 | */ |
770 | 770 | protected function renderCalendarYearOptions($writer, $selected=null) |
771 | 771 | { |
772 | - $years = array(); |
|
773 | - for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
774 | - $years[$i] = $i; |
|
772 | + $years=array(); |
|
773 | + for($i=$this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
774 | + $years[$i]=$i; |
|
775 | 775 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year'); |
776 | 776 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year'); |
777 | 777 | $writer->addAttribute('class', 'datepicker_year_options'); |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
801 | 801 | $writer->addAttribute('type', 'button'); |
802 | 802 | $writer->addAttribute('class', $this->getCssClass().' TDatePickerButton'); |
803 | - $writer->addAttribute('value',$this->getButtonText()); |
|
803 | + $writer->addAttribute('value', $this->getButtonText()); |
|
804 | 804 | if(!$this->getEnabled(true)) |
805 | 805 | $writer->addAttribute('disabled', 'disabled'); |
806 | 806 | $writer->renderBeginTag("input"); |
@@ -813,8 +813,8 @@ discard block |
||
813 | 813 | */ |
814 | 814 | protected function renderImageButtonDatePicker($writer) |
815 | 815 | { |
816 | - $url = $this->getButtonImageUrl(); |
|
817 | - $url = empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
816 | + $url=$this->getButtonImageUrl(); |
|
817 | + $url=empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
818 | 818 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
819 | 819 | $writer->addAttribute('src', $url); |
820 | 820 | $writer->addAttribute('alt', ' '); |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | */ |
834 | 834 | protected function getAssetUrl($file='') |
835 | 835 | { |
836 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
836 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
837 | 837 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
838 | 838 | } |
839 | 839 | |
@@ -843,8 +843,8 @@ discard block |
||
843 | 843 | */ |
844 | 844 | protected function publishCalendarStyle() |
845 | 845 | { |
846 | - $url = $this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
847 | - $cs = $this->getPage()->getClientScript(); |
|
846 | + $url=$this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
847 | + $cs=$this->getPage()->getClientScript(); |
|
848 | 848 | if(!$cs->isStyleSheetFileRegistered($url)) |
849 | 849 | $cs->registerStyleSheetFile($url, $url); |
850 | 850 | return $url; |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | protected function addAttributesToRender($writer) |
858 | 858 | { |
859 | 859 | parent::addAttributesToRender($writer); |
860 | - $writer->addAttribute('id',$this->getClientID()); |
|
860 | + $writer->addAttribute('id', $this->getClientID()); |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | /** |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | { |
868 | 868 | if($this->getShowCalendar()) |
869 | 869 | { |
870 | - $cs = $this->getPage()->getClientScript(); |
|
870 | + $cs=$this->getPage()->getClientScript(); |
|
871 | 871 | $cs->registerPradoScript("datepicker"); |
872 | 872 | } |
873 | 873 | } |
@@ -876,16 +876,16 @@ discard block |
||
876 | 876 | { |
877 | 877 | if($this->getShowCalendar()) |
878 | 878 | { |
879 | - $cs = $this->getPage()->getClientScript(); |
|
879 | + $cs=$this->getPage()->getClientScript(); |
|
880 | 880 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
881 | 881 | { |
882 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
883 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
882 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
883 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
884 | 884 | $cs->registerEndScript('TDatePicker.spacer', $code); |
885 | 885 | } |
886 | 886 | |
887 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
888 | - $code = "new Prado.WebUI.TDatePicker($options);"; |
|
887 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
888 | + $code="new Prado.WebUI.TDatePicker($options);"; |
|
889 | 889 | $cs->registerEndScript("prado:".$this->getClientID(), $code); |
890 | 890 | } |
891 | 891 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function setRepackUTF7($value) |
53 | 53 | { |
54 | - $this->setViewState('RepackUTF7',TPropertyValue::ensureBoolean($value),false); |
|
54 | + $this->setViewState('RepackUTF7', TPropertyValue::ensureBoolean($value), false); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getRepackUTF7() |
61 | 61 | { |
62 | - return $this->getViewState('RepackUTF7',false); |
|
62 | + return $this->getViewState('RepackUTF7', false); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function render($writer) |
72 | 72 | { |
73 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
73 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
74 | 74 | parent::render($htmlWriter); |
75 | 75 | $writer->write($this->parseSafeHtml($htmlWriter->flush())); |
76 | 76 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected function parseSafeHtml($text) |
84 | 84 | { |
85 | - $renderer = new TSafeHtmlParser; |
|
85 | + $renderer=new TSafeHtmlParser; |
|
86 | 86 | return $renderer->parse($text, $this->getRepackUTF7()); |
87 | 87 | } |
88 | 88 | } |