@@ -57,9 +57,9 @@ |
||
57 | 57 | * @param array the input data collection |
58 | 58 | * @return boolean whether the data of the control has been changed |
59 | 59 | */ |
60 | - public function loadPostData($key,$values) |
|
60 | + public function loadPostData($key, $values) |
|
61 | 61 | { |
62 | - $value=isset($values[$key])?$values[$key]:''; |
|
62 | + $value=isset($values[$key]) ? $values[$key] : ''; |
|
63 | 63 | $oldSelection=$this->getSelectedIndex(); |
64 | 64 | $this->ensureDataBound(); |
65 | 65 | foreach($this->getItems() as $index=>$item) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getDisplay() |
56 | 56 | { |
57 | - return $this->getViewState('Display',TValidationSummaryDisplayStyle::Fixed); |
|
57 | + return $this->getViewState('Display', TValidationSummaryDisplayStyle::Fixed); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function setDisplay($value) |
64 | 64 | { |
65 | - $this->setViewState('Display',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayStyle'),TValidationSummaryDisplayStyle::Fixed); |
|
65 | + $this->setViewState('Display', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayStyle'), TValidationSummaryDisplayStyle::Fixed); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getHeaderText() |
72 | 72 | { |
73 | - return $this->getViewState('HeaderText',''); |
|
73 | + return $this->getViewState('HeaderText', ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setHeaderText($value) |
81 | 81 | { |
82 | - $this->setViewState('HeaderText',$value,''); |
|
82 | + $this->setViewState('HeaderText', $value, ''); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getDisplayMode() |
89 | 89 | { |
90 | - return $this->getViewState('DisplayMode',TValidationSummaryDisplayMode::BulletList); |
|
90 | + return $this->getViewState('DisplayMode', TValidationSummaryDisplayMode::BulletList); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setDisplayMode($value) |
97 | 97 | { |
98 | - $this->setViewState('DisplayMode',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayMode'),TValidationSummaryDisplayMode::BulletList); |
|
98 | + $this->setViewState('DisplayMode', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayMode'), TValidationSummaryDisplayMode::BulletList); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getEnableClientScript() |
105 | 105 | { |
106 | - return $this->getViewState('EnableClientScript',true); |
|
106 | + return $this->getViewState('EnableClientScript', true); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setEnableClientScript($value) |
113 | 113 | { |
114 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
114 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getShowMessageBox() |
121 | 121 | { |
122 | - return $this->getViewState('ShowMessageBox',false); |
|
122 | + return $this->getViewState('ShowMessageBox', false); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setShowMessageBox($value) |
129 | 129 | { |
130 | - $this->setViewState('ShowMessageBox',TPropertyValue::ensureBoolean($value),false); |
|
130 | + $this->setViewState('ShowMessageBox', TPropertyValue::ensureBoolean($value), false); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getShowSummary() |
137 | 137 | { |
138 | - return $this->getViewState('ShowSummary',true); |
|
138 | + return $this->getViewState('ShowSummary', true); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setShowSummary($value) |
145 | 145 | { |
146 | - $this->setViewState('ShowSummary',TPropertyValue::ensureBoolean($value),true); |
|
146 | + $this->setViewState('ShowSummary', TPropertyValue::ensureBoolean($value), true); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getScrollToSummary() |
153 | 153 | { |
154 | - return $this->getViewState('ScrollToSummary',true); |
|
154 | + return $this->getViewState('ScrollToSummary', true); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setScrollToSummary($value) |
161 | 161 | { |
162 | - $this->setViewState('ScrollToSummary',TPropertyValue::ensureBoolean($value),true); |
|
162 | + $this->setViewState('ScrollToSummary', TPropertyValue::ensureBoolean($value), true); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function getShowAnchor() |
169 | 169 | { |
170 | - return $this->getViewState('ShowAnchor',false); |
|
170 | + return $this->getViewState('ShowAnchor', false); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function setShowAnchor($value) |
177 | 177 | { |
178 | - $this->setViewState('ShowAnchor',TPropertyValue::ensureBoolean($value),false); |
|
178 | + $this->setViewState('ShowAnchor', TPropertyValue::ensureBoolean($value), false); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getValidationGroup() |
203 | 203 | { |
204 | - return $this->getViewState('ValidationGroup',''); |
|
204 | + return $this->getViewState('ValidationGroup', ''); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function setValidationGroup($value) |
211 | 211 | { |
212 | - $this->setViewState('ValidationGroup',$value,''); |
|
212 | + $this->setViewState('ValidationGroup', $value, ''); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | protected function addAttributesToRender($writer) |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | if(!$visible) |
220 | 220 | { |
221 | 221 | if($display===TValidationSummaryDisplayStyle::None || $display===TValidationSummaryDisplayStyle::Dynamic) |
222 | - $writer->addStyleAttribute('display','none'); |
|
222 | + $writer->addStyleAttribute('display', 'none'); |
|
223 | 223 | else |
224 | - $writer->addStyleAttribute('visibility','hidden'); |
|
224 | + $writer->addStyleAttribute('visibility', 'hidden'); |
|
225 | 225 | } |
226 | - $writer->addAttribute('id',$this->getClientID()); |
|
226 | + $writer->addAttribute('id', $this->getClientID()); |
|
227 | 227 | parent::addAttributesToRender($writer); |
228 | 228 | } |
229 | 229 | |
@@ -235,23 +235,23 @@ discard block |
||
235 | 235 | { |
236 | 236 | if(!$this->getEnabled(true) || !$this->getEnableClientScript()) |
237 | 237 | return; |
238 | - $cs = $this->getPage()->getClientScript(); |
|
238 | + $cs=$this->getPage()->getClientScript(); |
|
239 | 239 | $cs->registerPradoScript('validator'); |
240 | 240 | |
241 | 241 | //need to register the validation manager is validation summary is alone. |
242 | 242 | $formID=$this->getPage()->getForm()->getClientID(); |
243 | - $scriptKey = "TBaseValidator:$formID"; |
|
243 | + $scriptKey="TBaseValidator:$formID"; |
|
244 | 244 | if($this->getEnableClientScript() && !$cs->isEndScriptRegistered($scriptKey)) |
245 | 245 | { |
246 | - $manager['FormID'] = $formID; |
|
247 | - $options = TJavaScript::encode($manager); |
|
246 | + $manager['FormID']=$formID; |
|
247 | + $options=TJavaScript::encode($manager); |
|
248 | 248 | $cs->registerPradoScript('validator'); |
249 | 249 | $cs->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});"); |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | $options=TJavaScript::encode($this->getClientScriptOptions()); |
254 | - $script = "new Prado.WebUI.TValidationSummary({$options});"; |
|
254 | + $script="new Prado.WebUI.TValidationSummary({$options});"; |
|
255 | 255 | $cs->registerEndScript($this->getClientID(), $script); |
256 | 256 | } |
257 | 257 | |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | */ |
262 | 262 | protected function getClientScriptOptions() |
263 | 263 | { |
264 | - $options['ID'] = $this->getClientID(); |
|
265 | - $options['FormID'] = $this->getPage()->getForm()->getClientID(); |
|
264 | + $options['ID']=$this->getClientID(); |
|
265 | + $options['FormID']=$this->getPage()->getForm()->getClientID(); |
|
266 | 266 | if($this->getShowMessageBox()) |
267 | 267 | $options['ShowMessageBox']=true; |
268 | 268 | if(!$this->getShowSummary()) |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | $options['HeaderText']=$this->getHeaderText(); |
273 | 273 | $options['DisplayMode']=$this->getDisplayMode(); |
274 | 274 | |
275 | - $options['Refresh'] = $this->getAutoUpdate(); |
|
276 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
277 | - $options['Display'] = $this->getDisplay(); |
|
275 | + $options['Refresh']=$this->getAutoUpdate(); |
|
276 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
277 | + $options['Display']=$this->getDisplay(); |
|
278 | 278 | |
279 | 279 | if($this->_clientSide!==null) |
280 | - $options = array_merge($options,$this->_clientSide->getOptions()->toArray()); |
|
280 | + $options=array_merge($options, $this->_clientSide->getOptions()->toArray()); |
|
281 | 281 | |
282 | 282 | return $options; |
283 | 283 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | public function getClientSide() |
290 | 290 | { |
291 | 291 | if($this->_clientSide===null) |
292 | - $this->_clientSide = $this->createClientScript(); |
|
292 | + $this->_clientSide=$this->createClientScript(); |
|
293 | 293 | return $this->_clientSide; |
294 | 294 | } |
295 | 295 | |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | protected function getErrorMessages() |
309 | 309 | { |
310 | 310 | $validators=$this->getPage()->getValidators($this->getValidationGroup()); |
311 | - $messages = array(); |
|
311 | + $messages=array(); |
|
312 | 312 | foreach($validators as $validator) |
313 | 313 | { |
314 | 314 | if(!$validator->getIsValid() && ($msg=$validator->getErrorMessage())!=='') |
315 | 315 | //$messages[] = $validator->getAnchoredMessage($msg); |
316 | - $messages[] = $msg; |
|
316 | + $messages[]=$msg; |
|
317 | 317 | } |
318 | 318 | return $messages; |
319 | 319 | } |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | { |
357 | 357 | $header=$this->getHeaderText(); |
358 | 358 | $messages=$this->getErrorMessages(); |
359 | - $content = ''; |
|
359 | + $content=''; |
|
360 | 360 | if(strlen($header)) |
361 | - $content.= $header."<br/>\n"; |
|
361 | + $content.=$header."<br/>\n"; |
|
362 | 362 | foreach($messages as $message) |
363 | 363 | $content.="$message<br/>\n"; |
364 | 364 | $writer->write($content); |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | { |
375 | 375 | $header=$this->getHeaderText(); |
376 | 376 | $messages=$this->getErrorMessages(); |
377 | - $content = $header; |
|
377 | + $content=$header; |
|
378 | 378 | foreach($messages as $message) |
379 | - $content.= ' '.$message; |
|
379 | + $content.=' '.$message; |
|
380 | 380 | $writer->write($content); |
381 | 381 | } |
382 | 382 | |
@@ -390,13 +390,13 @@ discard block |
||
390 | 390 | { |
391 | 391 | $header=$this->getHeaderText(); |
392 | 392 | $messages=$this->getErrorMessages(); |
393 | - $content = $header; |
|
394 | - if(count($messages)>0) |
|
393 | + $content=$header; |
|
394 | + if(count($messages) > 0) |
|
395 | 395 | { |
396 | - $content .= "<ul>\n"; |
|
396 | + $content.="<ul>\n"; |
|
397 | 397 | foreach($messages as $message) |
398 | - $content.= '<li>'.$message."</li>\n"; |
|
399 | - $content .= "</ul>\n"; |
|
398 | + $content.='<li>'.$message."</li>\n"; |
|
399 | + $content.="</ul>\n"; |
|
400 | 400 | } |
401 | 401 | $writer->write($content); |
402 | 402 | } |
@@ -41,24 +41,24 @@ discard block |
||
41 | 41 | protected function __getZappableSleepProps(&$exprops) |
42 | 42 | { |
43 | 43 | parent::__getZappableSleepProps($exprops); |
44 | - if ($this->_mode===null) |
|
45 | - $exprops[] = "\0TDataGridPagerStyle\0_mode"; |
|
46 | - if ($this->_nextText===null) |
|
47 | - $exprops[] = "\0TDataGridPagerStyle\0_nextText"; |
|
48 | - if ($this->_prevText===null) |
|
49 | - $exprops[] = "\0TDataGridPagerStyle\0_prevText"; |
|
50 | - if ($this->_firstText===null) |
|
51 | - $exprops[] = "\0TDataGridPagerStyle\0_firstText"; |
|
52 | - if ($this->_lastText===null) |
|
53 | - $exprops[] = "\0TDataGridPagerStyle\0_lastText"; |
|
54 | - if ($this->_buttonCount===null) |
|
55 | - $exprops[] = "\0TDataGridPagerStyle\0_buttonCount"; |
|
56 | - if ($this->_position===null) |
|
57 | - $exprops[] = "\0TDataGridPagerStyle\0_position"; |
|
58 | - if ($this->_visible===null) |
|
59 | - $exprops[] = "\0TDataGridPagerStyle\0_visible"; |
|
60 | - if ($this->_buttonType===null) |
|
61 | - $exprops[] = "\0TDataGridPagerStyle\0_buttonType"; |
|
44 | + if($this->_mode===null) |
|
45 | + $exprops[]="\0TDataGridPagerStyle\0_mode"; |
|
46 | + if($this->_nextText===null) |
|
47 | + $exprops[]="\0TDataGridPagerStyle\0_nextText"; |
|
48 | + if($this->_prevText===null) |
|
49 | + $exprops[]="\0TDataGridPagerStyle\0_prevText"; |
|
50 | + if($this->_firstText===null) |
|
51 | + $exprops[]="\0TDataGridPagerStyle\0_firstText"; |
|
52 | + if($this->_lastText===null) |
|
53 | + $exprops[]="\0TDataGridPagerStyle\0_lastText"; |
|
54 | + if($this->_buttonCount===null) |
|
55 | + $exprops[]="\0TDataGridPagerStyle\0_buttonCount"; |
|
56 | + if($this->_position===null) |
|
57 | + $exprops[]="\0TDataGridPagerStyle\0_position"; |
|
58 | + if($this->_visible===null) |
|
59 | + $exprops[]="\0TDataGridPagerStyle\0_visible"; |
|
60 | + if($this->_buttonType===null) |
|
61 | + $exprops[]="\0TDataGridPagerStyle\0_buttonType"; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function getMode() |
68 | 68 | { |
69 | - return $this->_mode===null?TDataGridPagerMode::NextPrev : $this->_mode; |
|
69 | + return $this->_mode===null ? TDataGridPagerMode::NextPrev : $this->_mode; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function setMode($value) |
76 | 76 | { |
77 | - $this->_mode=TPropertyValue::ensureEnum($value,'TDataGridPagerMode'); |
|
77 | + $this->_mode=TPropertyValue::ensureEnum($value, 'TDataGridPagerMode'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getButtonType() |
84 | 84 | { |
85 | - return $this->_buttonType===null?TDataGridPagerButtonType::LinkButton:$this->_buttonType; |
|
85 | + return $this->_buttonType===null ? TDataGridPagerButtonType::LinkButton : $this->_buttonType; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setButtonType($value) |
92 | 92 | { |
93 | - $this->_buttonType=TPropertyValue::ensureEnum($value,'TDataGridPagerButtonType'); |
|
93 | + $this->_buttonType=TPropertyValue::ensureEnum($value, 'TDataGridPagerButtonType'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function getNextPageText() |
100 | 100 | { |
101 | - return $this->_nextText===null?'>':$this->_nextText; |
|
101 | + return $this->_nextText===null ? '>' : $this->_nextText; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function getPrevPageText() |
116 | 116 | { |
117 | - return $this->_prevText===null?'<':$this->_prevText; |
|
117 | + return $this->_prevText===null ? '<' : $this->_prevText; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getFirstPageText() |
132 | 132 | { |
133 | - return $this->_firstText===null?'<<':$this->_firstText; |
|
133 | + return $this->_firstText===null ? '<<' : $this->_firstText; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getLastPageText() |
148 | 148 | { |
149 | - return $this->_lastText===null?'>>':$this->_lastText; |
|
149 | + return $this->_lastText===null ? '>>' : $this->_lastText; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function getPageButtonCount() |
164 | 164 | { |
165 | - return $this->_buttonCount===null?10:$this->_buttonCount; |
|
165 | + return $this->_buttonCount===null ? 10 : $this->_buttonCount; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function setPageButtonCount($value) |
173 | 173 | { |
174 | - if(($value=TPropertyValue::ensureInteger($value))<1) |
|
174 | + if(($value=TPropertyValue::ensureInteger($value)) < 1) |
|
175 | 175 | throw new TInvalidDataValueException('datagridpagerstyle_pagebuttoncount_invalid'); |
176 | 176 | $this->_buttonCount=$value; |
177 | 177 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function getPosition() |
183 | 183 | { |
184 | - return $this->_position===null?TDataGridPagerPosition::Bottom:$this->_position; |
|
184 | + return $this->_position===null ? TDataGridPagerPosition::Bottom : $this->_position; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function setPosition($value) |
191 | 191 | { |
192 | - $this->_position=TPropertyValue::ensureEnum($value,'TDataGridPagerPosition'); |
|
192 | + $this->_position=TPropertyValue::ensureEnum($value, 'TDataGridPagerPosition'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function getVisible() |
199 | 199 | { |
200 | - return $this->_visible===null?true:$this->_visible; |
|
200 | + return $this->_visible===null ? true : $this->_visible; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | public function onPreRender($param) |
106 | 106 | { |
107 | 107 | parent::onPreRender($param); |
108 | - $scripts = preg_split('/,|\s+/', $this->getPradoScripts()); |
|
109 | - $cs = $this->getPage()->getClientScript(); |
|
108 | + $scripts=preg_split('/,|\s+/', $this->getPradoScripts()); |
|
109 | + $cs=$this->getPage()->getClientScript(); |
|
110 | 110 | foreach($scripts as $script) |
111 | 111 | { |
112 | - if(($script = trim($script))!=='') |
|
112 | + if(($script=trim($script))!=='') |
|
113 | 113 | $cs->registerPradoScript($script); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function render($writer) |
124 | 124 | { |
125 | - if ($this->getFlushScriptFiles()) |
|
125 | + if($this->getFlushScriptFiles()) |
|
126 | 126 | $this->getPage()->getClientScript()->flushScriptFiles($writer, $this); |
127 | 127 | $this->renderCustomScriptFile($writer); |
128 | 128 | $this->renderCustomScript($writer); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function renderCustomScriptFile($writer) |
136 | 136 | { |
137 | - if(($scriptUrl = $this->getScriptUrl())!=='') |
|
137 | + if(($scriptUrl=$this->getScriptUrl())!=='') |
|
138 | 138 | $writer->write("<script type=\"text/javascript\" src=\"$scriptUrl\"></script>\n"); |
139 | 139 | } |
140 | 140 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function processText($text) |
53 | 53 | { |
54 | - $result = Parsedown::instance()->parse($text); |
|
54 | + $result=Parsedown::instance()->parse($text); |
|
55 | 55 | return preg_replace_callback( |
56 | 56 | '/<pre><code class="language-(\w+)">((.|\n)*?)<\\/code><\\/pre>/im', |
57 | 57 | array($this, 'highlightCode'), $result); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected function highlightCode($matches) |
66 | 66 | { |
67 | - $text = html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'); |
|
67 | + $text=html_entity_decode($matches[2], ENT_QUOTES, 'UTF-8'); |
|
68 | 68 | $this->setLanguage($matches[1]); |
69 | 69 | return parent::processText($text); |
70 | 70 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function setStartRowIndex($value) |
32 | 32 | { |
33 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
33 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
34 | 34 | $value=0; |
35 | 35 | $this->_startRowIndex=$value; |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function setMaximumRows($value) |
44 | 44 | { |
45 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
45 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
46 | 46 | $value=0; |
47 | 47 | $this->_maximumRows=$value; |
48 | 48 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | public function setTotalRowCount($value) |
66 | 66 | { |
67 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
67 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
68 | 68 | $value=0; |
69 | 69 | $this->_totalRowCount=$value; |
70 | 70 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | private $_owner; |
83 | 83 | private $_name; |
84 | 84 | |
85 | - public function __construct(IDataSource $owner,$viewName) |
|
85 | + public function __construct(IDataSource $owner, $viewName) |
|
86 | 86 | { |
87 | 87 | $this->_owner=$owner; |
88 | 88 | $this->_name=$viewName; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param array|TMap new values |
112 | 112 | * @return integer affected rows |
113 | 113 | */ |
114 | - public function update($keys,$values) |
|
114 | + public function update($keys, $values) |
|
115 | 115 | { |
116 | 116 | throw new TNotSupportedException('datasourceview_update_unsupported'); |
117 | 117 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | public function onDataSourceViewChanged($param) |
170 | 170 | { |
171 | - $this->raiseEvent('OnDataSourceViewChanged',$this,$param); |
|
171 | + $this->raiseEvent('OnDataSourceViewChanged', $this, $param); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | { |
184 | 184 | private $_dataSource=null; |
185 | 185 | |
186 | - public function __construct(IDataSource $owner,$viewName,$dataSource) |
|
186 | + public function __construct(IDataSource $owner, $viewName, $dataSource) |
|
187 | 187 | { |
188 | - parent::__construct($owner,$viewName); |
|
188 | + parent::__construct($owner, $viewName); |
|
189 | 189 | if($dataSource===null || is_array($dataSource)) |
190 | 190 | $this->_dataSource=new TMap($dataSource); |
191 | 191 | else if($dataSource instanceof Traversable) |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function getTagName() |
39 | 39 | { |
40 | - return ($this->getForControl()==='')?'span':'label'; |
|
40 | + return ($this->getForControl()==='') ? 'span' : 'label'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | protected function addAttributesToRender($writer) |
49 | 49 | { |
50 | 50 | if($this->_forControl!=='') |
51 | - $writer->addAttribute('for',$this->_forControl); |
|
51 | + $writer->addAttribute('for', $this->_forControl); |
|
52 | 52 | parent::addAttributesToRender($writer); |
53 | 53 | } |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | else |
74 | - throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
|
74 | + throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid); |
|
75 | 75 | } |
76 | 76 | else |
77 | 77 | parent::render($writer); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getText() |
96 | 96 | { |
97 | - return $this->getViewState('Text',''); |
|
97 | + return $this->getViewState('Text', ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setText($value) |
104 | 104 | { |
105 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
105 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getForControl() |
138 | 138 | { |
139 | - return $this->getViewState('ForControl',''); |
|
139 | + return $this->getViewState('ForControl', ''); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setForControl($value) |
148 | 148 | { |
149 | - $this->setViewState('ForControl',$value,''); |
|
149 | + $this->setViewState('ForControl', $value, ''); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 |
@@ -233,8 +233,7 @@ discard block |
||
233 | 233 | $newid=substr($id,$pos+1); |
234 | 234 | if ($control!==null) |
235 | 235 | $control=$control->$newid; |
236 | - } |
|
237 | - else |
|
236 | + } else |
|
238 | 237 | { |
239 | 238 | // TCheckBoxList overrides findControl() with a fake implementation |
240 | 239 | // but accepts a second parameter to use the standard one |
@@ -296,8 +295,7 @@ discard block |
||
296 | 295 | { |
297 | 296 | $group=$this->getValidationGroup(); |
298 | 297 | return $this->getPage()->getValidators($group)->getCount()>0; |
299 | - } |
|
300 | - else |
|
298 | + } else |
|
301 | 299 | return false; |
302 | 300 | } |
303 | 301 |
@@ -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 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * TSessionPageStatePersister class file |
|
4 | - * |
|
5 | - * @author Qiang Xue <[email protected]> |
|
6 | - * @link https://github.com/pradosoft/prado |
|
7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | - * @package System.Web.UI |
|
10 | - */ |
|
3 | + * TSessionPageStatePersister class file |
|
4 | + * |
|
5 | + * @author Qiang Xue <[email protected]> |
|
6 | + * @link https://github.com/pradosoft/prado |
|
7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | + * @package System.Web.UI |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * TSessionPageStatePersister class |
@@ -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 | /** |