@@ -404,8 +404,7 @@ discard block |
||
| 404 | 404 | $this->setPageCount($targetControl->getPageCount()); |
| 405 | 405 | $this->setCurrentPageIndex($targetControl->getCurrentPageIndex()); |
| 406 | 406 | $this->buildPager(); |
| 407 | - } |
|
| 408 | - else |
|
| 407 | + } else |
|
| 409 | 408 | $this->_pageCount = 0; |
| 410 | 409 | } |
| 411 | 410 | |
@@ -467,15 +466,13 @@ discard block |
||
| 467 | 466 | $button->setCssClass($this->getButtonCssClass()); |
| 468 | 467 | return $button; |
| 469 | 468 | } |
| 470 | - } |
|
| 471 | - else |
|
| 469 | + } else |
|
| 472 | 470 | { |
| 473 | 471 | if($buttonType === TPagerButtonType::ImageButton) |
| 474 | 472 | { |
| 475 | 473 | $button = new TImageButton; |
| 476 | 474 | $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
| 477 | - } |
|
| 478 | - else |
|
| 475 | + } else |
|
| 479 | 476 | $button = new TButton; |
| 480 | 477 | if(!$enabled) |
| 481 | 478 | $button->setEnabled(false); |
@@ -530,8 +527,7 @@ discard block |
||
| 530 | 527 | } |
| 531 | 528 | $label = $this->createPagerButton($buttonType, false, $this->getPrevPageText(), self::CMD_PAGE_PREV, ''); |
| 532 | 529 | $controls->add($label); |
| 533 | - } |
|
| 534 | - else |
|
| 530 | + } else |
|
| 535 | 531 | { |
| 536 | 532 | if(($text = $this->getFirstPageText()) !== '') |
| 537 | 533 | { |
@@ -553,8 +549,7 @@ discard block |
||
| 553 | 549 | $label = $this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_LAST, ''); |
| 554 | 550 | $controls->add($label); |
| 555 | 551 | } |
| 556 | - } |
|
| 557 | - else |
|
| 552 | + } else |
|
| 558 | 553 | { |
| 559 | 554 | $button = $this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE_NEXT, ''); |
| 560 | 555 | $controls->add($button); |
@@ -612,8 +607,7 @@ discard block |
||
| 612 | 607 | { |
| 613 | 608 | $label = $this->createPagerButton($buttonType, false, "$i", self::CMD_PAGE, ''); |
| 614 | 609 | $controls->add($label); |
| 615 | - } |
|
| 616 | - else |
|
| 610 | + } else |
|
| 617 | 611 | { |
| 618 | 612 | $button = $this->createPagerButton($buttonType, true, "$i", self::CMD_PAGE, "$i"); |
| 619 | 613 | $controls->add($button); |
@@ -690,32 +684,27 @@ discard block |
||
| 690 | 684 | $pageIndex = TPropertyValue::ensureInteger($param->getCommandParameter()) - 1; |
| 691 | 685 | $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
| 692 | 686 | return true; |
| 693 | - } |
|
| 694 | - elseif(strcasecmp($command, self::CMD_PAGE_NEXT) === 0) |
|
| 687 | + } elseif(strcasecmp($command, self::CMD_PAGE_NEXT) === 0) |
|
| 695 | 688 | { |
| 696 | 689 | $pageIndex = $this->getCurrentPageIndex() + 1; |
| 697 | 690 | $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
| 698 | 691 | return true; |
| 699 | - } |
|
| 700 | - elseif(strcasecmp($command, self::CMD_PAGE_PREV) === 0) |
|
| 692 | + } elseif(strcasecmp($command, self::CMD_PAGE_PREV) === 0) |
|
| 701 | 693 | { |
| 702 | 694 | $pageIndex = $this->getCurrentPageIndex() - 1; |
| 703 | 695 | $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
| 704 | 696 | return true; |
| 705 | - } |
|
| 706 | - elseif(strcasecmp($command, self::CMD_PAGE_FIRST) === 0) |
|
| 697 | + } elseif(strcasecmp($command, self::CMD_PAGE_FIRST) === 0) |
|
| 707 | 698 | { |
| 708 | 699 | $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, 0)); |
| 709 | 700 | return true; |
| 710 | - } |
|
| 711 | - elseif(strcasecmp($command, self::CMD_PAGE_LAST) === 0) |
|
| 701 | + } elseif(strcasecmp($command, self::CMD_PAGE_LAST) === 0) |
|
| 712 | 702 | { |
| 713 | 703 | $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $this->getPageCount() - 1)); |
| 714 | 704 | return true; |
| 715 | 705 | } |
| 716 | 706 | return false; |
| 717 | - } |
|
| 718 | - else |
|
| 707 | + } else |
|
| 719 | 708 | return false; |
| 720 | 709 | } |
| 721 | 710 | } |
| 722 | 711 | \ No newline at end of file |
@@ -74,11 +74,9 @@ |
||
| 74 | 74 | $this->_forControl = $control->getClientID(); |
| 75 | 75 | parent::render($writer); |
| 76 | 76 | } |
| 77 | - } |
|
| 78 | - else |
|
| 77 | + } else |
|
| 79 | 78 | throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid); |
| 80 | - } |
|
| 81 | - else |
|
| 79 | + } else |
|
| 82 | 80 | parent::render($writer); |
| 83 | 81 | } |
| 84 | 82 | |
@@ -150,15 +150,13 @@ discard block |
||
| 150 | 150 | $activeView = $views->itemAt($index); |
| 151 | 151 | else |
| 152 | 152 | throw new TInvalidDataValueException('accordion_activeviewid_invalid', $id); |
| 153 | - } |
|
| 154 | - elseif(($index = $this->getActiveViewIndex()) >= 0) |
|
| 153 | + } elseif(($index = $this->getActiveViewIndex()) >= 0) |
|
| 155 | 154 | { |
| 156 | 155 | if($index < $views->getCount()) |
| 157 | 156 | $activeView = $views->itemAt($index); |
| 158 | 157 | else |
| 159 | 158 | throw new TInvalidDataValueException('accordion_activeviewindex_invalid', $index); |
| 160 | - } |
|
| 161 | - else |
|
| 159 | + } else |
|
| 162 | 160 | { |
| 163 | 161 | foreach($views as $index => $view) |
| 164 | 162 | { |
@@ -349,8 +347,7 @@ discard block |
||
| 349 | 347 | $this->setActiveViewIndex($index); |
| 350 | 348 | $this->setActiveViewID($view->getID(false)); |
| 351 | 349 | $view->setActive(true); |
| 352 | - } |
|
| 353 | - else |
|
| 350 | + } else |
|
| 354 | 351 | $v->setActive(false); |
| 355 | 352 | } |
| 356 | 353 | } |
@@ -106,8 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
| 108 | 108 | $this->renderClientControlScript($writer); |
| 109 | - } |
|
| 110 | - elseif($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 109 | + } elseif($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 111 | 110 | $writer->addAttribute('disabled', 'disabled'); |
| 112 | 111 | parent::addAttributesToRender($writer); |
| 113 | 112 | } |
@@ -141,8 +140,7 @@ discard block |
||
| 141 | 140 | { |
| 142 | 141 | $group = $this->getValidationGroup(); |
| 143 | 142 | return $this->getPage()->getValidators($group)->getCount() > 0; |
| 144 | - } |
|
| 145 | - else |
|
| 143 | + } else |
|
| 146 | 144 | return false; |
| 147 | 145 | } |
| 148 | 146 | |
@@ -91,8 +91,7 @@ |
||
| 91 | 91 | $cell->registerObject('CheckBox', $checkBox); |
| 92 | 92 | if($this->getDataField() !== '') |
| 93 | 93 | $checkBox->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
| 94 | - } |
|
| 95 | - else |
|
| 94 | + } else |
|
| 96 | 95 | parent::initializeCell($cell, $columnIndex, $itemType); |
| 97 | 96 | } |
| 98 | 97 | |
@@ -328,8 +328,7 @@ discard block |
||
| 328 | 328 | $writer->addAttributes($attributes); |
| 329 | 329 | if($value !== null) |
| 330 | 330 | $attributes->add('value', $value); |
| 331 | - } |
|
| 332 | - else |
|
| 331 | + } else |
|
| 333 | 332 | $onclick = ''; |
| 334 | 333 | if($needspan = $this->getSpanNeeded()) |
| 335 | 334 | { |
@@ -343,14 +342,12 @@ discard block |
||
| 343 | 342 | { |
| 344 | 343 | $this->renderLabel($writer, $clientID, $text); |
| 345 | 344 | $this->renderInputTag($writer, $clientID, $onclick); |
| 346 | - } |
|
| 347 | - else |
|
| 345 | + } else |
|
| 348 | 346 | { |
| 349 | 347 | $this->renderInputTag($writer, $clientID, $onclick); |
| 350 | 348 | $this->renderLabel($writer, $clientID, $text); |
| 351 | 349 | } |
| 352 | - } |
|
| 353 | - else |
|
| 350 | + } else |
|
| 354 | 351 | $this->renderInputTag($writer, $clientID, $onclick); |
| 355 | 352 | if($needspan) |
| 356 | 353 | $writer->renderEndTag(); |
@@ -924,23 +924,19 @@ discard block |
||
| 924 | 924 | $this->setSelectedItemIndex($item->getItemIndex()); |
| 925 | 925 | $this->onSelectedIndexChanged($param); |
| 926 | 926 | return true; |
| 927 | - } |
|
| 928 | - elseif(strcasecmp($command, self::CMD_EDIT) === 0) |
|
| 927 | + } elseif(strcasecmp($command, self::CMD_EDIT) === 0) |
|
| 929 | 928 | { |
| 930 | 929 | $this->onEditCommand($param); |
| 931 | 930 | return true; |
| 932 | - } |
|
| 933 | - elseif(strcasecmp($command, self::CMD_DELETE) === 0) |
|
| 931 | + } elseif(strcasecmp($command, self::CMD_DELETE) === 0) |
|
| 934 | 932 | { |
| 935 | 933 | $this->onDeleteCommand($param); |
| 936 | 934 | return true; |
| 937 | - } |
|
| 938 | - elseif(strcasecmp($command, self::CMD_UPDATE) === 0) |
|
| 935 | + } elseif(strcasecmp($command, self::CMD_UPDATE) === 0) |
|
| 939 | 936 | { |
| 940 | 937 | $this->onUpdateCommand($param); |
| 941 | 938 | return true; |
| 942 | - } |
|
| 943 | - elseif(strcasecmp($command, self::CMD_CANCEL) === 0) |
|
| 939 | + } elseif(strcasecmp($command, self::CMD_CANCEL) === 0) |
|
| 944 | 940 | { |
| 945 | 941 | $this->onCancelCommand($param); |
| 946 | 942 | return true; |
@@ -1078,8 +1074,7 @@ discard block |
||
| 1078 | 1074 | $style = $item->getStyle(); |
| 1079 | 1075 | $item->clearStyle(); |
| 1080 | 1076 | return $style; |
| 1081 | - } |
|
| 1082 | - else |
|
| 1077 | + } else |
|
| 1083 | 1078 | return null; |
| 1084 | 1079 | } |
| 1085 | 1080 | |
@@ -1141,8 +1136,7 @@ discard block |
||
| 1141 | 1136 | $this->onItemCreated($param); |
| 1142 | 1137 | $this->getControls()->add($item); |
| 1143 | 1138 | return $item; |
| 1144 | - } |
|
| 1145 | - else |
|
| 1139 | + } else |
|
| 1146 | 1140 | return null; |
| 1147 | 1141 | } |
| 1148 | 1142 | |
@@ -1166,8 +1160,7 @@ discard block |
||
| 1166 | 1160 | $item->dataBind(); |
| 1167 | 1161 | $this->onItemDataBound($param); |
| 1168 | 1162 | return $item; |
| 1169 | - } |
|
| 1170 | - else |
|
| 1163 | + } else |
|
| 1171 | 1164 | return null; |
| 1172 | 1165 | } |
| 1173 | 1166 | |
@@ -1187,8 +1180,7 @@ discard block |
||
| 1187 | 1180 | return [$this->getItemRenderer(),$this->_itemTemplate]; |
| 1188 | 1181 | else |
| 1189 | 1182 | return $this->getAlternatingItemDisplay(); |
| 1190 | - } |
|
| 1191 | - else |
|
| 1183 | + } else |
|
| 1192 | 1184 | return [$classPath,$this->_selectedItemTemplate]; |
| 1193 | 1185 | } |
| 1194 | 1186 | |
@@ -1248,15 +1240,13 @@ discard block |
||
| 1248 | 1240 | $item->setItemIndex($itemIndex); |
| 1249 | 1241 | $item->setItemType($itemType); |
| 1250 | 1242 | } |
| 1251 | - } |
|
| 1252 | - elseif($template !== null) |
|
| 1243 | + } elseif($template !== null) |
|
| 1253 | 1244 | { |
| 1254 | 1245 | $item = new TDataListItem; |
| 1255 | 1246 | $item->setItemIndex($itemIndex); |
| 1256 | 1247 | $item->setItemType($itemType); |
| 1257 | 1248 | $template->instantiateIn($item); |
| 1258 | - } |
|
| 1259 | - else |
|
| 1249 | + } else |
|
| 1260 | 1250 | $item = null; |
| 1261 | 1251 | |
| 1262 | 1252 | return $item; |
@@ -1415,8 +1405,7 @@ discard block |
||
| 1415 | 1405 | $items->add($this->createItemInternal($i, $itemType)); |
| 1416 | 1406 | } |
| 1417 | 1407 | $this->_footer = $this->createItemInternal(-1, TListItemType::Footer); |
| 1418 | - } |
|
| 1419 | - else |
|
| 1408 | + } else |
|
| 1420 | 1409 | $this->createEmptyContent(); |
| 1421 | 1410 | $this->clearChildState(); |
| 1422 | 1411 | } |
@@ -1481,8 +1470,7 @@ discard block |
||
| 1481 | 1470 | $this->applyItemStyles(); |
| 1482 | 1471 | $repeatInfo = $this->getRepeatInfo(); |
| 1483 | 1472 | $repeatInfo->renderRepeater($writer, $this); |
| 1484 | - } |
|
| 1485 | - elseif($this->_emptyTemplate !== null || $this->getEmptyRenderer() !== '') |
|
| 1473 | + } elseif($this->_emptyTemplate !== null || $this->getEmptyRenderer() !== '') |
|
| 1486 | 1474 | parent::render($writer); |
| 1487 | 1475 | } |
| 1488 | 1476 | } |
@@ -141,8 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $this->renderClientControlScript($writer); |
| 143 | 143 | } |
| 144 | - } |
|
| 145 | - elseif($this->getEnabled()) |
|
| 144 | + } elseif($this->getEnabled()) |
|
| 146 | 145 | $writer->addAttribute('disabled', 'disabled'); |
| 147 | 146 | parent::addAttributesToRender($writer); |
| 148 | 147 | } |
@@ -228,8 +227,7 @@ discard block |
||
| 228 | 227 | $item->setValue($value); |
| 229 | 228 | if($groupField !== '') |
| 230 | 229 | $item->setAttribute('Group', TDataFieldAccessor::getDataFieldValue($object, $groupField)); |
| 231 | - } |
|
| 232 | - else |
|
| 230 | + } else |
|
| 233 | 231 | { |
| 234 | 232 | $text = $object; |
| 235 | 233 | $item->setValue("$key"); |
@@ -242,18 +240,15 @@ discard block |
||
| 242 | 240 | { |
| 243 | 241 | $this->setSelectedValue($this->_cachedSelectedValue); |
| 244 | 242 | $this->resetCachedSelections(); |
| 245 | - } |
|
| 246 | - elseif($this->_cachedSelectedIndex !== -1) |
|
| 243 | + } elseif($this->_cachedSelectedIndex !== -1) |
|
| 247 | 244 | { |
| 248 | 245 | $this->setSelectedIndex($this->_cachedSelectedIndex); |
| 249 | 246 | $this->resetCachedSelections(); |
| 250 | - } |
|
| 251 | - elseif($this->_cachedSelectedValues !== null) |
|
| 247 | + } elseif($this->_cachedSelectedValues !== null) |
|
| 252 | 248 | { |
| 253 | 249 | $this->setSelectedValues($this->_cachedSelectedValues); |
| 254 | 250 | $this->resetCachedSelections(); |
| 255 | - } |
|
| 256 | - elseif($this->_cachedSelectedIndices !== null) |
|
| 251 | + } elseif($this->_cachedSelectedIndices !== null) |
|
| 257 | 252 | { |
| 258 | 253 | $this->setSelectedIndices($this->_cachedSelectedIndices); |
| 259 | 254 | $this->resetCachedSelections(); |
@@ -529,8 +524,7 @@ discard block |
||
| 529 | 524 | } |
| 530 | 525 | } |
| 531 | 526 | $this->_cachedSelectedIndices = $indices; |
| 532 | - } |
|
| 533 | - else |
|
| 527 | + } else |
|
| 534 | 528 | throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this)); |
| 535 | 529 | |
| 536 | 530 | if($this->getAdapter() instanceof IListControlAdapter) |
@@ -599,8 +593,7 @@ discard block |
||
| 599 | 593 | { |
| 600 | 594 | $this->clearSelection(); |
| 601 | 595 | $item->setSelected(true); |
| 602 | - } |
|
| 603 | - else |
|
| 596 | + } else |
|
| 604 | 597 | $this->clearSelection(); |
| 605 | 598 | } |
| 606 | 599 | $this->_cachedSelectedValue = $value; |
@@ -646,8 +639,7 @@ discard block |
||
| 646 | 639 | } |
| 647 | 640 | } |
| 648 | 641 | $this->_cachedSelectedValues = $values; |
| 649 | - } |
|
| 650 | - else |
|
| 642 | + } else |
|
| 651 | 643 | throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this)); |
| 652 | 644 | |
| 653 | 645 | if($this->getAdapter() instanceof IListControlAdapter) |
@@ -821,8 +813,7 @@ discard block |
||
| 821 | 813 | } |
| 822 | 814 | foreach($item->getAttributes() as $name => $value) |
| 823 | 815 | $writer->addAttribute($name, $value); |
| 824 | - } |
|
| 825 | - elseif($previousGroup !== null) |
|
| 816 | + } elseif($previousGroup !== null) |
|
| 826 | 817 | { |
| 827 | 818 | $writer->renderEndTag(); |
| 828 | 819 | $writer->writeLine(); |
@@ -869,13 +860,11 @@ discard block |
||
| 869 | 860 | if(eval("\$result=$expression;") === false) |
| 870 | 861 | throw new Exception(''); |
| 871 | 862 | return $result; |
| 872 | - } |
|
| 873 | - catch(Exception $e) |
|
| 863 | + } catch(Exception $e) |
|
| 874 | 864 | { |
| 875 | 865 | throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage()); |
| 876 | 866 | } |
| 877 | - } |
|
| 878 | - else |
|
| 867 | + } else |
|
| 879 | 868 | return sprintf($formatString, $value); |
| 880 | 869 | } |
| 881 | 870 | } |
| 882 | 871 | \ No newline at end of file |
@@ -178,8 +178,7 @@ discard block |
||
| 178 | 178 | $control->setItemType($item->getItemType()); |
| 179 | 179 | } |
| 180 | 180 | $cell->getControls()->add($control); |
| 181 | - } |
|
| 182 | - else |
|
| 181 | + } else |
|
| 183 | 182 | $control = $cell; |
| 184 | 183 | $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
| 185 | 184 | break; |
@@ -196,15 +195,13 @@ discard block |
||
| 196 | 195 | } |
| 197 | 196 | $cell->getControls()->add($control); |
| 198 | 197 | $cell->registerObject('EditControl', $control); |
| 199 | - } |
|
| 200 | - else |
|
| 198 | + } else |
|
| 201 | 199 | { |
| 202 | 200 | $control = new TTextBox; |
| 203 | 201 | $cell->getControls()->add($control); |
| 204 | 202 | $cell->registerObject('TextBox', $control); |
| 205 | 203 | } |
| 206 | - } |
|
| 207 | - else |
|
| 204 | + } else |
|
| 208 | 205 | { |
| 209 | 206 | if(($classPath = $this->getItemRenderer()) !== '') |
| 210 | 207 | { |
@@ -215,8 +212,7 @@ discard block |
||
| 215 | 212 | $control->setItemType($item->getItemType()); |
| 216 | 213 | } |
| 217 | 214 | $cell->getControls()->add($control); |
| 218 | - } |
|
| 219 | - else |
|
| 215 | + } else |
|
| 220 | 216 | $control = $cell; |
| 221 | 217 | } |
| 222 | 218 | $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |