@@ -136,8 +136,7 @@ discard block |
||
| 136 | 136 | $button->setCssClass($this->getButtonCssClass()); |
| 137 | 137 | return $button; |
| 138 | 138 | } |
| 139 | - } |
|
| 140 | - elseif($buttonType === TPagerButtonType::ImageButton) |
|
| 139 | + } elseif($buttonType === TPagerButtonType::ImageButton) |
|
| 141 | 140 | { |
| 142 | 141 | $button = new TActiveImageButton; |
| 143 | 142 | $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
@@ -145,8 +144,7 @@ discard block |
||
| 145 | 144 | $button->Visible = true; |
| 146 | 145 | else |
| 147 | 146 | $button->Visible = false; |
| 148 | - } |
|
| 149 | - else |
|
| 147 | + } else |
|
| 150 | 148 | { |
| 151 | 149 | $button = new TActiveButton; |
| 152 | 150 | if(!$enabled) |
@@ -206,8 +204,7 @@ discard block |
||
| 206 | 204 | TWebControl::render($writer); |
| 207 | 205 | if($this->getActiveControl()->canUpdateClientSide()) |
| 208 | 206 | $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
| 209 | - } |
|
| 210 | - else |
|
| 207 | + } else |
|
| 211 | 208 | { |
| 212 | 209 | $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
| 213 | 210 | } |
@@ -116,8 +116,7 @@ discard block |
||
| 116 | 116 | $newid = substr($id, $pos + 1); |
| 117 | 117 | if ($control !== null) |
| 118 | 118 | $control = $control->$newid; |
| 119 | - } |
|
| 120 | - else |
|
| 119 | + } else |
|
| 121 | 120 | { |
| 122 | 121 | // TCheckBoxList overrides findControl() with a fake implementation |
| 123 | 122 | // but accepts a second parameter to use the standard one |
@@ -179,8 +178,7 @@ discard block |
||
| 179 | 178 | { |
| 180 | 179 | $group = $this->getValidationGroup(); |
| 181 | 180 | return $this->getPage()->getValidators($group)->getCount() > 0; |
| 182 | - } |
|
| 183 | - else |
|
| 181 | + } else |
|
| 184 | 182 | return false; |
| 185 | 183 | } |
| 186 | 184 | |
@@ -71,8 +71,7 @@ |
||
| 71 | 71 | $value = str_ireplace(["\r\n", "\n"], "", $value); |
| 72 | 72 | $command = "tinyMCE.getInstanceById('{$this->getClientID()}').execCommand('mceSetContent',false,'{$value}')"; |
| 73 | 73 | $this->getPage()->getCallbackClient()->evaluateScript($command); |
| 74 | - } |
|
| 75 | - else |
|
| 74 | + } else |
|
| 76 | 75 | $this->getPage()->getCallbackClient()->setValue($this, $value); |
| 77 | 76 | } |
| 78 | 77 | } |
@@ -239,13 +239,11 @@ discard block |
||
| 239 | 239 | // this is the most secure method, file info can't be forged from client side, no matter what |
| 240 | 240 | $token = md5('TActiveFileUpload::Params::' . $this->ClientID . '::' . rand(1000 * 1000, 9999 * 1000)); |
| 241 | 241 | $cache->set($token, serialize($params), 5 * 60); // expire in 5 minutes - the callback should arrive back in seconds, actually |
| 242 | - } |
|
| 243 | - elseif ($mgr = Prado::getApplication()->getSecurityManager()) |
|
| 242 | + } elseif ($mgr = Prado::getApplication()->getSecurityManager()) |
|
| 244 | 243 | { |
| 245 | 244 | // this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key |
| 246 | 245 | $token = urlencode(base64_encode($mgr->encrypt(serialize($params)))); |
| 247 | - } |
|
| 248 | - else |
|
| 246 | + } else |
|
| 249 | 247 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
| 250 | 248 | |
| 251 | 249 | return $token; |
@@ -259,13 +257,11 @@ discard block |
||
| 259 | 257 | assert($v != ''); |
| 260 | 258 | $cache->delete($token); // remove it from cache so it can't be used again and won't take up space either |
| 261 | 259 | $params = unserialize($v); |
| 262 | - } |
|
| 263 | - elseif ($mgr = Prado::getApplication()->getSecurityManager()) |
|
| 260 | + } elseif ($mgr = Prado::getApplication()->getSecurityManager()) |
|
| 264 | 261 | { |
| 265 | 262 | $v = $mgr->decrypt(base64_decode(urldecode($token))); |
| 266 | 263 | $params = unserialize($v); |
| 267 | - } |
|
| 268 | - else |
|
| 264 | + } else |
|
| 269 | 265 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
| 270 | 266 | |
| 271 | 267 | assert($params instanceof TActiveFileUploadCallbackParams); |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | elseif($item[0] === self::TYPE_DATABINDING) |
| 53 | 53 | $this->_bindings[$id] = $item[1]; |
| 54 | 54 | $this->_items[$id] = ''; |
| 55 | - } |
|
| 56 | - else |
|
| 55 | + } else |
|
| 57 | 56 | $this->_items[$id] = $item; |
| 58 | 57 | } |
| 59 | 58 | } |
@@ -244,8 +244,7 @@ discard block |
||
| 244 | 244 | $component->createdOnTemplate($parent); |
| 245 | 245 | if($component->getAllowChildControls()) |
| 246 | 246 | $controls[$key] = $component; |
| 247 | - } |
|
| 248 | - elseif($component instanceof TComponent) |
|
| 247 | + } elseif($component instanceof TComponent) |
|
| 249 | 248 | { |
| 250 | 249 | $controls[$key] = $component; |
| 251 | 250 | if(isset($properties['id'])) |
@@ -263,8 +262,7 @@ discard block |
||
| 263 | 262 | else |
| 264 | 263 | $component->createdOnTemplate($parent); |
| 265 | 264 | } |
| 266 | - } |
|
| 267 | - else |
|
| 265 | + } else |
|
| 268 | 266 | { |
| 269 | 267 | if($object[1] instanceof TCompositeLiteral) |
| 270 | 268 | { |
@@ -275,8 +273,7 @@ discard block |
||
| 275 | 273 | $directChildren[] = $o; |
| 276 | 274 | else |
| 277 | 275 | $parent->addParsedObject($o); |
| 278 | - } |
|
| 279 | - else |
|
| 276 | + } else |
|
| 280 | 277 | { |
| 281 | 278 | if($parent === $parentControl) |
| 282 | 279 | $directChildren[] = $object[1]; |
@@ -387,8 +384,7 @@ discard block |
||
| 387 | 384 | throw new TConfigurationException('template_tag_unexpected', $name, $value[1]); |
| 388 | 385 | break; |
| 389 | 386 | } |
| 390 | - } |
|
| 391 | - else |
|
| 387 | + } else |
|
| 392 | 388 | { |
| 393 | 389 | if (substr($name, 0, 2) == 'js') |
| 394 | 390 | if ($value and !($value instanceof TJavaScriptLiteral)) |
@@ -436,8 +432,7 @@ discard block |
||
| 436 | 432 | throw new TConfigurationException('template_tag_unexpected', $name, $value[1]); |
| 437 | 433 | break; |
| 438 | 434 | } |
| 439 | - } |
|
| 440 | - else |
|
| 435 | + } else |
|
| 441 | 436 | $component->setSubProperty($name, $value); |
| 442 | 437 | } |
| 443 | 438 | |
@@ -498,8 +493,7 @@ discard block |
||
| 498 | 493 | $stack[] = $type; |
| 499 | 494 | $container = $c - 1; |
| 500 | 495 | } |
| 501 | - } |
|
| 502 | - elseif(strpos($str, '</com:') === 0) // closing component tag |
|
| 496 | + } elseif(strpos($str, '</com:') === 0) // closing component tag |
|
| 503 | 497 | { |
| 504 | 498 | if($expectPropEnd) |
| 505 | 499 | continue; |
@@ -518,8 +512,7 @@ discard block |
||
| 518 | 512 | throw new TConfigurationException('template_closingtag_expected', $tag, "</com:$type>"); |
| 519 | 513 | } |
| 520 | 514 | $container = $tpl[$container][0]; |
| 521 | - } |
|
| 522 | - elseif(strpos($str, '<%@') === 0) // directive |
|
| 515 | + } elseif(strpos($str, '<%@') === 0) // directive |
|
| 523 | 516 | { |
| 524 | 517 | if($expectPropEnd) |
| 525 | 518 | continue; |
@@ -529,8 +522,7 @@ discard block |
||
| 529 | 522 | if(isset($tpl[0]) || $this->_directive !== null) |
| 530 | 523 | throw new TConfigurationException('template_directive_nonunique'); |
| 531 | 524 | $this->_directive = $this->parseAttributes($match[4][0], $match[4][1]); |
| 532 | - } |
|
| 533 | - elseif(strpos($str, '<%') === 0) // expression |
|
| 525 | + } elseif(strpos($str, '<%') === 0) // expression |
|
| 534 | 526 | { |
| 535 | 527 | if($expectPropEnd) |
| 536 | 528 | continue; |
@@ -555,8 +547,7 @@ discard block |
||
| 555 | 547 | $literal = strtr(trim(substr($literal, 0, strlen($literal) - 1)), ["'" => "\'","\\" => "\\\\"]); |
| 556 | 548 | $tpl[$c++] = [$container,[TCompositeLiteral::TYPE_EXPRESSION,"Prado::localize('$literal')"]]; |
| 557 | 549 | } |
| 558 | - } |
|
| 559 | - elseif(strpos($str, '<prop:') === 0) // opening property |
|
| 550 | + } elseif(strpos($str, '<prop:') === 0) // opening property |
|
| 560 | 551 | { |
| 561 | 552 | if(strrpos($str, '/>') === strlen($str) - 2) //subproperties |
| 562 | 553 | { |
@@ -578,8 +569,7 @@ discard block |
||
| 578 | 569 | throw new TConfigurationException('template_property_duplicated', $name); |
| 579 | 570 | $tpl[$container][2][$name] = $value; |
| 580 | 571 | } |
| 581 | - } |
|
| 582 | - else // regular property |
|
| 572 | + } else // regular property |
|
| 583 | 573 | { |
| 584 | 574 | $prop = strtolower($match[3][0]); |
| 585 | 575 | $stack[] = '@' . $prop; |
@@ -591,8 +581,7 @@ discard block |
||
| 591 | 581 | $expectPropEnd = true; |
| 592 | 582 | } |
| 593 | 583 | } |
| 594 | - } |
|
| 595 | - elseif(strpos($str, '</prop:') === 0) // closing property |
|
| 584 | + } elseif(strpos($str, '</prop:') === 0) // closing property |
|
| 596 | 585 | { |
| 597 | 586 | $prop = strtolower($match[3][0]); |
| 598 | 587 | if(empty($stack)) |
@@ -619,23 +608,20 @@ discard block |
||
| 619 | 608 | if(isset($tpl[$container][2][$prop])) |
| 620 | 609 | throw new TConfigurationException('template_property_duplicated', $prop); |
| 621 | 610 | $tpl[$container][2][$prop] = $value; |
| 622 | - } |
|
| 623 | - else // a property for the template control |
|
| 611 | + } else // a property for the template control |
|
| 624 | 612 | $this->_directive[$prop] = $value; |
| 625 | 613 | $textStart = $matchEnd + 1; |
| 626 | 614 | } |
| 627 | 615 | $expectPropEnd = false; |
| 628 | 616 | } |
| 629 | - } |
|
| 630 | - elseif(strpos($str, '<!--') === 0) // comments |
|
| 617 | + } elseif(strpos($str, '<!--') === 0) // comments |
|
| 631 | 618 | { |
| 632 | 619 | if($expectPropEnd) |
| 633 | 620 | throw new TConfigurationException('template_comments_forbidden'); |
| 634 | 621 | if($matchStart > $textStart) |
| 635 | 622 | $tpl[$c++] = [$container,substr($input, $textStart, $matchStart - $textStart)]; |
| 636 | 623 | $textStart = $matchEnd + 1; |
| 637 | - } |
|
| 638 | - else |
|
| 624 | + } else |
|
| 639 | 625 | throw new TConfigurationException('template_matching_unexpected', $match); |
| 640 | 626 | } |
| 641 | 627 | if(!empty($stack)) |
@@ -646,8 +632,7 @@ discard block |
||
| 646 | 632 | } |
| 647 | 633 | if($textStart < strlen($input)) |
| 648 | 634 | $tpl[$c++] = [$container,substr($input, $textStart)]; |
| 649 | - } |
|
| 650 | - catch(\Exception $e) |
|
| 635 | + } catch(\Exception $e) |
|
| 651 | 636 | { |
| 652 | 637 | if(($e instanceof TException) && ($e instanceof TTemplateException)) |
| 653 | 638 | throw $e; |
@@ -680,14 +665,12 @@ discard block |
||
| 680 | 665 | { |
| 681 | 666 | $parent = null; |
| 682 | 667 | $objects[$id] = $object; |
| 683 | - } |
|
| 684 | - else |
|
| 668 | + } else |
|
| 685 | 669 | { |
| 686 | 670 | $parent = $object[0]; |
| 687 | 671 | $merged = [$parent,[$object[1]]]; |
| 688 | 672 | } |
| 689 | - } |
|
| 690 | - else |
|
| 673 | + } else |
|
| 691 | 674 | $merged[1][] = $object[1]; |
| 692 | 675 | } |
| 693 | 676 | if($parent !== null) |
@@ -726,8 +709,7 @@ discard block |
||
| 726 | 709 | $attributes[$name] = $this->parseTemplateProperty(substr($value, 1, strlen($value) - 2), $match[2][1] + 1); |
| 727 | 710 | else |
| 728 | 711 | $attributes[$name] = $this->parseTemplateProperty($value, $match[2][1]); |
| 729 | - } |
|
| 730 | - else |
|
| 712 | + } else |
|
| 731 | 713 | { |
| 732 | 714 | if($value[0] === '\'' || $value[0] === '"') |
| 733 | 715 | $attributes[$name] = $this->parseAttribute(substr($value, 1, strlen($value) - 2)); |
@@ -776,8 +758,7 @@ discard block |
||
| 776 | 758 | return [self::CONFIG_DATABIND,ltrim($expr, '.')]; |
| 777 | 759 | else |
| 778 | 760 | return [self::CONFIG_EXPRESSION,ltrim($expr, '.')]; |
| 779 | - } |
|
| 780 | - elseif(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>|<%\/.*?%>)\\s*/msS', $value, $matches) && $matches[0] === $value) |
|
| 761 | + } elseif(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>|<%\/.*?%>)\\s*/msS', $value, $matches) && $matches[0] === $value) |
|
| 781 | 762 | { |
| 782 | 763 | $value = $matches[1]; |
| 783 | 764 | if($value[2] === '~') |
@@ -790,8 +771,7 @@ discard block |
||
| 790 | 771 | $literal = trim(substr($value, 3, strlen($value) - 5)); |
| 791 | 772 | return [self::CONFIG_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '\/').'/$literal'"]; |
| 792 | 773 | } |
| 793 | - } |
|
| 794 | - else |
|
| 774 | + } else |
|
| 795 | 775 | return $value; |
| 796 | 776 | } |
| 797 | 777 | |
@@ -813,16 +793,14 @@ discard block |
||
| 813 | 793 | $subname = substr($name, 0, $pos); |
| 814 | 794 | if(!$class->hasMethod('get' . $subname)) |
| 815 | 795 | throw new TConfigurationException('template_property_unknown', $type, $subname); |
| 816 | - } |
|
| 817 | - elseif(strncasecmp($name, 'on', 2) === 0) |
|
| 796 | + } elseif(strncasecmp($name, 'on', 2) === 0) |
|
| 818 | 797 | { |
| 819 | 798 | // an event |
| 820 | 799 | if(!$class->hasMethod($name)) |
| 821 | 800 | throw new TConfigurationException('template_event_unknown', $type, $name); |
| 822 | 801 | elseif(!is_string($att)) |
| 823 | 802 | throw new TConfigurationException('template_eventhandler_invalid', $type, $name); |
| 824 | - } |
|
| 825 | - else |
|
| 803 | + } else |
|
| 826 | 804 | { |
| 827 | 805 | // a simple property |
| 828 | 806 | if (! ($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, 'set' . $name))) |
@@ -831,8 +809,7 @@ discard block |
||
| 831 | 809 | throw new TConfigurationException('template_property_readonly', $type, $name); |
| 832 | 810 | else |
| 833 | 811 | throw new TConfigurationException('template_property_unknown', $type, $name); |
| 834 | - } |
|
| 835 | - elseif(is_array($att) && $att[0] !== self::CONFIG_EXPRESSION) |
|
| 812 | + } elseif(is_array($att) && $att[0] !== self::CONFIG_EXPRESSION) |
|
| 836 | 813 | { |
| 837 | 814 | if(strcasecmp($name, 'id') === 0) |
| 838 | 815 | throw new TConfigurationException('template_controlid_invalid', $type); |
@@ -841,8 +818,7 @@ discard block |
||
| 841 | 818 | } |
| 842 | 819 | } |
| 843 | 820 | } |
| 844 | - } |
|
| 845 | - elseif(is_subclass_of($className, '\Prado\TComponent') || $className === '\Prado\TComponent') |
|
| 821 | + } elseif(is_subclass_of($className, '\Prado\TComponent') || $className === '\Prado\TComponent') |
|
| 846 | 822 | { |
| 847 | 823 | foreach($attributes as $name => $att) |
| 848 | 824 | { |
@@ -854,8 +830,7 @@ discard block |
||
| 854 | 830 | $subname = substr($name, 0, $pos); |
| 855 | 831 | if(!$class->hasMethod('get' . $subname)) |
| 856 | 832 | throw new TConfigurationException('template_property_unknown', $type, $subname); |
| 857 | - } |
|
| 858 | - elseif(strncasecmp($name, 'on', 2) === 0) |
|
| 833 | + } elseif(strncasecmp($name, 'on', 2) === 0) |
|
| 859 | 834 | throw new TConfigurationException('template_event_forbidden', $type, $name); |
| 860 | 835 | else |
| 861 | 836 | { |
@@ -869,8 +844,7 @@ discard block |
||
| 869 | 844 | } |
| 870 | 845 | } |
| 871 | 846 | } |
| 872 | - } |
|
| 873 | - else |
|
| 847 | + } else |
|
| 874 | 848 | throw new TConfigurationException('template_component_required', $type); |
| 875 | 849 | return $class->getName(); |
| 876 | 850 | } |
@@ -906,8 +880,7 @@ discard block |
||
| 906 | 880 | $line = $line - $this->_includeAtLine[$i] + 1; |
| 907 | 881 | $srcFile = $this->_includedFiles[$i]; |
| 908 | 882 | break; |
| 909 | - } |
|
| 910 | - else |
|
| 883 | + } else |
|
| 911 | 884 | $line = $line - $this->_includeLines[$i] + 1; |
| 912 | 885 | } |
| 913 | 886 | } |
@@ -204,8 +204,7 @@ discard block |
||
| 204 | 204 | $this->processCallbackRequest($writer); |
| 205 | 205 | else |
| 206 | 206 | $this->processPostBackRequest($writer); |
| 207 | - } |
|
| 208 | - else |
|
| 207 | + } else |
|
| 209 | 208 | $this->processNormalRequest($writer); |
| 210 | 209 | |
| 211 | 210 | $this->_writer = null; |
@@ -494,8 +493,7 @@ discard block |
||
| 494 | 493 | { |
| 495 | 494 | foreach($this->_validators as $validator) |
| 496 | 495 | $validator->validate(); |
| 497 | - } |
|
| 498 | - else |
|
| 496 | + } else |
|
| 499 | 497 | { |
| 500 | 498 | foreach($this->_validators as $validator) |
| 501 | 499 | { |
@@ -523,8 +521,7 @@ discard block |
||
| 523 | 521 | return false; |
| 524 | 522 | } |
| 525 | 523 | return true; |
| 526 | - } |
|
| 527 | - else |
|
| 524 | + } else |
|
| 528 | 525 | throw new TInvalidOperationException('page_isvalid_unknown'); |
| 529 | 526 | } |
| 530 | 527 | |
@@ -878,15 +875,13 @@ discard block |
||
| 878 | 875 | { |
| 879 | 876 | if($control->loadPostData($key, $postData)) |
| 880 | 877 | $this->_controlsPostDataChanged[] = $control; |
| 881 | - } |
|
| 882 | - elseif($control instanceof IPostBackEventHandler && |
|
| 878 | + } elseif($control instanceof IPostBackEventHandler && |
|
| 883 | 879 | empty($this->_postData[self::FIELD_POSTBACK_TARGET])) |
| 884 | 880 | { |
| 885 | 881 | $this->_postData->add(self::FIELD_POSTBACK_TARGET, $key); // not calling setPostBackEventTarget() because the control may be removed later |
| 886 | 882 | } |
| 887 | 883 | unset($this->_controlsRequiringPostData[$key]); |
| 888 | - } |
|
| 889 | - elseif($beforeLoad) |
|
| 884 | + } elseif($beforeLoad) |
|
| 890 | 885 | $this->_restPostData->add($key, $value); |
| 891 | 886 | } |
| 892 | 887 | |
@@ -898,8 +893,7 @@ discard block |
||
| 898 | 893 | { |
| 899 | 894 | if($control->loadPostData($key, $this->_postData)) |
| 900 | 895 | $this->_controlsPostDataChanged[] = $control; |
| 901 | - } |
|
| 902 | - else |
|
| 896 | + } else |
|
| 903 | 897 | throw new TInvalidDataValueException('page_postbackcontrol_invalid', $key); |
| 904 | 898 | unset($this->_controlsRequiringPostData[$key]); |
| 905 | 899 | } |
@@ -978,8 +972,7 @@ discard block |
||
| 978 | 972 | else |
| 979 | 973 | $focus = $this->_focus; |
| 980 | 974 | $this->getClientScript()->registerFocusControl($focus); |
| 981 | - } |
|
| 982 | - elseif($this->_postData && ($lastFocus = $this->_postData->itemAt(self::FIELD_LASTFOCUS)) !== null) |
|
| 975 | + } elseif($this->_postData && ($lastFocus = $this->_postData->itemAt(self::FIELD_LASTFOCUS)) !== null) |
|
| 983 | 976 | $this->getClientScript()->registerFocusControl($lastFocus); |
| 984 | 977 | $this->_inFormRender = false; |
| 985 | 978 | } |
@@ -208,8 +208,7 @@ |
||
| 208 | 208 | { |
| 209 | 209 | $str .= ' />'; |
| 210 | 210 | $this->_openTags[] = ''; |
| 211 | - } |
|
| 212 | - else |
|
| 211 | + } else |
|
| 213 | 212 | { |
| 214 | 213 | $str .= '>'; |
| 215 | 214 | $this->_openTags[] = $tagName; |
@@ -406,11 +406,9 @@ discard block |
||
| 406 | 406 | return $this->_id; |
| 407 | 407 | else |
| 408 | 408 | return ($this->_uid = $prefix . self::ID_SEPARATOR . $this->_id); |
| 409 | - } |
|
| 410 | - else // no naming container |
|
| 409 | + } else // no naming container |
|
| 411 | 410 | return $this->_id; |
| 412 | - } |
|
| 413 | - else |
|
| 411 | + } else |
|
| 414 | 412 | return $this->_uid; |
| 415 | 413 | } |
| 416 | 414 | |
@@ -564,8 +562,7 @@ discard block |
||
| 564 | 562 | if(!$control->getVisible(false)) |
| 565 | 563 | return false; |
| 566 | 564 | return true; |
| 567 | - } |
|
| 568 | - else |
|
| 565 | + } else |
|
| 569 | 566 | return $this->getViewState('Visible', true); |
| 570 | 567 | } |
| 571 | 568 | |
@@ -595,8 +592,7 @@ discard block |
||
| 595 | 592 | if(!$control->getViewState('Enabled', true)) |
| 596 | 593 | return false; |
| 597 | 594 | return true; |
| 598 | - } |
|
| 599 | - else |
|
| 595 | + } else |
|
| 600 | 596 | return $this->getViewState('Enabled', true); |
| 601 | 597 | } |
| 602 | 598 | |
@@ -693,8 +689,7 @@ discard block |
||
| 693 | 689 | if($control->_flags & self::IS_DISABLE_VIEWSTATE) |
| 694 | 690 | return false; |
| 695 | 691 | return true; |
| 696 | - } |
|
| 697 | - else |
|
| 692 | + } else |
|
| 698 | 693 | return !($this->_flags & self::IS_DISABLE_VIEWSTATE); |
| 699 | 694 | } |
| 700 | 695 | |
@@ -779,8 +774,7 @@ discard block |
||
| 779 | 774 | if(is_object($this->_tempState[$key]) && $this->_trackViewState) |
| 780 | 775 | $this->_viewState[$key] = $this->_tempState[$key]; |
| 781 | 776 | return $this->_tempState[$key]; |
| 782 | - } |
|
| 783 | - else |
|
| 777 | + } else |
|
| 784 | 778 | return $defaultValue; |
| 785 | 779 | } |
| 786 | 780 | |
@@ -800,8 +794,7 @@ discard block |
||
| 800 | 794 | { |
| 801 | 795 | unset($this->_tempState[$key]); |
| 802 | 796 | $this->_viewState[$key] = $value; |
| 803 | - } |
|
| 804 | - else |
|
| 797 | + } else |
|
| 805 | 798 | { |
| 806 | 799 | unset($this->_viewState[$key]); |
| 807 | 800 | if($value === $defaultValue) |
@@ -950,8 +943,7 @@ discard block |
||
| 950 | 943 | $this->createChildControls(); |
| 951 | 944 | $this->_flags &= ~self::IS_CREATING_CHILD; |
| 952 | 945 | $this->_flags |= self::IS_CHILD_CREATED; |
| 953 | - } |
|
| 954 | - catch(Exception $e) |
|
| 946 | + } catch(Exception $e) |
|
| 955 | 947 | { |
| 956 | 948 | $this->_flags &= ~self::IS_CREATING_CHILD; |
| 957 | 949 | $this->_flags |= self::IS_CHILD_CREATED; |
@@ -1190,8 +1182,9 @@ discard block |
||
| 1190 | 1182 | final protected function isDescendentOf($ancestor) |
| 1191 | 1183 | { |
| 1192 | 1184 | $control = $this; |
| 1193 | - while($control !== $ancestor && $control->_parent) |
|
| 1194 | - $control = $control->_parent; |
|
| 1185 | + while($control !== $ancestor && $control->_parent) { |
|
| 1186 | + $control = $control->_parent; |
|
| 1187 | + } |
|
| 1195 | 1188 | return $control === $ancestor; |
| 1196 | 1189 | } |
| 1197 | 1190 | |
@@ -1227,8 +1220,7 @@ discard block |
||
| 1227 | 1220 | { |
| 1228 | 1221 | $state = $this->_rf[self::RF_CHILD_STATE][$control->_id]; |
| 1229 | 1222 | unset($this->_rf[self::RF_CHILD_STATE][$control->_id]); |
| 1230 | - } |
|
| 1231 | - else |
|
| 1223 | + } else |
|
| 1232 | 1224 | $state = null; |
| 1233 | 1225 | $control->loadStateRecursive($state, !($this->_flags & self::IS_DISABLE_VIEWSTATE)); |
| 1234 | 1226 | if($this->_stage >= self::CS_LOADED) |
@@ -1633,8 +1625,7 @@ discard block |
||
| 1633 | 1625 | { |
| 1634 | 1626 | $this->_rf[self::RF_CONTROLSTATE] = &$state[1]; |
| 1635 | 1627 | unset($state[1]); |
| 1636 | - } |
|
| 1637 | - else |
|
| 1628 | + } else |
|
| 1638 | 1629 | unset($this->_rf[self::RF_CONTROLSTATE]); |
| 1639 | 1630 | if($needViewState) |
| 1640 | 1631 | { |
@@ -1711,8 +1702,7 @@ discard block |
||
| 1711 | 1702 | { |
| 1712 | 1703 | $page->applyControlStyleSheet($this); |
| 1713 | 1704 | $this->_flags |= self::IS_STYLESHEET_APPLIED; |
| 1714 | - } |
|
| 1715 | - elseif($this->_flags & self::IS_STYLESHEET_APPLIED) |
|
| 1705 | + } elseif($this->_flags & self::IS_STYLESHEET_APPLIED) |
|
| 1716 | 1706 | throw new TInvalidOperationException('control_stylesheet_applied', get_class($this)); |
| 1717 | 1707 | } |
| 1718 | 1708 | |