class-wizards.php
2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
*
*/
abstract class BackWPup_Pro_Wizards {
public $info = array();
/**
*
*/
abstract public function __construct();
/**
* with steps has the wizard to to
*
* @param array $wizard_settings
*
* @return
*/
abstract public function get_steps( array $wizard_settings );
/**
* Initiate Wizard Settings
*
* @param array $wizard_settings
*
* @return array
*/
public function initiate( array $wizard_settings ) {
return $wizard_settings;
}
/**
* called on page admin_print_styles
*
* @param array $wizard_settings
*/
public function admin_print_styles( array $wizard_settings ) {
}
/**
* called on page admin_print_scripts
*
* @param array $wizard_settings
*/
public function admin_print_scripts( array $wizard_settings ) {
}
/**
* called on page
*
* @param array $wizard_settings
*
* @return
*/
abstract public function page( array $wizard_settings );
/**
* called on page inline_js
*
* @param array $wizard_settings
*/
public function inline_js( array $wizard_settings ) {
}
/**
* called on page load to save form data
*
* @param array $wizard_settings
*
* @return
*/
abstract public function save( array $wizard_settings );
/**
* called if last button clicked
*
* @param array $wizard_settings
*
* @return
*/
abstract public function execute( array $wizard_settings );
/**
* executed if cancel button clicked
*
* @param array $wizard_settings
*/
public function cancel( array $wizard_settings ) {
}
/**
* The name of the last button (execute button)
*
* @param $wizard_settings
* @return string
*/
abstract public function get_last_button_name( array $wizard_settings ) ;
/**
* Should the wizard run step by step or can yup between steps
*
* @param $wizard_settings
* @return bool
*/
public function is_step_by_step( array $wizard_settings ) {
return TRUE;
}
/**
* Set Pre configurations
*
* @param $id
* @return array
*/
public function get_pre_configurations( $id = NULL ) {
// every configuration must have a name field in array
$pre_configurations = array();
if ( empty( $pre_configurations ) ) {
return FALSE;
}
if ( $id == NULL ) {
$pre_configurations_names = array();
foreach ( $pre_configurations as $id => $values ) {
$pre_configurations_names[ $id ] = $values[ 'name' ];
}
return $pre_configurations_names;
} else {
return $pre_configurations[ $id ];
}
}
}