@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | if(count($params) > 0) |
105 | 105 | { |
106 | - if ($params[0] instanceof ISurroundable) |
|
106 | + if($params[0] instanceof ISurroundable) |
|
107 | 107 | $params[0] = $params[0]->getSurroundingTagID(); |
108 | 108 | elseif($params[0] instanceof TControl) |
109 | 109 | $params[0] = $params[0]->getClientID(); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function jQuery($element, $method, $params = []) |
121 | 121 | { |
122 | - if ($element instanceof ISurroundable) |
|
122 | + if($element instanceof ISurroundable) |
|
123 | 123 | $element = $element->getSurroundingTagID(); |
124 | 124 | elseif($element instanceof TControl) |
125 | 125 | $element = $element->getClientID(); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | public function setAttribute($control, $name, $value) |
226 | 226 | { |
227 | 227 | // Attributes should be applied on Surrounding tag, except for 'disabled' attribute |
228 | - if ($control instanceof ISurroundable && strtolower($name) !== 'disabled') |
|
228 | + if($control instanceof ISurroundable && strtolower($name) !== 'disabled') |
|
229 | 229 | $control = $control->getSurroundingTagID(); |
230 | 230 | $this->callClientFunction('Prado.Element.setAttribute', [$control, $name, $value]); |
231 | 231 | } |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | foreach($items as $item) |
254 | 254 | { |
255 | 255 | if($item->getHasAttributes()) |
256 | - $options[] = [$item->getText(),$item->getValue(), $item->getAttributes()->itemAt('Group')]; |
|
256 | + $options[] = [$item->getText(), $item->getValue(), $item->getAttributes()->itemAt('Group')]; |
|
257 | 257 | else |
258 | - $options[] = [$item->getText(),$item->getValue()]; |
|
258 | + $options[] = [$item->getText(), $item->getValue()]; |
|
259 | 259 | } |
260 | 260 | $this->callClientFunction('Prado.Element.setOptions', [$control, $options]); |
261 | 261 | } |
@@ -114,17 +114,17 @@ discard block |
||
114 | 114 | * Indexes for the rare fields. |
115 | 115 | * In order to save memory, rare fields will only be created if they are needed. |
116 | 116 | */ |
117 | - const RF_CONTROLS = 0; // child controls |
|
118 | - const RF_CHILD_STATE = 1; // child state field |
|
119 | - const RF_NAMED_CONTROLS = 2; // list of controls whose namingcontainer is this control |
|
120 | - const RF_NAMED_CONTROLS_ID = 3; // counter for automatic id |
|
121 | - const RF_SKIN_ID = 4; // skin ID |
|
122 | - const RF_DATA_BINDINGS = 5; // data bindings |
|
123 | - const RF_EVENTS = 6; // event handlers |
|
124 | - const RF_CONTROLSTATE = 7; // controlstate |
|
125 | - const RF_NAMED_OBJECTS = 8; // controls declared with ID on template |
|
126 | - const RF_ADAPTER = 9; // adapter |
|
127 | - const RF_AUTO_BINDINGS = 10; // auto data bindings |
|
117 | + const RF_CONTROLS = 0; // child controls |
|
118 | + const RF_CHILD_STATE = 1; // child state field |
|
119 | + const RF_NAMED_CONTROLS = 2; // list of controls whose namingcontainer is this control |
|
120 | + const RF_NAMED_CONTROLS_ID = 3; // counter for automatic id |
|
121 | + const RF_SKIN_ID = 4; // skin ID |
|
122 | + const RF_DATA_BINDINGS = 5; // data bindings |
|
123 | + const RF_EVENTS = 6; // event handlers |
|
124 | + const RF_CONTROLSTATE = 7; // controlstate |
|
125 | + const RF_NAMED_OBJECTS = 8; // controls declared with ID on template |
|
126 | + const RF_ADAPTER = 9; // adapter |
|
127 | + const RF_AUTO_BINDINGS = 10; // auto data bindings |
|
128 | 128 | |
129 | 129 | /** |
130 | 130 | * @var string control ID |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function getAdapter() |
239 | 239 | { |
240 | - return isset($this->_rf[self::RF_ADAPTER])?$this->_rf[self::RF_ADAPTER]:null; |
|
240 | + return isset($this->_rf[self::RF_ADAPTER]) ? $this->_rf[self::RF_ADAPTER] : null; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | { |
398 | 398 | if($this->_uid === '' || $this->_uid === null) // need to build the UniqueID |
399 | 399 | { |
400 | - $this->_uid = ''; // set to not-null, so that clearCachedUniqueID() may take action |
|
400 | + $this->_uid = ''; // set to not-null, so that clearCachedUniqueID() may take action |
|
401 | 401 | if($namingContainer = $this->getNamingContainer()) |
402 | 402 | { |
403 | 403 | if($this->getPage() === $namingContainer) |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function getSkinID() |
451 | 451 | { |
452 | - return isset($this->_rf[self::RF_SKIN_ID])?$this->_rf[self::RF_SKIN_ID]:''; |
|
452 | + return isset($this->_rf[self::RF_SKIN_ID]) ? $this->_rf[self::RF_SKIN_ID] : ''; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | /** |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | if($this->_flags & self::IS_DISABLE_THEMING) |
483 | 483 | return false; |
484 | 484 | else |
485 | - return $this->_parent?$this->_parent->getEnableTheming():true; |
|
485 | + return $this->_parent ? $this->_parent->getEnableTheming() : true; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | /** |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | */ |
547 | 547 | protected function createControlCollection() |
548 | 548 | { |
549 | - return $this->getAllowChildControls()?new TControlCollection($this):new TEmptyControlCollection($this); |
|
549 | + return $this->getAllowChildControls() ? new TControlCollection($this) : new TEmptyControlCollection($this); |
|
550 | 550 | } |
551 | 551 | |
552 | 552 | /** |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | { |
561 | 561 | if($checkParents) |
562 | 562 | { |
563 | - for($control = $this;$control;$control = $control->_parent) |
|
563 | + for($control = $this; $control; $control = $control->_parent) |
|
564 | 564 | if(!$control->getVisible(false)) |
565 | 565 | return false; |
566 | 566 | return true; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | { |
592 | 592 | if($checkParents) |
593 | 593 | { |
594 | - for($control = $this;$control;$control = $control->_parent) |
|
594 | + for($control = $this; $control; $control = $control->_parent) |
|
595 | 595 | if(!$control->getViewState('Enabled', true)) |
596 | 596 | return false; |
597 | 597 | return true; |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | { |
690 | 690 | if($checkParents) |
691 | 691 | { |
692 | - for($control = $this;$control !== null;$control = $control->getParent()) |
|
692 | + for($control = $this; $control !== null; $control = $control->getParent()) |
|
693 | 693 | if($control->_flags & self::IS_DISABLE_VIEWSTATE) |
694 | 694 | return false; |
695 | 695 | return true; |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | */ |
721 | 721 | protected function getControlState($key, $defaultValue = null) |
722 | 722 | { |
723 | - return isset($this->_rf[self::RF_CONTROLSTATE][$key])?$this->_rf[self::RF_CONTROLSTATE][$key]:$defaultValue; |
|
723 | + return isset($this->_rf[self::RF_CONTROLSTATE][$key]) ? $this->_rf[self::RF_CONTROLSTATE][$key] : $defaultValue; |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | /** |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | public function getViewState($key, $defaultValue = null) |
774 | 774 | { |
775 | 775 | if(isset($this->_viewState[$key])) |
776 | - return $this->_viewState[$key] !== null?$this->_viewState[$key]:$defaultValue; |
|
776 | + return $this->_viewState[$key] !== null ? $this->_viewState[$key] : $defaultValue; |
|
777 | 777 | elseif(isset($this->_tempState[$key])) |
778 | 778 | { |
779 | 779 | if(is_object($this->_tempState[$key]) && $this->_trackViewState) |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | $this->_flags &= ~self::IS_CREATING_CHILD; |
952 | 952 | $this->_flags |= self::IS_CHILD_CREATED; |
953 | 953 | } |
954 | - catch(Exception $e) |
|
954 | + catch (Exception $e) |
|
955 | 955 | { |
956 | 956 | $this->_flags &= ~self::IS_CREATING_CHILD; |
957 | 957 | $this->_flags |= self::IS_CHILD_CREATED; |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | public function findControl($id) |
985 | 985 | { |
986 | 986 | $id = strtr($id, '.', self::ID_SEPARATOR); |
987 | - $container = ($this instanceof INamingContainer)?$this:$this->getNamingContainer(); |
|
987 | + $container = ($this instanceof INamingContainer) ? $this : $this->getNamingContainer(); |
|
988 | 988 | if(!$container || !$container->getHasControls()) |
989 | 989 | return null; |
990 | 990 | if(!isset($container->_rf[self::RF_NAMED_CONTROLS])) |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | $container->fillNameTable($container, $container->_rf[self::RF_CONTROLS]); |
994 | 994 | } |
995 | 995 | if(($pos = strpos($id, self::ID_SEPARATOR)) === false) |
996 | - return isset($container->_rf[self::RF_NAMED_CONTROLS][$id])?$container->_rf[self::RF_NAMED_CONTROLS][$id]:null; |
|
996 | + return isset($container->_rf[self::RF_NAMED_CONTROLS][$id]) ? $container->_rf[self::RF_NAMED_CONTROLS][$id] : null; |
|
997 | 997 | else |
998 | 998 | { |
999 | 999 | $cid = substr($id, 0, $pos); |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | */ |
1148 | 1148 | public function getRegisteredObject($name) |
1149 | 1149 | { |
1150 | - return isset($this->_rf[self::RF_NAMED_OBJECTS][$name])?$this->_rf[self::RF_NAMED_OBJECTS][$name]:null; |
|
1150 | + return isset($this->_rf[self::RF_NAMED_OBJECTS][$name]) ? $this->_rf[self::RF_NAMED_OBJECTS][$name] : null; |
|
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | /** |
@@ -1207,7 +1207,7 @@ discard block |
||
1207 | 1207 | $control->_parent->getControls()->remove($control); |
1208 | 1208 | $control->_parent = $this; |
1209 | 1209 | $control->_page = $this->getPage(); |
1210 | - $namingContainer = ($this instanceof INamingContainer)?$this:$this->_namingContainer; |
|
1210 | + $namingContainer = ($this instanceof INamingContainer) ? $this : $this->_namingContainer; |
|
1211 | 1211 | if($namingContainer) |
1212 | 1212 | { |
1213 | 1213 | $control->_namingContainer = $namingContainer; |
@@ -1486,7 +1486,7 @@ discard block |
||
1486 | 1486 | */ |
1487 | 1487 | public function broadcastEvent($name, $sender, $param) |
1488 | 1488 | { |
1489 | - $rootControl = (($page = $this->getPage()) === null)?$this:$page; |
|
1489 | + $rootControl = (($page = $this->getPage()) === null) ? $this : $page; |
|
1490 | 1490 | $rootControl->broadcastEventInternal($name, $sender, new TBroadcastEventParameter($name, $param)); |
1491 | 1491 | } |
1492 | 1492 |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | elseif($skin[0] !== -1) |
153 | 153 | throw new TConfigurationException('theme_control_nested', $skin[1], dirname($themePath)); |
154 | 154 | $type = $skin[1]; |
155 | - $id = isset($skin[2]['skinid'])?$skin[2]['skinid']:0; |
|
155 | + $id = isset($skin[2]['skinid']) ? $skin[2]['skinid'] : 0; |
|
156 | 156 | unset($skin[2]['skinid']); |
157 | 157 | if(isset($this->_skins[$type][$id])) |
158 | 158 | throw new TConfigurationException('theme_skinid_duplicated', $type, $id, dirname($themePath)); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | sort($this->_cssFiles); |
172 | 172 | sort($this->_jsFiles); |
173 | 173 | if($cache !== null) |
174 | - $cache->set(self::THEME_CACHE_PREFIX . $themePath, [$this->_skins,$this->_cssFiles,$this->_jsFiles,time()]); |
|
174 | + $cache->set(self::THEME_CACHE_PREFIX . $themePath, [$this->_skins, $this->_cssFiles, $this->_jsFiles, time()]); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 |
@@ -102,7 +102,7 @@ |
||
102 | 102 | * @param string|null $class Theme class name in namespace format |
103 | 103 | */ |
104 | 104 | public function setThemeClass($class) { |
105 | - $this->_themeClass = $class === null ? self::DEFAULT_THEMECLASS : (string)$class; |
|
105 | + $this->_themeClass = $class === null ? self::DEFAULT_THEMECLASS : (string) $class; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getOptions() |
81 | 81 | { |
82 | - if (($options = $this->getViewState('JuiOptions')) === null) |
|
82 | + if(($options = $this->getViewState('JuiOptions')) === null) |
|
83 | 83 | { |
84 | 84 | $options = new TJuiControlOptions($this); |
85 | 85 | $this->setViewState('JuiOptions', $options); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * Raises the OnCreate event |
144 | 144 | * @param object $params event parameters |
145 | 145 | */ |
146 | - public function onCreate ($params) |
|
146 | + public function onCreate($params) |
|
147 | 147 | { |
148 | 148 | $this->raiseEvent('OnCreate', $this, $params); |
149 | 149 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * Raises the OnResize event |
153 | 153 | * @param object $params event parameters |
154 | 154 | */ |
155 | - public function onResize ($params) |
|
155 | + public function onResize($params) |
|
156 | 156 | { |
157 | 157 | $this->raiseEvent('OnResize', $this, $params); |
158 | 158 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * Raises the OnStart event |
162 | 162 | * @param object $params event parameters |
163 | 163 | */ |
164 | - public function onStart ($params) |
|
164 | + public function onStart($params) |
|
165 | 165 | { |
166 | 166 | $this->raiseEvent('OnStart', $this, $params); |
167 | 167 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * Raises the OnStop event |
171 | 171 | * @param object $params event parameters |
172 | 172 | */ |
173 | - public function onStop ($params) |
|
173 | + public function onStop($params) |
|
174 | 174 | { |
175 | 175 | $this->raiseEvent('OnStop', $this, $params); |
176 | 176 | } |
@@ -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); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | { |
382 | 382 | $items->itemAt($i)->render($writer); |
383 | 383 | $item = $writer->flush(); |
384 | - $data[] = [ 'id' => $i, 'label' => $item]; |
|
384 | + $data[] = ['id' => $i, 'label' => $item]; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -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); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | protected function getTimeStampFromText() |
277 | 277 | { |
278 | 278 | $pattern = $this->getDateFormat(); |
279 | - $pattern = str_replace(['MMMM', 'MMM'], ['MM','MM'], $pattern); |
|
279 | + $pattern = str_replace(['MMMM', 'MMM'], ['MM', 'MM'], $pattern); |
|
280 | 280 | $formatter = new TSimpleDateFormatter($pattern); |
281 | 281 | return $formatter->parse($this->getText()); |
282 | 282 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | */ |
84 | 84 | public function getOptions() |
85 | 85 | { |
86 | - if (($options = $this->getViewState('JuiOptions')) === null) |
|
86 | + if(($options = $this->getViewState('JuiOptions')) === null) |
|
87 | 87 | { |
88 | 88 | $options = new TJuiControlOptions($this); |
89 | 89 | $this->setViewState('JuiOptions', $options); |
@@ -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); |
@@ -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 | } |