@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | //package base folder in prado alias notation |
4 | -$folders = array( |
|
4 | +$folders=array( |
|
5 | 5 | 'prado' => 'Prado\\Web\\Javascripts\\source\\prado', |
6 | 6 | 'jquery' => 'Vendor\\bower-asset\\jquery\\dist', |
7 | 7 | 'jquery-ui' => 'Vendor\\bower-asset\\jquery-ui', |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | ); |
14 | 14 | |
15 | 15 | //package names and its contents (files relative to the current directory) |
16 | -$packages = array( |
|
16 | +$packages=array( |
|
17 | 17 | // base prado scripts |
18 | 18 | 'prado' => array( |
19 | 19 | 'prado/prado.js', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ); |
113 | 113 | |
114 | 114 | //package names and their dependencies |
115 | -$dependencies = array( |
|
115 | +$dependencies=array( |
|
116 | 116 | 'jquery' => array('jquery'), |
117 | 117 | 'prado' => array('jquery', 'prado'), |
118 | 118 | 'bootstrap' => array('jquery', 'bootstrap'), |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function setActiveStep($step) |
202 | 202 | { |
203 | - if(($index=$this->getWizardSteps()->indexOf($step))<0) |
|
203 | + if(($index=$this->getWizardSteps()->indexOf($step)) < 0) |
|
204 | 204 | throw new TInvalidOperationException('wizard_step_invalid'); |
205 | 205 | $this->setActiveStepIndex($index); |
206 | 206 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function getShowCancelButton() |
249 | 249 | { |
250 | - return $this->getViewState('ShowCancelButton',false); |
|
250 | + return $this->getViewState('ShowCancelButton', false); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function setShowCancelButton($value) |
257 | 257 | { |
258 | - $this->setViewState('ShowCancelButton',TPropertyValue::ensureBoolean($value),false); |
|
258 | + $this->setViewState('ShowCancelButton', TPropertyValue::ensureBoolean($value), false); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function getShowSideBar() |
265 | 265 | { |
266 | - return $this->getViewState('ShowSideBar',true); |
|
266 | + return $this->getViewState('ShowSideBar', true); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function setShowSideBar($value) |
273 | 273 | { |
274 | - $this->setViewState('ShowSideBar',TPropertyValue::ensureBoolean($value),true); |
|
274 | + $this->setViewState('ShowSideBar', TPropertyValue::ensureBoolean($value), true); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function getHeaderText() |
366 | 366 | { |
367 | - return $this->getViewState('HeaderText',''); |
|
367 | + return $this->getViewState('HeaderText', ''); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function setHeaderText($value) |
374 | 374 | { |
375 | - $this->setViewState('HeaderText',TPropertyValue::ensureString($value),''); |
|
375 | + $this->setViewState('HeaderText', TPropertyValue::ensureString($value), ''); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | */ |
382 | 382 | public function getCancelDestinationUrl() |
383 | 383 | { |
384 | - return $this->getViewState('CancelDestinationUrl',''); |
|
384 | + return $this->getViewState('CancelDestinationUrl', ''); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function setCancelDestinationUrl($value) |
392 | 392 | { |
393 | - $this->setViewState('CancelDestinationUrl',TPropertyValue::ensureString($value),''); |
|
393 | + $this->setViewState('CancelDestinationUrl', TPropertyValue::ensureString($value), ''); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | */ |
400 | 400 | public function getFinishDestinationUrl() |
401 | 401 | { |
402 | - return $this->getViewState('FinishDestinationUrl',''); |
|
402 | + return $this->getViewState('FinishDestinationUrl', ''); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function setFinishDestinationUrl($value) |
409 | 409 | { |
410 | - $this->setViewState('FinishDestinationUrl',TPropertyValue::ensureString($value),''); |
|
410 | + $this->setViewState('FinishDestinationUrl', TPropertyValue::ensureString($value), ''); |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -415,10 +415,10 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function getSideBarButtonStyle() |
417 | 417 | { |
418 | - if(($style=$this->getViewState('SideBarButtonStyle',null))===null) |
|
418 | + if(($style=$this->getViewState('SideBarButtonStyle', null))===null) |
|
419 | 419 | { |
420 | 420 | $style=new TStyle; |
421 | - $this->setViewState('SideBarButtonStyle',$style,null); |
|
421 | + $this->setViewState('SideBarButtonStyle', $style, null); |
|
422 | 422 | } |
423 | 423 | return $style; |
424 | 424 | } |
@@ -428,10 +428,10 @@ discard block |
||
428 | 428 | */ |
429 | 429 | public function getNavigationButtonStyle() |
430 | 430 | { |
431 | - if(($style=$this->getViewState('NavigationButtonStyle',null))===null) |
|
431 | + if(($style=$this->getViewState('NavigationButtonStyle', null))===null) |
|
432 | 432 | { |
433 | 433 | $style=new TStyle; |
434 | - $this->setViewState('NavigationButtonStyle',$style,null); |
|
434 | + $this->setViewState('NavigationButtonStyle', $style, null); |
|
435 | 435 | } |
436 | 436 | return $style; |
437 | 437 | } |
@@ -441,11 +441,11 @@ discard block |
||
441 | 441 | */ |
442 | 442 | public function getStartNextButtonStyle() |
443 | 443 | { |
444 | - if(($style=$this->getViewState('StartNextButtonStyle',null))===null) |
|
444 | + if(($style=$this->getViewState('StartNextButtonStyle', null))===null) |
|
445 | 445 | { |
446 | 446 | $style=new TWizardNavigationButtonStyle; |
447 | 447 | $style->setButtonText('Next'); |
448 | - $this->setViewState('StartNextButtonStyle',$style,null); |
|
448 | + $this->setViewState('StartNextButtonStyle', $style, null); |
|
449 | 449 | } |
450 | 450 | return $style; |
451 | 451 | } |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | */ |
456 | 456 | public function getStepNextButtonStyle() |
457 | 457 | { |
458 | - if(($style=$this->getViewState('StepNextButtonStyle',null))===null) |
|
458 | + if(($style=$this->getViewState('StepNextButtonStyle', null))===null) |
|
459 | 459 | { |
460 | 460 | $style=new TWizardNavigationButtonStyle; |
461 | 461 | $style->setButtonText('Next'); |
462 | - $this->setViewState('StepNextButtonStyle',$style,null); |
|
462 | + $this->setViewState('StepNextButtonStyle', $style, null); |
|
463 | 463 | } |
464 | 464 | return $style; |
465 | 465 | } |
@@ -469,11 +469,11 @@ discard block |
||
469 | 469 | */ |
470 | 470 | public function getStepPreviousButtonStyle() |
471 | 471 | { |
472 | - if(($style=$this->getViewState('StepPreviousButtonStyle',null))===null) |
|
472 | + if(($style=$this->getViewState('StepPreviousButtonStyle', null))===null) |
|
473 | 473 | { |
474 | 474 | $style=new TWizardNavigationButtonStyle; |
475 | 475 | $style->setButtonText('Previous'); |
476 | - $this->setViewState('StepPreviousButtonStyle',$style,null); |
|
476 | + $this->setViewState('StepPreviousButtonStyle', $style, null); |
|
477 | 477 | } |
478 | 478 | return $style; |
479 | 479 | } |
@@ -483,11 +483,11 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function getFinishCompleteButtonStyle() |
485 | 485 | { |
486 | - if(($style=$this->getViewState('FinishCompleteButtonStyle',null))===null) |
|
486 | + if(($style=$this->getViewState('FinishCompleteButtonStyle', null))===null) |
|
487 | 487 | { |
488 | 488 | $style=new TWizardNavigationButtonStyle; |
489 | 489 | $style->setButtonText('Complete'); |
490 | - $this->setViewState('FinishCompleteButtonStyle',$style,null); |
|
490 | + $this->setViewState('FinishCompleteButtonStyle', $style, null); |
|
491 | 491 | } |
492 | 492 | return $style; |
493 | 493 | } |
@@ -497,11 +497,11 @@ discard block |
||
497 | 497 | */ |
498 | 498 | public function getFinishPreviousButtonStyle() |
499 | 499 | { |
500 | - if(($style=$this->getViewState('FinishPreviousButtonStyle',null))===null) |
|
500 | + if(($style=$this->getViewState('FinishPreviousButtonStyle', null))===null) |
|
501 | 501 | { |
502 | 502 | $style=new TWizardNavigationButtonStyle; |
503 | 503 | $style->setButtonText('Previous'); |
504 | - $this->setViewState('FinishPreviousButtonStyle',$style,null); |
|
504 | + $this->setViewState('FinishPreviousButtonStyle', $style, null); |
|
505 | 505 | } |
506 | 506 | return $style; |
507 | 507 | } |
@@ -511,11 +511,11 @@ discard block |
||
511 | 511 | */ |
512 | 512 | public function getCancelButtonStyle() |
513 | 513 | { |
514 | - if(($style=$this->getViewState('CancelButtonStyle',null))===null) |
|
514 | + if(($style=$this->getViewState('CancelButtonStyle', null))===null) |
|
515 | 515 | { |
516 | 516 | $style=new TWizardNavigationButtonStyle; |
517 | 517 | $style->setButtonText('Cancel'); |
518 | - $this->setViewState('CancelButtonStyle',$style,null); |
|
518 | + $this->setViewState('CancelButtonStyle', $style, null); |
|
519 | 519 | } |
520 | 520 | return $style; |
521 | 521 | } |
@@ -525,10 +525,10 @@ discard block |
||
525 | 525 | */ |
526 | 526 | public function getSideBarStyle() |
527 | 527 | { |
528 | - if(($style=$this->getViewState('SideBarStyle',null))===null) |
|
528 | + if(($style=$this->getViewState('SideBarStyle', null))===null) |
|
529 | 529 | { |
530 | 530 | $style=new TPanelStyle; |
531 | - $this->setViewState('SideBarStyle',$style,null); |
|
531 | + $this->setViewState('SideBarStyle', $style, null); |
|
532 | 532 | } |
533 | 533 | return $style; |
534 | 534 | } |
@@ -538,10 +538,10 @@ discard block |
||
538 | 538 | */ |
539 | 539 | public function getHeaderStyle() |
540 | 540 | { |
541 | - if(($style=$this->getViewState('HeaderStyle',null))===null) |
|
541 | + if(($style=$this->getViewState('HeaderStyle', null))===null) |
|
542 | 542 | { |
543 | 543 | $style=new TPanelStyle; |
544 | - $this->setViewState('HeaderStyle',$style,null); |
|
544 | + $this->setViewState('HeaderStyle', $style, null); |
|
545 | 545 | } |
546 | 546 | return $style; |
547 | 547 | } |
@@ -551,10 +551,10 @@ discard block |
||
551 | 551 | */ |
552 | 552 | public function getStepStyle() |
553 | 553 | { |
554 | - if(($style=$this->getViewState('StepStyle',null))===null) |
|
554 | + if(($style=$this->getViewState('StepStyle', null))===null) |
|
555 | 555 | { |
556 | 556 | $style=new TPanelStyle; |
557 | - $this->setViewState('StepStyle',$style,null); |
|
557 | + $this->setViewState('StepStyle', $style, null); |
|
558 | 558 | } |
559 | 559 | return $style; |
560 | 560 | } |
@@ -564,10 +564,10 @@ discard block |
||
564 | 564 | */ |
565 | 565 | public function getNavigationStyle() |
566 | 566 | { |
567 | - if(($style=$this->getViewState('NavigationStyle',null))===null) |
|
567 | + if(($style=$this->getViewState('NavigationStyle', null))===null) |
|
568 | 568 | { |
569 | 569 | $style=new TPanelStyle; |
570 | - $this->setViewState('NavigationStyle',$style,null); |
|
570 | + $this->setViewState('NavigationStyle', $style, null); |
|
571 | 571 | } |
572 | 572 | return $style; |
573 | 573 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public function getUseDefaultLayout() |
579 | 579 | { |
580 | - return $this->getViewState('UseDefaultLayout',true); |
|
580 | + return $this->getViewState('UseDefaultLayout', true); |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | /** |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | */ |
588 | 588 | public function setUseDefaultLayout($value) |
589 | 589 | { |
590 | - $this->setViewState('UseDefaultLayout',TPropertyValue::ensureBoolean($value),true); |
|
590 | + $this->setViewState('UseDefaultLayout', TPropertyValue::ensureBoolean($value), true); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | */ |
647 | 647 | public function onActiveStepChanged($param) |
648 | 648 | { |
649 | - $this->raiseEvent('OnActiveStepChanged',$this,$param); |
|
649 | + $this->raiseEvent('OnActiveStepChanged', $this, $param); |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | /** |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | */ |
658 | 658 | public function onCancelButtonClick($param) |
659 | 659 | { |
660 | - $this->raiseEvent('OnCancelButtonClick',$this,$param); |
|
660 | + $this->raiseEvent('OnCancelButtonClick', $this, $param); |
|
661 | 661 | if(($url=$this->getCancelDestinationUrl())!=='') |
662 | 662 | $this->getResponse()->redirect($url); |
663 | 663 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | */ |
671 | 671 | public function onCompleteButtonClick($param) |
672 | 672 | { |
673 | - $this->raiseEvent('OnCompleteButtonClick',$this,$param); |
|
673 | + $this->raiseEvent('OnCompleteButtonClick', $this, $param); |
|
674 | 674 | if(($url=$this->getFinishDestinationUrl())!=='') |
675 | 675 | $this->getResponse()->redirect($url); |
676 | 676 | } |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | */ |
684 | 684 | public function onNextButtonClick($param) |
685 | 685 | { |
686 | - $this->raiseEvent('OnNextButtonClick',$this,$param); |
|
686 | + $this->raiseEvent('OnNextButtonClick', $this, $param); |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | /** |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | public function onPreviousButtonClick($param) |
696 | 696 | { |
697 | - $this->raiseEvent('OnPreviousButtonClick',$this,$param); |
|
697 | + $this->raiseEvent('OnPreviousButtonClick', $this, $param); |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | /** |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | */ |
705 | 705 | public function onSideBarButtonClick($param) |
706 | 706 | { |
707 | - $this->raiseEvent('OnSideBarButtonClick',$this,$param); |
|
707 | + $this->raiseEvent('OnSideBarButtonClick', $this, $param); |
|
708 | 708 | } |
709 | 709 | |
710 | 710 | /** |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | { |
719 | 719 | $this->_multiView=new TMultiView; |
720 | 720 | $this->_multiView->setID('WizardMultiView'); |
721 | - $this->_multiView->attachEventHandler('OnActiveViewChanged',array($this,'onActiveStepChanged')); |
|
721 | + $this->_multiView->attachEventHandler('OnActiveViewChanged', array($this, 'onActiveStepChanged')); |
|
722 | 722 | $this->_multiView->ignoreBubbleEvents(); |
723 | 723 | } |
724 | 724 | return $this->_multiView; |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | parent::onInit($param); |
761 | 761 | $this->ensureChildControls(); |
762 | 762 | $this->setEnsureId(true); |
763 | - if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0) |
|
763 | + if($this->getActiveStepIndex() < 0 && $this->getWizardSteps()->getCount() > 0) |
|
764 | 764 | $this->setActiveStepIndex(0); |
765 | 765 | } |
766 | 766 | |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | */ |
837 | 837 | protected function applyHeaderProperties() |
838 | 838 | { |
839 | - if(($style=$this->getViewState('HeaderStyle',null))!==null) |
|
839 | + if(($style=$this->getViewState('HeaderStyle', null))!==null) |
|
840 | 840 | $this->_header->getStyle()->mergeWith($style); |
841 | 841 | if($this->getHeaderTemplate()===null) |
842 | 842 | { |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | $this->_sideBarDataList->setDataSource($this->getWizardSteps()); |
857 | 857 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
858 | 858 | $this->_sideBarDataList->dataBind(); |
859 | - if(($style=$this->getViewState('SideBarButtonStyle',null))!==null) |
|
859 | + if(($style=$this->getViewState('SideBarButtonStyle', null))!==null) |
|
860 | 860 | { |
861 | 861 | foreach($this->_sideBarDataList->getItems() as $item) |
862 | 862 | { |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | } |
866 | 866 | } |
867 | 867 | } |
868 | - if(($style=$this->getViewState('SideBarStyle',null))!==null) |
|
868 | + if(($style=$this->getViewState('SideBarStyle', null))!==null) |
|
869 | 869 | $this->_sideBar->getStyle()->mergeWith($style); |
870 | 870 | } |
871 | 871 | |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | */ |
875 | 875 | protected function applyStepContentProperties() |
876 | 876 | { |
877 | - if(($style=$this->getViewState('StepStyle',null))!==null) |
|
877 | + if(($style=$this->getViewState('StepStyle', null))!==null) |
|
878 | 878 | $this->_stepContent->getStyle()->mergeWith($style); |
879 | 879 | } |
880 | 880 | |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | |
890 | 890 | if(!$this->_navigation) |
891 | 891 | return; |
892 | - else if($activeStepIndex<0 || $activeStepIndex>=$wizardSteps->getCount()) |
|
892 | + else if($activeStepIndex < 0 || $activeStepIndex >= $wizardSteps->getCount()) |
|
893 | 893 | { |
894 | 894 | $this->_navigation->setVisible(false); |
895 | 895 | return; |
@@ -920,12 +920,12 @@ discard block |
||
920 | 920 | $this->_stepNavigation->setVisible($showStandard && $activeStepType===TWizardStepType::Step); |
921 | 921 | $this->_finishNavigation->setVisible($showStandard && $activeStepType===TWizardStepType::Finish); |
922 | 922 | |
923 | - if(($navigationStyle=$this->getViewState('NavigationStyle',null))!==null) |
|
923 | + if(($navigationStyle=$this->getViewState('NavigationStyle', null))!==null) |
|
924 | 924 | $this->_navigation->getStyle()->mergeWith($navigationStyle); |
925 | 925 | |
926 | 926 | $displayCancelButton=$this->getShowCancelButton(); |
927 | 927 | $cancelButtonStyle=$this->getCancelButtonStyle(); |
928 | - $buttonStyle=$this->getViewState('NavigationButtonStyle',null); |
|
928 | + $buttonStyle=$this->getViewState('NavigationButtonStyle', null); |
|
929 | 929 | if($buttonStyle!==null) |
930 | 930 | $cancelButtonStyle->mergeWith($buttonStyle); |
931 | 931 | |
@@ -1002,10 +1002,10 @@ discard block |
||
1002 | 1002 | */ |
1003 | 1003 | protected function getHistory() |
1004 | 1004 | { |
1005 | - if(($history=$this->getControlState('History',null))===null) |
|
1005 | + if(($history=$this->getControlState('History', null))===null) |
|
1006 | 1006 | { |
1007 | 1007 | $history=new TStack; |
1008 | - $this->setControlState('History',$history); |
|
1008 | + $this->setControlState('History', $history); |
|
1009 | 1009 | } |
1010 | 1010 | return $history; |
1011 | 1011 | } |
@@ -1020,14 +1020,14 @@ discard block |
||
1020 | 1020 | if(($type=$wizardStep->getStepType())===TWizardStepType::Auto) |
1021 | 1021 | { |
1022 | 1022 | $steps=$this->getWizardSteps(); |
1023 | - if(($index=$steps->indexOf($wizardStep))>=0) |
|
1023 | + if(($index=$steps->indexOf($wizardStep)) >= 0) |
|
1024 | 1024 | { |
1025 | 1025 | $stepCount=$steps->getCount(); |
1026 | - if($stepCount===1 || ($index<$stepCount-1 && $steps->itemAt($index+1)->getStepType()===TWizardStepType::Complete)) |
|
1026 | + if($stepCount===1 || ($index < $stepCount - 1 && $steps->itemAt($index + 1)->getStepType()===TWizardStepType::Complete)) |
|
1027 | 1027 | return TWizardStepType::Finish; |
1028 | 1028 | else if($index===0) |
1029 | 1029 | return TWizardStepType::Start; |
1030 | - else if($index===$stepCount-1) |
|
1030 | + else if($index===$stepCount - 1) |
|
1031 | 1031 | return TWizardStepType::Finish; |
1032 | 1032 | else |
1033 | 1033 | return TWizardStepType::Step; |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | |
1097 | 1097 | if(($this->_sideBarDataList=$this->_sideBar->findControl(self::ID_SIDEBAR_LIST))!==null) |
1098 | 1098 | { |
1099 | - $this->_sideBarDataList->attachEventHandler('OnItemCommand',array($this,'dataListItemCommand')); |
|
1100 | - $this->_sideBarDataList->attachEventHandler('OnItemDataBound',array($this,'dataListItemDataBound')); |
|
1099 | + $this->_sideBarDataList->attachEventHandler('OnItemCommand', array($this, 'dataListItemCommand')); |
|
1100 | + $this->_sideBarDataList->attachEventHandler('OnItemDataBound', array($this, 'dataListItemDataBound')); |
|
1101 | 1101 | $this->_sideBarDataList->setDataSource($this->getWizardSteps()); |
1102 | 1102 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
1103 | 1103 | $this->_sideBarDataList->dataBind(); |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | * @param mixed sender of the event |
1118 | 1118 | * @param TDataListCommandEventParameter |
1119 | 1119 | */ |
1120 | - public function dataListItemCommand($sender,$param) |
|
1120 | + public function dataListItemCommand($sender, $param) |
|
1121 | 1121 | { |
1122 | 1122 | $item=$param->getItem(); |
1123 | 1123 | if($param->getCommandName()===self::CMD_MOVETO) |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | * @param mixed sender of the event |
1154 | 1154 | * @param TDataListItemEventParameter |
1155 | 1155 | */ |
1156 | - public function dataListItemDataBound($sender,$param) |
|
1156 | + public function dataListItemDataBound($sender, $param) |
|
1157 | 1157 | { |
1158 | 1158 | $item=$param->getItem(); |
1159 | 1159 | $itemType=$item->getItemType(); |
@@ -1276,20 +1276,20 @@ discard block |
||
1276 | 1276 | protected function getPreviousStepIndex($popStack) |
1277 | 1277 | { |
1278 | 1278 | $history=$this->getHistory(); |
1279 | - if($history->getCount()>=0) |
|
1279 | + if($history->getCount() >= 0) |
|
1280 | 1280 | { |
1281 | 1281 | $activeStepIndex=$this->getActiveStepIndex(); |
1282 | 1282 | $previousStepIndex=-1; |
1283 | 1283 | if($popStack) |
1284 | 1284 | { |
1285 | 1285 | $previousStepIndex=$history->pop(); |
1286 | - if($activeStepIndex===$previousStepIndex && $history->getCount()>0) |
|
1286 | + if($activeStepIndex===$previousStepIndex && $history->getCount() > 0) |
|
1287 | 1287 | $previousStepIndex=$history->pop(); |
1288 | 1288 | } |
1289 | 1289 | else |
1290 | 1290 | { |
1291 | 1291 | $previousStepIndex=$history->peek(); |
1292 | - if($activeStepIndex===$previousStepIndex && $history->getCount()>1) |
|
1292 | + if($activeStepIndex===$previousStepIndex && $history->getCount() > 1) |
|
1293 | 1293 | { |
1294 | 1294 | $saveIndex=$history->pop(); |
1295 | 1295 | $previousStepIndex=$history->peek(); |
@@ -1333,12 +1333,12 @@ discard block |
||
1333 | 1333 | * @param TEventParameter event parameter |
1334 | 1334 | * @throws TInvalidDataValueException if a navigation command is associated with an invalid parameter |
1335 | 1335 | */ |
1336 | - public function bubbleEvent($sender,$param) |
|
1336 | + public function bubbleEvent($sender, $param) |
|
1337 | 1337 | { |
1338 | 1338 | if($param instanceof \Prado\Web\UI\TCommandEventParameter) |
1339 | 1339 | { |
1340 | 1340 | $command=$param->getCommandName(); |
1341 | - if(strcasecmp($command,self::CMD_CANCEL)===0) |
|
1341 | + if(strcasecmp($command, self::CMD_CANCEL)===0) |
|
1342 | 1342 | { |
1343 | 1343 | $this->onCancelButtonClick($param); |
1344 | 1344 | return true; |
@@ -1354,49 +1354,49 @@ discard block |
||
1354 | 1354 | $movePrev=false; |
1355 | 1355 | $this->_activeStepIndexSet=false; |
1356 | 1356 | |
1357 | - if(strcasecmp($command,self::CMD_NEXT)===0) |
|
1357 | + if(strcasecmp($command, self::CMD_NEXT)===0) |
|
1358 | 1358 | { |
1359 | 1359 | if($type!==TWizardStepType::Start && $type!==TWizardStepType::Step) |
1360 | - throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_NEXT); |
|
1361 | - if($index<$this->getWizardSteps()->getCount()-1) |
|
1362 | - $navParam->setNextStepIndex($index+1); |
|
1360 | + throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_NEXT); |
|
1361 | + if($index < $this->getWizardSteps()->getCount() - 1) |
|
1362 | + $navParam->setNextStepIndex($index + 1); |
|
1363 | 1363 | $this->onNextButtonClick($navParam); |
1364 | 1364 | $handled=true; |
1365 | 1365 | } |
1366 | - else if(strcasecmp($command,self::CMD_PREVIOUS)===0) |
|
1366 | + else if(strcasecmp($command, self::CMD_PREVIOUS)===0) |
|
1367 | 1367 | { |
1368 | 1368 | if($type!==TWizardStepType::Finish && $type!==TWizardStepType::Step) |
1369 | - throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_PREVIOUS); |
|
1369 | + throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_PREVIOUS); |
|
1370 | 1370 | $movePrev=true; |
1371 | - if(($prevIndex=$this->getPreviousStepIndex(false))>=0) |
|
1371 | + if(($prevIndex=$this->getPreviousStepIndex(false)) >= 0) |
|
1372 | 1372 | $navParam->setNextStepIndex($prevIndex); |
1373 | 1373 | $this->onPreviousButtonClick($navParam); |
1374 | 1374 | $handled=true; |
1375 | 1375 | } |
1376 | - else if(strcasecmp($command,self::CMD_COMPLETE)===0) |
|
1376 | + else if(strcasecmp($command, self::CMD_COMPLETE)===0) |
|
1377 | 1377 | { |
1378 | 1378 | if($type!==TWizardStepType::Finish) |
1379 | - throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_COMPLETE); |
|
1380 | - if($index<$this->getWizardSteps()->getCount()-1) |
|
1381 | - $navParam->setNextStepIndex($index+1); |
|
1379 | + throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_COMPLETE); |
|
1380 | + if($index < $this->getWizardSteps()->getCount() - 1) |
|
1381 | + $navParam->setNextStepIndex($index + 1); |
|
1382 | 1382 | $this->onCompleteButtonClick($navParam); |
1383 | 1383 | $handled=true; |
1384 | 1384 | } |
1385 | - else if(strcasecmp($command,self::CMD_MOVETO)===0) |
|
1385 | + else if(strcasecmp($command, self::CMD_MOVETO)===0) |
|
1386 | 1386 | { |
1387 | 1387 | if($this->_cancelNavigation) // may be set in onSideBarButtonClick |
1388 | 1388 | $navParam->setCancelNavigation(true); |
1389 | 1389 | $requestedStep=$param->getCommandParameter(); |
1390 | - if (!is_numeric($requestedStep)) |
|
1390 | + if(!is_numeric($requestedStep)) |
|
1391 | 1391 | { |
1392 | 1392 | $requestedIndex=-1; |
1393 | - foreach ($this->getWizardSteps() as $index=>$step) |
|
1394 | - if ($step->getId()===$requestedStep) |
|
1393 | + foreach($this->getWizardSteps() as $index=>$step) |
|
1394 | + if($step->getId()===$requestedStep) |
|
1395 | 1395 | { |
1396 | 1396 | $requestedIndex=$index; |
1397 | 1397 | break; |
1398 | 1398 | } |
1399 | - if ($requestedIndex<0) |
|
1399 | + if($requestedIndex < 0) |
|
1400 | 1400 | throw new TConfigurationException('wizard_step_invalid'); |
1401 | 1401 | } |
1402 | 1402 | else |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($nextStepIndex)) |
1414 | 1414 | { |
1415 | 1415 | if($movePrev) |
1416 | - $this->getPreviousStepIndex(true); // pop out the previous move from history |
|
1416 | + $this->getPreviousStepIndex(true); // pop out the previous move from history |
|
1417 | 1417 | $this->setActiveStepIndex($nextStepIndex); |
1418 | 1418 | } |
1419 | 1419 | } |
@@ -41,22 +41,22 @@ discard block |
||
41 | 41 | { |
42 | 42 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
43 | 43 | { |
44 | - $response = $this->getApplication()->getResponse(); |
|
45 | - $trace = $this->getExceptionStackTrace($exception); |
|
44 | + $response=$this->getApplication()->getResponse(); |
|
45 | + $trace=$this->getExceptionStackTrace($exception); |
|
46 | 46 | // avoid error on non-utf8 strings |
47 | 47 | try { |
48 | - $trace = TJavaScript::jsonEncode($trace); |
|
49 | - } catch (Exception $e) { |
|
48 | + $trace=TJavaScript::jsonEncode($trace); |
|
49 | + } catch(Exception $e) { |
|
50 | 50 | // strip everythin not 7bit ascii |
51 | - $trace = preg_replace('/[^(\x20-\x7F)]*/','', serialize($trace)); |
|
51 | + $trace=preg_replace('/[^(\x20-\x7F)]*/', '', serialize($trace)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // avoid exception loop if headers have already been sent |
55 | 55 | try { |
56 | 56 | $response->setStatusCode(500, 'Internal Server Error'); |
57 | - } catch (Exception $e) { } |
|
57 | + } catch(Exception $e) { } |
|
58 | 58 | |
59 | - $content = $response->createHtmlWriter(); |
|
59 | + $content=$response->createHtmlWriter(); |
|
60 | 60 | $content->getWriter()->setBoundary(TActivePageAdapter::CALLBACK_ERROR_HEADER); |
61 | 61 | $content->write($trace); |
62 | 62 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $data['type']=get_class($exception); |
92 | 92 | $data['message']=$exception->getMessage(); |
93 | 93 | $data['version']=$_SERVER['SERVER_SOFTWARE'].' '.Prado::getVersion(); |
94 | - $data['time']=@strftime('%Y-%m-%d %H:%M',time()); |
|
94 | + $data['time']=@strftime('%Y-%m-%d %H:%M', time()); |
|
95 | 95 | return $data; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | \ No newline at end of file |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getWidgetID() |
74 | 74 | { |
75 | - return $this->getClientID() . '_0'; |
|
75 | + return $this->getClientID().'_0'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getOptions() |
83 | 83 | { |
84 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
84 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
85 | 85 | { |
86 | 86 | $options=new TJuiControlOptions($this); |
87 | 87 | $this->setViewState('JuiOptions', $options); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function getPostBackOptions() |
114 | 114 | { |
115 | - $options = $this->getOptions()->toArray(); |
|
115 | + $options=$this->getOptions()->toArray(); |
|
116 | 116 | // overload the "OnStop" event to add information about the current selected items |
117 | 117 | if(isset($options['stop'])) |
118 | 118 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | protected function addAttributesToRender($writer) |
129 | 129 | { |
130 | 130 | parent::addAttributesToRender($writer); |
131 | - $writer->addAttribute('id',$this->getClientID()); |
|
131 | + $writer->addAttribute('id', $this->getClientID()); |
|
132 | 132 | $options=TJavaScript::encode($this->getPostBackOptions()); |
133 | 133 | $cs=$this->getPage()->getClientScript(); |
134 | 134 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * Raises the OnCreate event |
150 | 150 | * @param object $params event parameters |
151 | 151 | */ |
152 | - public function onCreate ($params) |
|
152 | + public function onCreate($params) |
|
153 | 153 | { |
154 | 154 | $this->raiseEvent('OnCreate', $this, $params); |
155 | 155 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Raises the OnSelected event |
159 | 159 | * @param object $params event parameters |
160 | 160 | */ |
161 | - public function onSelected ($params) |
|
161 | + public function onSelected($params) |
|
162 | 162 | { |
163 | 163 | $this->raiseEvent('OnSelected', $this, $params); |
164 | 164 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * Raises the OnSelecting event |
168 | 168 | * @param object $params event parameters |
169 | 169 | */ |
170 | - public function onSelecting ($params) |
|
170 | + public function onSelecting($params) |
|
171 | 171 | { |
172 | 172 | $this->raiseEvent('OnSelecting', $this, $params); |
173 | 173 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * Raises the OnStart event |
177 | 177 | * @param object $params event parameters |
178 | 178 | */ |
179 | - public function onStart ($params) |
|
179 | + public function onStart($params) |
|
180 | 180 | { |
181 | 181 | $this->raiseEvent('OnStart', $this, $params); |
182 | 182 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Raises the OnStop event |
186 | 186 | * @param object $params event parameters |
187 | 187 | */ |
188 | - public function onStop ($params) |
|
188 | + public function onStop($params) |
|
189 | 189 | { |
190 | 190 | $this->raiseEvent('OnStop', $this, $params); |
191 | 191 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * Raises the OnUnselected event |
195 | 195 | * @param object $params event parameters |
196 | 196 | */ |
197 | - public function onUnselected ($params) |
|
197 | + public function onUnselected($params) |
|
198 | 198 | { |
199 | 199 | $this->raiseEvent('OnUnselected', $this, $params); |
200 | 200 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * Raises the OnUnselecting event |
204 | 204 | * @param object $params event parameters |
205 | 205 | */ |
206 | - public function onUnselecting ($params) |
|
206 | + public function onUnselecting($params) |
|
207 | 207 | { |
208 | 208 | $this->raiseEvent('OnUnselecting', $this, $params); |
209 | 209 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | public function getSelectables() |
239 | 239 | { |
240 | 240 | if($this->_repeater===null) |
241 | - $this->_repeater = $this->createRepeater(); |
|
241 | + $this->_repeater=$this->createRepeater(); |
|
242 | 242 | return $this->_repeater; |
243 | 243 | } |
244 | 244 | |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | */ |
248 | 248 | protected function createRepeater() |
249 | 249 | { |
250 | - $repeater = new TRepeater; |
|
250 | + $repeater=new TRepeater; |
|
251 | 251 | $repeater->setHeaderTemplate(new TJuiSelectableTemplate('<ul id="'.$this->getWidgetID().'">')); |
252 | 252 | $repeater->setFooterTemplate(new TJuiSelectableTemplate('</ul>')); |
253 | - $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>',null)); |
|
253 | + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>', null)); |
|
254 | 254 | $repeater->setEmptyTemplate(new TJuiSelectableTemplate('<ul></ul>')); |
255 | 255 | $this->getControls()->add($repeater); |
256 | 256 | return $repeater; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function setRecordPk($value) |
91 | 91 | { |
92 | 92 | $this->clearRecordObject(); |
93 | - $val = TPropertyValue::ensureArray($value); |
|
93 | + $val=TPropertyValue::ensureArray($value); |
|
94 | 94 | $this->setViewState('PK', count($val) > 0 ? $val : null); |
95 | 95 | } |
96 | 96 | |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function initializeEditForm() |
117 | 117 | { |
118 | - $record = $this->getCurrentRecord(); |
|
119 | - $classPath = $this->getEditRenderer(); |
|
120 | - if($classPath === '') |
|
118 | + $record=$this->getCurrentRecord(); |
|
119 | + $classPath=$this->getEditRenderer(); |
|
120 | + if($classPath==='') |
|
121 | 121 | { |
122 | - $columns = $this->getTableInfo()->getColumns(); |
|
122 | + $columns=$this->getTableInfo()->getColumns(); |
|
123 | 123 | $this->getInputRepeater()->setDataSource($columns); |
124 | 124 | $this->getInputRepeater()->dataBind(); |
125 | 125 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function createEditRenderer($record, $classPath) |
143 | 143 | { |
144 | - $this->_editRenderer = Prado::createComponent($classPath); |
|
144 | + $this->_editRenderer=Prado::createComponent($classPath); |
|
145 | 145 | if($this->_editRenderer instanceof IScaffoldEditRenderer) |
146 | 146 | { |
147 | - $index = $this->getControls()->remove($this->getInputRepeater()); |
|
148 | - $this->getControls()->insertAt($index,$this->_editRenderer); |
|
147 | + $index=$this->getControls()->remove($this->getInputRepeater()); |
|
148 | + $this->getControls()->insertAt($index, $this->_editRenderer); |
|
149 | 149 | $this->_editRenderer->setData($record); |
150 | 150 | } |
151 | 151 | else |
@@ -160,16 +160,16 @@ discard block |
||
160 | 160 | */ |
161 | 161 | protected function createRepeaterEditItem($sender, $param) |
162 | 162 | { |
163 | - $type = $param->getItem()->getItemType(); |
|
163 | + $type=$param->getItem()->getItemType(); |
|
164 | 164 | if($type==TListItemType::Item || $type==TListItemType::AlternatingItem) |
165 | 165 | { |
166 | - $item = $param->getItem(); |
|
167 | - $column = $item->getData(); |
|
166 | + $item=$param->getItem(); |
|
167 | + $column=$item->getData(); |
|
168 | 168 | if($column===null) |
169 | 169 | return; |
170 | 170 | |
171 | - $record = $this->getCurrentRecord(); |
|
172 | - $builder = $this->getScaffoldInputBuilder($record); |
|
171 | + $record=$this->getCurrentRecord(); |
|
172 | + $builder=$this->getScaffoldInputBuilder($record); |
|
173 | 173 | $builder->createScaffoldInput($this, $item, $column, $record); |
174 | 174 | } |
175 | 175 | } |
@@ -201,14 +201,14 @@ discard block |
||
201 | 201 | { |
202 | 202 | if($this->getPage()->getIsValid()) |
203 | 203 | { |
204 | - $record = $this->getCurrentRecord(); |
|
204 | + $record=$this->getCurrentRecord(); |
|
205 | 205 | if($this->_editRenderer===null) |
206 | 206 | { |
207 | - $table = $this->getTableInfo(); |
|
208 | - $builder = $this->getScaffoldInputBuilder($record); |
|
207 | + $table=$this->getTableInfo(); |
|
208 | + $builder=$this->getScaffoldInputBuilder($record); |
|
209 | 209 | foreach($this->getInputRepeater()->getItems() as $item) |
210 | 210 | { |
211 | - $column = $table->getColumn($item->getCustomData()); |
|
211 | + $column=$table->getColumn($item->getCustomData()); |
|
212 | 212 | $builder->loadScaffoldInput($this, $item, $column, $record); |
213 | 213 | } |
214 | 214 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | protected function getScaffoldInputBuilder($record) |
273 | 273 | { |
274 | 274 | static $_builders=array(); |
275 | - $class = get_class($record); |
|
275 | + $class=get_class($record); |
|
276 | 276 | if(!isset($_builders[$class])) |
277 | 277 | { |
278 | - $_builders[$class] = TScaffoldInputBase::createInputBuilder($record); |
|
278 | + $_builders[$class]=TScaffoldInputBase::createInputBuilder($record); |
|
279 | 279 | } |
280 | 280 | return $_builders[$class]; |
281 | 281 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Configuration file type, application.xml and config.xml |
109 | 109 | */ |
110 | - const CONFIG_TYPE_XML = 'xml'; |
|
110 | + const CONFIG_TYPE_XML='xml'; |
|
111 | 111 | /** |
112 | 112 | * Application configuration file name |
113 | 113 | */ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * Configuration file type, application.php and config.php |
121 | 121 | */ |
122 | - const CONFIG_TYPE_PHP = 'php'; |
|
122 | + const CONFIG_TYPE_PHP='php'; |
|
123 | 123 | /** |
124 | 124 | * Runtime directory name |
125 | 125 | */ |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * @var string Customizable page service ID |
274 | 274 | */ |
275 | - private $_pageServiceID = self::PAGE_SERVICE_ID; |
|
275 | + private $_pageServiceID=self::PAGE_SERVICE_ID; |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Constructor. |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @param boolean whether to cache application configuration. Defaults to true. |
293 | 293 | * @throws TConfigurationException if configuration file cannot be read or the runtime path is invalid. |
294 | 294 | */ |
295 | - public function __construct($basePath='protected',$cacheConfig=true, $configType=self::CONFIG_TYPE_XML) |
|
295 | + public function __construct($basePath='protected', $cacheConfig=true, $configType=self::CONFIG_TYPE_XML) |
|
296 | 296 | { |
297 | 297 | // register application as a singleton |
298 | 298 | Prado::setApplication($this); |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | // generates unique ID by hashing the runtime path |
306 | 306 | $this->_uniqueID=md5($this->_runtimePath); |
307 | 307 | $this->_parameters=new \Prado\Collections\TMap; |
308 | - $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null)); |
|
308 | + $this->_services=array($this->getPageServiceID()=>array('TPageService', array(), null)); |
|
309 | 309 | |
310 | - Prado::setPathOfAlias('Application',$this->_basePath); |
|
310 | + Prado::setPathOfAlias('Application', $this->_basePath); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | { |
325 | 325 | // determine configuration path and file |
326 | 326 | if(empty($basePath) || ($basePath=realpath($basePath))===false) |
327 | - throw new TConfigurationException('application_basepath_invalid',$basePath); |
|
327 | + throw new TConfigurationException('application_basepath_invalid', $basePath); |
|
328 | 328 | if(is_dir($basePath) && is_file($basePath.DIRECTORY_SEPARATOR.$this->getConfigurationFileName())) |
329 | 329 | $configFile=$basePath.DIRECTORY_SEPARATOR.$this->getConfigurationFileName(); |
330 | 330 | else if(is_file($basePath)) |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | if(!is_dir($runtimePath)) |
346 | 346 | { |
347 | 347 | if(@mkdir($runtimePath)===false) |
348 | - throw new TConfigurationException('application_runtimepath_failed',$runtimePath); |
|
348 | + throw new TConfigurationException('application_runtimepath_failed', $runtimePath); |
|
349 | 349 | @chmod($runtimePath, PRADO_CHMOD); //make it deletable |
350 | 350 | } |
351 | 351 | $this->setConfigurationFile($configFile); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $this->setRuntimePath($runtimePath); |
355 | 355 | } |
356 | 356 | else |
357 | - throw new TConfigurationException('application_runtimepath_invalid',$runtimePath); |
|
357 | + throw new TConfigurationException('application_runtimepath_invalid', $runtimePath); |
|
358 | 358 | |
359 | 359 | } |
360 | 360 | |
@@ -371,14 +371,14 @@ discard block |
||
371 | 371 | $n=count(self::$_steps); |
372 | 372 | $this->_step=0; |
373 | 373 | $this->_requestCompleted=false; |
374 | - while($this->_step<$n) |
|
374 | + while($this->_step < $n) |
|
375 | 375 | { |
376 | 376 | if($this->_mode===TApplicationMode::Off) |
377 | - throw new THttpException(503,'application_unavailable'); |
|
377 | + throw new THttpException(503, 'application_unavailable'); |
|
378 | 378 | if($this->_requestCompleted) |
379 | 379 | break; |
380 | 380 | $method=self::$_steps[$this->_step]; |
381 | - Prado::trace("Executing $method()",'Prado\TApplication'); |
|
381 | + Prado::trace("Executing $method()", 'Prado\TApplication'); |
|
382 | 382 | $this->$method(); |
383 | 383 | $this->_step++; |
384 | 384 | } |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | * @param mixed the default value. If $key is not found, $defaultValue will be returned |
417 | 417 | * @return mixed the global value corresponding to $key |
418 | 418 | */ |
419 | - public function getGlobalState($key,$defaultValue=null) |
|
419 | + public function getGlobalState($key, $defaultValue=null) |
|
420 | 420 | { |
421 | - return isset($this->_globals[$key])?$this->_globals[$key]:$defaultValue; |
|
421 | + return isset($this->_globals[$key]) ? $this->_globals[$key] : $defaultValue; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | * @param mixed the default value. If $key is not found, $defaultValue will be returned |
432 | 432 | * @param boolean wheter to force an immediate GlobalState save. defaults to false |
433 | 433 | */ |
434 | - public function setGlobalState($key,$value,$defaultValue=null,$forceSave=false) |
|
434 | + public function setGlobalState($key, $value, $defaultValue=null, $forceSave=false) |
|
435 | 435 | { |
436 | 436 | $this->_stateChanged=true; |
437 | 437 | if($value===$defaultValue) |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | */ |
532 | 532 | public function setMode($value) |
533 | 533 | { |
534 | - $this->_mode=TPropertyValue::ensureEnum($value,'\Prado\TApplicationMode'); |
|
534 | + $this->_mode=TPropertyValue::ensureEnum($value, '\Prado\TApplicationMode'); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | /** |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | */ |
580 | 580 | public function setConfigurationType($value) |
581 | 581 | { |
582 | - $this->_configType = $value; |
|
582 | + $this->_configType=$value; |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | /** |
@@ -592,10 +592,10 @@ discard block |
||
592 | 592 | switch($this->_configType) |
593 | 593 | { |
594 | 594 | case TApplication::CONFIG_TYPE_PHP: |
595 | - $this->_configFileExt = TApplication::CONFIG_FILE_EXT_PHP; |
|
595 | + $this->_configFileExt=TApplication::CONFIG_FILE_EXT_PHP; |
|
596 | 596 | break; |
597 | 597 | default: |
598 | - $this->_configFileExt = TApplication::CONFIG_FILE_EXT_XML; |
|
598 | + $this->_configFileExt=TApplication::CONFIG_FILE_EXT_XML; |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | return $this->_configFileExt; |
@@ -607,15 +607,15 @@ discard block |
||
607 | 607 | public function getConfigurationFileName() |
608 | 608 | { |
609 | 609 | static $fileName; |
610 | - if($fileName == null) |
|
610 | + if($fileName==null) |
|
611 | 611 | { |
612 | 612 | switch($this->_configType) |
613 | 613 | { |
614 | 614 | case TApplication::CONFIG_TYPE_PHP: |
615 | - $fileName = TApplication::CONFIG_FILE_PHP; |
|
615 | + $fileName=TApplication::CONFIG_FILE_PHP; |
|
616 | 616 | break; |
617 | 617 | default: |
618 | - $fileName = TApplication::CONFIG_FILE_XML; |
|
618 | + $fileName=TApplication::CONFIG_FILE_XML; |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | return $fileName; |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | public function setModule($id, IModule $module=null) |
667 | 667 | { |
668 | 668 | if(isset($this->_modules[$id])) |
669 | - throw new TConfigurationException('application_moduleid_duplicated',$id); |
|
669 | + throw new TConfigurationException('application_moduleid_duplicated', $id); |
|
670 | 670 | else |
671 | 671 | $this->_modules[$id]=$module; |
672 | 672 | } |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | // force loading of a lazy module |
683 | 683 | if($this->_modules[$id]===null) |
684 | 684 | { |
685 | - $module = $this->internalLoadModule($id, true); |
|
685 | + $module=$this->internalLoadModule($id, true); |
|
686 | 686 | $module[0]->init($module[1]); |
687 | 687 | } |
688 | 688 | |
@@ -931,37 +931,37 @@ discard block |
||
931 | 931 | list($moduleClass, $initProperties, $configElement)=$this->_lazyModules[$id]; |
932 | 932 | if(isset($initProperties['lazy']) && $initProperties['lazy'] && !$force) |
933 | 933 | { |
934 | - Prado::trace("Postponed loading of lazy module $id ({$moduleClass})",'\Prado\TApplication'); |
|
934 | + Prado::trace("Postponed loading of lazy module $id ({$moduleClass})", '\Prado\TApplication'); |
|
935 | 935 | $this->setModule($id, null); |
936 | 936 | return null; |
937 | 937 | } |
938 | 938 | |
939 | - Prado::trace("Loading module $id ({$moduleClass})",'\Prado\TApplication'); |
|
939 | + Prado::trace("Loading module $id ({$moduleClass})", '\Prado\TApplication'); |
|
940 | 940 | $module=Prado::createComponent($moduleClass); |
941 | 941 | foreach($initProperties as $name=>$value) |
942 | 942 | { |
943 | 943 | if($name==='lazy') continue; |
944 | - $module->setSubProperty($name,$value); |
|
944 | + $module->setSubProperty($name, $value); |
|
945 | 945 | } |
946 | - $this->setModule($id,$module); |
|
946 | + $this->setModule($id, $module); |
|
947 | 947 | // keep the key to avoid reuse of the old module id |
948 | 948 | $this->_lazyModules[$id]=null; |
949 | 949 | |
950 | - return array($module,$configElement); |
|
950 | + return array($module, $configElement); |
|
951 | 951 | } |
952 | 952 | /** |
953 | 953 | * Applies an application configuration. |
954 | 954 | * @param TApplicationConfiguration the configuration |
955 | 955 | * @param boolean whether the configuration is specified within a service. |
956 | 956 | */ |
957 | - public function applyConfiguration($config,$withinService=false) |
|
957 | + public function applyConfiguration($config, $withinService=false) |
|
958 | 958 | { |
959 | 959 | if($config->getIsEmpty()) |
960 | 960 | return; |
961 | 961 | |
962 | 962 | // set path aliases and using namespaces |
963 | 963 | foreach($config->getAliases() as $alias=>$path) |
964 | - Prado::setPathOfAlias($alias,$path); |
|
964 | + Prado::setPathOfAlias($alias, $path); |
|
965 | 965 | foreach($config->getUsings() as $using) |
966 | 966 | Prado::using($using); |
967 | 967 | |
@@ -969,11 +969,11 @@ discard block |
||
969 | 969 | if(!$withinService) |
970 | 970 | { |
971 | 971 | foreach($config->getProperties() as $name=>$value) |
972 | - $this->setSubProperty($name,$value); |
|
972 | + $this->setSubProperty($name, $value); |
|
973 | 973 | } |
974 | 974 | |
975 | 975 | if(empty($this->_services)) |
976 | - $this->_services=array($this->getPageServiceID()=>array('Prado\Web\Services\TPageService',array(),null)); |
|
976 | + $this->_services=array($this->getPageServiceID()=>array('Prado\Web\Services\TPageService', array(), null)); |
|
977 | 977 | |
978 | 978 | // load parameters |
979 | 979 | foreach($config->getParameters() as $id=>$parameter) |
@@ -982,11 +982,11 @@ discard block |
||
982 | 982 | { |
983 | 983 | $component=Prado::createComponent($parameter[0]); |
984 | 984 | foreach($parameter[1] as $name=>$value) |
985 | - $component->setSubProperty($name,$value); |
|
986 | - $this->_parameters->add($id,$component); |
|
985 | + $component->setSubProperty($name, $value); |
|
986 | + $this->_parameters->add($id, $component); |
|
987 | 987 | } |
988 | 988 | else |
989 | - $this->_parameters->add($id,$parameter); |
|
989 | + $this->_parameters->add($id, $parameter); |
|
990 | 990 | } |
991 | 991 | |
992 | 992 | // load and init modules specified in app config |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | if(!is_string($id)) |
997 | 997 | $id='_module'.count($this->_lazyModules); |
998 | 998 | $this->_lazyModules[$id]=$moduleConfig; |
999 | - if($module = $this->internalLoadModule($id)) |
|
999 | + if($module=$this->internalLoadModule($id)) |
|
1000 | 1000 | $modules[]=$module; |
1001 | 1001 | } |
1002 | 1002 | foreach($modules as $module) |
@@ -1013,12 +1013,12 @@ discard block |
||
1013 | 1013 | $condition=$this->evaluateExpression($condition); |
1014 | 1014 | if($condition) |
1015 | 1015 | { |
1016 | - if(($path=Prado::getPathOfNamespace($filePath,$this->getConfigurationFileExt()))===null || !is_file($path)) |
|
1017 | - throw new TConfigurationException('application_includefile_invalid',$filePath); |
|
1016 | + if(($path=Prado::getPathOfNamespace($filePath, $this->getConfigurationFileExt()))===null || !is_file($path)) |
|
1017 | + throw new TConfigurationException('application_includefile_invalid', $filePath); |
|
1018 | 1018 | $cn=$this->getApplicationConfigurationClass(); |
1019 | 1019 | $c=new $cn; |
1020 | 1020 | $c->loadFromFile($path); |
1021 | - $this->applyConfiguration($c,$withinService); |
|
1021 | + $this->applyConfiguration($c, $withinService); |
|
1022 | 1022 | } |
1023 | 1023 | } |
1024 | 1024 | } |
@@ -1034,21 +1034,21 @@ discard block |
||
1034 | 1034 | */ |
1035 | 1035 | protected function initApplication() |
1036 | 1036 | { |
1037 | - Prado::trace('Initializing application','Prado\TApplication'); |
|
1037 | + Prado::trace('Initializing application', 'Prado\TApplication'); |
|
1038 | 1038 | |
1039 | 1039 | if($this->_configFile!==null) |
1040 | 1040 | { |
1041 | - if($this->_cacheFile===null || @filemtime($this->_cacheFile)<filemtime($this->_configFile)) |
|
1041 | + if($this->_cacheFile===null || @filemtime($this->_cacheFile) < filemtime($this->_configFile)) |
|
1042 | 1042 | { |
1043 | 1043 | $config=new TApplicationConfiguration; |
1044 | 1044 | $config->loadFromFile($this->_configFile); |
1045 | 1045 | if($this->_cacheFile!==null) |
1046 | - file_put_contents($this->_cacheFile,serialize($config),LOCK_EX); |
|
1046 | + file_put_contents($this->_cacheFile, serialize($config), LOCK_EX); |
|
1047 | 1047 | } |
1048 | 1048 | else |
1049 | 1049 | $config=unserialize(file_get_contents($this->_cacheFile)); |
1050 | 1050 | |
1051 | - $this->applyConfiguration($config,false); |
|
1051 | + $this->applyConfiguration($config, false); |
|
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null) |
@@ -1067,32 +1067,32 @@ discard block |
||
1067 | 1067 | { |
1068 | 1068 | if(isset($this->_services[$serviceID])) |
1069 | 1069 | { |
1070 | - list($serviceClass,$initProperties,$configElement)=$this->_services[$serviceID]; |
|
1070 | + list($serviceClass, $initProperties, $configElement)=$this->_services[$serviceID]; |
|
1071 | 1071 | $service=Prado::createComponent($serviceClass); |
1072 | 1072 | if(!($service instanceof IService)) |
1073 | - throw new THttpException(500,'application_service_invalid',$serviceClass); |
|
1073 | + throw new THttpException(500, 'application_service_invalid', $serviceClass); |
|
1074 | 1074 | if(!$service->getEnabled()) |
1075 | - throw new THttpException(500,'application_service_unavailable',$serviceClass); |
|
1075 | + throw new THttpException(500, 'application_service_unavailable', $serviceClass); |
|
1076 | 1076 | $service->setID($serviceID); |
1077 | 1077 | $this->setService($service); |
1078 | 1078 | |
1079 | 1079 | foreach($initProperties as $name=>$value) |
1080 | - $service->setSubProperty($name,$value); |
|
1080 | + $service->setSubProperty($name, $value); |
|
1081 | 1081 | |
1082 | 1082 | if($configElement!==null) |
1083 | 1083 | { |
1084 | 1084 | $config=new TApplicationConfiguration; |
1085 | 1085 | if($this->getConfigurationType()==self::CONFIG_TYPE_PHP) |
1086 | - $config->loadFromPhp($configElement,$this->getBasePath()); |
|
1086 | + $config->loadFromPhp($configElement, $this->getBasePath()); |
|
1087 | 1087 | else |
1088 | - $config->loadFromXml($configElement,$this->getBasePath()); |
|
1089 | - $this->applyConfiguration($config,true); |
|
1088 | + $config->loadFromXml($configElement, $this->getBasePath()); |
|
1089 | + $this->applyConfiguration($config, true); |
|
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | $service->init($configElement); |
1093 | 1093 | } |
1094 | 1094 | else |
1095 | - throw new THttpException(500,'application_service_unknown',$serviceID); |
|
1095 | + throw new THttpException(500, 'application_service_unknown', $serviceID); |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | /** |
@@ -1103,9 +1103,9 @@ discard block |
||
1103 | 1103 | */ |
1104 | 1104 | public function onError($param) |
1105 | 1105 | { |
1106 | - Prado::log($param->getMessage(),TLogger::ERROR,'Prado\TApplication'); |
|
1107 | - $this->raiseEvent('OnError',$this,$param); |
|
1108 | - $this->getErrorHandler()->handleError($this,$param); |
|
1106 | + Prado::log($param->getMessage(), TLogger::ERROR, 'Prado\TApplication'); |
|
1107 | + $this->raiseEvent('OnError', $this, $param); |
|
1108 | + $this->getErrorHandler()->handleError($this, $param); |
|
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | /** |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | */ |
1118 | 1118 | public function onBeginRequest() |
1119 | 1119 | { |
1120 | - $this->raiseEvent('OnBeginRequest',$this,null); |
|
1120 | + $this->raiseEvent('OnBeginRequest', $this, null); |
|
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | /** |
@@ -1126,7 +1126,7 @@ discard block |
||
1126 | 1126 | */ |
1127 | 1127 | public function onAuthentication() |
1128 | 1128 | { |
1129 | - $this->raiseEvent('OnAuthentication',$this,null); |
|
1129 | + $this->raiseEvent('OnAuthentication', $this, null); |
|
1130 | 1130 | } |
1131 | 1131 | |
1132 | 1132 | /** |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | */ |
1136 | 1136 | public function onAuthenticationComplete() |
1137 | 1137 | { |
1138 | - $this->raiseEvent('OnAuthenticationComplete',$this,null); |
|
1138 | + $this->raiseEvent('OnAuthenticationComplete', $this, null); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | /** |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | */ |
1145 | 1145 | public function onAuthorization() |
1146 | 1146 | { |
1147 | - $this->raiseEvent('OnAuthorization',$this,null); |
|
1147 | + $this->raiseEvent('OnAuthorization', $this, null); |
|
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | /** |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | */ |
1154 | 1154 | public function onAuthorizationComplete() |
1155 | 1155 | { |
1156 | - $this->raiseEvent('OnAuthorizationComplete',$this,null); |
|
1156 | + $this->raiseEvent('OnAuthorizationComplete', $this, null); |
|
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | /** |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | public function onLoadState() |
1164 | 1164 | { |
1165 | 1165 | $this->loadGlobals(); |
1166 | - $this->raiseEvent('OnLoadState',$this,null); |
|
1166 | + $this->raiseEvent('OnLoadState', $this, null); |
|
1167 | 1167 | } |
1168 | 1168 | |
1169 | 1169 | /** |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | */ |
1173 | 1173 | public function onLoadStateComplete() |
1174 | 1174 | { |
1175 | - $this->raiseEvent('OnLoadStateComplete',$this,null); |
|
1175 | + $this->raiseEvent('OnLoadStateComplete', $this, null); |
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | /** |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | */ |
1182 | 1182 | public function onPreRunService() |
1183 | 1183 | { |
1184 | - $this->raiseEvent('OnPreRunService',$this,null); |
|
1184 | + $this->raiseEvent('OnPreRunService', $this, null); |
|
1185 | 1185 | } |
1186 | 1186 | |
1187 | 1187 | /** |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | */ |
1200 | 1200 | public function onSaveState() |
1201 | 1201 | { |
1202 | - $this->raiseEvent('OnSaveState',$this,null); |
|
1202 | + $this->raiseEvent('OnSaveState', $this, null); |
|
1203 | 1203 | $this->saveGlobals(); |
1204 | 1204 | } |
1205 | 1205 | |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | */ |
1210 | 1210 | public function onSaveStateComplete() |
1211 | 1211 | { |
1212 | - $this->raiseEvent('OnSaveStateComplete',$this,null); |
|
1212 | + $this->raiseEvent('OnSaveStateComplete', $this, null); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | /** |
@@ -1218,14 +1218,14 @@ discard block |
||
1218 | 1218 | */ |
1219 | 1219 | public function onPreFlushOutput() |
1220 | 1220 | { |
1221 | - $this->raiseEvent('OnPreFlushOutput',$this,null); |
|
1221 | + $this->raiseEvent('OnPreFlushOutput', $this, null); |
|
1222 | 1222 | } |
1223 | 1223 | |
1224 | 1224 | /** |
1225 | 1225 | * Flushes output to client side. |
1226 | 1226 | * @param boolean whether to continue buffering after flush if buffering was active |
1227 | 1227 | */ |
1228 | - public function flushOutput($continueBuffering = true) |
|
1228 | + public function flushOutput($continueBuffering=true) |
|
1229 | 1229 | { |
1230 | 1230 | $this->getResponse()->flush($continueBuffering); |
1231 | 1231 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | public function onEndRequest() |
1238 | 1238 | { |
1239 | 1239 | $this->flushOutput(false); // flush all remaining content in the buffer |
1240 | - $this->saveGlobals(); // save global state |
|
1241 | - $this->raiseEvent('OnEndRequest',$this,null); |
|
1240 | + $this->saveGlobals(); // save global state |
|
1241 | + $this->raiseEvent('OnEndRequest', $this, null); |
|
1242 | 1242 | } |
1243 | 1243 | } |