@@ -696,33 +696,27 @@ discard block |
||
| 696 | 696 | $this->setSelectedItemIndex($param->getItem()->getItemIndex()); |
| 697 | 697 | $this->onSelectedIndexChanged($param); |
| 698 | 698 | return true; |
| 699 | - } |
|
| 700 | - elseif(strcasecmp($command, self::CMD_EDIT) === 0) |
|
| 699 | + } elseif(strcasecmp($command, self::CMD_EDIT) === 0) |
|
| 701 | 700 | { |
| 702 | 701 | $this->onEditCommand($param); |
| 703 | 702 | return true; |
| 704 | - } |
|
| 705 | - elseif(strcasecmp($command, self::CMD_DELETE) === 0) |
|
| 703 | + } elseif(strcasecmp($command, self::CMD_DELETE) === 0) |
|
| 706 | 704 | { |
| 707 | 705 | $this->onDeleteCommand($param); |
| 708 | 706 | return true; |
| 709 | - } |
|
| 710 | - elseif(strcasecmp($command, self::CMD_UPDATE) === 0) |
|
| 707 | + } elseif(strcasecmp($command, self::CMD_UPDATE) === 0) |
|
| 711 | 708 | { |
| 712 | 709 | $this->onUpdateCommand($param); |
| 713 | 710 | return true; |
| 714 | - } |
|
| 715 | - elseif(strcasecmp($command, self::CMD_CANCEL) === 0) |
|
| 711 | + } elseif(strcasecmp($command, self::CMD_CANCEL) === 0) |
|
| 716 | 712 | { |
| 717 | 713 | $this->onCancelCommand($param); |
| 718 | 714 | return true; |
| 719 | - } |
|
| 720 | - elseif(strcasecmp($command, self::CMD_SORT) === 0) |
|
| 715 | + } elseif(strcasecmp($command, self::CMD_SORT) === 0) |
|
| 721 | 716 | { |
| 722 | 717 | $this->onSortCommand(new TDataGridSortCommandEventParameter($sender, $param)); |
| 723 | 718 | return true; |
| 724 | - } |
|
| 725 | - elseif(strcasecmp($command, self::CMD_PAGE) === 0) |
|
| 719 | + } elseif(strcasecmp($command, self::CMD_PAGE) === 0) |
|
| 726 | 720 | { |
| 727 | 721 | $p = $param->getCommandParameter(); |
| 728 | 722 | if(strcasecmp($p, self::CMD_PAGE_NEXT) === 0) |
@@ -869,8 +863,7 @@ discard block |
||
| 869 | 863 | foreach($this->_autoColumns as $column) |
| 870 | 864 | $state[] = $column->saveState(); |
| 871 | 865 | $this->setViewState('AutoColumns', $state, []); |
| 872 | - } |
|
| 873 | - else |
|
| 866 | + } else |
|
| 874 | 867 | $this->clearViewState('AutoColumns'); |
| 875 | 868 | if($this->_columns) |
| 876 | 869 | { |
@@ -878,8 +871,7 @@ discard block |
||
| 878 | 871 | foreach($this->_columns as $column) |
| 879 | 872 | $state[] = $column->saveState(); |
| 880 | 873 | $this->setViewState('Columns', $state, []); |
| 881 | - } |
|
| 882 | - else |
|
| 874 | + } else |
|
| 883 | 875 | $this->clearViewState('Columns'); |
| 884 | 876 | } |
| 885 | 877 | |
@@ -904,8 +896,7 @@ discard block |
||
| 904 | 896 | $column->loadState($st); |
| 905 | 897 | $this->_autoColumns->add($column); |
| 906 | 898 | } |
| 907 | - } |
|
| 908 | - else |
|
| 899 | + } else |
|
| 909 | 900 | $this->_autoColumns = null; |
| 910 | 901 | $state = $this->getViewState('Columns', []); |
| 911 | 902 | if($this->_columns && $this->_columns->getCount() === count($state)) |
@@ -1011,8 +1002,7 @@ discard block |
||
| 1011 | 1002 | $columns = new TList($this->getColumns()); |
| 1012 | 1003 | $autoColumns = $this->createAutoColumns($data); |
| 1013 | 1004 | $columns->mergeWith($autoColumns); |
| 1014 | - } |
|
| 1015 | - else |
|
| 1005 | + } else |
|
| 1016 | 1006 | $columns = $this->getColumns(); |
| 1017 | 1007 | $this->_allColumns = $columns; |
| 1018 | 1008 | |
@@ -1102,8 +1092,7 @@ discard block |
||
| 1102 | 1092 | { |
| 1103 | 1093 | $prevCell = $cell; |
| 1104 | 1094 | $prevCellText = $cellText; |
| 1105 | - } |
|
| 1106 | - else |
|
| 1095 | + } else |
|
| 1107 | 1096 | { |
| 1108 | 1097 | if(($rowSpan = $prevCell->getRowSpan()) === 0) |
| 1109 | 1098 | $rowSpan = 1; |
@@ -1152,8 +1141,7 @@ discard block |
||
| 1152 | 1141 | $this->getControls()->add($item); |
| 1153 | 1142 | $item->dataBind(); |
| 1154 | 1143 | $this->onItemDataBound($param); |
| 1155 | - } |
|
| 1156 | - else |
|
| 1144 | + } else |
|
| 1157 | 1145 | { |
| 1158 | 1146 | $this->onItemCreated($param); |
| 1159 | 1147 | $this->getControls()->add($item); |
@@ -1236,8 +1224,7 @@ discard block |
||
| 1236 | 1224 | $button->setText($text); |
| 1237 | 1225 | return $button; |
| 1238 | 1226 | } |
| 1239 | - } |
|
| 1240 | - else |
|
| 1227 | + } else |
|
| 1241 | 1228 | { |
| 1242 | 1229 | $button = new TButton; |
| 1243 | 1230 | if(!$enabled) |
@@ -1271,8 +1258,7 @@ discard block |
||
| 1271 | 1258 | |
| 1272 | 1259 | $label = $this->createPagerButton($pager, $buttonType, false, $style->getPrevPageText(), '', ''); |
| 1273 | 1260 | $controls->add($label); |
| 1274 | - } |
|
| 1275 | - else |
|
| 1261 | + } else |
|
| 1276 | 1262 | { |
| 1277 | 1263 | if(($text = $style->getFirstPageText()) !== '') |
| 1278 | 1264 | { |
@@ -1295,8 +1281,7 @@ discard block |
||
| 1295 | 1281 | $label = $this->createPagerButton($pager, $buttonType, false, $text, '', ''); |
| 1296 | 1282 | $controls->add($label); |
| 1297 | 1283 | } |
| 1298 | - } |
|
| 1299 | - else |
|
| 1284 | + } else |
|
| 1300 | 1285 | { |
| 1301 | 1286 | $button = $this->createPagerButton($pager, $buttonType, true, $style->getNextPageText(), self::CMD_PAGE, self::CMD_PAGE_NEXT); |
| 1302 | 1287 | $controls->add($button); |
@@ -1356,8 +1341,7 @@ discard block |
||
| 1356 | 1341 | { |
| 1357 | 1342 | $label = $this->createPagerButton($pager, $buttonType, false, "$i", '', ''); |
| 1358 | 1343 | $controls->add($label); |
| 1359 | - } |
|
| 1360 | - else |
|
| 1344 | + } else |
|
| 1361 | 1345 | { |
| 1362 | 1346 | $button = $this->createPagerButton($pager, $buttonType, true, "$i", self::CMD_PAGE, "$i"); |
| 1363 | 1347 | $controls->add($button); |
@@ -1403,8 +1387,7 @@ discard block |
||
| 1403 | 1387 | $column->setDataField($key); |
| 1404 | 1388 | $column->setSortExpression($key); |
| 1405 | 1389 | $autoColumns->add($column); |
| 1406 | - } |
|
| 1407 | - else |
|
| 1390 | + } else |
|
| 1408 | 1391 | { |
| 1409 | 1392 | $column->setHeaderText(TListItemType::Item); |
| 1410 | 1393 | $column->setDataField($key); |
@@ -1495,8 +1478,7 @@ discard block |
||
| 1495 | 1478 | { |
| 1496 | 1479 | if($itemStyle) |
| 1497 | 1480 | $item->getStyle()->mergeWith($itemStyle); |
| 1498 | - } |
|
| 1499 | - else |
|
| 1481 | + } else |
|
| 1500 | 1482 | { |
| 1501 | 1483 | if($alternatingItemStyle) |
| 1502 | 1484 | $item->getStyle()->mergeWith($alternatingItemStyle); |
@@ -1509,8 +1491,7 @@ discard block |
||
| 1509 | 1491 | { |
| 1510 | 1492 | if($itemStyle) |
| 1511 | 1493 | $item->getStyle()->mergeWith($itemStyle); |
| 1512 | - } |
|
| 1513 | - else |
|
| 1494 | + } else |
|
| 1514 | 1495 | { |
| 1515 | 1496 | if($alternatingItemStyle) |
| 1516 | 1497 | $item->getStyle()->mergeWith($alternatingItemStyle); |
@@ -1524,8 +1505,7 @@ discard block |
||
| 1524 | 1505 | { |
| 1525 | 1506 | if($pagerStyle->getPosition() === TDataGridPagerPosition::Bottom || !$pagerStyle->getVisible()) |
| 1526 | 1507 | $item->setVisible(false); |
| 1527 | - } |
|
| 1528 | - else |
|
| 1508 | + } else |
|
| 1529 | 1509 | { |
| 1530 | 1510 | if($pagerStyle->getPosition() === TDataGridPagerPosition::Top || !$pagerStyle->getVisible()) |
| 1531 | 1511 | $item->setVisible(false); |
@@ -1597,8 +1577,7 @@ discard block |
||
| 1597 | 1577 | $control->renderBeginTag($writer); |
| 1598 | 1578 | $this->renderContents($writer); |
| 1599 | 1579 | $control->renderEndTag($writer); |
| 1600 | - } |
|
| 1601 | - elseif($this->getViewState('ItemCount', 0) > 0) |
|
| 1580 | + } elseif($this->getViewState('ItemCount', 0) > 0) |
|
| 1602 | 1581 | { |
| 1603 | 1582 | $this->applyItemStyles(); |
| 1604 | 1583 | if($this->_topPager) |
@@ -142,8 +142,7 @@ |
||
| 142 | 142 | return file_put_contents($fileName, file_get_contents($this->_localName)) !== false; |
| 143 | 143 | else |
| 144 | 144 | return false; |
| 145 | - } |
|
| 146 | - else |
|
| 145 | + } else |
|
| 147 | 146 | return false; |
| 148 | 147 | } |
| 149 | 148 | |
@@ -306,8 +306,7 @@ discard block |
||
| 306 | 306 | { |
| 307 | 307 | if($index === 0 && $currentSection === TTableRowSection::Header) |
| 308 | 308 | $writer->renderBeginTag('thead'); |
| 309 | - } |
|
| 310 | - else |
|
| 309 | + } else |
|
| 311 | 310 | { |
| 312 | 311 | if($currentSection === TTableRowSection::Header) |
| 313 | 312 | { |
@@ -318,8 +317,7 @@ discard block |
||
| 318 | 317 | else |
| 319 | 318 | $writer->renderBeginTag('tfoot'); |
| 320 | 319 | $currentSection = $section; |
| 321 | - } |
|
| 322 | - elseif($currentSection === TTableRowSection::Body) |
|
| 320 | + } elseif($currentSection === TTableRowSection::Body) |
|
| 323 | 321 | { |
| 324 | 322 | $writer->renderEndTag(); |
| 325 | 323 | if($section === TTableRowSection::Footer) |
@@ -327,16 +325,14 @@ discard block |
||
| 327 | 325 | else |
| 328 | 326 | throw new TConfigurationException('table_tablesection_outoforder'); |
| 329 | 327 | $currentSection = $section; |
| 330 | - } |
|
| 331 | - else // Footer |
|
| 328 | + } else // Footer |
|
| 332 | 329 | throw new TConfigurationException('table_tablesection_outoforder'); |
| 333 | 330 | } |
| 334 | 331 | $row->renderControl($writer); |
| 335 | 332 | $writer->writeLine(); |
| 336 | 333 | } |
| 337 | 334 | $writer->renderEndTag(); |
| 338 | - } |
|
| 339 | - else |
|
| 335 | + } else |
|
| 340 | 336 | { |
| 341 | 337 | $writer->writeLine(); |
| 342 | 338 | foreach($this->getControls() as $row) |
@@ -108,8 +108,7 @@ |
||
| 108 | 108 | { |
| 109 | 109 | $options['TokenHash'] = $this->generateTokenHash($control->getToken()); |
| 110 | 110 | $options['CaseSensitive'] = true; |
| 111 | - } |
|
| 112 | - else |
|
| 111 | + } else |
|
| 113 | 112 | { |
| 114 | 113 | $options['TokenHash'] = $this->generateTokenHash(strtoupper($control->getToken())); |
| 115 | 114 | $options['CaseSensitive'] = false; |
@@ -121,8 +121,7 @@ discard block |
||
| 121 | 121 | $writer->addAttribute('cols', "$cols"); |
| 122 | 122 | if(!$this->getWrap()) |
| 123 | 123 | $writer->addAttribute('wrap', 'off'); |
| 124 | - } |
|
| 125 | - else |
|
| 124 | + } else |
|
| 126 | 125 | { |
| 127 | 126 | switch($textMode) |
| 128 | 127 | { |
@@ -268,8 +267,7 @@ discard block |
||
| 268 | 267 | { |
| 269 | 268 | $this->setText($value); |
| 270 | 269 | return $this->_dataChanged = true; |
| 271 | - } |
|
| 272 | - else |
|
| 270 | + } else |
|
| 273 | 271 | return false; |
| 274 | 272 | } |
| 275 | 273 | |
@@ -80,12 +80,10 @@ discard block |
||
| 80 | 80 | $name = urlencode($name . '[]'); |
| 81 | 81 | foreach($value as $v) |
| 82 | 82 | $url .= $amp . $name . '=' . urlencode($v); |
| 83 | - } |
|
| 84 | - else |
|
| 83 | + } else |
|
| 85 | 84 | $url .= $amp . urlencode($name) . '=' . urlencode($value); |
| 86 | 85 | } |
| 87 | - } |
|
| 88 | - else |
|
| 86 | + } else |
|
| 89 | 87 | { |
| 90 | 88 | foreach($getItems as $name => $value) |
| 91 | 89 | { |
@@ -93,8 +91,7 @@ discard block |
||
| 93 | 91 | { |
| 94 | 92 | foreach($value as $v) |
| 95 | 93 | $url .= $amp . $name . '[]=' . $v; |
| 96 | - } |
|
| 97 | - else |
|
| 94 | + } else |
|
| 98 | 95 | $url .= $amp . $name . '=' . $value; |
| 99 | 96 | } |
| 100 | 97 | } |
@@ -147,14 +144,12 @@ discard block |
||
| 147 | 144 | $getVariables[substr($name, 0, $pos)][] = $value; |
| 148 | 145 | else |
| 149 | 146 | $getVariables[$name] = $value; |
| 150 | - } |
|
| 151 | - else |
|
| 147 | + } else |
|
| 152 | 148 | $getVariables[$path] = ''; |
| 153 | 149 | } |
| 154 | 150 | } |
| 155 | 151 | return $getVariables; |
| 156 | - } |
|
| 157 | - else |
|
| 152 | + } else |
|
| 158 | 153 | return []; |
| 159 | 154 | } |
| 160 | 155 | } |
@@ -104,8 +104,7 @@ |
||
| 104 | 104 | $this->_query = isset($ret['query'])?$ret['query']:''; |
| 105 | 105 | $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
| 106 | 106 | $this->_uri = $uri; |
| 107 | - } |
|
| 108 | - else |
|
| 107 | + } else |
|
| 109 | 108 | { |
| 110 | 109 | throw new TInvalidDataValueException('uri_format_invalid', $uri); |
| 111 | 110 | } |
@@ -318,13 +318,11 @@ discard block |
||
| 318 | 318 | { |
| 319 | 319 | ini_set('session.use_cookies', '0'); |
| 320 | 320 | ini_set('session.use_only_cookies', '0'); |
| 321 | - } |
|
| 322 | - elseif($value === THttpSessionCookieMode::Allow) |
|
| 321 | + } elseif($value === THttpSessionCookieMode::Allow) |
|
| 323 | 322 | { |
| 324 | 323 | ini_set('session.use_cookies', '1'); |
| 325 | 324 | ini_set('session.use_only_cookies', '0'); |
| 326 | - } |
|
| 327 | - else |
|
| 325 | + } else |
|
| 328 | 326 | { |
| 329 | 327 | ini_set('session.use_cookies', '1'); |
| 330 | 328 | ini_set('session.use_only_cookies', '1'); |
@@ -377,8 +375,7 @@ discard block |
||
| 377 | 375 | { |
| 378 | 376 | ini_set('session.gc_probability', $value); |
| 379 | 377 | ini_set('session.gc_divisor', '100'); |
| 380 | - } |
|
| 381 | - else |
|
| 378 | + } else |
|
| 382 | 379 | throw new TInvalidDataValueException('httpsession_gcprobability_invalid', $value); |
| 383 | 380 | } |
| 384 | 381 | } |
@@ -570,8 +567,7 @@ discard block |
||
| 570 | 567 | $value = $_SESSION[$key]; |
| 571 | 568 | unset($_SESSION[$key]); |
| 572 | 569 | return $value; |
| 573 | - } |
|
| 574 | - else |
|
| 570 | + } else |
|
| 575 | 571 | return null; |
| 576 | 572 | } |
| 577 | 573 | |
@@ -232,8 +232,7 @@ discard block |
||
| 232 | 232 | $port = $_SERVER['SERVER_PORT']; |
| 233 | 233 | if(($port != 80 && !$secure) || ($port != 443 && $secure)) |
| 234 | 234 | $url .= ':' . $port; |
| 235 | - } |
|
| 236 | - else |
|
| 235 | + } else |
|
| 237 | 236 | $url .= $_SERVER['HTTP_HOST']; |
| 238 | 237 | $url .= $this->getRequestUri(); |
| 239 | 238 | $this->_url = new TUri($url); |
@@ -341,8 +340,7 @@ discard block |
||
| 341 | 340 | { |
| 342 | 341 | $this->_urlManager = new TUrlManager; |
| 343 | 342 | $this->_urlManager->init(null); |
| 344 | - } |
|
| 345 | - else |
|
| 343 | + } else |
|
| 346 | 344 | { |
| 347 | 345 | $this->_urlManager = $this->getApplication()->getModule($this->_urlManagerID); |
| 348 | 346 | if($this->_urlManager === null) |
@@ -462,8 +460,7 @@ discard block |
||
| 462 | 460 | |
| 463 | 461 | if($result === null && function_exists('apache_request_headers')) { |
| 464 | 462 | $result = apache_request_headers(); |
| 465 | - } |
|
| 466 | - elseif($result === null) { |
|
| 463 | + } elseif($result === null) { |
|
| 467 | 464 | $result = []; |
| 468 | 465 | foreach($_SERVER as $key => $value) { |
| 469 | 466 | if(strncasecmp($key, 'HTTP_', 5) !== 0) continue; |
@@ -575,8 +572,7 @@ discard block |
||
| 575 | 572 | try |
| 576 | 573 | { |
| 577 | 574 | return get_browser(); |
| 578 | - } |
|
| 579 | - catch(TPhpErrorException $e) |
|
| 575 | + } catch(TPhpErrorException $e) |
|
| 580 | 576 | { |
| 581 | 577 | throw new TConfigurationException('httprequest_browscap_required'); |
| 582 | 578 | } |
@@ -679,8 +675,7 @@ discard block |
||
| 679 | 675 | if(($value = $sm->validateData($value)) !== false) |
| 680 | 676 | $this->_cookies->add(new THttpCookie($key, $value)); |
| 681 | 677 | } |
| 682 | - } |
|
| 683 | - else |
|
| 678 | + } else |
|
| 684 | 679 | { |
| 685 | 680 | foreach($_COOKIE as $key => $value) |
| 686 | 681 | $this->_cookies->add(new THttpCookie($key, $value)); |
@@ -897,8 +892,7 @@ discard block |
||
| 897 | 892 | $value = $this->_items[$key]; |
| 898 | 893 | unset($this->_items[$key]); |
| 899 | 894 | return $value; |
| 900 | - } |
|
| 901 | - else |
|
| 895 | + } else |
|
| 902 | 896 | return null; |
| 903 | 897 | } |
| 904 | 898 | |