@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Creates a control used for repetition (used as a template). |
40 | - * @return TControl the control to be repeated |
|
40 | + * @return TRadioButtonItem the control to be repeated |
|
41 | 41 | */ |
42 | 42 | protected function createRepeatedControl() |
43 | 43 | { |
@@ -54,14 +54,14 @@ |
||
54 | 54 | */ |
55 | 55 | public function loadPostData($key, $values) |
56 | 56 | { |
57 | - $value = isset($values[$key])?$values[$key]:''; |
|
58 | - $oldSelection = $this->getSelectedIndex(); |
|
57 | + $value=isset($values[$key]) ? $values[$key] : ''; |
|
58 | + $oldSelection=$this->getSelectedIndex(); |
|
59 | 59 | $this->ensureDataBound(); |
60 | 60 | foreach($this->getItems() as $index => $item) |
61 | 61 | { |
62 | - if($item->getEnabled() && $item->getValue() === $value) |
|
62 | + if($item->getEnabled() && $item->getValue()===$value) |
|
63 | 63 | { |
64 | - if($index === $oldSelection) |
|
64 | + if($index===$oldSelection) |
|
65 | 65 | return false; |
66 | 66 | else |
67 | 67 | { |
@@ -34,6 +34,7 @@ |
||
34 | 34 | /** |
35 | 35 | * Constructor. |
36 | 36 | * @param TControl repeater item related with the corresponding event |
37 | + * @param \Prado\TComponent $item |
|
37 | 38 | */ |
38 | 39 | public function __construct($item) |
39 | 40 | { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function __construct($item) |
40 | 40 | { |
41 | - $this->_item = $item; |
|
41 | + $this->_item=$item; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -96,6 +96,9 @@ discard block |
||
96 | 96 | return $this->validateStandardControl($control); |
97 | 97 | } |
98 | 98 | |
99 | + /** |
|
100 | + * @param TListControl $control |
|
101 | + */ |
|
99 | 102 | private function validateListControl($control) |
100 | 103 | { |
101 | 104 | $initial = trim($this->getInitialValue()); |
@@ -108,6 +111,9 @@ discard block |
||
108 | 111 | return $count > 0; |
109 | 112 | } |
110 | 113 | |
114 | + /** |
|
115 | + * @param TRadioButton $control |
|
116 | + */ |
|
111 | 117 | private function validateRadioButtonGroup($control) |
112 | 118 | { |
113 | 119 | $initial = trim($this->getInitialValue()); |
@@ -124,6 +130,9 @@ discard block |
||
124 | 130 | return false; |
125 | 131 | } |
126 | 132 | |
133 | + /** |
|
134 | + * @param \Prado\Web\UI\TControl $control |
|
135 | + */ |
|
127 | 136 | private function validateStandardControl($control) |
128 | 137 | { |
129 | 138 | $initial = trim($this->getInitialValue()); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | protected function getControlPromptValue() |
62 | 62 | { |
63 | - $control = $this->getValidationTarget(); |
|
63 | + $control=$this->getValidationTarget(); |
|
64 | 64 | if($control instanceof TListControl) |
65 | 65 | return $control->getPromptValue(); |
66 | 66 | return ''; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | protected function evaluateIsValid() |
90 | 90 | { |
91 | - $control = $this->getValidationTarget(); |
|
91 | + $control=$this->getValidationTarget(); |
|
92 | 92 | if($control instanceof TListControl) |
93 | 93 | return $this->validateListControl($control); |
94 | 94 | elseif($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | |
100 | 100 | private function validateListControl($control) |
101 | 101 | { |
102 | - $initial = trim($this->getInitialValue()); |
|
103 | - $count = 0; |
|
102 | + $initial=trim($this->getInitialValue()); |
|
103 | + $count=0; |
|
104 | 104 | foreach($control->getItems() as $item) |
105 | 105 | { |
106 | - if($item->getSelected() && $item->getValue() != $initial) |
|
106 | + if($item->getSelected() && $item->getValue()!=$initial) |
|
107 | 107 | $count++; |
108 | 108 | } |
109 | 109 | return $count > 0; |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | |
112 | 112 | private function validateRadioButtonGroup($control) |
113 | 113 | { |
114 | - $initial = trim($this->getInitialValue()); |
|
114 | + $initial=trim($this->getInitialValue()); |
|
115 | 115 | foreach($control->getRadioButtonsInGroup() as $radio) |
116 | 116 | { |
117 | 117 | if($radio->getChecked()) |
118 | 118 | { |
119 | - if(strlen($value = $radio->getValue()) > 0) |
|
120 | - return $value !== $initial; |
|
119 | + if(strlen($value=$radio->getValue()) > 0) |
|
120 | + return $value!==$initial; |
|
121 | 121 | else |
122 | 122 | return true; |
123 | 123 | } |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | |
128 | 128 | private function validateStandardControl($control) |
129 | 129 | { |
130 | - $initial = trim($this->getInitialValue()); |
|
131 | - $value = $this->getValidationValue($control); |
|
132 | - return (is_bool($value) && $value) || trim($value) !== $initial; |
|
130 | + $initial=trim($this->getInitialValue()); |
|
131 | + $value=$this->getValidationValue($control); |
|
132 | + return (is_bool($value) && $value) || trim($value)!==$initial; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -138,13 +138,13 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function getClientScriptOptions() |
140 | 140 | { |
141 | - $options = parent::getClientScriptOptions(); |
|
142 | - $options['InitialValue'] = $this->getInitialValue(); |
|
143 | - $control = $this->getValidationTarget(); |
|
141 | + $options=parent::getClientScriptOptions(); |
|
142 | + $options['InitialValue']=$this->getInitialValue(); |
|
143 | + $control=$this->getValidationTarget(); |
|
144 | 144 | if($control instanceof TListControl) |
145 | - $options['TotalItems'] = $control->getItemCount(); |
|
145 | + $options['TotalItems']=$control->getItemCount(); |
|
146 | 146 | if($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
147 | - $options['GroupName'] = $control->getGroupName(); |
|
147 | + $options['GroupName']=$control->getGroupName(); |
|
148 | 148 | return $options; |
149 | 149 | } |
150 | 150 | } |
@@ -252,7 +252,7 @@ |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
255 | - * @return boolean true to observe changes. |
|
255 | + * @return boolean|string true to observe changes. |
|
256 | 256 | */ |
257 | 257 | public function getObserveChanges() |
258 | 258 | { |
@@ -105,7 +105,7 @@ |
||
105 | 105 | */ |
106 | 106 | public function getObserveChanges() |
107 | 107 | { |
108 | - $changes = $this->getOption('ObserveChanges'); |
|
109 | - return ($changes === null) ? true : $changes; |
|
108 | + $changes=$this->getOption('ObserveChanges'); |
|
109 | + return ($changes===null) ? true : $changes; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -663,6 +663,7 @@ discard block |
||
663 | 663 | * This event is raised when a cancel navigation button is clicked in the |
664 | 664 | * current active step. |
665 | 665 | * @param TEventParameter event parameter |
666 | + * @param \Prado\Web\UI\TCommandEventParameter $param |
|
666 | 667 | */ |
667 | 668 | public function onCancelButtonClick($param) |
668 | 669 | { |
@@ -676,6 +677,7 @@ discard block |
||
676 | 677 | * This event is raised when a finish navigation button is clicked in the |
677 | 678 | * current active step. |
678 | 679 | * @param TWizardNavigationEventParameter event parameter |
680 | + * @param TWizardNavigationEventParameter $param |
|
679 | 681 | */ |
680 | 682 | public function onCompleteButtonClick($param) |
681 | 683 | { |
@@ -689,6 +691,7 @@ discard block |
||
689 | 691 | * This event is raised when a next navigation button is clicked in the |
690 | 692 | * current active step. |
691 | 693 | * @param TWizardNavigationEventParameter event parameter |
694 | + * @param TWizardNavigationEventParameter $param |
|
692 | 695 | */ |
693 | 696 | public function onNextButtonClick($param) |
694 | 697 | { |
@@ -700,6 +703,7 @@ discard block |
||
700 | 703 | * This event is raised when a previous navigation button is clicked in the |
701 | 704 | * current active step. |
702 | 705 | * @param TWizardNavigationEventParameter event parameter |
706 | + * @param TWizardNavigationEventParameter $param |
|
703 | 707 | */ |
704 | 708 | public function onPreviousButtonClick($param) |
705 | 709 | { |
@@ -710,6 +714,7 @@ discard block |
||
710 | 714 | * Raises <b>OnSideBarButtonClick</b> event. |
711 | 715 | * This event is raised when a link button in the side bar is clicked. |
712 | 716 | * @param TWizardNavigationEventParameter event parameter |
717 | + * @param TWizardNavigationEventParameter $param |
|
713 | 718 | */ |
714 | 719 | public function onSideBarButtonClick($param) |
715 | 720 | { |
@@ -738,6 +743,7 @@ discard block |
||
738 | 743 | * This method should only be used by control developers. |
739 | 744 | * It is invoked when a step is added into the step collection of the wizard. |
740 | 745 | * @param TWizardStep wizard step to be added into multiview. |
746 | + * @param TWizardStep $step |
|
741 | 747 | */ |
742 | 748 | public function addedWizardStep($step) |
743 | 749 | { |
@@ -1281,6 +1287,7 @@ discard block |
||
1281 | 1287 | * Determines the index of the previous step based on history. |
1282 | 1288 | * @param boolean whether the first item in the history stack should be popped |
1283 | 1289 | * up after calling this method. |
1290 | + * @param boolean $popStack |
|
1284 | 1291 | */ |
1285 | 1292 | protected function getPreviousStepIndex($popStack) |
1286 | 1293 | { |
@@ -1324,6 +1331,7 @@ discard block |
||
1324 | 1331 | |
1325 | 1332 | /** |
1326 | 1333 | * @param integer index of the step |
1334 | + * @param integer $index |
|
1327 | 1335 | * @return boolean whether navigation to the specified step is allowed |
1328 | 1336 | */ |
1329 | 1337 | protected function allowNavigationToStep($index) |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * Navigation commands. |
86 | 86 | */ |
87 | - const CMD_PREVIOUS = 'PreviousStep'; |
|
88 | - const CMD_NEXT = 'NextStep'; |
|
89 | - const CMD_CANCEL = 'Cancel'; |
|
90 | - const CMD_COMPLETE = 'Complete'; |
|
91 | - const CMD_MOVETO = 'MoveTo'; |
|
87 | + const CMD_PREVIOUS='PreviousStep'; |
|
88 | + const CMD_NEXT='NextStep'; |
|
89 | + const CMD_CANCEL='Cancel'; |
|
90 | + const CMD_COMPLETE='Complete'; |
|
91 | + const CMD_MOVETO='MoveTo'; |
|
92 | 92 | /** |
93 | 93 | * Side bar button ID |
94 | 94 | */ |
95 | - const ID_SIDEBAR_BUTTON = 'SideBarButton'; |
|
95 | + const ID_SIDEBAR_BUTTON='SideBarButton'; |
|
96 | 96 | /** |
97 | 97 | * Side bar data list |
98 | 98 | */ |
99 | - const ID_SIDEBAR_LIST = 'SideBarList'; |
|
99 | + const ID_SIDEBAR_LIST='SideBarList'; |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * @var TMultiView multiview that contains the wizard steps |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * @var boolean whether ActiveStepIndex was already set |
159 | 159 | */ |
160 | - private $_activeStepIndexSet = false; |
|
160 | + private $_activeStepIndexSet=false; |
|
161 | 161 | /** |
162 | 162 | * @var TDataList side bar data list. |
163 | 163 | */ |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /** |
166 | 166 | * @var boolean whether navigation should be cancelled (a status set in OnSideBarButtonClick) |
167 | 167 | */ |
168 | - private $_cancelNavigation = false; |
|
168 | + private $_cancelNavigation=false; |
|
169 | 169 | |
170 | 170 | /** |
171 | 171 | * @return string tag name for the wizard |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setActiveStep($step) |
203 | 203 | { |
204 | - if(($index = $this->getWizardSteps()->indexOf($step)) < 0) |
|
204 | + if(($index=$this->getWizardSteps()->indexOf($step)) < 0) |
|
205 | 205 | throw new TInvalidOperationException('wizard_step_invalid'); |
206 | 206 | $this->setActiveStepIndex($index); |
207 | 207 | } |
@@ -219,13 +219,13 @@ discard block |
||
219 | 219 | */ |
220 | 220 | public function setActiveStepIndex($value) |
221 | 221 | { |
222 | - $value = TPropertyValue::ensureInteger($value); |
|
223 | - $multiView = $this->getMultiView(); |
|
224 | - if($multiView->getActiveViewIndex() !== $value) |
|
222 | + $value=TPropertyValue::ensureInteger($value); |
|
223 | + $multiView=$this->getMultiView(); |
|
224 | + if($multiView->getActiveViewIndex()!==$value) |
|
225 | 225 | { |
226 | 226 | $multiView->setActiveViewIndex($value); |
227 | - $this->_activeStepIndexSet = true; |
|
228 | - if($this->_sideBarDataList !== null && $this->getSideBarTemplate() !== null) |
|
227 | + $this->_activeStepIndexSet=true; |
|
228 | + if($this->_sideBarDataList!==null && $this->getSideBarTemplate()!==null) |
|
229 | 229 | { |
230 | 230 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
231 | 231 | $this->_sideBarDataList->dataBind(); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function getWizardSteps() |
240 | 240 | { |
241 | - if($this->_wizardSteps === null) |
|
242 | - $this->_wizardSteps = new TWizardStepCollection($this); |
|
241 | + if($this->_wizardSteps===null) |
|
242 | + $this->_wizardSteps=new TWizardStepCollection($this); |
|
243 | 243 | return $this->_wizardSteps; |
244 | 244 | } |
245 | 245 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public function setStartNavigationTemplate($value) |
290 | 290 | { |
291 | - $this->_startNavigationTemplate = $value; |
|
291 | + $this->_startNavigationTemplate=$value; |
|
292 | 292 | $this->requiresControlsRecreation(); |
293 | 293 | } |
294 | 294 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function setStepNavigationTemplate($value) |
307 | 307 | { |
308 | - $this->_stepNavigationTemplate = $value; |
|
308 | + $this->_stepNavigationTemplate=$value; |
|
309 | 309 | $this->requiresControlsRecreation(); |
310 | 310 | } |
311 | 311 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function setFinishNavigationTemplate($value) |
324 | 324 | { |
325 | - $this->_finishNavigationTemplate = $value; |
|
325 | + $this->_finishNavigationTemplate=$value; |
|
326 | 326 | $this->requiresControlsRecreation(); |
327 | 327 | } |
328 | 328 | |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function setHeaderTemplate($value) |
341 | 341 | { |
342 | - $this->_headerTemplate = $value; |
|
342 | + $this->_headerTemplate=$value; |
|
343 | 343 | $this->requiresControlsRecreation(); |
344 | 344 | } |
345 | 345 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function setSideBarTemplate($value) |
358 | 358 | { |
359 | - $this->_sideBarTemplate = $value; |
|
359 | + $this->_sideBarTemplate=$value; |
|
360 | 360 | $this->requiresControlsRecreation(); |
361 | 361 | } |
362 | 362 | |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | */ |
417 | 417 | public function getSideBarButtonStyle() |
418 | 418 | { |
419 | - if(($style = $this->getViewState('SideBarButtonStyle', null)) === null) |
|
419 | + if(($style=$this->getViewState('SideBarButtonStyle', null))===null) |
|
420 | 420 | { |
421 | - $style = new TStyle; |
|
421 | + $style=new TStyle; |
|
422 | 422 | $this->setViewState('SideBarButtonStyle', $style, null); |
423 | 423 | } |
424 | 424 | return $style; |
@@ -429,9 +429,9 @@ discard block |
||
429 | 429 | */ |
430 | 430 | public function getNavigationButtonStyle() |
431 | 431 | { |
432 | - if(($style = $this->getViewState('NavigationButtonStyle', null)) === null) |
|
432 | + if(($style=$this->getViewState('NavigationButtonStyle', null))===null) |
|
433 | 433 | { |
434 | - $style = new TStyle; |
|
434 | + $style=new TStyle; |
|
435 | 435 | $this->setViewState('NavigationButtonStyle', $style, null); |
436 | 436 | } |
437 | 437 | return $style; |
@@ -442,9 +442,9 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function getStartNextButtonStyle() |
444 | 444 | { |
445 | - if(($style = $this->getViewState('StartNextButtonStyle', null)) === null) |
|
445 | + if(($style=$this->getViewState('StartNextButtonStyle', null))===null) |
|
446 | 446 | { |
447 | - $style = new TWizardNavigationButtonStyle; |
|
447 | + $style=new TWizardNavigationButtonStyle; |
|
448 | 448 | $style->setButtonText('Next'); |
449 | 449 | $this->setViewState('StartNextButtonStyle', $style, null); |
450 | 450 | } |
@@ -456,9 +456,9 @@ discard block |
||
456 | 456 | */ |
457 | 457 | public function getStepNextButtonStyle() |
458 | 458 | { |
459 | - if(($style = $this->getViewState('StepNextButtonStyle', null)) === null) |
|
459 | + if(($style=$this->getViewState('StepNextButtonStyle', null))===null) |
|
460 | 460 | { |
461 | - $style = new TWizardNavigationButtonStyle; |
|
461 | + $style=new TWizardNavigationButtonStyle; |
|
462 | 462 | $style->setButtonText('Next'); |
463 | 463 | $this->setViewState('StepNextButtonStyle', $style, null); |
464 | 464 | } |
@@ -470,9 +470,9 @@ discard block |
||
470 | 470 | */ |
471 | 471 | public function getStepPreviousButtonStyle() |
472 | 472 | { |
473 | - if(($style = $this->getViewState('StepPreviousButtonStyle', null)) === null) |
|
473 | + if(($style=$this->getViewState('StepPreviousButtonStyle', null))===null) |
|
474 | 474 | { |
475 | - $style = new TWizardNavigationButtonStyle; |
|
475 | + $style=new TWizardNavigationButtonStyle; |
|
476 | 476 | $style->setButtonText('Previous'); |
477 | 477 | $this->setViewState('StepPreviousButtonStyle', $style, null); |
478 | 478 | } |
@@ -484,9 +484,9 @@ discard block |
||
484 | 484 | */ |
485 | 485 | public function getFinishCompleteButtonStyle() |
486 | 486 | { |
487 | - if(($style = $this->getViewState('FinishCompleteButtonStyle', null)) === null) |
|
487 | + if(($style=$this->getViewState('FinishCompleteButtonStyle', null))===null) |
|
488 | 488 | { |
489 | - $style = new TWizardNavigationButtonStyle; |
|
489 | + $style=new TWizardNavigationButtonStyle; |
|
490 | 490 | $style->setButtonText('Complete'); |
491 | 491 | $this->setViewState('FinishCompleteButtonStyle', $style, null); |
492 | 492 | } |
@@ -498,9 +498,9 @@ discard block |
||
498 | 498 | */ |
499 | 499 | public function getFinishPreviousButtonStyle() |
500 | 500 | { |
501 | - if(($style = $this->getViewState('FinishPreviousButtonStyle', null)) === null) |
|
501 | + if(($style=$this->getViewState('FinishPreviousButtonStyle', null))===null) |
|
502 | 502 | { |
503 | - $style = new TWizardNavigationButtonStyle; |
|
503 | + $style=new TWizardNavigationButtonStyle; |
|
504 | 504 | $style->setButtonText('Previous'); |
505 | 505 | $this->setViewState('FinishPreviousButtonStyle', $style, null); |
506 | 506 | } |
@@ -512,9 +512,9 @@ discard block |
||
512 | 512 | */ |
513 | 513 | public function getCancelButtonStyle() |
514 | 514 | { |
515 | - if(($style = $this->getViewState('CancelButtonStyle', null)) === null) |
|
515 | + if(($style=$this->getViewState('CancelButtonStyle', null))===null) |
|
516 | 516 | { |
517 | - $style = new TWizardNavigationButtonStyle; |
|
517 | + $style=new TWizardNavigationButtonStyle; |
|
518 | 518 | $style->setButtonText('Cancel'); |
519 | 519 | $this->setViewState('CancelButtonStyle', $style, null); |
520 | 520 | } |
@@ -526,9 +526,9 @@ discard block |
||
526 | 526 | */ |
527 | 527 | public function getSideBarStyle() |
528 | 528 | { |
529 | - if(($style = $this->getViewState('SideBarStyle', null)) === null) |
|
529 | + if(($style=$this->getViewState('SideBarStyle', null))===null) |
|
530 | 530 | { |
531 | - $style = new TPanelStyle; |
|
531 | + $style=new TPanelStyle; |
|
532 | 532 | $this->setViewState('SideBarStyle', $style, null); |
533 | 533 | } |
534 | 534 | return $style; |
@@ -539,9 +539,9 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function getHeaderStyle() |
541 | 541 | { |
542 | - if(($style = $this->getViewState('HeaderStyle', null)) === null) |
|
542 | + if(($style=$this->getViewState('HeaderStyle', null))===null) |
|
543 | 543 | { |
544 | - $style = new TPanelStyle; |
|
544 | + $style=new TPanelStyle; |
|
545 | 545 | $this->setViewState('HeaderStyle', $style, null); |
546 | 546 | } |
547 | 547 | return $style; |
@@ -552,9 +552,9 @@ discard block |
||
552 | 552 | */ |
553 | 553 | public function getStepStyle() |
554 | 554 | { |
555 | - if(($style = $this->getViewState('StepStyle', null)) === null) |
|
555 | + if(($style=$this->getViewState('StepStyle', null))===null) |
|
556 | 556 | { |
557 | - $style = new TPanelStyle; |
|
557 | + $style=new TPanelStyle; |
|
558 | 558 | $this->setViewState('StepStyle', $style, null); |
559 | 559 | } |
560 | 560 | return $style; |
@@ -565,9 +565,9 @@ discard block |
||
565 | 565 | */ |
566 | 566 | public function getNavigationStyle() |
567 | 567 | { |
568 | - if(($style = $this->getViewState('NavigationStyle', null)) === null) |
|
568 | + if(($style=$this->getViewState('NavigationStyle', null))===null) |
|
569 | 569 | { |
570 | - $style = new TPanelStyle; |
|
570 | + $style=new TPanelStyle; |
|
571 | 571 | $this->setViewState('NavigationStyle', $style, null); |
572 | 572 | } |
573 | 573 | return $style; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | public function onCancelButtonClick($param) |
660 | 660 | { |
661 | 661 | $this->raiseEvent('OnCancelButtonClick', $this, $param); |
662 | - if(($url = $this->getCancelDestinationUrl()) !== '') |
|
662 | + if(($url=$this->getCancelDestinationUrl())!=='') |
|
663 | 663 | $this->getResponse()->redirect($url); |
664 | 664 | } |
665 | 665 | |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | public function onCompleteButtonClick($param) |
673 | 673 | { |
674 | 674 | $this->raiseEvent('OnCompleteButtonClick', $this, $param); |
675 | - if(($url = $this->getFinishDestinationUrl()) !== '') |
|
675 | + if(($url=$this->getFinishDestinationUrl())!=='') |
|
676 | 676 | $this->getResponse()->redirect($url); |
677 | 677 | } |
678 | 678 | |
@@ -715,11 +715,11 @@ discard block |
||
715 | 715 | */ |
716 | 716 | public function getMultiView() |
717 | 717 | { |
718 | - if($this->_multiView === null) |
|
718 | + if($this->_multiView===null) |
|
719 | 719 | { |
720 | - $this->_multiView = new TMultiView; |
|
720 | + $this->_multiView=new TMultiView; |
|
721 | 721 | $this->_multiView->setID('WizardMultiView'); |
722 | - $this->_multiView->attachEventHandler('OnActiveViewChanged', [$this,'onActiveStepChanged']); |
|
722 | + $this->_multiView->attachEventHandler('OnActiveViewChanged', [$this, 'onActiveStepChanged']); |
|
723 | 723 | $this->_multiView->ignoreBubbleEvents(); |
724 | 724 | } |
725 | 725 | return $this->_multiView; |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | */ |
734 | 734 | public function addedWizardStep($step) |
735 | 735 | { |
736 | - if(($wizard = $step->getWizard()) !== null) |
|
736 | + if(($wizard=$step->getWizard())!==null) |
|
737 | 737 | $wizard->getWizardSteps()->remove($step); |
738 | 738 | $step->setWizard($this); |
739 | 739 | $this->wizardStepsChanged(); |
@@ -771,9 +771,9 @@ discard block |
||
771 | 771 | */ |
772 | 772 | public function saveState() |
773 | 773 | { |
774 | - $index = $this->getActiveStepIndex(); |
|
775 | - $history = $this->getHistory(); |
|
776 | - if(!$history->getCount() || $history->peek() !== $index) |
|
774 | + $index=$this->getActiveStepIndex(); |
|
775 | + $history=$this->getHistory(); |
|
776 | + if(!$history->getCount() || $history->peek()!==$index) |
|
777 | 777 | $history->push($index); |
778 | 778 | } |
779 | 779 | |
@@ -837,9 +837,9 @@ discard block |
||
837 | 837 | */ |
838 | 838 | protected function applyHeaderProperties() |
839 | 839 | { |
840 | - if(($style = $this->getViewState('HeaderStyle', null)) !== null) |
|
840 | + if(($style=$this->getViewState('HeaderStyle', null))!==null) |
|
841 | 841 | $this->_header->getStyle()->mergeWith($style); |
842 | - if($this->getHeaderTemplate() === null) |
|
842 | + if($this->getHeaderTemplate()===null) |
|
843 | 843 | { |
844 | 844 | $this->_header->getControls()->clear(); |
845 | 845 | $this->_header->getControls()->add($this->getHeaderText()); |
@@ -852,21 +852,21 @@ discard block |
||
852 | 852 | protected function applySideBarProperties() |
853 | 853 | { |
854 | 854 | $this->_sideBar->setVisible($this->getShowSideBar()); |
855 | - if($this->_sideBarDataList !== null && $this->getShowSideBar()) |
|
855 | + if($this->_sideBarDataList!==null && $this->getShowSideBar()) |
|
856 | 856 | { |
857 | 857 | $this->_sideBarDataList->setDataSource($this->getWizardSteps()); |
858 | 858 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
859 | 859 | $this->_sideBarDataList->dataBind(); |
860 | - if(($style = $this->getViewState('SideBarButtonStyle', null)) !== null) |
|
860 | + if(($style=$this->getViewState('SideBarButtonStyle', null))!==null) |
|
861 | 861 | { |
862 | 862 | foreach($this->_sideBarDataList->getItems() as $item) |
863 | 863 | { |
864 | - if(($button = $item->findControl('SideBarButton')) !== null) |
|
864 | + if(($button=$item->findControl('SideBarButton'))!==null) |
|
865 | 865 | $button->getStyle()->mergeWith($style); |
866 | 866 | } |
867 | 867 | } |
868 | 868 | } |
869 | - if(($style = $this->getViewState('SideBarStyle', null)) !== null) |
|
869 | + if(($style=$this->getViewState('SideBarStyle', null))!==null) |
|
870 | 870 | $this->_sideBar->getStyle()->mergeWith($style); |
871 | 871 | } |
872 | 872 | |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | */ |
876 | 876 | protected function applyStepContentProperties() |
877 | 877 | { |
878 | - if(($style = $this->getViewState('StepStyle', null)) !== null) |
|
878 | + if(($style=$this->getViewState('StepStyle', null))!==null) |
|
879 | 879 | $this->_stepContent->getStyle()->mergeWith($style); |
880 | 880 | } |
881 | 881 | |
@@ -884,9 +884,9 @@ discard block |
||
884 | 884 | */ |
885 | 885 | protected function applyNavigationProperties() |
886 | 886 | { |
887 | - $wizardSteps = $this->getWizardSteps(); |
|
888 | - $activeStep = $this->getActiveStep(); |
|
889 | - $activeStepIndex = $this->getActiveStepIndex(); |
|
887 | + $wizardSteps=$this->getWizardSteps(); |
|
888 | + $activeStep=$this->getActiveStep(); |
|
889 | + $activeStepIndex=$this->getActiveStepIndex(); |
|
890 | 890 | |
891 | 891 | if(!$this->_navigation) |
892 | 892 | return; |
@@ -897,103 +897,103 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | // set visibility of different types of navigation panel |
900 | - $showStandard = true; |
|
900 | + $showStandard=true; |
|
901 | 901 | foreach($wizardSteps as $step) |
902 | 902 | { |
903 | - if(($step instanceof TTemplatedWizardStep) && ($container = $step->getNavigationContainer()) !== null) |
|
903 | + if(($step instanceof TTemplatedWizardStep) && ($container=$step->getNavigationContainer())!==null) |
|
904 | 904 | { |
905 | - if($activeStep === $step) |
|
905 | + if($activeStep===$step) |
|
906 | 906 | { |
907 | 907 | $container->setVisible(true); |
908 | - $showStandard = false; |
|
908 | + $showStandard=false; |
|
909 | 909 | } |
910 | 910 | else |
911 | 911 | $container->setVisible(false); |
912 | 912 | } |
913 | 913 | } |
914 | - $activeStepType = $this->getStepType($activeStep); |
|
915 | - if($activeStepType === TWizardStepType::Complete) |
|
914 | + $activeStepType=$this->getStepType($activeStep); |
|
915 | + if($activeStepType===TWizardStepType::Complete) |
|
916 | 916 | { |
917 | 917 | $this->_sideBar->setVisible(false); |
918 | 918 | $this->_header->setVisible(false); |
919 | 919 | } |
920 | - $this->_startNavigation->setVisible($showStandard && $activeStepType === TWizardStepType::Start); |
|
921 | - $this->_stepNavigation->setVisible($showStandard && $activeStepType === TWizardStepType::Step); |
|
922 | - $this->_finishNavigation->setVisible($showStandard && $activeStepType === TWizardStepType::Finish); |
|
920 | + $this->_startNavigation->setVisible($showStandard && $activeStepType===TWizardStepType::Start); |
|
921 | + $this->_stepNavigation->setVisible($showStandard && $activeStepType===TWizardStepType::Step); |
|
922 | + $this->_finishNavigation->setVisible($showStandard && $activeStepType===TWizardStepType::Finish); |
|
923 | 923 | |
924 | - if(($navigationStyle = $this->getViewState('NavigationStyle', null)) !== null) |
|
924 | + if(($navigationStyle=$this->getViewState('NavigationStyle', null))!==null) |
|
925 | 925 | $this->_navigation->getStyle()->mergeWith($navigationStyle); |
926 | 926 | |
927 | - $displayCancelButton = $this->getShowCancelButton(); |
|
928 | - $cancelButtonStyle = $this->getCancelButtonStyle(); |
|
929 | - $buttonStyle = $this->getViewState('NavigationButtonStyle', null); |
|
930 | - if($buttonStyle !== null) |
|
927 | + $displayCancelButton=$this->getShowCancelButton(); |
|
928 | + $cancelButtonStyle=$this->getCancelButtonStyle(); |
|
929 | + $buttonStyle=$this->getViewState('NavigationButtonStyle', null); |
|
930 | + if($buttonStyle!==null) |
|
931 | 931 | $cancelButtonStyle->mergeWith($buttonStyle); |
932 | 932 | |
933 | 933 | // apply styles to start navigation buttons |
934 | - if(($cancelButton = $this->_startNavigation->getCancelButton()) !== null) |
|
934 | + if(($cancelButton=$this->_startNavigation->getCancelButton())!==null) |
|
935 | 935 | { |
936 | 936 | $cancelButton->setVisible($displayCancelButton); |
937 | 937 | $cancelButtonStyle->apply($cancelButton); |
938 | 938 | } |
939 | - if(($button = $this->_startNavigation->getNextButton()) !== null) |
|
939 | + if(($button=$this->_startNavigation->getNextButton())!==null) |
|
940 | 940 | { |
941 | 941 | $button->setVisible(true); |
942 | - $style = $this->getStartNextButtonStyle(); |
|
943 | - if($buttonStyle !== null) |
|
942 | + $style=$this->getStartNextButtonStyle(); |
|
943 | + if($buttonStyle!==null) |
|
944 | 944 | $style->mergeWith($buttonStyle); |
945 | 945 | $style->apply($button); |
946 | - if($activeStepType === TWizardStepType::Start) |
|
946 | + if($activeStepType===TWizardStepType::Start) |
|
947 | 947 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
948 | 948 | } |
949 | 949 | |
950 | 950 | // apply styles to finish navigation buttons |
951 | - if(($cancelButton = $this->_finishNavigation->getCancelButton()) !== null) |
|
951 | + if(($cancelButton=$this->_finishNavigation->getCancelButton())!==null) |
|
952 | 952 | { |
953 | 953 | $cancelButton->setVisible($displayCancelButton); |
954 | 954 | $cancelButtonStyle->apply($cancelButton); |
955 | 955 | } |
956 | - if(($button = $this->_finishNavigation->getPreviousButton()) !== null) |
|
956 | + if(($button=$this->_finishNavigation->getPreviousButton())!==null) |
|
957 | 957 | { |
958 | 958 | $button->setVisible($this->allowNavigationToPreviousStep()); |
959 | - $style = $this->getFinishPreviousButtonStyle(); |
|
960 | - if($buttonStyle !== null) |
|
959 | + $style=$this->getFinishPreviousButtonStyle(); |
|
960 | + if($buttonStyle!==null) |
|
961 | 961 | $style->mergeWith($buttonStyle); |
962 | 962 | $style->apply($button); |
963 | 963 | } |
964 | - if(($button = $this->_finishNavigation->getCompleteButton()) !== null) |
|
964 | + if(($button=$this->_finishNavigation->getCompleteButton())!==null) |
|
965 | 965 | { |
966 | 966 | $button->setVisible(true); |
967 | - $style = $this->getFinishCompleteButtonStyle(); |
|
968 | - if($buttonStyle !== null) |
|
967 | + $style=$this->getFinishCompleteButtonStyle(); |
|
968 | + if($buttonStyle!==null) |
|
969 | 969 | $style->mergeWith($buttonStyle); |
970 | 970 | $style->apply($button); |
971 | - if($activeStepType === TWizardStepType::Finish) |
|
971 | + if($activeStepType===TWizardStepType::Finish) |
|
972 | 972 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
973 | 973 | } |
974 | 974 | |
975 | 975 | // apply styles to step navigation buttons |
976 | - if(($cancelButton = $this->_stepNavigation->getCancelButton()) !== null) |
|
976 | + if(($cancelButton=$this->_stepNavigation->getCancelButton())!==null) |
|
977 | 977 | { |
978 | 978 | $cancelButton->setVisible($displayCancelButton); |
979 | 979 | $cancelButtonStyle->apply($cancelButton); |
980 | 980 | } |
981 | - if(($button = $this->_stepNavigation->getPreviousButton()) !== null) |
|
981 | + if(($button=$this->_stepNavigation->getPreviousButton())!==null) |
|
982 | 982 | { |
983 | 983 | $button->setVisible($this->allowNavigationToPreviousStep()); |
984 | - $style = $this->getStepPreviousButtonStyle(); |
|
985 | - if($buttonStyle !== null) |
|
984 | + $style=$this->getStepPreviousButtonStyle(); |
|
985 | + if($buttonStyle!==null) |
|
986 | 986 | $style->mergeWith($buttonStyle); |
987 | 987 | $style->apply($button); |
988 | 988 | } |
989 | - if(($button = $this->_stepNavigation->getNextButton()) !== null) |
|
989 | + if(($button=$this->_stepNavigation->getNextButton())!==null) |
|
990 | 990 | { |
991 | 991 | $button->setVisible(true); |
992 | - $style = $this->getStepNextButtonStyle(); |
|
993 | - if($buttonStyle !== null) |
|
992 | + $style=$this->getStepNextButtonStyle(); |
|
993 | + if($buttonStyle!==null) |
|
994 | 994 | $style->mergeWith($buttonStyle); |
995 | 995 | $style->apply($button); |
996 | - if($activeStepType === TWizardStepType::Step) |
|
996 | + if($activeStepType===TWizardStepType::Step) |
|
997 | 997 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
998 | 998 | } |
999 | 999 | } |
@@ -1003,9 +1003,9 @@ discard block |
||
1003 | 1003 | */ |
1004 | 1004 | protected function getHistory() |
1005 | 1005 | { |
1006 | - if(($history = $this->getControlState('History', null)) === null) |
|
1006 | + if(($history=$this->getControlState('History', null))===null) |
|
1007 | 1007 | { |
1008 | - $history = new TStack; |
|
1008 | + $history=new TStack; |
|
1009 | 1009 | $this->setControlState('History', $history); |
1010 | 1010 | } |
1011 | 1011 | return $history; |
@@ -1018,17 +1018,17 @@ discard block |
||
1018 | 1018 | */ |
1019 | 1019 | protected function getStepType($wizardStep) |
1020 | 1020 | { |
1021 | - if(($type = $wizardStep->getStepType()) === TWizardStepType::Auto) |
|
1021 | + if(($type=$wizardStep->getStepType())===TWizardStepType::Auto) |
|
1022 | 1022 | { |
1023 | - $steps = $this->getWizardSteps(); |
|
1024 | - if(($index = $steps->indexOf($wizardStep)) >= 0) |
|
1023 | + $steps=$this->getWizardSteps(); |
|
1024 | + if(($index=$steps->indexOf($wizardStep)) >= 0) |
|
1025 | 1025 | { |
1026 | - $stepCount = $steps->getCount(); |
|
1027 | - if($stepCount === 1 || ($index < $stepCount - 1 && $steps->itemAt($index + 1)->getStepType() === TWizardStepType::Complete)) |
|
1026 | + $stepCount=$steps->getCount(); |
|
1027 | + if($stepCount===1 || ($index < $stepCount - 1 && $steps->itemAt($index + 1)->getStepType()===TWizardStepType::Complete)) |
|
1028 | 1028 | return TWizardStepType::Finish; |
1029 | - elseif($index === 0) |
|
1029 | + elseif($index===0) |
|
1030 | 1030 | return TWizardStepType::Start; |
1031 | - elseif($index === $stepCount - 1) |
|
1031 | + elseif($index===$stepCount - 1) |
|
1032 | 1032 | return TWizardStepType::Finish; |
1033 | 1033 | else |
1034 | 1034 | return TWizardStepType::Step; |
@@ -1046,14 +1046,14 @@ discard block |
||
1046 | 1046 | protected function reset() |
1047 | 1047 | { |
1048 | 1048 | $this->getControls()->clear(); |
1049 | - $this->_header = null; |
|
1050 | - $this->_stepContent = null; |
|
1051 | - $this->_sideBar = null; |
|
1052 | - $this->_sideBarDataList = null; |
|
1053 | - $this->_navigation = null; |
|
1054 | - $this->_startNavigation = null; |
|
1055 | - $this->_stepNavigation = null; |
|
1056 | - $this->_finishNavigation = null; |
|
1049 | + $this->_header=null; |
|
1050 | + $this->_stepContent=null; |
|
1051 | + $this->_sideBar=null; |
|
1052 | + $this->_sideBarDataList=null; |
|
1053 | + $this->_navigation=null; |
|
1054 | + $this->_startNavigation=null; |
|
1055 | + $this->_stepNavigation=null; |
|
1056 | + $this->_finishNavigation=null; |
|
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | /** |
@@ -1074,8 +1074,8 @@ discard block |
||
1074 | 1074 | */ |
1075 | 1075 | protected function createHeader() |
1076 | 1076 | { |
1077 | - $this->_header = new TPanel; |
|
1078 | - if(($template = $this->getHeaderTemplate()) !== null) |
|
1077 | + $this->_header=new TPanel; |
|
1078 | + if(($template=$this->getHeaderTemplate())!==null) |
|
1079 | 1079 | $template->instantiateIn($this->_header); |
1080 | 1080 | else |
1081 | 1081 | $this->_header->getControls()->add($this->getHeaderText()); |
@@ -1089,16 +1089,16 @@ discard block |
||
1089 | 1089 | { |
1090 | 1090 | if($this->getShowSideBar()) |
1091 | 1091 | { |
1092 | - if(($template = $this->getSideBarTemplate()) === null) |
|
1093 | - $template = new TWizardSideBarTemplate; |
|
1094 | - $this->_sideBar = new TPanel; |
|
1092 | + if(($template=$this->getSideBarTemplate())===null) |
|
1093 | + $template=new TWizardSideBarTemplate; |
|
1094 | + $this->_sideBar=new TPanel; |
|
1095 | 1095 | $template->instantiateIn($this->_sideBar); |
1096 | 1096 | $this->getControls()->add($this->_sideBar); |
1097 | 1097 | |
1098 | - if(($this->_sideBarDataList = $this->_sideBar->findControl(self::ID_SIDEBAR_LIST)) !== null) |
|
1098 | + if(($this->_sideBarDataList=$this->_sideBar->findControl(self::ID_SIDEBAR_LIST))!==null) |
|
1099 | 1099 | { |
1100 | - $this->_sideBarDataList->attachEventHandler('OnItemCommand', [$this,'dataListItemCommand']); |
|
1101 | - $this->_sideBarDataList->attachEventHandler('OnItemDataBound', [$this,'dataListItemDataBound']); |
|
1100 | + $this->_sideBarDataList->attachEventHandler('OnItemCommand', [$this, 'dataListItemCommand']); |
|
1101 | + $this->_sideBarDataList->attachEventHandler('OnItemDataBound', [$this, 'dataListItemDataBound']); |
|
1102 | 1102 | $this->_sideBarDataList->setDataSource($this->getWizardSteps()); |
1103 | 1103 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
1104 | 1104 | $this->_sideBarDataList->dataBind(); |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | } |
1107 | 1107 | else |
1108 | 1108 | { |
1109 | - $this->_sideBar = new TPanel; |
|
1109 | + $this->_sideBar=new TPanel; |
|
1110 | 1110 | $this->getControls()->add($this->_sideBar); |
1111 | 1111 | } |
1112 | 1112 | } |
@@ -1120,23 +1120,23 @@ discard block |
||
1120 | 1120 | */ |
1121 | 1121 | public function dataListItemCommand($sender, $param) |
1122 | 1122 | { |
1123 | - $item = $param->getItem(); |
|
1124 | - if($param->getCommandName() === self::CMD_MOVETO) |
|
1123 | + $item=$param->getItem(); |
|
1124 | + if($param->getCommandName()===self::CMD_MOVETO) |
|
1125 | 1125 | { |
1126 | - $stepIndex = $this->getActiveStepIndex(); |
|
1127 | - $newStepIndex = TPropertyValue::ensureInteger($param->getCommandParameter()); |
|
1128 | - $navParam = new TWizardNavigationEventParameter($stepIndex); |
|
1126 | + $stepIndex=$this->getActiveStepIndex(); |
|
1127 | + $newStepIndex=TPropertyValue::ensureInteger($param->getCommandParameter()); |
|
1128 | + $navParam=new TWizardNavigationEventParameter($stepIndex); |
|
1129 | 1129 | $navParam->setNextStepIndex($newStepIndex); |
1130 | 1130 | |
1131 | 1131 | // if the button clicked causes validation which fails, |
1132 | 1132 | // by default we will cancel navigation to the new step |
1133 | - $button = $param->getCommandSource(); |
|
1134 | - if(($button instanceof \Prado\Web\UI\IButtonControl) && $button->getCausesValidation() && ($page = $this->getPage()) !== null && !$page->getIsValid()) |
|
1133 | + $button=$param->getCommandSource(); |
|
1134 | + if(($button instanceof \Prado\Web\UI\IButtonControl) && $button->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid()) |
|
1135 | 1135 | $navParam->setCancelNavigation(true); |
1136 | 1136 | |
1137 | - $this->_activeStepIndexSet = false; |
|
1137 | + $this->_activeStepIndexSet=false; |
|
1138 | 1138 | $this->onSideBarButtonClick($navParam); |
1139 | - $this->_cancelNavigation = $navParam->getCancelNavigation(); |
|
1139 | + $this->_cancelNavigation=$navParam->getCancelNavigation(); |
|
1140 | 1140 | if(!$this->_cancelNavigation) |
1141 | 1141 | { |
1142 | 1142 | if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex)) |
@@ -1156,20 +1156,20 @@ discard block |
||
1156 | 1156 | */ |
1157 | 1157 | public function dataListItemDataBound($sender, $param) |
1158 | 1158 | { |
1159 | - $item = $param->getItem(); |
|
1160 | - $itemType = $item->getItemType(); |
|
1161 | - if($itemType === 'Item' || $itemType === 'AlternatingItem' || $itemType === 'SelectedItem' || $itemType === 'EditItem') |
|
1159 | + $item=$param->getItem(); |
|
1160 | + $itemType=$item->getItemType(); |
|
1161 | + if($itemType==='Item' || $itemType==='AlternatingItem' || $itemType==='SelectedItem' || $itemType==='EditItem') |
|
1162 | 1162 | { |
1163 | - if(($button = $item->findControl(self::ID_SIDEBAR_BUTTON)) !== null) |
|
1163 | + if(($button=$item->findControl(self::ID_SIDEBAR_BUTTON))!==null) |
|
1164 | 1164 | { |
1165 | - $step = $item->getData(); |
|
1166 | - if(($this->getStepType($step) === TWizardStepType::Complete)) |
|
1165 | + $step=$item->getData(); |
|
1166 | + if(($this->getStepType($step)===TWizardStepType::Complete)) |
|
1167 | 1167 | $button->setEnabled(false); |
1168 | - if(($title = $step->getTitle()) !== '') |
|
1168 | + if(($title=$step->getTitle())!=='') |
|
1169 | 1169 | $button->setText($title); |
1170 | 1170 | else |
1171 | 1171 | $button->setText($step->getID(false)); |
1172 | - $index = $this->getWizardSteps()->indexOf($step); |
|
1172 | + $index=$this->getWizardSteps()->indexOf($step); |
|
1173 | 1173 | $button->setCommandName(self::CMD_MOVETO); |
1174 | 1174 | $button->setCommandParameter("$index"); |
1175 | 1175 | } |
@@ -1186,8 +1186,8 @@ discard block |
||
1186 | 1186 | if($step instanceof TTemplatedWizardStep) |
1187 | 1187 | $step->ensureChildControls(); |
1188 | 1188 | } |
1189 | - $multiView = $this->getMultiView(); |
|
1190 | - $this->_stepContent = new TPanel; |
|
1189 | + $multiView=$this->getMultiView(); |
|
1190 | + $this->_stepContent=new TPanel; |
|
1191 | 1191 | $this->_stepContent->getControls()->add($multiView); |
1192 | 1192 | $this->getControls()->add($this->_stepContent); |
1193 | 1193 | if($multiView->getViews()->getCount()) |
@@ -1199,23 +1199,23 @@ discard block |
||
1199 | 1199 | */ |
1200 | 1200 | protected function createNavigation() |
1201 | 1201 | { |
1202 | - $this->_navigation = new TPanel; |
|
1202 | + $this->_navigation=new TPanel; |
|
1203 | 1203 | $this->getControls()->add($this->_navigation); |
1204 | - $controls = $this->_navigation->getControls(); |
|
1204 | + $controls=$this->_navigation->getControls(); |
|
1205 | 1205 | foreach($this->getWizardSteps() as $step) |
1206 | 1206 | { |
1207 | 1207 | if($step instanceof TTemplatedWizardStep) |
1208 | 1208 | { |
1209 | 1209 | $step->instantiateNavigationTemplate(); |
1210 | - if(($panel = $step->getNavigationContainer()) !== null) |
|
1210 | + if(($panel=$step->getNavigationContainer())!==null) |
|
1211 | 1211 | $controls->add($panel); |
1212 | 1212 | } |
1213 | 1213 | } |
1214 | - $this->_startNavigation = $this->createStartNavigation(); |
|
1214 | + $this->_startNavigation=$this->createStartNavigation(); |
|
1215 | 1215 | $controls->add($this->_startNavigation); |
1216 | - $this->_stepNavigation = $this->createStepNavigation(); |
|
1216 | + $this->_stepNavigation=$this->createStepNavigation(); |
|
1217 | 1217 | $controls->add($this->_stepNavigation); |
1218 | - $this->_finishNavigation = $this->createFinishNavigation(); |
|
1218 | + $this->_finishNavigation=$this->createFinishNavigation(); |
|
1219 | 1219 | $controls->add($this->_finishNavigation); |
1220 | 1220 | } |
1221 | 1221 | |
@@ -1224,9 +1224,9 @@ discard block |
||
1224 | 1224 | */ |
1225 | 1225 | protected function createStartNavigation() |
1226 | 1226 | { |
1227 | - if(($template = $this->getStartNavigationTemplate()) === null) |
|
1228 | - $template = new TWizardStartNavigationTemplate($this); |
|
1229 | - $navigation = new TWizardNavigationContainer; |
|
1227 | + if(($template=$this->getStartNavigationTemplate())===null) |
|
1228 | + $template=new TWizardStartNavigationTemplate($this); |
|
1229 | + $navigation=new TWizardNavigationContainer; |
|
1230 | 1230 | $template->instantiateIn($navigation); |
1231 | 1231 | return $navigation; |
1232 | 1232 | } |
@@ -1236,9 +1236,9 @@ discard block |
||
1236 | 1236 | */ |
1237 | 1237 | protected function createStepNavigation() |
1238 | 1238 | { |
1239 | - if(($template = $this->getStepNavigationTemplate()) === null) |
|
1240 | - $template = new TWizardStepNavigationTemplate($this); |
|
1241 | - $navigation = new TWizardNavigationContainer; |
|
1239 | + if(($template=$this->getStepNavigationTemplate())===null) |
|
1240 | + $template=new TWizardStepNavigationTemplate($this); |
|
1241 | + $navigation=new TWizardNavigationContainer; |
|
1242 | 1242 | $template->instantiateIn($navigation); |
1243 | 1243 | return $navigation; |
1244 | 1244 | } |
@@ -1248,9 +1248,9 @@ discard block |
||
1248 | 1248 | */ |
1249 | 1249 | protected function createFinishNavigation() |
1250 | 1250 | { |
1251 | - if(($template = $this->getFinishNavigationTemplate()) === null) |
|
1252 | - $template = new TWizardFinishNavigationTemplate($this); |
|
1253 | - $navigation = new TWizardNavigationContainer; |
|
1251 | + if(($template=$this->getFinishNavigationTemplate())===null) |
|
1252 | + $template=new TWizardFinishNavigationTemplate($this); |
|
1253 | + $navigation=new TWizardNavigationContainer; |
|
1254 | 1254 | $template->instantiateIn($navigation); |
1255 | 1255 | return $navigation; |
1256 | 1256 | } |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | */ |
1262 | 1262 | public function wizardStepsChanged() |
1263 | 1263 | { |
1264 | - if($this->_sideBarDataList !== null) |
|
1264 | + if($this->_sideBarDataList!==null) |
|
1265 | 1265 | { |
1266 | 1266 | $this->_sideBarDataList->setDataSource($this->getWizardSteps()); |
1267 | 1267 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
@@ -1276,28 +1276,28 @@ discard block |
||
1276 | 1276 | */ |
1277 | 1277 | protected function getPreviousStepIndex($popStack) |
1278 | 1278 | { |
1279 | - $history = $this->getHistory(); |
|
1279 | + $history=$this->getHistory(); |
|
1280 | 1280 | if($history->getCount() >= 0) |
1281 | 1281 | { |
1282 | - $activeStepIndex = $this->getActiveStepIndex(); |
|
1283 | - $previousStepIndex = -1; |
|
1282 | + $activeStepIndex=$this->getActiveStepIndex(); |
|
1283 | + $previousStepIndex=-1; |
|
1284 | 1284 | if($popStack) |
1285 | 1285 | { |
1286 | - $previousStepIndex = $history->pop(); |
|
1287 | - if($activeStepIndex === $previousStepIndex && $history->getCount() > 0) |
|
1288 | - $previousStepIndex = $history->pop(); |
|
1286 | + $previousStepIndex=$history->pop(); |
|
1287 | + if($activeStepIndex===$previousStepIndex && $history->getCount() > 0) |
|
1288 | + $previousStepIndex=$history->pop(); |
|
1289 | 1289 | } |
1290 | 1290 | else |
1291 | 1291 | { |
1292 | - $previousStepIndex = $history->peek(); |
|
1293 | - if($activeStepIndex === $previousStepIndex && $history->getCount() > 1) |
|
1292 | + $previousStepIndex=$history->peek(); |
|
1293 | + if($activeStepIndex===$previousStepIndex && $history->getCount() > 1) |
|
1294 | 1294 | { |
1295 | - $saveIndex = $history->pop(); |
|
1296 | - $previousStepIndex = $history->peek(); |
|
1295 | + $saveIndex=$history->pop(); |
|
1296 | + $previousStepIndex=$history->peek(); |
|
1297 | 1297 | $history->push($saveIndex); |
1298 | 1298 | } |
1299 | 1299 | } |
1300 | - return $activeStepIndex === $previousStepIndex ? -1 : $previousStepIndex; |
|
1300 | + return $activeStepIndex===$previousStepIndex ? -1 : $previousStepIndex; |
|
1301 | 1301 | } |
1302 | 1302 | else |
1303 | 1303 | return -1; |
@@ -1308,7 +1308,7 @@ discard block |
||
1308 | 1308 | */ |
1309 | 1309 | protected function allowNavigationToPreviousStep() |
1310 | 1310 | { |
1311 | - if(($index = $this->getPreviousStepIndex(false)) !== -1) |
|
1311 | + if(($index=$this->getPreviousStepIndex(false))!==-1) |
|
1312 | 1312 | return $this->getWizardSteps()->itemAt($index)->getAllowReturn(); |
1313 | 1313 | else |
1314 | 1314 | return false; |
@@ -1338,83 +1338,83 @@ discard block |
||
1338 | 1338 | { |
1339 | 1339 | if($param instanceof \Prado\Web\UI\TCommandEventParameter) |
1340 | 1340 | { |
1341 | - $command = $param->getCommandName(); |
|
1342 | - if(strcasecmp($command, self::CMD_CANCEL) === 0) |
|
1341 | + $command=$param->getCommandName(); |
|
1342 | + if(strcasecmp($command, self::CMD_CANCEL)===0) |
|
1343 | 1343 | { |
1344 | 1344 | $this->onCancelButtonClick($param); |
1345 | 1345 | return true; |
1346 | 1346 | } |
1347 | 1347 | |
1348 | - $type = $this->getStepType($this->getActiveStep()); |
|
1349 | - $index = $this->getActiveStepIndex(); |
|
1350 | - $navParam = new TWizardNavigationEventParameter($index); |
|
1351 | - if(($sender instanceof \Prado\Web\UI\IButtonControl) && $sender->getCausesValidation() && ($page = $this->getPage()) !== null && !$page->getIsValid()) |
|
1348 | + $type=$this->getStepType($this->getActiveStep()); |
|
1349 | + $index=$this->getActiveStepIndex(); |
|
1350 | + $navParam=new TWizardNavigationEventParameter($index); |
|
1351 | + if(($sender instanceof \Prado\Web\UI\IButtonControl) && $sender->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid()) |
|
1352 | 1352 | $navParam->setCancelNavigation(true); |
1353 | 1353 | |
1354 | - $handled = false; |
|
1355 | - $movePrev = false; |
|
1356 | - $this->_activeStepIndexSet = false; |
|
1354 | + $handled=false; |
|
1355 | + $movePrev=false; |
|
1356 | + $this->_activeStepIndexSet=false; |
|
1357 | 1357 | |
1358 | - if(strcasecmp($command, self::CMD_NEXT) === 0) |
|
1358 | + if(strcasecmp($command, self::CMD_NEXT)===0) |
|
1359 | 1359 | { |
1360 | - if($type !== TWizardStepType::Start && $type !== TWizardStepType::Step) |
|
1360 | + if($type!==TWizardStepType::Start && $type!==TWizardStepType::Step) |
|
1361 | 1361 | throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_NEXT); |
1362 | 1362 | if($index < $this->getWizardSteps()->getCount() - 1) |
1363 | 1363 | $navParam->setNextStepIndex($index + 1); |
1364 | 1364 | $this->onNextButtonClick($navParam); |
1365 | - $handled = true; |
|
1365 | + $handled=true; |
|
1366 | 1366 | } |
1367 | - elseif(strcasecmp($command, self::CMD_PREVIOUS) === 0) |
|
1367 | + elseif(strcasecmp($command, self::CMD_PREVIOUS)===0) |
|
1368 | 1368 | { |
1369 | - if($type !== TWizardStepType::Finish && $type !== TWizardStepType::Step) |
|
1369 | + if($type!==TWizardStepType::Finish && $type!==TWizardStepType::Step) |
|
1370 | 1370 | throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_PREVIOUS); |
1371 | - $movePrev = true; |
|
1372 | - if(($prevIndex = $this->getPreviousStepIndex(false)) >= 0) |
|
1371 | + $movePrev=true; |
|
1372 | + if(($prevIndex=$this->getPreviousStepIndex(false)) >= 0) |
|
1373 | 1373 | $navParam->setNextStepIndex($prevIndex); |
1374 | 1374 | $this->onPreviousButtonClick($navParam); |
1375 | - $handled = true; |
|
1375 | + $handled=true; |
|
1376 | 1376 | } |
1377 | - elseif(strcasecmp($command, self::CMD_COMPLETE) === 0) |
|
1377 | + elseif(strcasecmp($command, self::CMD_COMPLETE)===0) |
|
1378 | 1378 | { |
1379 | - if($type !== TWizardStepType::Finish) |
|
1379 | + if($type!==TWizardStepType::Finish) |
|
1380 | 1380 | throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_COMPLETE); |
1381 | 1381 | if($index < $this->getWizardSteps()->getCount() - 1) |
1382 | 1382 | $navParam->setNextStepIndex($index + 1); |
1383 | 1383 | $this->onCompleteButtonClick($navParam); |
1384 | - $handled = true; |
|
1384 | + $handled=true; |
|
1385 | 1385 | } |
1386 | - elseif(strcasecmp($command, self::CMD_MOVETO) === 0) |
|
1386 | + elseif(strcasecmp($command, self::CMD_MOVETO)===0) |
|
1387 | 1387 | { |
1388 | 1388 | if($this->_cancelNavigation) // may be set in onSideBarButtonClick |
1389 | 1389 | $navParam->setCancelNavigation(true); |
1390 | - $requestedStep = $param->getCommandParameter(); |
|
1391 | - if (!is_numeric($requestedStep)) |
|
1390 | + $requestedStep=$param->getCommandParameter(); |
|
1391 | + if(!is_numeric($requestedStep)) |
|
1392 | 1392 | { |
1393 | - $requestedIndex = -1; |
|
1394 | - foreach ($this->getWizardSteps() as $index => $step) |
|
1395 | - if ($step->getId() === $requestedStep) |
|
1393 | + $requestedIndex=-1; |
|
1394 | + foreach($this->getWizardSteps() as $index => $step) |
|
1395 | + if($step->getId()===$requestedStep) |
|
1396 | 1396 | { |
1397 | - $requestedIndex = $index; |
|
1397 | + $requestedIndex=$index; |
|
1398 | 1398 | break; |
1399 | 1399 | } |
1400 | - if ($requestedIndex < 0) |
|
1400 | + if($requestedIndex < 0) |
|
1401 | 1401 | throw new TConfigurationException('wizard_step_invalid'); |
1402 | 1402 | } |
1403 | 1403 | else |
1404 | - $requestedIndex = TPropertyValue::ensureInteger($requestedStep); |
|
1404 | + $requestedIndex=TPropertyValue::ensureInteger($requestedStep); |
|
1405 | 1405 | $navParam->setNextStepIndex($requestedIndex); |
1406 | - $handled = true; |
|
1406 | + $handled=true; |
|
1407 | 1407 | } |
1408 | 1408 | |
1409 | 1409 | if($handled) |
1410 | 1410 | { |
1411 | 1411 | if(!$navParam->getCancelNavigation()) |
1412 | 1412 | { |
1413 | - $nextStepIndex = $navParam->getNextStepIndex(); |
|
1413 | + $nextStepIndex=$navParam->getNextStepIndex(); |
|
1414 | 1414 | if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($nextStepIndex)) |
1415 | 1415 | { |
1416 | 1416 | if($movePrev) |
1417 | - $this->getPreviousStepIndex(true); // pop out the previous move from history |
|
1417 | + $this->getPreviousStepIndex(true); // pop out the previous move from history |
|
1418 | 1418 | $this->setActiveStepIndex($nextStepIndex); |
1419 | 1419 | } |
1420 | 1420 | } |
@@ -807,8 +807,7 @@ discard block |
||
807 | 807 | $this->_navigation->renderControl($writer); |
808 | 808 | $writer->write("\n</td></tr></table>\n"); |
809 | 809 | $this->renderEndTag($writer); |
810 | - } |
|
811 | - else |
|
810 | + } else |
|
812 | 811 | { |
813 | 812 | $this->applyControlProperties(); |
814 | 813 | $this->renderBeginTag($writer); |
@@ -906,8 +905,7 @@ discard block |
||
906 | 905 | { |
907 | 906 | $container->setVisible(true); |
908 | 907 | $showStandard = false; |
909 | - } |
|
910 | - else |
|
908 | + } else |
|
911 | 909 | $container->setVisible(false); |
912 | 910 | } |
913 | 911 | } |
@@ -1032,11 +1030,9 @@ discard block |
||
1032 | 1030 | return TWizardStepType::Finish; |
1033 | 1031 | else |
1034 | 1032 | return TWizardStepType::Step; |
1035 | - } |
|
1036 | - else |
|
1033 | + } else |
|
1037 | 1034 | return $type; |
1038 | - } |
|
1039 | - else |
|
1035 | + } else |
|
1040 | 1036 | return $type; |
1041 | 1037 | } |
1042 | 1038 | |
@@ -1103,8 +1099,7 @@ discard block |
||
1103 | 1099 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
1104 | 1100 | $this->_sideBarDataList->dataBind(); |
1105 | 1101 | } |
1106 | - } |
|
1107 | - else |
|
1102 | + } else |
|
1108 | 1103 | { |
1109 | 1104 | $this->_sideBar = new TPanel; |
1110 | 1105 | $this->getControls()->add($this->_sideBar); |
@@ -1141,8 +1136,7 @@ discard block |
||
1141 | 1136 | { |
1142 | 1137 | if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex)) |
1143 | 1138 | $this->setActiveStepIndex($newStepIndex); |
1144 | - } |
|
1145 | - else |
|
1139 | + } else |
|
1146 | 1140 | $this->setActiveStepIndex($stepIndex); |
1147 | 1141 | } |
1148 | 1142 | } |
@@ -1286,8 +1280,7 @@ discard block |
||
1286 | 1280 | $previousStepIndex = $history->pop(); |
1287 | 1281 | if($activeStepIndex === $previousStepIndex && $history->getCount() > 0) |
1288 | 1282 | $previousStepIndex = $history->pop(); |
1289 | - } |
|
1290 | - else |
|
1283 | + } else |
|
1291 | 1284 | { |
1292 | 1285 | $previousStepIndex = $history->peek(); |
1293 | 1286 | if($activeStepIndex === $previousStepIndex && $history->getCount() > 1) |
@@ -1298,8 +1291,7 @@ discard block |
||
1298 | 1291 | } |
1299 | 1292 | } |
1300 | 1293 | return $activeStepIndex === $previousStepIndex ? -1 : $previousStepIndex; |
1301 | - } |
|
1302 | - else |
|
1294 | + } else |
|
1303 | 1295 | return -1; |
1304 | 1296 | } |
1305 | 1297 | |
@@ -1363,8 +1355,7 @@ discard block |
||
1363 | 1355 | $navParam->setNextStepIndex($index + 1); |
1364 | 1356 | $this->onNextButtonClick($navParam); |
1365 | 1357 | $handled = true; |
1366 | - } |
|
1367 | - elseif(strcasecmp($command, self::CMD_PREVIOUS) === 0) |
|
1358 | + } elseif(strcasecmp($command, self::CMD_PREVIOUS) === 0) |
|
1368 | 1359 | { |
1369 | 1360 | if($type !== TWizardStepType::Finish && $type !== TWizardStepType::Step) |
1370 | 1361 | throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_PREVIOUS); |
@@ -1373,8 +1364,7 @@ discard block |
||
1373 | 1364 | $navParam->setNextStepIndex($prevIndex); |
1374 | 1365 | $this->onPreviousButtonClick($navParam); |
1375 | 1366 | $handled = true; |
1376 | - } |
|
1377 | - elseif(strcasecmp($command, self::CMD_COMPLETE) === 0) |
|
1367 | + } elseif(strcasecmp($command, self::CMD_COMPLETE) === 0) |
|
1378 | 1368 | { |
1379 | 1369 | if($type !== TWizardStepType::Finish) |
1380 | 1370 | throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_COMPLETE); |
@@ -1382,8 +1372,7 @@ discard block |
||
1382 | 1372 | $navParam->setNextStepIndex($index + 1); |
1383 | 1373 | $this->onCompleteButtonClick($navParam); |
1384 | 1374 | $handled = true; |
1385 | - } |
|
1386 | - elseif(strcasecmp($command, self::CMD_MOVETO) === 0) |
|
1375 | + } elseif(strcasecmp($command, self::CMD_MOVETO) === 0) |
|
1387 | 1376 | { |
1388 | 1377 | if($this->_cancelNavigation) // may be set in onSideBarButtonClick |
1389 | 1378 | $navParam->setCancelNavigation(true); |
@@ -1399,8 +1388,7 @@ discard block |
||
1399 | 1388 | } |
1400 | 1389 | if ($requestedIndex < 0) |
1401 | 1390 | throw new TConfigurationException('wizard_step_invalid'); |
1402 | - } |
|
1403 | - else |
|
1391 | + } else |
|
1404 | 1392 | $requestedIndex = TPropertyValue::ensureInteger($requestedStep); |
1405 | 1393 | $navParam->setNextStepIndex($requestedIndex); |
1406 | 1394 | $handled = true; |
@@ -1417,8 +1405,7 @@ discard block |
||
1417 | 1405 | $this->getPreviousStepIndex(true); // pop out the previous move from history |
1418 | 1406 | $this->setActiveStepIndex($nextStepIndex); |
1419 | 1407 | } |
1420 | - } |
|
1421 | - else |
|
1408 | + } else |
|
1422 | 1409 | $this->setActiveStepIndex($index); |
1423 | 1410 | return true; |
1424 | 1411 | } |
@@ -39,6 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Constructor. |
41 | 41 | * @param integer current step index |
42 | + * @param integer $currentStep |
|
42 | 43 | */ |
43 | 44 | public function __construct($currentStep) |
44 | 45 | { |
@@ -80,6 +81,7 @@ discard block |
||
80 | 81 | |
81 | 82 | /** |
82 | 83 | * @param boolean whether navigation to the next step should be canceled. |
84 | + * @param boolean $value |
|
83 | 85 | */ |
84 | 86 | public function setCancelNavigation($value) |
85 | 87 | { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | class TWizardNavigationEventParameter extends \Prado\TEventParameter |
35 | 35 | { |
36 | - private $_cancel = false; |
|
36 | + private $_cancel=false; |
|
37 | 37 | private $_currentStep; |
38 | 38 | private $_nextStep; |
39 | 39 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct($currentStep) |
45 | 45 | { |
46 | - $this->_currentStep = $currentStep; |
|
47 | - $this->_nextStep = $currentStep; |
|
46 | + $this->_currentStep=$currentStep; |
|
47 | + $this->_nextStep=$currentStep; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function setNextStepIndex($index) |
70 | 70 | { |
71 | - $this->_nextStep = TPropertyValue::ensureInteger($index); |
|
71 | + $this->_nextStep=TPropertyValue::ensureInteger($index); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -84,6 +84,6 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setCancelNavigation($value) |
86 | 86 | { |
87 | - $this->_cancel = TPropertyValue::ensureBoolean($value); |
|
87 | + $this->_cancel=TPropertyValue::ensureBoolean($value); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | \ No newline at end of file |
@@ -94,6 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | /** |
96 | 96 | * @param string version of this XML document |
97 | + * @param string $version |
|
97 | 98 | */ |
98 | 99 | public function setVersion($version) |
99 | 100 | { |
@@ -110,6 +111,7 @@ discard block |
||
110 | 111 | |
111 | 112 | /** |
112 | 113 | * @param string encoding of this XML document |
114 | + * @param string $encoding |
|
113 | 115 | */ |
114 | 116 | public function setEncoding($encoding) |
115 | 117 | { |
@@ -233,6 +235,7 @@ discard block |
||
233 | 235 | /** |
234 | 236 | * Recursively converts DOM XML nodes into TXmlElement |
235 | 237 | * @param DOMXmlNode the node to be converted |
238 | + * @param \DOMElement $node |
|
236 | 239 | * @return TXmlElement the converted TXmlElement |
237 | 240 | */ |
238 | 241 | protected function buildElement($node) |
@@ -195,8 +195,7 @@ |
||
195 | 195 | { |
196 | 196 | fwrite($fw, $this->saveToString()); |
197 | 197 | fclose($fw); |
198 | - } |
|
199 | - else |
|
198 | + } else |
|
200 | 199 | throw new TIOException('xmldocument_file_write_failed', $file); |
201 | 200 | } |
202 | 201 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param string version of this XML document |
79 | 79 | * @param string encoding of this XML document |
80 | 80 | */ |
81 | - public function __construct($version = '1.0', $encoding = '') |
|
81 | + public function __construct($version='1.0', $encoding='') |
|
82 | 82 | { |
83 | 83 | parent::__construct(''); |
84 | 84 | $this->setVersion($version); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function setVersion($version) |
100 | 100 | { |
101 | - $this->_version = $version; |
|
101 | + $this->_version=$version; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function setEncoding($encoding) |
116 | 116 | { |
117 | - $this->_encoding = $encoding; |
|
117 | + $this->_encoding=$encoding; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function loadFromFile($file) |
127 | 127 | { |
128 | - if(($str = @file_get_contents($file)) !== false) |
|
128 | + if(($str=@file_get_contents($file))!==false) |
|
129 | 129 | return $this->loadFromString($str); |
130 | 130 | else |
131 | 131 | throw new TIOException('xmldocument_file_read_failed', $file); |
@@ -140,41 +140,41 @@ discard block |
||
140 | 140 | public function loadFromString($string) |
141 | 141 | { |
142 | 142 | // TODO: since PHP 5.1, we can get parsing errors and throw them as exception |
143 | - $doc = new \DOMDocument(); |
|
144 | - if($doc->loadXML($string) === false) |
|
143 | + $doc=new \DOMDocument(); |
|
144 | + if($doc->loadXML($string)===false) |
|
145 | 145 | return false; |
146 | 146 | |
147 | 147 | $this->setEncoding($doc->encoding); |
148 | 148 | $this->setVersion($doc->xmlVersion); |
149 | 149 | |
150 | - $element = $doc->documentElement; |
|
150 | + $element=$doc->documentElement; |
|
151 | 151 | $this->setTagName($element->tagName); |
152 | 152 | $this->setValue($element->nodeValue); |
153 | - $elements = $this->getElements(); |
|
154 | - $attributes = $this->getAttributes(); |
|
153 | + $elements=$this->getElements(); |
|
154 | + $attributes=$this->getAttributes(); |
|
155 | 155 | $elements->clear(); |
156 | 156 | $attributes->clear(); |
157 | 157 | |
158 | 158 | static $bSimpleXml; |
159 | - if($bSimpleXml === null) |
|
160 | - $bSimpleXml = (boolean)function_exists('simplexml_load_string'); |
|
159 | + if($bSimpleXml===null) |
|
160 | + $bSimpleXml=(boolean) function_exists('simplexml_load_string'); |
|
161 | 161 | |
162 | 162 | if($bSimpleXml) |
163 | 163 | { |
164 | - $simpleDoc = simplexml_load_string($string); |
|
165 | - $docNamespaces = $simpleDoc->getDocNamespaces(false); |
|
166 | - $simpleDoc = null; |
|
164 | + $simpleDoc=simplexml_load_string($string); |
|
165 | + $docNamespaces=$simpleDoc->getDocNamespaces(false); |
|
166 | + $simpleDoc=null; |
|
167 | 167 | foreach($docNamespaces as $prefix => $uri) |
168 | 168 | { |
169 | - if($prefix === '') |
|
169 | + if($prefix==='') |
|
170 | 170 | $attributes->add('xmlns', $uri); |
171 | 171 | else |
172 | - $attributes->add('xmlns:' . $prefix, $uri); |
|
172 | + $attributes->add('xmlns:'.$prefix, $uri); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | 176 | foreach($element->attributes as $name => $attr) |
177 | - $attributes->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name, $attr->value); |
|
177 | + $attributes->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value); |
|
178 | 178 | foreach($element->childNodes as $child) |
179 | 179 | { |
180 | 180 | if($child instanceof \DOMElement) |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function saveToFile($file) |
193 | 193 | { |
194 | - if(($fw = fopen($file, 'w')) !== false) |
|
194 | + if(($fw=fopen($file, 'w'))!==false) |
|
195 | 195 | { |
196 | 196 | fwrite($fw, $this->saveToString()); |
197 | 197 | fclose($fw); |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function saveToString() |
208 | 208 | { |
209 | - $version = empty($this->_version)?' version="1.0"':' version="' . $this->_version . '"'; |
|
210 | - $encoding = empty($this->_encoding)?'':' encoding="' . $this->_encoding . '"'; |
|
211 | - return "<?xml{$version}{$encoding}?>\n" . $this->toString(0); |
|
209 | + $version=empty($this->_version) ? ' version="1.0"' : ' version="'.$this->_version.'"'; |
|
210 | + $encoding=empty($this->_encoding) ? '' : ' encoding="'.$this->_encoding.'"'; |
|
211 | + return "<?xml{$version}{$encoding}?>\n".$this->toString(0); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | */ |
239 | 239 | protected function buildElement($node) |
240 | 240 | { |
241 | - $element = new TXmlElement($node->tagName); |
|
241 | + $element=new TXmlElement($node->tagName); |
|
242 | 242 | $element->setValue($node->nodeValue); |
243 | 243 | foreach($node->attributes as $name => $attr) |
244 | - $element->getAttributes()->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name, $attr->value); |
|
244 | + $element->getAttributes()->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value); |
|
245 | 245 | |
246 | 246 | foreach($node->childNodes as $child) |
247 | 247 | { |
@@ -71,6 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | /** |
73 | 73 | * @param TXmlElement parent element of this element |
74 | + * @param TXmlElement|null $parent |
|
74 | 75 | */ |
75 | 76 | public function setParent($parent) |
76 | 77 | { |
@@ -180,6 +181,7 @@ discard block |
||
180 | 181 | } |
181 | 182 | |
182 | 183 | /** |
184 | + * @param string $tagName |
|
183 | 185 | * @return TList list of all child elements that have the specified tag-name |
184 | 186 | */ |
185 | 187 | public function getElementsByTagName($tagName) |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @var string tag-name of this element |
41 | 41 | */ |
42 | - private $_tagName = 'unknown'; |
|
42 | + private $_tagName='unknown'; |
|
43 | 43 | /** |
44 | 44 | * @var string text enclosed between opening and closing tags of this element |
45 | 45 | */ |
46 | - private $_value = ''; |
|
46 | + private $_value=''; |
|
47 | 47 | /** |
48 | 48 | * @var TXmlElementList list of child elements of this element |
49 | 49 | */ |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function setParent($parent) |
77 | 77 | { |
78 | - $this->_parent = $parent; |
|
78 | + $this->_parent=$parent; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setTagName($tagName) |
93 | 93 | { |
94 | - $this->_tagName = $tagName; |
|
94 | + $this->_tagName=$tagName; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function setValue($value) |
109 | 109 | { |
110 | - $this->_value = TPropertyValue::ensureString($value); |
|
110 | + $this->_value=TPropertyValue::ensureString($value); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function getHasElement() |
117 | 117 | { |
118 | - return $this->_elements !== null && $this->_elements->getCount() > 0; |
|
118 | + return $this->_elements!==null && $this->_elements->getCount() > 0; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getHasAttribute() |
125 | 125 | { |
126 | - return $this->_attributes !== null && $this->_attributes->getCount() > 0; |
|
126 | + return $this->_attributes!==null && $this->_attributes->getCount() > 0; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getAttribute($name) |
133 | 133 | { |
134 | - if($this->_attributes !== null) |
|
134 | + if($this->_attributes!==null) |
|
135 | 135 | return $this->_attributes->itemAt($name); |
136 | 136 | else |
137 | 137 | return null; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public function getElements() |
153 | 153 | { |
154 | 154 | if(!$this->_elements) |
155 | - $this->_elements = new TXmlElementList($this); |
|
155 | + $this->_elements=new TXmlElementList($this); |
|
156 | 156 | return $this->_elements; |
157 | 157 | } |
158 | 158 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function getAttributes() |
163 | 163 | { |
164 | 164 | if(!$this->_attributes) |
165 | - $this->_attributes = new TMap; |
|
165 | + $this->_attributes=new TMap; |
|
166 | 166 | return $this->_attributes; |
167 | 167 | } |
168 | 168 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if($this->_elements) |
175 | 175 | { |
176 | 176 | foreach($this->_elements as $element) |
177 | - if($element->_tagName === $tagName) |
|
177 | + if($element->_tagName===$tagName) |
|
178 | 178 | return $element; |
179 | 179 | } |
180 | 180 | return null; |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function getElementsByTagName($tagName) |
187 | 187 | { |
188 | - $list = new TList; |
|
188 | + $list=new TList; |
|
189 | 189 | if($this->_elements) |
190 | 190 | { |
191 | 191 | foreach($this->_elements as $element) |
192 | - if($element->_tagName === $tagName) |
|
192 | + if($element->_tagName===$tagName) |
|
193 | 193 | $list->add($element); |
194 | 194 | } |
195 | 195 | return $list; |
@@ -198,33 +198,33 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * @return string string representation of this element |
200 | 200 | */ |
201 | - public function toString($indent = 0) |
|
201 | + public function toString($indent=0) |
|
202 | 202 | { |
203 | - $attr = ''; |
|
204 | - if($this->_attributes !== null) |
|
203 | + $attr=''; |
|
204 | + if($this->_attributes!==null) |
|
205 | 205 | { |
206 | 206 | foreach($this->_attributes as $name => $value) |
207 | 207 | { |
208 | - $value = $this->xmlEncode($value); |
|
209 | - $attr .= " $name=\"$value\""; |
|
208 | + $value=$this->xmlEncode($value); |
|
209 | + $attr.=" $name=\"$value\""; |
|
210 | 210 | } |
211 | 211 | } |
212 | - $prefix = str_repeat(' ', $indent * 4); |
|
212 | + $prefix=str_repeat(' ', $indent * 4); |
|
213 | 213 | if($this->getHasElement()) |
214 | 214 | { |
215 | - $str = $prefix . "<{$this->_tagName}$attr>\n"; |
|
215 | + $str=$prefix."<{$this->_tagName}$attr>\n"; |
|
216 | 216 | foreach($this->getElements() as $element) |
217 | - $str .= $element->toString($indent + 1) . "\n"; |
|
218 | - $str .= $prefix . "</{$this->_tagName}>"; |
|
217 | + $str.=$element->toString($indent + 1)."\n"; |
|
218 | + $str.=$prefix."</{$this->_tagName}>"; |
|
219 | 219 | return $str; |
220 | 220 | } |
221 | - elseif(($value = $this->getValue()) !== '') |
|
221 | + elseif(($value=$this->getValue())!=='') |
|
222 | 222 | { |
223 | - $value = $this->xmlEncode($value); |
|
224 | - return $prefix . "<{$this->_tagName}$attr>$value</{$this->_tagName}>"; |
|
223 | + $value=$this->xmlEncode($value); |
|
224 | + return $prefix."<{$this->_tagName}$attr>$value</{$this->_tagName}>"; |
|
225 | 225 | } |
226 | 226 | else |
227 | - return $prefix . "<{$this->_tagName}$attr />"; |
|
227 | + return $prefix."<{$this->_tagName}$attr />"; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -217,13 +217,11 @@ |
||
217 | 217 | $str .= $element->toString($indent + 1) . "\n"; |
218 | 218 | $str .= $prefix . "</{$this->_tagName}>"; |
219 | 219 | return $str; |
220 | - } |
|
221 | - elseif(($value = $this->getValue()) !== '') |
|
220 | + } elseif(($value = $this->getValue()) !== '') |
|
222 | 221 | { |
223 | 222 | $value = $this->xmlEncode($value); |
224 | 223 | return $prefix . "<{$this->_tagName}$attr>$value</{$this->_tagName}>"; |
225 | - } |
|
226 | - else |
|
224 | + } else |
|
227 | 225 | return $prefix . "<{$this->_tagName}$attr />"; |
228 | 226 | } |
229 | 227 |
@@ -29,6 +29,6 @@ |
||
29 | 29 | */ |
30 | 30 | class TActiveRecordInvalidFinderResult extends \Prado\TEnumerable |
31 | 31 | { |
32 | - const Null = 'Null'; |
|
33 | - const Exception = 'Exception'; |
|
32 | + const Null='Null'; |
|
33 | + const Exception='Exception'; |
|
34 | 34 | } |
35 | 35 | \ No newline at end of file |