@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | protected function loadTemplate() |
117 | 117 | { |
118 | - Prado::trace("Loading template ".get_class($this),'System.Web.UI.TTemplateControl'); |
|
118 | + Prado::trace("Loading template ".get_class($this), 'System.Web.UI.TTemplateControl'); |
|
119 | 119 | $template=$this->getService()->getTemplateManager()->getTemplateByClassName(get_class($this)); |
120 | 120 | return $template; |
121 | 121 | } |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | foreach($tpl->getDirective() as $name=>$value) |
133 | 133 | { |
134 | 134 | if(is_string($value)) |
135 | - $this->setSubProperty($name,$value); |
|
135 | + $this->setSubProperty($name, $value); |
|
136 | 136 | else |
137 | - throw new TConfigurationException('templatecontrol_directive_invalid',get_class($this),$name); |
|
137 | + throw new TConfigurationException('templatecontrol_directive_invalid', get_class($this), $name); |
|
138 | 138 | } |
139 | 139 | $tpl->instantiateIn($this); |
140 | 140 | } |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | * @param string ID of the content |
146 | 146 | * @param TContent |
147 | 147 | */ |
148 | - public function registerContent($id,TContent $object) |
|
148 | + public function registerContent($id, TContent $object) |
|
149 | 149 | { |
150 | 150 | if(isset($this->_contents[$id])) |
151 | - throw new TConfigurationException('templatecontrol_contentid_duplicated',$id); |
|
151 | + throw new TConfigurationException('templatecontrol_contentid_duplicated', $id); |
|
152 | 152 | else |
153 | 153 | $this->_contents[$id]=$object; |
154 | 154 | } |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * @param string placeholder ID |
160 | 160 | * @param TContentPlaceHolder placeholder control |
161 | 161 | */ |
162 | - public function registerContentPlaceHolder($id,TContentPlaceHolder $object) |
|
162 | + public function registerContentPlaceHolder($id, TContentPlaceHolder $object) |
|
163 | 163 | { |
164 | 164 | if(isset($this->_placeholders[$id])) |
165 | - throw new TConfigurationException('templatecontrol_placeholderid_duplicated',$id); |
|
165 | + throw new TConfigurationException('templatecontrol_placeholderid_duplicated', $id); |
|
166 | 166 | else |
167 | 167 | $this->_placeholders[$id]=$object; |
168 | 168 | } |
@@ -197,17 +197,17 @@ discard block |
||
197 | 197 | * @param string ID of the content control |
198 | 198 | * @param TContent the content to be injected |
199 | 199 | */ |
200 | - public function injectContent($id,$content) |
|
200 | + public function injectContent($id, $content) |
|
201 | 201 | { |
202 | 202 | if(isset($this->_placeholders[$id])) |
203 | 203 | { |
204 | 204 | $placeholder=$this->_placeholders[$id]; |
205 | 205 | $controls=$placeholder->getParent()->getControls(); |
206 | 206 | $loc=$controls->remove($placeholder); |
207 | - $controls->insertAt($loc,$content); |
|
207 | + $controls->insertAt($loc, $content); |
|
208 | 208 | } |
209 | 209 | else |
210 | - throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id); |
|
210 | + throw new TConfigurationException('templatecontrol_placeholder_inexistent', $id); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | $this->getControls()->add($master); |
232 | 232 | $master->ensureChildControls(); |
233 | 233 | foreach($this->_contents as $id=>$content) |
234 | - $master->injectContent($id,$content); |
|
234 | + $master->injectContent($id, $content); |
|
235 | 235 | } |
236 | 236 | else if(!empty($this->_contents)) |
237 | - throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this)); |
|
237 | + throw new TConfigurationException('templatecontrol_mastercontrol_required', get_class($this)); |
|
238 | 238 | parent::initRecursive($namingContainer); |
239 | 239 | } |
240 | 240 | |
@@ -245,38 +245,38 @@ discard block |
||
245 | 245 | * @param Boolean $throwExceptions Wheter or not to throw exceptions |
246 | 246 | * @author Daniel Sampedro <[email protected]> |
247 | 247 | */ |
248 | - public function tryToUpdateView($arObj, $throwExceptions = false) |
|
248 | + public function tryToUpdateView($arObj, $throwExceptions=false) |
|
249 | 249 | { |
250 | - $objAttrs = get_class_vars(get_class($arObj)); |
|
251 | - foreach (array_keys($objAttrs) as $key) |
|
250 | + $objAttrs=get_class_vars(get_class($arObj)); |
|
251 | + foreach(array_keys($objAttrs) as $key) |
|
252 | 252 | { |
253 | 253 | try |
254 | 254 | { |
255 | - if ($key != "RELATIONS") |
|
255 | + if($key!="RELATIONS") |
|
256 | 256 | { |
257 | - $control = $this->{$key}; |
|
258 | - if ($control instanceof TTextBox) |
|
259 | - $control->Text = $arObj->{$key}; |
|
260 | - elseif ($control instanceof TCheckBox) |
|
261 | - $control->Checked = (boolean) $arObj->{$key}; |
|
262 | - elseif ($control instanceof TDatePicker) |
|
263 | - $control->Date = $arObj->{$key}; |
|
257 | + $control=$this->{$key}; |
|
258 | + if($control instanceof TTextBox) |
|
259 | + $control->Text=$arObj->{$key}; |
|
260 | + elseif($control instanceof TCheckBox) |
|
261 | + $control->Checked=(boolean) $arObj->{$key}; |
|
262 | + elseif($control instanceof TDatePicker) |
|
263 | + $control->Date=$arObj->{$key}; |
|
264 | 264 | } |
265 | 265 | else |
266 | 266 | { |
267 | - foreach ($objAttrs["RELATIONS"] as $relKey => $relValues) |
|
267 | + foreach($objAttrs["RELATIONS"] as $relKey => $relValues) |
|
268 | 268 | { |
269 | - $relControl = $this->{$relKey}; |
|
270 | - switch ($relValues[0]) |
|
269 | + $relControl=$this->{$relKey}; |
|
270 | + switch($relValues[0]) |
|
271 | 271 | { |
272 | 272 | case TActiveRecord::BELONGS_TO: |
273 | 273 | case TActiveRecord::HAS_ONE: |
274 | - $relControl->Text = $arObj->{$relKey}; |
|
274 | + $relControl->Text=$arObj->{$relKey}; |
|
275 | 275 | break; |
276 | 276 | case TActiveRecord::HAS_MANY: |
277 | - if ($relControl instanceof TListControl) |
|
277 | + if($relControl instanceof TListControl) |
|
278 | 278 | { |
279 | - $relControl->DataSource = $arObj->{$relKey}; |
|
279 | + $relControl->DataSource=$arObj->{$relKey}; |
|
280 | 280 | $relControl->dataBind(); |
281 | 281 | } |
282 | 282 | break; |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | break; |
286 | 286 | } |
287 | 287 | } |
288 | - catch (Exception $ex) |
|
288 | + catch(Exception $ex) |
|
289 | 289 | { |
290 | - if ($throwExceptions) |
|
290 | + if($throwExceptions) |
|
291 | 291 | throw $ex; |
292 | 292 | } |
293 | 293 | } |
@@ -299,26 +299,26 @@ discard block |
||
299 | 299 | * @param Boolean $throwExceptions Wheter or not to throw exceptions |
300 | 300 | * @author Daniel Sampedro <[email protected]> |
301 | 301 | */ |
302 | - public function tryToUpdateAR($arObj, $throwExceptions = false) |
|
302 | + public function tryToUpdateAR($arObj, $throwExceptions=false) |
|
303 | 303 | { |
304 | - $objAttrs = get_class_vars(get_class($arObj)); |
|
305 | - foreach (array_keys($objAttrs) as $key) |
|
304 | + $objAttrs=get_class_vars(get_class($arObj)); |
|
305 | + foreach(array_keys($objAttrs) as $key) |
|
306 | 306 | { |
307 | 307 | try |
308 | 308 | { |
309 | - if ($key == "RELATIONS") |
|
309 | + if($key=="RELATIONS") |
|
310 | 310 | break; |
311 | - $control = $this->{$key}; |
|
312 | - if ($control instanceof TTextBox) |
|
313 | - $arObj->{$key} = $control->Text; |
|
314 | - elseif ($control instanceof TCheckBox) |
|
315 | - $arObj->{$key} = $control->Checked; |
|
316 | - elseif ($control instanceof TDatePicker) |
|
317 | - $arObj->{$key} = $control->Date; |
|
311 | + $control=$this->{$key}; |
|
312 | + if($control instanceof TTextBox) |
|
313 | + $arObj->{$key}=$control->Text; |
|
314 | + elseif($control instanceof TCheckBox) |
|
315 | + $arObj->{$key}=$control->Checked; |
|
316 | + elseif($control instanceof TDatePicker) |
|
317 | + $arObj->{$key}=$control->Date; |
|
318 | 318 | } |
319 | - catch (Exception $ex) |
|
319 | + catch(Exception $ex) |
|
320 | 320 | { |
321 | - if ($throwExceptions) |
|
321 | + if($throwExceptions) |
|
322 | 322 | throw $ex; |
323 | 323 | } |
324 | 324 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setHistorySize($value) |
81 | 81 | { |
82 | - if(($value=TPropertyValue::ensureInteger($value))>0) |
|
82 | + if(($value=TPropertyValue::ensureInteger($value)) > 0) |
|
83 | 83 | $this->_historySize=$value; |
84 | 84 | else |
85 | 85 | throw new TInvalidDataValueException('sessionpagestatepersister_historysize_invalid'); |
@@ -93,19 +93,19 @@ discard block |
||
93 | 93 | $session=$this->_page->getSession(); |
94 | 94 | $session->open(); |
95 | 95 | $data=serialize($state); |
96 | - $timestamp=(string)microtime(true); |
|
96 | + $timestamp=(string) microtime(true); |
|
97 | 97 | $key=self::STATE_SESSION_KEY.$timestamp; |
98 | - $session->add($key,$data); |
|
98 | + $session->add($key, $data); |
|
99 | 99 | if(($queue=$session->itemAt(self::QUEUE_SESSION_KEY))===null) |
100 | 100 | $queue=array(); |
101 | 101 | $queue[]=$key; |
102 | - if(count($queue)>$this->getHistorySize()) |
|
102 | + if(count($queue) > $this->getHistorySize()) |
|
103 | 103 | { |
104 | 104 | $expiredKey=array_shift($queue); |
105 | 105 | $session->remove($expiredKey); |
106 | 106 | } |
107 | - $session->add(self::QUEUE_SESSION_KEY,$queue); |
|
108 | - $this->_page->setClientState(TPageStateFormatter::serialize($this->_page,$timestamp)); |
|
107 | + $session->add(self::QUEUE_SESSION_KEY, $queue); |
|
108 | + $this->_page->setClientState(TPageStateFormatter::serialize($this->_page, $timestamp)); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function load() |
117 | 117 | { |
118 | - if(($timestamp=TPageStateFormatter::unserialize($this->_page,$this->_page->getRequestClientState()))!==null) |
|
118 | + if(($timestamp=TPageStateFormatter::unserialize($this->_page, $this->_page->getRequestClientState()))!==null) |
|
119 | 119 | { |
120 | 120 | $session=$this->_page->getSession(); |
121 | 121 | $session->open(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | if(($data=$session->itemAt($key))!==null) |
124 | 124 | return unserialize($data); |
125 | 125 | } |
126 | - throw new THttpException(400,'sessionpagestatepersister_pagestate_corrupted'); |
|
126 | + throw new THttpException(400, 'sessionpagestatepersister_pagestate_corrupted'); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function getPage() |
50 | 50 | { |
51 | - return $this->_control?$this->_control->getPage():null; |
|
51 | + return $this->_control ? $this->_control->getPage() : null; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | protected function addAttributesToRender($writer) |
45 | 45 | { |
46 | - $writer->addAttribute('id',$this->getClientID()); |
|
47 | - $writer->addAttribute('method',$this->getMethod()); |
|
46 | + $writer->addAttribute('id', $this->getClientID()); |
|
47 | + $writer->addAttribute('method', $this->getMethod()); |
|
48 | 48 | $uri=$this->getRequest()->getRequestURI(); |
49 | - $writer->addAttribute('action',str_replace('&','&',str_replace('&','&',$uri))); |
|
49 | + $writer->addAttribute('action', str_replace('&', '&', str_replace('&', '&', $uri))); |
|
50 | 50 | if(($enctype=$this->getEnctype())!=='') |
51 | - $writer->addAttribute('enctype',$enctype); |
|
51 | + $writer->addAttribute('enctype', $enctype); |
|
52 | 52 | |
53 | 53 | $attributes=$this->getAttributes(); |
54 | 54 | $attributes->remove('action'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if(($button=$this->findControl($butt))!==null) |
60 | 60 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
61 | 61 | else |
62 | - throw new TInvalidDataValueException('form_defaultbutton_invalid',$butt); |
|
62 | + throw new TInvalidDataValueException('form_defaultbutton_invalid', $butt); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function getDefaultButton() |
110 | 110 | { |
111 | - return $this->getViewState('DefaultButton',''); |
|
111 | + return $this->getViewState('DefaultButton', ''); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function setDefaultButton($value) |
121 | 121 | { |
122 | - $this->setViewState('DefaultButton',$value,''); |
|
122 | + $this->setViewState('DefaultButton', $value, ''); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getMethod() |
129 | 129 | { |
130 | - return $this->getViewState('Method','post'); |
|
130 | + return $this->getViewState('Method', 'post'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function setMethod($value) |
137 | 137 | { |
138 | - $this->setViewState('Method',TPropertyValue::ensureEnum($value,'post','get'),'post'); |
|
138 | + $this->setViewState('Method', TPropertyValue::ensureEnum($value, 'post', 'get'), 'post'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function getEnctype() |
145 | 145 | { |
146 | - return $this->getViewState('Enctype',''); |
|
146 | + return $this->getViewState('Enctype', ''); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function setEnctype($value) |
157 | 157 | { |
158 | - $this->setViewState('Enctype',$value,''); |
|
158 | + $this->setViewState('Enctype', $value, ''); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | public function setWriter($writer) |
90 | 90 | { |
91 | - $this->_writer = $writer; |
|
91 | + $this->_writer=$writer; |
|
92 | 92 | } |
93 | 93 | /** |
94 | 94 | * Adds a list of attributes to be rendered. |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param string name of the attribute |
106 | 106 | * @param string value of the attribute |
107 | 107 | */ |
108 | - public function addAttribute($name,$value) |
|
108 | + public function addAttribute($name, $value) |
|
109 | 109 | { |
110 | 110 | $this->_attributes[THttpUtility::htmlStrip($name)]=THttpUtility::htmlEncode($value); |
111 | 111 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param string stylesheet attribute name |
135 | 135 | * @param string stylesheet attribute value |
136 | 136 | */ |
137 | - public function addStyleAttribute($name,$value) |
|
137 | + public function addStyleAttribute($name, $value) |
|
138 | 138 | { |
139 | 139 | $this->_styles[THttpUtility::htmlStrip($name)]=THttpUtility::htmlEncode($value); |
140 | 140 | } |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | if(isset(self::$_simpleTags[$tagName])) |
204 | 204 | { |
205 | 205 | $str.=' />'; |
206 | - $this->_openTags[] = ''; |
|
206 | + $this->_openTags[]=''; |
|
207 | 207 | } |
208 | 208 | else |
209 | 209 | { |
210 | 210 | $str.='>'; |
211 | - $this->_openTags[] = $tagName; |
|
211 | + $this->_openTags[]=$tagName; |
|
212 | 212 | } |
213 | 213 | $this->_writer->write($str); |
214 | 214 | $this->_attributes=array(); |
@@ -110,17 +110,17 @@ discard block |
||
110 | 110 | * Indexes for the rare fields. |
111 | 111 | * In order to save memory, rare fields will only be created if they are needed. |
112 | 112 | */ |
113 | - const RF_CONTROLS=0; // child controls |
|
114 | - const RF_CHILD_STATE=1; // child state field |
|
115 | - const RF_NAMED_CONTROLS=2; // list of controls whose namingcontainer is this control |
|
116 | - const RF_NAMED_CONTROLS_ID=3; // counter for automatic id |
|
117 | - const RF_SKIN_ID=4; // skin ID |
|
118 | - const RF_DATA_BINDINGS=5; // data bindings |
|
119 | - const RF_EVENTS=6; // event handlers |
|
120 | - const RF_CONTROLSTATE=7; // controlstate |
|
121 | - const RF_NAMED_OBJECTS=8; // controls declared with ID on template |
|
122 | - const RF_ADAPTER=9; // adapter |
|
123 | - const RF_AUTO_BINDINGS=10; // auto data bindings |
|
113 | + const RF_CONTROLS=0; // child controls |
|
114 | + const RF_CHILD_STATE=1; // child state field |
|
115 | + const RF_NAMED_CONTROLS=2; // list of controls whose namingcontainer is this control |
|
116 | + const RF_NAMED_CONTROLS_ID=3; // counter for automatic id |
|
117 | + const RF_SKIN_ID=4; // skin ID |
|
118 | + const RF_DATA_BINDINGS=5; // data bindings |
|
119 | + const RF_EVENTS=6; // event handlers |
|
120 | + const RF_CONTROLSTATE=7; // controlstate |
|
121 | + const RF_NAMED_OBJECTS=8; // controls declared with ID on template |
|
122 | + const RF_ADAPTER=9; // adapter |
|
123 | + const RF_AUTO_BINDINGS=10; // auto data bindings |
|
124 | 124 | |
125 | 125 | /** |
126 | 126 | * @var string control ID |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | public function getAdapter() |
210 | 210 | { |
211 | - return isset($this->_rf[self::RF_ADAPTER])?$this->_rf[self::RF_ADAPTER]:null; |
|
211 | + return isset($this->_rf[self::RF_ADAPTER]) ? $this->_rf[self::RF_ADAPTER] : null; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | */ |
349 | 349 | public function setID($id) |
350 | 350 | { |
351 | - if(!preg_match(self::ID_FORMAT,$id)) |
|
352 | - throw new TInvalidDataValueException('control_id_invalid',get_class($this),$id); |
|
351 | + if(!preg_match(self::ID_FORMAT, $id)) |
|
352 | + throw new TInvalidDataValueException('control_id_invalid', get_class($this), $id); |
|
353 | 353 | $this->_id=$id; |
354 | - $this->_flags |= self::IS_ID_SET; |
|
354 | + $this->_flags|=self::IS_ID_SET; |
|
355 | 355 | $this->clearCachedUniqueID($this instanceof INamingContainer); |
356 | 356 | if($this->_namingContainer) |
357 | 357 | $this->_namingContainer->clearNameTable(); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | { |
369 | 369 | if($this->_uid==='' || $this->_uid===null) // need to build the UniqueID |
370 | 370 | { |
371 | - $this->_uid=''; // set to not-null, so that clearCachedUniqueID() may take action |
|
371 | + $this->_uid=''; // set to not-null, so that clearCachedUniqueID() may take action |
|
372 | 372 | if($namingContainer=$this->getNamingContainer()) |
373 | 373 | { |
374 | 374 | if($this->getPage()===$namingContainer) |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | */ |
403 | 403 | public function getClientID() |
404 | 404 | { |
405 | - return strtr($this->getUniqueID(),self::ID_SEPARATOR,self::CLIENT_ID_SEPARATOR); |
|
405 | + return strtr($this->getUniqueID(), self::ID_SEPARATOR, self::CLIENT_ID_SEPARATOR); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | /** |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | */ |
413 | 413 | public static function convertUniqueIdToClientId($uniqueID) |
414 | 414 | { |
415 | - return strtr($uniqueID,self::ID_SEPARATOR,self::CLIENT_ID_SEPARATOR); |
|
415 | + return strtr($uniqueID, self::ID_SEPARATOR, self::CLIENT_ID_SEPARATOR); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | */ |
421 | 421 | public function getSkinID() |
422 | 422 | { |
423 | - return isset($this->_rf[self::RF_SKIN_ID])?$this->_rf[self::RF_SKIN_ID]:''; |
|
423 | + return isset($this->_rf[self::RF_SKIN_ID]) ? $this->_rf[self::RF_SKIN_ID] : ''; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | */ |
430 | 430 | public function setSkinID($value) |
431 | 431 | { |
432 | - if(($this->_flags & self::IS_SKIN_APPLIED) || $this->_stage>=self::CS_CHILD_INITIALIZED) |
|
433 | - throw new TInvalidOperationException('control_skinid_unchangeable',get_class($this)); |
|
432 | + if(($this->_flags & self::IS_SKIN_APPLIED) || $this->_stage >= self::CS_CHILD_INITIALIZED) |
|
433 | + throw new TInvalidOperationException('control_skinid_unchangeable', get_class($this)); |
|
434 | 434 | else |
435 | 435 | $this->_rf[self::RF_SKIN_ID]=$value; |
436 | 436 | } |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | if($this->_flags & self::IS_DISABLE_THEMING) |
454 | 454 | return false; |
455 | 455 | else |
456 | - return $this->_parent?$this->_parent->getEnableTheming():true; |
|
456 | + return $this->_parent ? $this->_parent->getEnableTheming() : true; |
|
457 | 457 | } |
458 | 458 | |
459 | 459 | /** |
@@ -462,12 +462,12 @@ discard block |
||
462 | 462 | */ |
463 | 463 | public function setEnableTheming($value) |
464 | 464 | { |
465 | - if($this->_stage>=self::CS_CHILD_INITIALIZED) |
|
466 | - throw new TInvalidOperationException('control_enabletheming_unchangeable',get_class($this),$this->getUniqueID()); |
|
465 | + if($this->_stage >= self::CS_CHILD_INITIALIZED) |
|
466 | + throw new TInvalidOperationException('control_enabletheming_unchangeable', get_class($this), $this->getUniqueID()); |
|
467 | 467 | else if(TPropertyValue::ensureBoolean($value)) |
468 | - $this->_flags &= ~self::IS_DISABLE_THEMING; |
|
468 | + $this->_flags&=~self::IS_DISABLE_THEMING; |
|
469 | 469 | else |
470 | - $this->_flags |= self::IS_DISABLE_THEMING; |
|
470 | + $this->_flags|=self::IS_DISABLE_THEMING; |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | */ |
480 | 480 | public function getCustomData() |
481 | 481 | { |
482 | - return $this->getViewState('CustomData',null); |
|
482 | + return $this->getViewState('CustomData', null); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | /** |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | */ |
490 | 490 | public function setCustomData($value) |
491 | 491 | { |
492 | - $this->setViewState('CustomData',$value,null); |
|
492 | + $this->setViewState('CustomData', $value, null); |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | /** |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | */ |
498 | 498 | public function getHasControls() |
499 | 499 | { |
500 | - return isset($this->_rf[self::RF_CONTROLS]) && $this->_rf[self::RF_CONTROLS]->getCount()>0; |
|
500 | + return isset($this->_rf[self::RF_CONTROLS]) && $this->_rf[self::RF_CONTROLS]->getCount() > 0; |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | /** |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | protected function createControlCollection() |
519 | 519 | { |
520 | - return $this->getAllowChildControls()?new TControlCollection($this):new TEmptyControlCollection($this); |
|
520 | + return $this->getAllowChildControls() ? new TControlCollection($this) : new TEmptyControlCollection($this); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | /** |
@@ -531,13 +531,13 @@ discard block |
||
531 | 531 | { |
532 | 532 | if($checkParents) |
533 | 533 | { |
534 | - for($control=$this;$control;$control=$control->_parent) |
|
534 | + for($control=$this; $control; $control=$control->_parent) |
|
535 | 535 | if(!$control->getVisible(false)) |
536 | 536 | return false; |
537 | 537 | return true; |
538 | 538 | } |
539 | 539 | else |
540 | - return $this->getViewState('Visible',true); |
|
540 | + return $this->getViewState('Visible', true); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | /** |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | */ |
546 | 546 | public function setVisible($value) |
547 | 547 | { |
548 | - $this->setViewState('Visible',TPropertyValue::ensureBoolean($value),true); |
|
548 | + $this->setViewState('Visible', TPropertyValue::ensureBoolean($value), true); |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | /** |
@@ -562,13 +562,13 @@ discard block |
||
562 | 562 | { |
563 | 563 | if($checkParents) |
564 | 564 | { |
565 | - for($control=$this;$control;$control=$control->_parent) |
|
566 | - if(!$control->getViewState('Enabled',true)) |
|
565 | + for($control=$this; $control; $control=$control->_parent) |
|
566 | + if(!$control->getViewState('Enabled', true)) |
|
567 | 567 | return false; |
568 | 568 | return true; |
569 | 569 | } |
570 | 570 | else |
571 | - return $this->getViewState('Enabled',true); |
|
571 | + return $this->getViewState('Enabled', true); |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | /** |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | */ |
577 | 577 | public function setEnabled($value) |
578 | 578 | { |
579 | - $this->setViewState('Enabled',TPropertyValue::ensureBoolean($value),true); |
|
579 | + $this->setViewState('Enabled', TPropertyValue::ensureBoolean($value), true); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | */ |
585 | 585 | public function getHasAttributes() |
586 | 586 | { |
587 | - if($attributes=$this->getViewState('Attributes',null)) |
|
588 | - return $attributes->getCount()>0; |
|
587 | + if($attributes=$this->getViewState('Attributes', null)) |
|
588 | + return $attributes->getCount() > 0; |
|
589 | 589 | else |
590 | 590 | return false; |
591 | 591 | } |
@@ -598,12 +598,12 @@ discard block |
||
598 | 598 | */ |
599 | 599 | public function getAttributes() |
600 | 600 | { |
601 | - if($attributes=$this->getViewState('Attributes',null)) |
|
601 | + if($attributes=$this->getViewState('Attributes', null)) |
|
602 | 602 | return $attributes; |
603 | 603 | else |
604 | 604 | { |
605 | 605 | $attributes=new TAttributeCollection; |
606 | - $this->setViewState('Attributes',$attributes,null); |
|
606 | + $this->setViewState('Attributes', $attributes, null); |
|
607 | 607 | return $attributes; |
608 | 608 | } |
609 | 609 | } |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | */ |
614 | 614 | public function hasAttribute($name) |
615 | 615 | { |
616 | - if($attributes=$this->getViewState('Attributes',null)) |
|
616 | + if($attributes=$this->getViewState('Attributes', null)) |
|
617 | 617 | return $attributes->contains($name); |
618 | 618 | else |
619 | 619 | return false; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public function getAttribute($name) |
626 | 626 | { |
627 | - if($attributes=$this->getViewState('Attributes',null)) |
|
627 | + if($attributes=$this->getViewState('Attributes', null)) |
|
628 | 628 | return $attributes->itemAt($name); |
629 | 629 | else |
630 | 630 | return null; |
@@ -635,9 +635,9 @@ discard block |
||
635 | 635 | * @param string attribute name |
636 | 636 | * @param string value of the attribute |
637 | 637 | */ |
638 | - public function setAttribute($name,$value) |
|
638 | + public function setAttribute($name, $value) |
|
639 | 639 | { |
640 | - $this->getAttributes()->add($name,$value); |
|
640 | + $this->getAttributes()->add($name, $value); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | /** |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public function removeAttribute($name) |
649 | 649 | { |
650 | - if($attributes=$this->getViewState('Attributes',null)) |
|
650 | + if($attributes=$this->getViewState('Attributes', null)) |
|
651 | 651 | return $attributes->remove($name); |
652 | 652 | else |
653 | 653 | return null; |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | { |
661 | 661 | if($checkParents) |
662 | 662 | { |
663 | - for($control=$this;$control!==null;$control=$control->getParent()) |
|
663 | + for($control=$this; $control!==null; $control=$control->getParent()) |
|
664 | 664 | if($control->_flags & self::IS_DISABLE_VIEWSTATE) |
665 | 665 | return false; |
666 | 666 | return true; |
@@ -675,9 +675,9 @@ discard block |
||
675 | 675 | public function setEnableViewState($value) |
676 | 676 | { |
677 | 677 | if(TPropertyValue::ensureBoolean($value)) |
678 | - $this->_flags &= ~self::IS_DISABLE_VIEWSTATE; |
|
678 | + $this->_flags&=~self::IS_DISABLE_VIEWSTATE; |
|
679 | 679 | else |
680 | - $this->_flags |= self::IS_DISABLE_VIEWSTATE; |
|
680 | + $this->_flags|=self::IS_DISABLE_VIEWSTATE; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | /** |
@@ -689,9 +689,9 @@ discard block |
||
689 | 689 | * @param mixed the default value. If $key is not found in controlstate, $defaultValue will be returned |
690 | 690 | * @return mixed the controlstate value corresponding to $key |
691 | 691 | */ |
692 | - protected function getControlState($key,$defaultValue=null) |
|
692 | + protected function getControlState($key, $defaultValue=null) |
|
693 | 693 | { |
694 | - return isset($this->_rf[self::RF_CONTROLSTATE][$key])?$this->_rf[self::RF_CONTROLSTATE][$key]:$defaultValue; |
|
694 | + return isset($this->_rf[self::RF_CONTROLSTATE][$key]) ? $this->_rf[self::RF_CONTROLSTATE][$key] : $defaultValue; |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | /** |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | * @param mixed the controlstate value to be set |
705 | 705 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from controlstate |
706 | 706 | */ |
707 | - protected function setControlState($key,$value,$defaultValue=null) |
|
707 | + protected function setControlState($key, $value, $defaultValue=null) |
|
708 | 708 | { |
709 | 709 | if($value===$defaultValue) |
710 | 710 | unset($this->_rf[self::RF_CONTROLSTATE][$key]); |
@@ -741,10 +741,10 @@ discard block |
||
741 | 741 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
742 | 742 | * @return mixed the viewstate value corresponding to $key |
743 | 743 | */ |
744 | - public function getViewState($key,$defaultValue=null) |
|
744 | + public function getViewState($key, $defaultValue=null) |
|
745 | 745 | { |
746 | 746 | if(isset($this->_viewState[$key])) |
747 | - return $this->_viewState[$key]!==null?$this->_viewState[$key]:$defaultValue; |
|
747 | + return $this->_viewState[$key]!==null ? $this->_viewState[$key] : $defaultValue; |
|
748 | 748 | else if(isset($this->_tempState[$key])) |
749 | 749 | { |
750 | 750 | if(is_object($this->_tempState[$key]) && $this->_trackViewState) |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | * @param mixed the viewstate value to be set |
766 | 766 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
767 | 767 | */ |
768 | - public function setViewState($key,$value,$defaultValue=null) |
|
768 | + public function setViewState($key, $value, $defaultValue=null) |
|
769 | 769 | { |
770 | 770 | if($this->_trackViewState) |
771 | 771 | { |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | * @param string the property name, or property path |
802 | 802 | * @param string the expression |
803 | 803 | */ |
804 | - public function bindProperty($name,$expression) |
|
804 | + public function bindProperty($name, $expression) |
|
805 | 805 | { |
806 | 806 | $this->_rf[self::RF_DATA_BINDINGS][$name]=$expression; |
807 | 807 | } |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | * @param string the property name, or property path |
824 | 824 | * @param string the expression |
825 | 825 | */ |
826 | - public function autoBindProperty($name,$expression) |
|
826 | + public function autoBindProperty($name, $expression) |
|
827 | 827 | { |
828 | 828 | $this->_rf[self::RF_AUTO_BINDINGS][$name]=$expression; |
829 | 829 | } |
@@ -843,13 +843,13 @@ discard block |
||
843 | 843 | */ |
844 | 844 | protected function dataBindProperties() |
845 | 845 | { |
846 | - Prado::trace("Data bind properties",'System.Web.UI.TControl'); |
|
846 | + Prado::trace("Data bind properties", 'System.Web.UI.TControl'); |
|
847 | 847 | if(isset($this->_rf[self::RF_DATA_BINDINGS])) |
848 | 848 | { |
849 | 849 | if(($context=$this->getTemplateControl())===null) |
850 | 850 | $context=$this; |
851 | 851 | foreach($this->_rf[self::RF_DATA_BINDINGS] as $property=>$expression) |
852 | - $this->setSubProperty($property,$context->evaluateExpression($expression)); |
|
852 | + $this->setSubProperty($property, $context->evaluateExpression($expression)); |
|
853 | 853 | } |
854 | 854 | } |
855 | 855 | |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | if(($context=$this->getTemplateControl())===null) |
864 | 864 | $context=$this; |
865 | 865 | foreach($this->_rf[self::RF_AUTO_BINDINGS] as $property=>$expression) |
866 | - $this->setSubProperty($property,$context->evaluateExpression($expression)); |
|
866 | + $this->setSubProperty($property, $context->evaluateExpression($expression)); |
|
867 | 867 | } |
868 | 868 | } |
869 | 869 | |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | */ |
873 | 873 | protected function dataBindChildren() |
874 | 874 | { |
875 | - Prado::trace("dataBindChildren()",'System.Web.UI.TControl'); |
|
875 | + Prado::trace("dataBindChildren()", 'System.Web.UI.TControl'); |
|
876 | 876 | if(isset($this->_rf[self::RF_CONTROLS])) |
877 | 877 | { |
878 | 878 | foreach($this->_rf[self::RF_CONTROLS] as $control) |
@@ -897,12 +897,12 @@ discard block |
||
897 | 897 | final protected function setChildControlsCreated($value) |
898 | 898 | { |
899 | 899 | if($value) |
900 | - $this->_flags |= self::IS_CHILD_CREATED; |
|
900 | + $this->_flags|=self::IS_CHILD_CREATED; |
|
901 | 901 | else |
902 | 902 | { |
903 | 903 | if($this->getHasControls() && ($this->_flags & self::IS_CHILD_CREATED)) |
904 | 904 | $this->getControls()->clear(); |
905 | - $this->_flags &= ~self::IS_CHILD_CREATED; |
|
905 | + $this->_flags&=~self::IS_CHILD_CREATED; |
|
906 | 906 | } |
907 | 907 | } |
908 | 908 | |
@@ -917,18 +917,18 @@ discard block |
||
917 | 917 | { |
918 | 918 | try |
919 | 919 | { |
920 | - $this->_flags |= self::IS_CREATING_CHILD; |
|
920 | + $this->_flags|=self::IS_CREATING_CHILD; |
|
921 | 921 | if(isset($this->_rf[self::RF_ADAPTER])) |
922 | 922 | $this->_rf[self::RF_ADAPTER]->createChildControls(); |
923 | 923 | else |
924 | 924 | $this->createChildControls(); |
925 | - $this->_flags &= ~self::IS_CREATING_CHILD; |
|
926 | - $this->_flags |= self::IS_CHILD_CREATED; |
|
925 | + $this->_flags&=~self::IS_CREATING_CHILD; |
|
926 | + $this->_flags|=self::IS_CHILD_CREATED; |
|
927 | 927 | } |
928 | 928 | catch(Exception $e) |
929 | 929 | { |
930 | - $this->_flags &= ~self::IS_CREATING_CHILD; |
|
931 | - $this->_flags |= self::IS_CHILD_CREATED; |
|
930 | + $this->_flags&=~self::IS_CREATING_CHILD; |
|
931 | + $this->_flags|=self::IS_CHILD_CREATED; |
|
932 | 932 | throw $e; |
933 | 933 | } |
934 | 934 | } |
@@ -957,21 +957,21 @@ discard block |
||
957 | 957 | */ |
958 | 958 | public function findControl($id) |
959 | 959 | { |
960 | - $id=strtr($id,'.',self::ID_SEPARATOR); |
|
961 | - $container=($this instanceof INamingContainer)?$this:$this->getNamingContainer(); |
|
960 | + $id=strtr($id, '.', self::ID_SEPARATOR); |
|
961 | + $container=($this instanceof INamingContainer) ? $this : $this->getNamingContainer(); |
|
962 | 962 | if(!$container || !$container->getHasControls()) |
963 | 963 | return null; |
964 | 964 | if(!isset($container->_rf[self::RF_NAMED_CONTROLS])) |
965 | 965 | { |
966 | 966 | $container->_rf[self::RF_NAMED_CONTROLS]=array(); |
967 | - $container->fillNameTable($container,$container->_rf[self::RF_CONTROLS]); |
|
967 | + $container->fillNameTable($container, $container->_rf[self::RF_CONTROLS]); |
|
968 | 968 | } |
969 | - if(($pos=strpos($id,self::ID_SEPARATOR))===false) |
|
970 | - return isset($container->_rf[self::RF_NAMED_CONTROLS][$id])?$container->_rf[self::RF_NAMED_CONTROLS][$id]:null; |
|
969 | + if(($pos=strpos($id, self::ID_SEPARATOR))===false) |
|
970 | + return isset($container->_rf[self::RF_NAMED_CONTROLS][$id]) ? $container->_rf[self::RF_NAMED_CONTROLS][$id] : null; |
|
971 | 971 | else |
972 | 972 | { |
973 | - $cid=substr($id,0,$pos); |
|
974 | - $sid=substr($id,$pos+1); |
|
973 | + $cid=substr($id, 0, $pos); |
|
974 | + $sid=substr($id, $pos + 1); |
|
975 | 975 | if(isset($container->_rf[self::RF_NAMED_CONTROLS][$cid])) |
976 | 976 | return $container->_rf[self::RF_NAMED_CONTROLS][$cid]->findControl($sid); |
977 | 977 | else |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | * @param boolean whether the type comparison is strict or not. If false, controls of the parent classes of the specified class will also be returned. |
986 | 986 | * @return array list of controls found |
987 | 987 | */ |
988 | - public function findControlsByType($type,$strict=true) |
|
988 | + public function findControlsByType($type, $strict=true) |
|
989 | 989 | { |
990 | 990 | $controls=array(); |
991 | 991 | if($this->getHasControls()) |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | if(is_object($control) && (get_class($control)===$type || (!$strict && ($control instanceof $type)))) |
996 | 996 | $controls[]=$control; |
997 | 997 | if(($control instanceof TControl) && $control->getHasControls()) |
998 | - $controls=array_merge($controls,$control->findControlsByType($type,$strict)); |
|
998 | + $controls=array_merge($controls, $control->findControlsByType($type, $strict)); |
|
999 | 999 | } |
1000 | 1000 | } |
1001 | 1001 | return $controls; |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | { |
1022 | 1022 | if($control->_id===$id) |
1023 | 1023 | $controls[]=$control; |
1024 | - $controls=array_merge($controls,$control->findControlsByID($id)); |
|
1024 | + $controls=array_merge($controls, $control->findControlsByID($id)); |
|
1025 | 1025 | } |
1026 | 1026 | } |
1027 | 1027 | } |
@@ -1046,10 +1046,10 @@ discard block |
||
1046 | 1046 | * @param object object to be declared |
1047 | 1047 | * @see __get |
1048 | 1048 | */ |
1049 | - public function registerObject($name,$object) |
|
1049 | + public function registerObject($name, $object) |
|
1050 | 1050 | { |
1051 | 1051 | if(isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) |
1052 | - throw new TInvalidOperationException('control_object_reregistered',$name); |
|
1052 | + throw new TInvalidOperationException('control_object_reregistered', $name); |
|
1053 | 1053 | $this->_rf[self::RF_NAMED_OBJECTS][$name]=$object; |
1054 | 1054 | } |
1055 | 1055 | |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | */ |
1122 | 1122 | public function getRegisteredObject($name) |
1123 | 1123 | { |
1124 | - return isset($this->_rf[self::RF_NAMED_OBJECTS][$name])?$this->_rf[self::RF_NAMED_OBJECTS][$name]:null; |
|
1124 | + return isset($this->_rf[self::RF_NAMED_OBJECTS][$name]) ? $this->_rf[self::RF_NAMED_OBJECTS][$name] : null; |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | /** |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | $control->_parent->getControls()->remove($control); |
1182 | 1182 | $control->_parent=$this; |
1183 | 1183 | $control->_page=$this->getPage(); |
1184 | - $namingContainer=($this instanceof INamingContainer)?$this:$this->_namingContainer; |
|
1184 | + $namingContainer=($this instanceof INamingContainer) ? $this : $this->_namingContainer; |
|
1185 | 1185 | if($namingContainer) |
1186 | 1186 | { |
1187 | 1187 | $control->_namingContainer=$namingContainer; |
@@ -1192,10 +1192,10 @@ discard block |
||
1192 | 1192 | $control->clearCachedUniqueID($control instanceof INamingContainer); |
1193 | 1193 | } |
1194 | 1194 | |
1195 | - if($this->_stage>=self::CS_CHILD_INITIALIZED) |
|
1195 | + if($this->_stage >= self::CS_CHILD_INITIALIZED) |
|
1196 | 1196 | { |
1197 | 1197 | $control->initRecursive($namingContainer); |
1198 | - if($this->_stage>=self::CS_STATE_LOADED) |
|
1198 | + if($this->_stage >= self::CS_STATE_LOADED) |
|
1199 | 1199 | { |
1200 | 1200 | if(isset($this->_rf[self::RF_CHILD_STATE][$control->_id])) |
1201 | 1201 | { |
@@ -1204,11 +1204,11 @@ discard block |
||
1204 | 1204 | } |
1205 | 1205 | else |
1206 | 1206 | $state=null; |
1207 | - $control->loadStateRecursive($state,!($this->_flags & self::IS_DISABLE_VIEWSTATE)); |
|
1208 | - if($this->_stage>=self::CS_LOADED) |
|
1207 | + $control->loadStateRecursive($state, !($this->_flags & self::IS_DISABLE_VIEWSTATE)); |
|
1208 | + if($this->_stage >= self::CS_LOADED) |
|
1209 | 1209 | { |
1210 | 1210 | $control->loadRecursive(); |
1211 | - if($this->_stage>=self::CS_PRERENDERED) |
|
1211 | + if($this->_stage >= self::CS_PRERENDERED) |
|
1212 | 1212 | $control->preRenderRecursive(); |
1213 | 1213 | } |
1214 | 1214 | } |
@@ -1262,13 +1262,13 @@ discard block |
||
1262 | 1262 | } |
1263 | 1263 | } |
1264 | 1264 | } |
1265 | - if($this->_stage<self::CS_INITIALIZED) |
|
1265 | + if($this->_stage < self::CS_INITIALIZED) |
|
1266 | 1266 | { |
1267 | 1267 | $this->_stage=self::CS_CHILD_INITIALIZED; |
1268 | 1268 | if(($page=$this->getPage()) && $this->getEnableTheming() && !($this->_flags & self::IS_SKIN_APPLIED)) |
1269 | 1269 | { |
1270 | 1270 | $page->applyControlSkin($this); |
1271 | - $this->_flags |= self::IS_SKIN_APPLIED; |
|
1271 | + $this->_flags|=self::IS_SKIN_APPLIED; |
|
1272 | 1272 | } |
1273 | 1273 | if(isset($this->_rf[self::RF_ADAPTER])) |
1274 | 1274 | $this->_rf[self::RF_ADAPTER]->onInit(null); |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | */ |
1285 | 1285 | protected function loadRecursive() |
1286 | 1286 | { |
1287 | - if($this->_stage<self::CS_LOADED) |
|
1287 | + if($this->_stage < self::CS_LOADED) |
|
1288 | 1288 | { |
1289 | 1289 | if(isset($this->_rf[self::RF_ADAPTER])) |
1290 | 1290 | $this->_rf[self::RF_ADAPTER]->onLoad(null); |
@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | $control->loadRecursive(); |
1300 | 1300 | } |
1301 | 1301 | } |
1302 | - if($this->_stage<self::CS_LOADED) |
|
1302 | + if($this->_stage < self::CS_LOADED) |
|
1303 | 1303 | $this->_stage=self::CS_LOADED; |
1304 | 1304 | } |
1305 | 1305 | |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | */ |
1361 | 1361 | public function onInit($param) |
1362 | 1362 | { |
1363 | - $this->raiseEvent('OnInit',$this,$param); |
|
1363 | + $this->raiseEvent('OnInit', $this, $param); |
|
1364 | 1364 | } |
1365 | 1365 | |
1366 | 1366 | /** |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | */ |
1373 | 1373 | public function onLoad($param) |
1374 | 1374 | { |
1375 | - $this->raiseEvent('OnLoad',$this,$param); |
|
1375 | + $this->raiseEvent('OnLoad', $this, $param); |
|
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | /** |
@@ -1382,8 +1382,8 @@ discard block |
||
1382 | 1382 | */ |
1383 | 1383 | public function onDataBinding($param) |
1384 | 1384 | { |
1385 | - Prado::trace("onDataBinding()",'System.Web.UI.TControl'); |
|
1386 | - $this->raiseEvent('OnDataBinding',$this,$param); |
|
1385 | + Prado::trace("onDataBinding()", 'System.Web.UI.TControl'); |
|
1386 | + $this->raiseEvent('OnDataBinding', $this, $param); |
|
1387 | 1387 | } |
1388 | 1388 | |
1389 | 1389 | |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | */ |
1397 | 1397 | public function onUnload($param) |
1398 | 1398 | { |
1399 | - $this->raiseEvent('OnUnload',$this,$param); |
|
1399 | + $this->raiseEvent('OnUnload', $this, $param); |
|
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | /** |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | */ |
1409 | 1409 | public function onPreRender($param) |
1410 | 1410 | { |
1411 | - $this->raiseEvent('OnPreRender',$this,$param); |
|
1411 | + $this->raiseEvent('OnPreRender', $this, $param); |
|
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | /** |
@@ -1418,12 +1418,12 @@ discard block |
||
1418 | 1418 | * @param TEventParameter event parameter |
1419 | 1419 | * @see bubbleEvent |
1420 | 1420 | */ |
1421 | - protected function raiseBubbleEvent($sender,$param) |
|
1421 | + protected function raiseBubbleEvent($sender, $param) |
|
1422 | 1422 | { |
1423 | 1423 | $control=$this; |
1424 | 1424 | while($control=$control->_parent) |
1425 | 1425 | { |
1426 | - if($control->bubbleEvent($sender,$param)) |
|
1426 | + if($control->bubbleEvent($sender, $param)) |
|
1427 | 1427 | break; |
1428 | 1428 | } |
1429 | 1429 | } |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | * @return boolean true if the event bubbling is handled and no more bubbling. |
1438 | 1438 | * @see raiseBubbleEvent |
1439 | 1439 | */ |
1440 | - public function bubbleEvent($sender,$param) |
|
1440 | + public function bubbleEvent($sender, $param) |
|
1441 | 1441 | { |
1442 | 1442 | return false; |
1443 | 1443 | } |
@@ -1458,10 +1458,10 @@ discard block |
||
1458 | 1458 | * @param TControl sender of this event |
1459 | 1459 | * @param TEventParameter event parameter |
1460 | 1460 | */ |
1461 | - public function broadcastEvent($name,$sender,$param) |
|
1461 | + public function broadcastEvent($name, $sender, $param) |
|
1462 | 1462 | { |
1463 | - $rootControl=(($page=$this->getPage())===null)?$this:$page; |
|
1464 | - $rootControl->broadcastEventInternal($name,$sender,new TBroadcastEventParameter($name,$param)); |
|
1463 | + $rootControl=(($page=$this->getPage())===null) ? $this : $page; |
|
1464 | + $rootControl->broadcastEventInternal($name, $sender, new TBroadcastEventParameter($name, $param)); |
|
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | /** |
@@ -1471,18 +1471,18 @@ discard block |
||
1471 | 1471 | * @param TControl sender of the event |
1472 | 1472 | * @param TBroadcastEventParameter event parameter |
1473 | 1473 | */ |
1474 | - private function broadcastEventInternal($name,$sender,$param) |
|
1474 | + private function broadcastEventInternal($name, $sender, $param) |
|
1475 | 1475 | { |
1476 | 1476 | if($this->hasEvent($name)) |
1477 | - $this->raiseEvent($name,$sender,$param->getParameter()); |
|
1477 | + $this->raiseEvent($name, $sender, $param->getParameter()); |
|
1478 | 1478 | if($this instanceof IBroadcastEventReceiver) |
1479 | - $this->broadcastEventReceived($sender,$param); |
|
1479 | + $this->broadcastEventReceived($sender, $param); |
|
1480 | 1480 | if($this->getHasControls()) |
1481 | 1481 | { |
1482 | 1482 | foreach($this->_rf[self::RF_CONTROLS] as $control) |
1483 | 1483 | { |
1484 | 1484 | if($control instanceof TControl) |
1485 | - $control->broadcastEventInternal($name,$sender,$param); |
|
1485 | + $control->broadcastEventInternal($name, $sender, $param); |
|
1486 | 1486 | } |
1487 | 1487 | } |
1488 | 1488 | } |
@@ -1504,22 +1504,22 @@ discard block |
||
1504 | 1504 | * @param callback callback invoked before traversing child controls. If null, it is ignored. |
1505 | 1505 | * @param callback callback invoked after traversing child controls. If null, it is ignored. |
1506 | 1506 | */ |
1507 | - protected function traverseChildControls($param,$preCallback=null,$postCallback=null) |
|
1507 | + protected function traverseChildControls($param, $preCallback=null, $postCallback=null) |
|
1508 | 1508 | { |
1509 | 1509 | if($preCallback!==null) |
1510 | - call_user_func($preCallback,$this,$param); |
|
1510 | + call_user_func($preCallback, $this, $param); |
|
1511 | 1511 | if($this->getHasControls()) |
1512 | 1512 | { |
1513 | 1513 | foreach($this->_rf[self::RF_CONTROLS] as $control) |
1514 | 1514 | { |
1515 | 1515 | if($control instanceof TControl) |
1516 | 1516 | { |
1517 | - $control->traverseChildControls($param,$preCallback,$postCallback); |
|
1517 | + $control->traverseChildControls($param, $preCallback, $postCallback); |
|
1518 | 1518 | } |
1519 | 1519 | } |
1520 | 1520 | } |
1521 | 1521 | if($postCallback!==null) |
1522 | - call_user_func($postCallback,$this,$param); |
|
1522 | + call_user_func($postCallback, $this, $param); |
|
1523 | 1523 | } |
1524 | 1524 | |
1525 | 1525 | /** |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | * @param array the collection of the state |
1597 | 1597 | * @param boolean whether the viewstate should be loaded |
1598 | 1598 | */ |
1599 | - protected function loadStateRecursive(&$state,$needViewState=true) |
|
1599 | + protected function loadStateRecursive(&$state, $needViewState=true) |
|
1600 | 1600 | { |
1601 | 1601 | if(is_array($state)) |
1602 | 1602 | { |
@@ -1626,7 +1626,7 @@ discard block |
||
1626 | 1626 | { |
1627 | 1627 | if(isset($state[$control->_id])) |
1628 | 1628 | { |
1629 | - $control->loadStateRecursive($state[$control->_id],$needViewState); |
|
1629 | + $control->loadStateRecursive($state[$control->_id], $needViewState); |
|
1630 | 1630 | unset($state[$control->_id]); |
1631 | 1631 | } |
1632 | 1632 | } |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | { |
1663 | 1663 | if($control instanceof TControl) |
1664 | 1664 | { |
1665 | - if(count($tmp = &$control->saveStateRecursive($needViewState))) |
|
1665 | + if(count($tmp=&$control->saveStateRecursive($needViewState))) |
|
1666 | 1666 | $state[$control->_id]=$tmp; |
1667 | 1667 | } |
1668 | 1668 | } |
@@ -1684,10 +1684,10 @@ discard block |
||
1684 | 1684 | if($page && !($this->_flags & self::IS_STYLESHEET_APPLIED)) |
1685 | 1685 | { |
1686 | 1686 | $page->applyControlStyleSheet($this); |
1687 | - $this->_flags |= self::IS_STYLESHEET_APPLIED; |
|
1687 | + $this->_flags|=self::IS_STYLESHEET_APPLIED; |
|
1688 | 1688 | } |
1689 | 1689 | else if($this->_flags & self::IS_STYLESHEET_APPLIED) |
1690 | - throw new TInvalidOperationException('control_stylesheet_applied',get_class($this)); |
|
1690 | + throw new TInvalidOperationException('control_stylesheet_applied', get_class($this)); |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | /** |
@@ -1711,11 +1711,11 @@ discard block |
||
1711 | 1711 | */ |
1712 | 1712 | private function generateAutomaticID() |
1713 | 1713 | { |
1714 | - $this->_flags &= ~self::IS_ID_SET; |
|
1714 | + $this->_flags&=~self::IS_ID_SET; |
|
1715 | 1715 | if(!isset($this->_namingContainer->_rf[self::RF_NAMED_CONTROLS_ID])) |
1716 | 1716 | $this->_namingContainer->_rf[self::RF_NAMED_CONTROLS_ID]=0; |
1717 | 1717 | $id=$this->_namingContainer->_rf[self::RF_NAMED_CONTROLS_ID]++; |
1718 | - $this->_id=self::AUTOMATIC_ID_PREFIX . $id; |
|
1718 | + $this->_id=self::AUTOMATIC_ID_PREFIX.$id; |
|
1719 | 1719 | $this->_namingContainer->clearNameTable(); |
1720 | 1720 | } |
1721 | 1721 | |
@@ -1733,7 +1733,7 @@ discard block |
||
1733 | 1733 | * @param TControlCollection list of controls |
1734 | 1734 | * @throws TInvalidDataValueException if a control's ID is not unique within its naming container. |
1735 | 1735 | */ |
1736 | - private function fillNameTable($container,$controls) |
|
1736 | + private function fillNameTable($container, $controls) |
|
1737 | 1737 | { |
1738 | 1738 | foreach($controls as $control) |
1739 | 1739 | { |
@@ -1742,12 +1742,12 @@ discard block |
||
1742 | 1742 | if($control->_id!=='') |
1743 | 1743 | { |
1744 | 1744 | if(isset($container->_rf[self::RF_NAMED_CONTROLS][$control->_id])) |
1745 | - throw new TInvalidDataValueException('control_id_nonunique',get_class($control),$control->_id); |
|
1745 | + throw new TInvalidDataValueException('control_id_nonunique', get_class($control), $control->_id); |
|
1746 | 1746 | else |
1747 | 1747 | $container->_rf[self::RF_NAMED_CONTROLS][$control->_id]=$control; |
1748 | 1748 | } |
1749 | 1749 | if(!($control instanceof INamingContainer) && $control->getHasControls()) |
1750 | - $this->fillNameTable($container,$control->_rf[self::RF_CONTROLS]); |
|
1750 | + $this->fillNameTable($container, $control->_rf[self::RF_CONTROLS]); |
|
1751 | 1751 | } |
1752 | 1752 | } |
1753 | 1753 | } |
@@ -1777,10 +1777,10 @@ discard block |
||
1777 | 1777 | * @param TControl the control that owns this collection. |
1778 | 1778 | * @param boolean whether the list is read-only |
1779 | 1779 | */ |
1780 | - public function __construct(TControl $owner,$readOnly=false) |
|
1780 | + public function __construct(TControl $owner, $readOnly=false) |
|
1781 | 1781 | { |
1782 | 1782 | $this->_o=$owner; |
1783 | - parent::__construct(null,$readOnly); |
|
1783 | + parent::__construct(null, $readOnly); |
|
1784 | 1784 | } |
1785 | 1785 | |
1786 | 1786 | /** |
@@ -1799,15 +1799,15 @@ discard block |
||
1799 | 1799 | * @param mixed new item |
1800 | 1800 | * @throws TInvalidDataTypeException if the item to be inserted is neither a string nor a TControl. |
1801 | 1801 | */ |
1802 | - public function insertAt($index,$item) |
|
1802 | + public function insertAt($index, $item) |
|
1803 | 1803 | { |
1804 | 1804 | if($item instanceof TControl) |
1805 | 1805 | { |
1806 | - parent::insertAt($index,$item); |
|
1806 | + parent::insertAt($index, $item); |
|
1807 | 1807 | $this->_o->addedControl($item); |
1808 | 1808 | } |
1809 | 1809 | else if(is_string($item) || ($item instanceof IRenderable)) |
1810 | - parent::insertAt($index,$item); |
|
1810 | + parent::insertAt($index, $item); |
|
1811 | 1811 | else |
1812 | 1812 | throw new TInvalidDataTypeException('controlcollection_control_required'); |
1813 | 1813 | } |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | */ |
1857 | 1857 | public function __construct(TControl $owner) |
1858 | 1858 | { |
1859 | - parent::__construct($owner,true); |
|
1859 | + parent::__construct($owner, true); |
|
1860 | 1860 | } |
1861 | 1861 | |
1862 | 1862 | /** |
@@ -1865,10 +1865,10 @@ discard block |
||
1865 | 1865 | * @param integer the speicified position. |
1866 | 1866 | * @param mixed new item |
1867 | 1867 | */ |
1868 | - public function insertAt($index,$item) |
|
1868 | + public function insertAt($index, $item) |
|
1869 | 1869 | { |
1870 | 1870 | if(!is_string($item)) // string is possible if property tag is used. we simply ignore it in this case |
1871 | - parent::insertAt($index,$item); // this will generate an exception in parent implementation |
|
1871 | + parent::insertAt($index, $item); // this will generate an exception in parent implementation |
|
1872 | 1872 | } |
1873 | 1873 | } |
1874 | 1874 | |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | * @param array the input data collection |
1924 | 1924 | * @return boolean whether the data of the control has been changed |
1925 | 1925 | */ |
1926 | - public function loadPostData($key,$values); |
|
1926 | + public function loadPostData($key, $values); |
|
1927 | 1927 | /** |
1928 | 1928 | * Raises postdata changed event. |
1929 | 1929 | * The implementation of this function should raise appropriate event(s) (e.g. OnTextChanged) |
@@ -2019,7 +2019,7 @@ discard block |
||
2019 | 2019 | * @param TControl sender of the event |
2020 | 2020 | * @param TBroadCastEventParameter event parameter |
2021 | 2021 | */ |
2022 | - public function broadcastEventReceived($sender,$param); |
|
2022 | + public function broadcastEventReceived($sender, $param); |
|
2023 | 2023 | } |
2024 | 2024 | |
2025 | 2025 | /** |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | * @param string name of the broadcast event |
2193 | 2193 | * @param mixed parameter of the broadcast event |
2194 | 2194 | */ |
2195 | - public function __construct($name='',$parameter=null) |
|
2195 | + public function __construct($name='', $parameter=null) |
|
2196 | 2196 | { |
2197 | 2197 | $this->_name=$name; |
2198 | 2198 | $this->_param=$parameter; |
@@ -2253,7 +2253,7 @@ discard block |
||
2253 | 2253 | * @param string name of the command |
2254 | 2254 | * @param string parameter of the command |
2255 | 2255 | */ |
2256 | - public function __construct($name='',$parameter='') |
|
2256 | + public function __construct($name='', $parameter='') |
|
2257 | 2257 | { |
2258 | 2258 | $this->_name=$name; |
2259 | 2259 | $this->_param=$parameter; |
@@ -2345,7 +2345,7 @@ discard block |
||
2345 | 2345 | */ |
2346 | 2346 | public function evaluateDynamicContent() |
2347 | 2347 | { |
2348 | - $context=$this->_container===null?$this:$this->_container; |
|
2348 | + $context=$this->_container===null ? $this : $this->_container; |
|
2349 | 2349 | foreach($this->_expressions as $id=>$expression) |
2350 | 2350 | $this->_items[$id]=$context->evaluateExpression($expression); |
2351 | 2351 | foreach($this->_statements as $id=>$statement) |
@@ -2358,7 +2358,7 @@ discard block |
||
2358 | 2358 | */ |
2359 | 2359 | public function dataBind() |
2360 | 2360 | { |
2361 | - $context=$this->_container===null?$this:$this->_container; |
|
2361 | + $context=$this->_container===null ? $this : $this->_container; |
|
2362 | 2362 | foreach($this->_bindings as $id=>$binding) |
2363 | 2363 | $this->_items[$id]=$context->evaluateExpression($binding); |
2364 | 2364 | } |
@@ -2370,7 +2370,7 @@ discard block |
||
2370 | 2370 | */ |
2371 | 2371 | public function render($writer) |
2372 | 2372 | { |
2373 | - $writer->write(implode('',$this->_items)); |
|
2373 | + $writer->write(implode('', $this->_items)); |
|
2374 | 2374 | } |
2375 | 2375 | } |
2376 | 2376 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getWidgetID() |
67 | 67 | { |
68 | - return $this->getClientID() . '_0'; |
|
68 | + return $this->getClientID().'_0'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function getOptions() |
76 | 76 | { |
77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
78 | 78 | { |
79 | 79 | $options=new TJuiControlOptions($this); |
80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function getPostBackOptions() |
107 | 107 | { |
108 | - $options = $this->getOptions()->toArray(); |
|
108 | + $options=$this->getOptions()->toArray(); |
|
109 | 109 | // overload the "OnStop" event to add information about the current selected items |
110 | 110 | if(isset($options['stop'])) |
111 | 111 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | protected function addAttributesToRender($writer) |
122 | 122 | { |
123 | 123 | parent::addAttributesToRender($writer); |
124 | - $writer->addAttribute('id',$this->getClientID()); |
|
124 | + $writer->addAttribute('id', $this->getClientID()); |
|
125 | 125 | $options=TJavascript::encode($this->getPostBackOptions()); |
126 | 126 | $cs=$this->getPage()->getClientScript(); |
127 | 127 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * Raises the OnCreate event |
143 | 143 | * @param object $params event parameters |
144 | 144 | */ |
145 | - public function onCreate ($params) |
|
145 | + public function onCreate($params) |
|
146 | 146 | { |
147 | 147 | $this->raiseEvent('OnCreate', $this, $params); |
148 | 148 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * Raises the OnSelected event |
152 | 152 | * @param object $params event parameters |
153 | 153 | */ |
154 | - public function onSelected ($params) |
|
154 | + public function onSelected($params) |
|
155 | 155 | { |
156 | 156 | $this->raiseEvent('OnSelected', $this, $params); |
157 | 157 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * Raises the OnSelecting event |
161 | 161 | * @param object $params event parameters |
162 | 162 | */ |
163 | - public function onSelecting ($params) |
|
163 | + public function onSelecting($params) |
|
164 | 164 | { |
165 | 165 | $this->raiseEvent('OnSelecting', $this, $params); |
166 | 166 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * Raises the OnStart event |
170 | 170 | * @param object $params event parameters |
171 | 171 | */ |
172 | - public function onStart ($params) |
|
172 | + public function onStart($params) |
|
173 | 173 | { |
174 | 174 | $this->raiseEvent('OnStart', $this, $params); |
175 | 175 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * Raises the OnStop event |
179 | 179 | * @param object $params event parameters |
180 | 180 | */ |
181 | - public function onStop ($params) |
|
181 | + public function onStop($params) |
|
182 | 182 | { |
183 | 183 | $this->raiseEvent('OnStop', $this, $params); |
184 | 184 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * Raises the OnUnselected event |
188 | 188 | * @param object $params event parameters |
189 | 189 | */ |
190 | - public function onUnselected ($params) |
|
190 | + public function onUnselected($params) |
|
191 | 191 | { |
192 | 192 | $this->raiseEvent('OnUnselected', $this, $params); |
193 | 193 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * Raises the OnUnselecting event |
197 | 197 | * @param object $params event parameters |
198 | 198 | */ |
199 | - public function onUnselecting ($params) |
|
199 | + public function onUnselecting($params) |
|
200 | 200 | { |
201 | 201 | $this->raiseEvent('OnUnselecting', $this, $params); |
202 | 202 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | public function getSelectables() |
232 | 232 | { |
233 | 233 | if($this->_repeater===null) |
234 | - $this->_repeater = $this->createRepeater(); |
|
234 | + $this->_repeater=$this->createRepeater(); |
|
235 | 235 | return $this->_repeater; |
236 | 236 | } |
237 | 237 | |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | */ |
241 | 241 | protected function createRepeater() |
242 | 242 | { |
243 | - $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
243 | + $repeater=Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
244 | 244 | $repeater->setHeaderTemplate(new TJuiSelectableTemplate('<ul id="'.$this->getWidgetID().'">')); |
245 | 245 | $repeater->setFooterTemplate(new TJuiSelectableTemplate('</ul>')); |
246 | - $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>',null)); |
|
246 | + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>', null)); |
|
247 | 247 | $repeater->setEmptyTemplate(new TJuiSelectableTemplate('<ul></ul>')); |
248 | 248 | $this->getControls()->add($repeater); |
249 | 249 | return $repeater; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | public function __construct($template) |
268 | 268 | { |
269 | - $this->_template = $template; |
|
269 | + $this->_template=$template; |
|
270 | 270 | } |
271 | 271 | /** |
272 | 272 | * Instantiates the template. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function getOptions() |
76 | 76 | { |
77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
78 | 78 | { |
79 | 79 | $options=new TJuiControlOptions($this); |
80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function getPostBackOptions() |
107 | 107 | { |
108 | - $options = $this->getOptions()->toArray(); |
|
108 | + $options=$this->getOptions()->toArray(); |
|
109 | 109 | return $options; |
110 | 110 | } |
111 | 111 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | parent::addAttributesToRender($writer); |
119 | 119 | |
120 | - $writer->addAttribute('id',$this->getClientID()); |
|
120 | + $writer->addAttribute('id', $this->getClientID()); |
|
121 | 121 | $options=TJavascript::encode($this->getPostBackOptions()); |
122 | 122 | $cs=$this->getPage()->getClientScript(); |
123 | 123 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * Raises the OnCreate event |
139 | 139 | * @param object $params event parameters |
140 | 140 | */ |
141 | - public function onCreate ($params) |
|
141 | + public function onCreate($params) |
|
142 | 142 | { |
143 | 143 | $this->raiseEvent('OnCreate', $this, $params); |
144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * Raises the OnResize event |
148 | 148 | * @param object $params event parameters |
149 | 149 | */ |
150 | - public function onResize ($params) |
|
150 | + public function onResize($params) |
|
151 | 151 | { |
152 | 152 | $this->raiseEvent('OnResize', $this, $params); |
153 | 153 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * Raises the OnStart event |
157 | 157 | * @param object $params event parameters |
158 | 158 | */ |
159 | - public function onStart ($params) |
|
159 | + public function onStart($params) |
|
160 | 160 | { |
161 | 161 | $this->raiseEvent('OnStart', $this, $params); |
162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * Raises the OnStop event |
166 | 166 | * @param object $params event parameters |
167 | 167 | */ |
168 | - public function onStop ($params) |
|
168 | + public function onStop($params) |
|
169 | 169 | { |
170 | 170 | $this->raiseEvent('OnStop', $this, $params); |
171 | 171 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * it will register an additional clientscript to set the language specific global default settings. |
40 | 40 | * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise |
41 | 41 | */ |
42 | - private static $_first = true; |
|
42 | + private static $_first=true; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Creates a new callback control, sets the adapter to |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function getOptions() |
76 | 76 | { |
77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
78 | 78 | { |
79 | 79 | $options=new TJuiControlOptions($this); |
80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function getCurrentCulture() |
170 | 170 | { |
171 | - $app = $this->getApplication()->getGlobalization(false); |
|
172 | - return $this->getCulture() == '' ? |
|
171 | + $app=$this->getApplication()->getGlobalization(false); |
|
172 | + return $this->getCulture()=='' ? |
|
173 | 173 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
174 | 174 | } |
175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function getDateFormat() |
180 | 180 | { |
181 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
181 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function setDateFormat($value) |
189 | 189 | { |
190 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
190 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | $this->setText(''); |
254 | 254 | else |
255 | 255 | { |
256 | - $date = TPropertyValue::ensureFloat($value); |
|
257 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat()); |
|
256 | + $date=TPropertyValue::ensureFloat($value); |
|
257 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat()); |
|
258 | 258 | $this->setText($formatter->format($date)); |
259 | 259 | } |
260 | 260 | } |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | */ |
266 | 266 | protected function getTimeStampFromText() |
267 | 267 | { |
268 | - $pattern = $this->getDateFormat(); |
|
269 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
270 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern); |
|
268 | + $pattern=$this->getDateFormat(); |
|
269 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
270 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
271 | 271 | return $formatter->parse($this->getText()); |
272 | 272 | } |
273 | 273 | |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function getValidationPropertyValue() |
280 | 280 | { |
281 | - if(($text = $this->getText()) === '') |
|
281 | + if(($text=$this->getText())==='') |
|
282 | 282 | return ''; |
283 | - $date = $this->getTimeStamp(); |
|
284 | - return $date == null ? $text : $date; |
|
283 | + $date=$this->getTimeStamp(); |
|
284 | + return $date==null ? $text : $date; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | } |
288 | 288 | \ No newline at end of file |