@@ -24,7 +24,7 @@ class WizardComponent extends Component {
24
24
* @var boolean
25
25
* @access public
26
26
*/
27
- var $ autoAdvance = true ;
27
+ public $ autoAdvance = true ;
28
28
/**
29
29
* Option to automatically reset if the wizard does not follow "normal"
30
30
* operation. (ie. manual url changing, navigation away and returning, etc.)
@@ -34,15 +34,15 @@ class WizardComponent extends Component {
34
34
* @var boolean
35
35
* @access public
36
36
*/
37
- var $ autoReset = false ;
37
+ public $ autoReset = false ;
38
38
/**
39
39
* If no processCallback() exists for the current step, the component will automatically
40
40
* validate the model data against the models included in the controller's uses array.
41
41
*
42
42
* @var boolean
43
43
* @access public
44
44
*/
45
- var $ autoValidate = false ;
45
+ public $ autoValidate = false ;
46
46
/**
47
47
* List of steps, in order, that are to be included in the wizard.
48
48
* basic example: $steps = array('contact', 'payment', 'confirm');
@@ -57,103 +57,103 @@ class WizardComponent extends Component {
57
57
* @var array
58
58
* @access public
59
59
*/
60
- var $ steps = array ();
60
+ public $ steps = array ();
61
61
/**
62
62
* Controller action that processes your step.
63
63
*
64
64
* @var string
65
65
* @access public
66
66
*/
67
- var $ action = 'wizard ' ;
67
+ public $ action = 'wizard ' ;
68
68
/**
69
69
* Url to be redirected to after the wizard has been completed.
70
70
* Controller::afterComplete() is called directly before redirection.
71
71
*
72
72
* @var mixed
73
73
* @access public
74
74
*/
75
- var $ completeUrl = '/ ' ;
75
+ public $ completeUrl = '/ ' ;
76
76
/**
77
77
* Url to be redirected to after 'Cancel' submit button has been pressed by user.
78
78
*
79
79
* @var mixed
80
80
* @access public
81
81
*/
82
- var $ cancelUrl = '/ ' ;
82
+ public $ cancelUrl = '/ ' ;
83
83
/**
84
84
* Url to be redirected to after 'Draft' submit button has been pressed by user.
85
85
*
86
86
* @var mixed
87
87
* @access public
88
88
*/
89
- var $ draftUrl = '/ ' ;
89
+ public $ draftUrl = '/ ' ;
90
90
/**
91
91
* If true, the first "non-skipped" branch in a group will be used if a branch has
92
92
* not been included specifically.
93
93
*
94
94
* @var boolean
95
95
* @access public
96
96
*/
97
- var $ defaultBranch = true ;
97
+ public $ defaultBranch = true ;
98
98
/**
99
99
* If true, the user will not be allowed to edit previously completed steps. They will be
100
100
* "locked down" to the current step.
101
101
*
102
102
* @var boolean
103
103
* @access public
104
104
*/
105
- var $ lockdown = false ;
105
+ public $ lockdown = false ;
106
106
/**
107
107
* If true, the component will render views found in views/{wizardAction}/{step}.ctp rather
108
108
* than views/{step}.ctp.
109
109
*
110
110
* @var boolean
111
111
* @access public
112
112
*/
113
- var $ nestedViews = false ;
113
+ public $ nestedViews = false ;
114
114
/**
115
115
* Internal step tracking.
116
116
*
117
117
* @var string
118
118
* @access protected
119
119
*/
120
- var $ _currentStep = null ;
120
+ public $ _currentStep = null ;
121
121
/**
122
122
* Holds the session key for data storage.
123
123
*
124
124
* @var string
125
125
* @access protected
126
126
*/
127
- var $ _sessionKey = null ;
127
+ public $ _sessionKey = null ;
128
128
/**
129
129
* Other session keys used.
130
130
*
131
131
* @var string
132
132
* @access protected
133
133
*/
134
- var $ _configKey = null ;
135
- var $ _branchKey = null ;
134
+ public $ _configKey = null ;
135
+ public $ _branchKey = null ;
136
136
/**
137
137
* Holds the array based url for redirecting.
138
138
*
139
139
* @var array
140
140
* @access protected
141
141
*/
142
- var $ _wizardUrl = array ();
142
+ public $ _wizardUrl = array ();
143
143
/**
144
144
* Other components used.
145
145
*
146
146
* @var array
147
147
* @access public
148
148
*/
149
- var $ components = array ('Session ' );
149
+ public $ components = array ('Session ' );
150
150
/**
151
151
* Initializes WizardComponent for use in the controller
152
152
*
153
153
* @param object $controller A reference to the instantiating controller object
154
154
* @access public
155
155
*/
156
- function initialize ($ controller , $ settings = array ()) {
156
+ public function initialize ($ controller , $ settings = array ()) {
157
157
$ this ->controller = $ controller ;
158
158
$ this ->_set ($ settings );
159
159
@@ -167,7 +167,7 @@ function initialize($controller, $settings = array()) {
167
167
* @param object $controller A reference to the instantiating controller object
168
168
* @access public
169
169
*/
170
- function startup (&$ controller ) {
170
+ public function startup (&$ controller ) {
171
171
$ this ->steps = $ this ->_parseSteps ($ this ->steps );
172
172
173
173
$ this ->config ('action ' , $ this ->action );
@@ -183,7 +183,7 @@ function startup(&$controller) {
183
183
* @param string $step Name of step associated in $this->steps to be processed.
184
184
* @access public
185
185
*/
186
- function process ($ step ) {
186
+ public function process ($ step ) {
187
187
if (isset ($ this ->controller ->request ->data ['Cancel ' ])) {
188
188
if (method_exists ($ this ->controller , '_beforeCancel ' )) {
189
189
$ this ->controller ->_beforeCancel ($ this ->_getExpectedStep ());
@@ -284,7 +284,7 @@ function process($step) {
284
284
* @param boolean $skip Branch will be skipped instead of included if true.
285
285
* @access public
286
286
*/
287
- function branch ($ name , $ skip = false ) {
287
+ public function branch ($ name , $ skip = false ) {
288
288
$ branches = array ();
289
289
290
290
if ($ this ->controller ->Session ->check ($ this ->_branchKey )) {
@@ -309,7 +309,7 @@ function branch($name, $skip = false) {
309
309
* @return mixed
310
310
* @access public
311
311
*/
312
- function config ($ name , $ value = null ) {
312
+ public function config ($ name , $ value = null ) {
313
313
if ($ value == null ) {
314
314
return $ this ->controller ->Session ->read ("$ this ->_configKey . $ name " );
315
315
}
@@ -322,7 +322,7 @@ function config($name, $value = null) {
322
322
* @see WizardComponent::process()
323
323
* @access public
324
324
*/
325
- function loadDraft ($ draft = array ()) {
325
+ public function loadDraft ($ draft = array ()) {
326
326
if (!empty ($ draft ['_draft ' ]['current ' ]['step ' ])) {
327
327
$ this ->restore ($ draft );
328
328
$ this ->redirect ($ draft ['_draft ' ]['current ' ]['step ' ]);
@@ -336,7 +336,7 @@ function loadDraft($draft = array()) {
336
336
* @return mixed The value of the session variable
337
337
* @access public
338
338
*/
339
- function read ($ key = null ) {
339
+ public function read ($ key = null ) {
340
340
if ($ key == null ) {
341
341
return $ this ->controller ->Session ->read ($ this ->_sessionKey );
342
342
} else {
@@ -353,7 +353,7 @@ function read($key = null) {
353
353
* @see Controller::redirect()
354
354
* @access public
355
355
*/
356
- function redirect ($ step = null , $ status = null , $ exit = true ) {
356
+ public function redirect ($ step = null , $ status = null , $ exit = true ) {
357
357
if ($ step == null ) {
358
358
$ step = $ this ->_getExpectedStep ();
359
359
}
@@ -365,15 +365,15 @@ function redirect($step = null, $status = null, $exit = true) {
365
365
*
366
366
* @access public
367
367
*/
368
- function resetWizard () {
368
+ public function resetWizard () {
369
369
$ this ->reset ();
370
370
}
371
371
/**
372
372
* Resets the wizard by deleting the wizard session.
373
373
*
374
374
* @access public
375
375
*/
376
- function reset () {
376
+ public function reset () {
377
377
$ this ->controller ->Session ->delete ($ this ->_branchKey );
378
378
$ this ->controller ->Session ->delete ($ this ->_sessionKey );
379
379
}
@@ -384,7 +384,7 @@ function reset() {
384
384
* @param array $data Data to be written to controller's wizard session.
385
385
* @access public
386
386
*/
387
- function restore ($ data = array ()) {
387
+ public function restore ($ data = array ()) {
388
388
$ this ->controller ->Session ->write ($ this ->_sessionKey , $ data );
389
389
}
390
390
/**
@@ -395,7 +395,7 @@ function restore($data = array()) {
395
395
*
396
396
* @access public
397
397
*/
398
- function save ($ step = null , $ data = null ) {
398
+ public function save ($ step = null , $ data = null ) {
399
399
if (is_null ($ step )) {
400
400
$ step = $ this ->_currentStep ;
401
401
}
@@ -411,7 +411,7 @@ function save($step = null, $data = null) {
411
411
* @param mixed $name The name of the session variable (or a path as sent to Set.extract)
412
412
* @access public
413
413
*/
414
- function delete ($ key = null ) {
414
+ public function delete ($ key = null ) {
415
415
if ($ key == null ) {
416
416
return ;
417
417
} else {
@@ -425,7 +425,7 @@ function delete($key = null) {
425
425
* @param string $branch Name of branch to be removed from steps array.
426
426
* @access public
427
427
*/
428
- function unbranch ($ branch ) {
428
+ public function unbranch ($ branch ) {
429
429
$ this ->controller ->Session ->delete ("$ this ->_branchKey . $ branch " );
430
430
}
431
431
/**
@@ -434,7 +434,7 @@ function unbranch($branch) {
434
434
* @return string $step or false if complete
435
435
* @access protected
436
436
*/
437
- function _getExpectedStep () {
437
+ protected function _getExpectedStep () {
438
438
foreach ($ this ->steps as $ step ) {
439
439
if (!$ this ->controller ->Session ->check ("$ this ->_sessionKey . $ step " )) {
440
440
$ this ->config ('expectedStep ' , $ step );
@@ -449,7 +449,7 @@ function _getExpectedStep() {
449
449
* @return mixed
450
450
* @access protected
451
451
*/
452
- function _branchType ($ branch ) {
452
+ protected function _branchType ($ branch ) {
453
453
if ($ this ->controller ->Session ->check ("$ this ->_branchKey . $ branch " )) {
454
454
return $ this ->controller ->Session ->read ("$ this ->_branchKey . $ branch " );
455
455
}
@@ -463,7 +463,7 @@ function _branchType($branch) {
463
463
* @return array
464
464
* @access protected
465
465
*/
466
- function _parseSteps ($ steps ) {
466
+ protected function _parseSteps ($ steps ) {
467
467
$ parsed = array ();
468
468
469
469
foreach ($ steps as $ key => $ name ) {
@@ -501,7 +501,7 @@ function _parseSteps($steps) {
501
501
* @param $step Step to point to.
502
502
* @access protected
503
503
*/
504
- function _setCurrentStep ($ step ) {
504
+ protected function _setCurrentStep ($ step ) {
505
505
$ this ->_currentStep = reset ($ this ->steps );
506
506
507
507
while (current ($ this ->steps ) != $ step ) {
@@ -516,7 +516,7 @@ function _setCurrentStep($step) {
516
516
* @return boolean
517
517
* @access protected
518
518
*/
519
- function _validateData () {
519
+ protected function _validateData () {
520
520
$ controller =& $ this ->controller ;
521
521
522
522
foreach ($ controller ->data as $ model => $ data ) {
@@ -539,7 +539,7 @@ function _validateData() {
539
539
* @return mixed
540
540
* @access protected
541
541
*/
542
- function _validStep ($ step ) {
542
+ protected function _validStep ($ step ) {
543
543
if (in_array ($ step , $ this ->steps )) {
544
544
if ($ this ->lockdown ) {
545
545
return (array_search ($ step , $ this ->steps ) == array_search ($ this ->_getExpectedStep (), $ this ->steps ));
0 commit comments