@@ -191,13 +191,11 @@ discard block |
||
| 191 | 191 | $control->setCaption($this->_caption); |
| 192 | 192 | $control->setCaptionAlign($this->_captionAlign); |
| 193 | 193 | } |
| 194 | - } |
|
| 195 | - else if($this->_repeatLayout===TRepeatLayout::Raw) |
|
| 194 | + } else if($this->_repeatLayout===TRepeatLayout::Raw) |
|
| 196 | 195 | { |
| 197 | 196 | $this->renderRawContents($writer,$user); |
| 198 | 197 | return; |
| 199 | - } |
|
| 200 | - else |
|
| 198 | + } else |
|
| 201 | 199 | $control=new TWebControl; |
| 202 | 200 | $control->setID($user->getClientID()); |
| 203 | 201 | $control->copyBaseAttributes($user); |
@@ -295,8 +293,7 @@ discard block |
||
| 295 | 293 | } |
| 296 | 294 | } |
| 297 | 295 | $writer->renderEndTag(); |
| 298 | - } |
|
| 299 | - else |
|
| 296 | + } else |
|
| 300 | 297 | { |
| 301 | 298 | $column=0; |
| 302 | 299 | for($i=0;$i<$itemCount;++$i) |
@@ -334,8 +331,7 @@ discard block |
||
| 334 | 331 | $rows=$itemCount; |
| 335 | 332 | $columns=1; |
| 336 | 333 | $lastColumns=1; |
| 337 | - } |
|
| 338 | - else |
|
| 334 | + } else |
|
| 339 | 335 | { |
| 340 | 336 | $columns=$this->_repeatColumns; |
| 341 | 337 | $rows=(int)(($itemCount+$columns-1)/$columns); |
@@ -391,8 +387,7 @@ discard block |
||
| 391 | 387 | $user->renderItem($writer,$this,'Separator',$index); |
| 392 | 388 | $writer->renderEndTag(); |
| 393 | 389 | $writer->writeLine(); |
| 394 | - } |
|
| 395 | - else if($columns>1) |
|
| 390 | + } else if($columns>1) |
|
| 396 | 391 | $writer->write("<td></td>\n"); |
| 397 | 392 | } |
| 398 | 393 | if($row==$rows-1) |
@@ -407,8 +402,7 @@ discard block |
||
| 407 | 402 | $writer->writeLine(); |
| 408 | 403 | } |
| 409 | 404 | $writer->renderEndTag(); |
| 410 | - } |
|
| 411 | - else |
|
| 405 | + } else |
|
| 412 | 406 | { |
| 413 | 407 | $renderedItems=0; |
| 414 | 408 | for($row=0;$row<$rows;++$row) |
@@ -473,8 +467,7 @@ discard block |
||
| 473 | 467 | $writer->renderEndTag(); |
| 474 | 468 | $writer->renderEndTag(); |
| 475 | 469 | $writer->renderEndTag(); |
| 476 | - } |
|
| 477 | - else |
|
| 470 | + } else |
|
| 478 | 471 | { |
| 479 | 472 | $user->renderItem($writer,$this,'Header',-1); |
| 480 | 473 | if($needBreak) |
@@ -505,8 +498,7 @@ discard block |
||
| 505 | 498 | $writer->renderEndTag(); |
| 506 | 499 | $writer->renderEndTag(); |
| 507 | 500 | $writer->renderEndTag(); |
| 508 | - } |
|
| 509 | - else |
|
| 501 | + } else |
|
| 510 | 502 | $user->renderItem($writer,$this,'Footer',-1); |
| 511 | 503 | $writer->writeLine(); |
| 512 | 504 | } |
@@ -101,8 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $this->setSelectedIndex($index); |
| 103 | 103 | return $this->_dataChanged=true; |
| 104 | - } |
|
| 105 | - else |
|
| 104 | + } else |
|
| 106 | 105 | return false; |
| 107 | 106 | } |
| 108 | 107 | if(!is_array($selections)) |
@@ -124,8 +123,7 @@ discard block |
||
| 124 | 123 | break; |
| 125 | 124 | } |
| 126 | 125 | } |
| 127 | - } |
|
| 128 | - else |
|
| 126 | + } else |
|
| 129 | 127 | $flag=true; |
| 130 | 128 | if($flag) |
| 131 | 129 | { |
@@ -133,13 +131,11 @@ discard block |
||
| 133 | 131 | $this->_dataChanged=true; |
| 134 | 132 | } |
| 135 | 133 | return $flag; |
| 136 | - } |
|
| 137 | - else if($this->getSelectedIndex()!==-1) |
|
| 134 | + } else if($this->getSelectedIndex()!==-1) |
|
| 138 | 135 | { |
| 139 | 136 | $this->clearSelection(); |
| 140 | 137 | return $this->_dataChanged=true; |
| 141 | - } |
|
| 142 | - else |
|
| 138 | + } else |
|
| 143 | 139 | return false; |
| 144 | 140 | } |
| 145 | 141 | |
@@ -518,16 +518,14 @@ |
||
| 518 | 518 | { |
| 519 | 519 | $this->setIsValid(true); |
| 520 | 520 | $this->onValidationSuccess(); |
| 521 | - } |
|
| 522 | - else |
|
| 521 | + } else |
|
| 523 | 522 | { |
| 524 | 523 | if($target) |
| 525 | 524 | $target->setIsValid(false); |
| 526 | 525 | $this->setIsValid(false); |
| 527 | 526 | $this->onValidationError(); |
| 528 | 527 | } |
| 529 | - } |
|
| 530 | - else |
|
| 528 | + } else |
|
| 531 | 529 | { |
| 532 | 530 | $this->evaluateIsValid(); |
| 533 | 531 | $this->setIsValid(true); |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | if(!isset(self::$_template[$class])) |
| 70 | 70 | self::$_template[$class]=$this->loadTemplate(); |
| 71 | 71 | return self::$_template[$class]; |
| 72 | - } |
|
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | return $this->_localTemplate; |
| 75 | 74 | } |
| 76 | 75 | |
@@ -205,8 +204,7 @@ discard block |
||
| 205 | 204 | $controls=$placeholder->getParent()->getControls(); |
| 206 | 205 | $loc=$controls->remove($placeholder); |
| 207 | 206 | $controls->insertAt($loc,$content); |
| 208 | - } |
|
| 209 | - else |
|
| 207 | + } else |
|
| 210 | 208 | throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id); |
| 211 | 209 | } |
| 212 | 210 | |
@@ -232,8 +230,7 @@ discard block |
||
| 232 | 230 | $master->ensureChildControls(); |
| 233 | 231 | foreach($this->_contents as $id=>$content) |
| 234 | 232 | $master->injectContent($id,$content); |
| 235 | - } |
|
| 236 | - else if(!empty($this->_contents)) |
|
| 233 | + } else if(!empty($this->_contents)) |
|
| 237 | 234 | throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this)); |
| 238 | 235 | parent::initRecursive($namingContainer); |
| 239 | 236 | } |
@@ -261,8 +258,7 @@ discard block |
||
| 261 | 258 | $control->Checked = (boolean) $arObj->{$key}; |
| 262 | 259 | elseif ($control instanceof TDatePicker) |
| 263 | 260 | $control->Date = $arObj->{$key}; |
| 264 | - } |
|
| 265 | - else |
|
| 261 | + } else |
|
| 266 | 262 | { |
| 267 | 263 | foreach ($objAttrs["RELATIONS"] as $relKey => $relValues) |
| 268 | 264 | { |
@@ -284,8 +280,7 @@ discard block |
||
| 284 | 280 | } |
| 285 | 281 | break; |
| 286 | 282 | } |
| 287 | - } |
|
| 288 | - catch (Exception $ex) |
|
| 283 | + } catch (Exception $ex) |
|
| 289 | 284 | { |
| 290 | 285 | if ($throwExceptions) |
| 291 | 286 | throw $ex; |
@@ -315,8 +310,7 @@ discard block |
||
| 315 | 310 | $arObj->{$key} = $control->Checked; |
| 316 | 311 | elseif ($control instanceof TDatePicker) |
| 317 | 312 | $arObj->{$key} = $control->Date; |
| 318 | - } |
|
| 319 | - catch (Exception $ex) |
|
| 313 | + } catch (Exception $ex) |
|
| 320 | 314 | { |
| 321 | 315 | if ($throwExceptions) |
| 322 | 316 | throw $ex; |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | foreach (explode(".", $field) as $f) |
| 62 | 62 | $tmp = $tmp[$f]; |
| 63 | 63 | return $tmp; |
| 64 | - } |
|
| 65 | - else if(is_object($data)) |
|
| 64 | + } else if(is_object($data)) |
|
| 66 | 65 | { |
| 67 | 66 | if(strpos($field,'.')===false) // simple field |
| 68 | 67 | { |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | return call_user_func(array($data,'get'.$field)); |
| 71 | 70 | else |
| 72 | 71 | return $data->{$field}; |
| 73 | - } |
|
| 74 | - else // field in the format of xxx.yyy.zzz |
|
| 72 | + } else // field in the format of xxx.yyy.zzz |
|
| 75 | 73 | { |
| 76 | 74 | $object=$data; |
| 77 | 75 | foreach(explode('.',$field) as $f) |
@@ -79,8 +77,7 @@ discard block |
||
| 79 | 77 | return $object; |
| 80 | 78 | } |
| 81 | 79 | } |
| 82 | - } |
|
| 83 | - catch(Exception $e) |
|
| 80 | + } catch(Exception $e) |
|
| 84 | 81 | { |
| 85 | 82 | throw new TInvalidDataValueException('datafieldaccessor_datafield_invalid',$field,$e->getMessage()); |
| 86 | 83 | } |
@@ -71,14 +71,12 @@ discard block |
||
| 71 | 71 | $configFile->loadFromFile($this->_paramFile); |
| 72 | 72 | $cache->set($cacheKey,$configFile,0,new TFileCacheDependency($this->_paramFile)); |
| 73 | 73 | } |
| 74 | - } |
|
| 75 | - else |
|
| 74 | + } else |
|
| 76 | 75 | { |
| 77 | 76 | if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) |
| 78 | 77 | { |
| 79 | 78 | $configFile = include $this->_paramFile; |
| 80 | - } |
|
| 81 | - else |
|
| 79 | + } else |
|
| 82 | 80 | { |
| 83 | 81 | $configFile=new TXmlDocument; |
| 84 | 82 | $configFile->loadFromFile($this->_paramFile); |
@@ -105,14 +103,12 @@ discard block |
||
| 105 | 103 | { |
| 106 | 104 | $properties = isset($parameter['properties'])?$parameter['properties']:array(); |
| 107 | 105 | $parameters[$id]=array($parameter['class'],$properties); |
| 108 | - } |
|
| 109 | - else |
|
| 106 | + } else |
|
| 110 | 107 | { |
| 111 | 108 | $parameters[$id] = $parameter; |
| 112 | 109 | } |
| 113 | 110 | } |
| 114 | - } |
|
| 115 | - else if($config instanceof TXmlElement) |
|
| 111 | + } else if($config instanceof TXmlElement) |
|
| 116 | 112 | { |
| 117 | 113 | foreach($config->getElementsByTagName('parameter') as $node) |
| 118 | 114 | { |
@@ -125,8 +121,7 @@ discard block |
||
| 125 | 121 | $parameters[$id]=$node; |
| 126 | 122 | else |
| 127 | 123 | $parameters[$id]=$value; |
| 128 | - } |
|
| 129 | - else |
|
| 124 | + } else |
|
| 130 | 125 | $parameters[$id]=array($type,$properties->toArray()); |
| 131 | 126 | } |
| 132 | 127 | } |
@@ -140,8 +135,7 @@ discard block |
||
| 140 | 135 | foreach($parameter[1] as $name=>$value) |
| 141 | 136 | $component->setSubProperty($name,$value); |
| 142 | 137 | $appParams->add($id,$component); |
| 143 | - } |
|
| 144 | - else |
|
| 138 | + } else |
|
| 145 | 139 | $appParams->add($id,$parameter); |
| 146 | 140 | } |
| 147 | 141 | } |
@@ -155,8 +155,9 @@ discard block |
||
| 155 | 155 | $this->_temp_tarname = ''; |
| 156 | 156 | return false; |
| 157 | 157 | } |
| 158 | - while ($v_data = @fread($v_file_from, 1024)) |
|
| 159 | - @fwrite($v_file_to, $v_data); |
|
| 158 | + while ($v_data = @fread($v_file_from, 1024)) { |
|
| 159 | + @fwrite($v_file_to, $v_data); |
|
| 160 | + } |
|
| 160 | 161 | @fclose($v_file_from); |
| 161 | 162 | @fclose($v_file_to); |
| 162 | 163 | } |
@@ -410,8 +411,9 @@ discard block |
||
| 410 | 411 | $v_header['filename'] = substr($v_header['filename'], |
| 411 | 412 | $p_remove_path_size); |
| 412 | 413 | if (($p_path != './') && ($p_path != '/')) { |
| 413 | - while (substr($p_path, -1) == '/') |
|
| 414 | - $p_path = substr($p_path, 0, strlen($p_path)-1); |
|
| 414 | + while (substr($p_path, -1) == '/') { |
|
| 415 | + $p_path = substr($p_path, 0, strlen($p_path)-1); |
|
| 416 | + } |
|
| 415 | 417 | |
| 416 | 418 | if (substr($v_header['filename'], 0, 1) == '/') |
| 417 | 419 | $v_header['filename'] = $p_path.$v_header['filename']; |
@@ -203,11 +203,9 @@ discard block |
||
| 203 | 203 | $info['NumericPrecision'] = intval($matches[1]); |
| 204 | 204 | if(count($matches) > 2) |
| 205 | 205 | $info['NumericScale'] = intval($matches[2]); |
| 206 | - } |
|
| 207 | - else |
|
| 206 | + } else |
|
| 208 | 207 | $info['ColumnSize'] = intval($matches[1]); |
| 209 | - } |
|
| 210 | - else |
|
| 208 | + } else |
|
| 211 | 209 | $info['DbType'] = $col['type']; |
| 212 | 210 | $tableInfo->Columns[$columnId] = new TOracleTableColumn($info); |
| 213 | 211 | } |
@@ -349,8 +347,7 @@ discard block |
||
| 349 | 347 | SELECT table_name, '{$schema}' as table_schema FROM user_tables |
| 350 | 348 | EOD; |
| 351 | 349 | $command=$this->getDbConnection()->createCommand($sql); |
| 352 | - } |
|
| 353 | - else |
|
| 350 | + } else |
|
| 354 | 351 | { |
| 355 | 352 | $sql=<<<EOD |
| 356 | 353 | SELECT object_name as table_name, owner as table_schema FROM all_objects |
@@ -154,8 +154,7 @@ discard block |
||
| 154 | 154 | $info['NumericPrecision'] = intval($pscale[1]); |
| 155 | 155 | if(count($pscale) > 2) |
| 156 | 156 | $info['NumericScale'] = intval($pscale[2]); |
| 157 | - } |
|
| 158 | - else |
|
| 157 | + } else |
|
| 159 | 158 | $info['ColumnSize'] = intval($pscale[1]); |
| 160 | 159 | } |
| 161 | 160 | } |
@@ -254,8 +253,7 @@ discard block |
||
| 254 | 253 | try |
| 255 | 254 | { |
| 256 | 255 | return count($result = $command->queryRow()) > 0 && $result['Table_type']==='VIEW'; |
| 257 | - } |
|
| 258 | - catch(TDbException $e) |
|
| 256 | + } catch(TDbException $e) |
|
| 259 | 257 | { |
| 260 | 258 | $table = $schemaName===null?$tableName:$schemaName.'.'.$tableName; |
| 261 | 259 | throw new TDbException('dbcommon_invalid_table_name',$table,$e->getMessage()); |