@@ -113,8 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $userFile = include $this->_userFile; |
115 | 115 | $this->loadUserDataFromPhp($userFile); |
116 | - } |
|
117 | - else |
|
116 | + } else |
|
118 | 117 | { |
119 | 118 | $dom=new TXmlDocument; |
120 | 119 | $dom->loadFromFile($this->_userFile); |
@@ -310,8 +309,7 @@ discard block |
||
310 | 309 | $user=new TUser($this); |
311 | 310 | $user->setIsGuest(true); |
312 | 311 | return $user; |
313 | - } |
|
314 | - else |
|
312 | + } else |
|
315 | 313 | { |
316 | 314 | $username=strtolower($username); |
317 | 315 | if(isset($this->_users[$username])) |
@@ -322,8 +320,7 @@ discard block |
||
322 | 320 | if(isset($this->_roles[$username])) |
323 | 321 | $user->setRoles($this->_roles[$username]); |
324 | 322 | return $user; |
325 | - } |
|
326 | - else |
|
323 | + } else |
|
327 | 324 | return null; |
328 | 325 | } |
329 | 326 | } |
@@ -134,12 +134,10 @@ discard block |
||
134 | 134 | { |
135 | 135 | $sub = preg_replace('/(^\')|(\'$)/','',$pattern); |
136 | 136 | $tokens[$i] = str_replace('``````','\'',$sub); |
137 | - } |
|
138 | - else if($pattern == '``````') |
|
137 | + } else if($pattern == '``````') |
|
139 | 138 | { |
140 | 139 | $tokens[$i] = '\''; |
141 | - } |
|
142 | - else |
|
140 | + } else |
|
143 | 141 | { |
144 | 142 | $function = $this->getFunctionName($pattern); |
145 | 143 | if($function != null) |
@@ -149,8 +147,7 @@ discard block |
||
149 | 147 | { |
150 | 148 | $rs = $this->$fName($date, $pattern); |
151 | 149 | $tokens[$i] = $rs; |
152 | - } |
|
153 | - else |
|
150 | + } else |
|
154 | 151 | throw new |
155 | 152 | Exception('function '.$function.' not found.'); |
156 | 153 | } |
@@ -285,8 +282,7 @@ discard block |
||
285 | 282 | if($char==null || $pattern{$i} == $char || $text) |
286 | 283 | { |
287 | 284 | $token .= $pattern{$i}; |
288 | - } |
|
289 | - else |
|
285 | + } else |
|
290 | 286 | { |
291 | 287 | $tokens[] = str_replace("","'",$token); |
292 | 288 | $token = $pattern{$i}; |
@@ -175,8 +175,7 @@ |
||
175 | 175 | { |
176 | 176 | $cultureInfo = CultureInfo::getInstance($culture); |
177 | 177 | return $cultureInfo->getDateTimeFormat(); |
178 | - } |
|
179 | - else |
|
178 | + } else |
|
180 | 179 | { |
181 | 180 | $cultureInfo = CultureInfo::getInvariantCulture(); |
182 | 181 | return $cultureInfo->getDateTimeFormat(); |
@@ -124,8 +124,7 @@ |
||
124 | 124 | if (!@mysql_select_db($dsninfo['database'], $conn)) |
125 | 125 | throw new Exception('Error in connecting database, dns:'. |
126 | 126 | $dsninfo); |
127 | - } |
|
128 | - else |
|
127 | + } else |
|
129 | 128 | throw new Exception('Please provide a database for message'. |
130 | 129 | ' translation.'); |
131 | 130 | return $conn; |
@@ -184,15 +184,13 @@ discard block |
||
184 | 184 | $formatInfo = $culture->NumberFormat; |
185 | 185 | $formatInfo->setPattern($type); |
186 | 186 | return $formatInfo; |
187 | - } |
|
188 | - else if(is_string($culture)) |
|
187 | + } else if(is_string($culture)) |
|
189 | 188 | { |
190 | 189 | $cultureInfo = new CultureInfo($culture); |
191 | 190 | $formatInfo = $cultureInfo->NumberFormat; |
192 | 191 | $formatInfo->setPattern($type); |
193 | 192 | return $formatInfo; |
194 | - } |
|
195 | - else |
|
193 | + } else |
|
196 | 194 | { |
197 | 195 | $cultureInfo = new CultureInfo(); |
198 | 196 | $formatInfo = $cultureInfo->NumberFormat; |
@@ -292,8 +290,7 @@ discard block |
||
292 | 290 | { |
293 | 291 | $groupSize1 = $decimalPos - $groupPos1-1; |
294 | 292 | |
295 | - } |
|
296 | - else |
|
293 | + } else |
|
297 | 294 | { |
298 | 295 | //no decimal point, so traverse from the back |
299 | 296 | //to find the groupsize 1. |
@@ -203,16 +203,14 @@ discard block |
||
203 | 203 | $integer = $groupSeparator . $integer; |
204 | 204 | $count++; |
205 | 205 | } |
206 | - } |
|
207 | - else if($multiGroup && $count >= 1) |
|
206 | + } else if($multiGroup && $count >= 1) |
|
208 | 207 | { |
209 | 208 | if($i != 0 && ($i-$groupSize[0])%$groupSize[1] == 0) |
210 | 209 | { |
211 | 210 | $integer = $groupSeparator . $integer; |
212 | 211 | $count++; |
213 | 212 | } |
214 | - } |
|
215 | - else |
|
213 | + } else |
|
216 | 214 | { |
217 | 215 | if($i != 0 && $i%$groupSize[0] == 0) |
218 | 216 | { |
@@ -223,8 +221,7 @@ discard block |
||
223 | 221 | |
224 | 222 | $integer = $char . $integer; |
225 | 223 | } |
226 | - } |
|
227 | - else |
|
224 | + } else |
|
228 | 225 | $integer = $string; |
229 | 226 | |
230 | 227 | return $integer; |
@@ -250,27 +247,23 @@ discard block |
||
250 | 247 | if($decimalDigits == -1) |
251 | 248 | { |
252 | 249 | $decimal = substr($string, $dp+1); |
253 | - } |
|
254 | - else if(is_int($decimalDigits)) |
|
250 | + } else if(is_int($decimalDigits)) |
|
255 | 251 | { |
256 | 252 | $float = round((float)$string, $decimalDigits); |
257 | 253 | if(strpos((string)$float, '.') === false) |
258 | 254 | { |
259 | 255 | $decimal = str_pad($decimal,$decimalDigits,'0'); |
260 | - } |
|
261 | - else |
|
256 | + } else |
|
262 | 257 | { |
263 | 258 | $decimal = substr($float, strpos($float,'.')+1); |
264 | 259 | if(strlen($decimal)<$decimalDigits) |
265 | 260 | $decimal = str_pad($decimal,$decimalDigits,'0'); |
266 | 261 | } |
267 | - } |
|
268 | - else |
|
262 | + } else |
|
269 | 263 | return $decimal; |
270 | 264 | |
271 | 265 | return $decimalSeparator.$decimal; |
272 | - } |
|
273 | - else if ($decimalDigits > 0) |
|
266 | + } else if ($decimalDigits > 0) |
|
274 | 267 | return $decimalSeparator.str_pad($decimal,$decimalDigits,'0'); |
275 | 268 | |
276 | 269 | return $decimal; |
@@ -112,8 +112,7 @@ |
||
112 | 112 | && strlen($datetime[1]) == 1) |
113 | 113 | { |
114 | 114 | $pattern = $datetime; |
115 | - } |
|
116 | - else //no subpattern, try the presets |
|
115 | + } else //no subpattern, try the presets |
|
117 | 116 | $pattern = $this->getPreset($string); |
118 | 117 | |
119 | 118 | //no presets found, use the string as the pattern |
@@ -283,8 +283,7 @@ discard block |
||
283 | 283 | closedir($dir); |
284 | 284 | if($cacheValid) |
285 | 285 | $this->_skins=$skins; |
286 | - } |
|
287 | - else |
|
286 | + } else |
|
288 | 287 | { |
289 | 288 | $cacheValid=true; |
290 | 289 | $this->_cssFiles=$cssFiles; |
@@ -461,20 +460,16 @@ discard block |
||
461 | 460 | { |
462 | 461 | $setter='set'.$name; |
463 | 462 | $control->$setter($value); |
464 | - } |
|
465 | - else |
|
463 | + } else |
|
466 | 464 | throw new TConfigurationException('theme_property_readonly',$type,$name); |
467 | - } |
|
468 | - else |
|
465 | + } else |
|
469 | 466 | throw new TConfigurationException('theme_property_undefined',$type,$name); |
470 | - } |
|
471 | - else // complex property |
|
467 | + } else // complex property |
|
472 | 468 | $control->setSubProperty($name,$value); |
473 | 469 | } |
474 | 470 | } |
475 | 471 | return true; |
476 | - } |
|
477 | - else |
|
472 | + } else |
|
478 | 473 | return false; |
479 | 474 | } |
480 | 475 |
@@ -120,11 +120,9 @@ |
||
120 | 120 | { |
121 | 121 | $this->setChecked(true); |
122 | 122 | return true; |
123 | - } |
|
124 | - else |
|
123 | + } else |
|
125 | 124 | return false; |
126 | - } |
|
127 | - else if($this->getChecked()) |
|
125 | + } else if($this->getChecked()) |
|
128 | 126 | $this->setChecked(false); |
129 | 127 | return false; |
130 | 128 | } |