|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Displays the set-up wizard bussiness settings. |
|
4
|
|
|
* |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
defined( 'ABSPATH' ) || exit; |
|
8
|
|
|
|
|
9
|
|
|
global $aui_bs5; |
|
10
|
|
|
?> |
|
11
|
|
|
<div class="card shadow-sm my-5"> |
|
12
|
|
|
<form method="post" class="<?php echo( $aui_bs5 ? 'text-start' : 'text-left' ); ?> card-body" action="options.php"> |
|
13
|
|
|
<?php settings_fields( 'wpinv_settings' ); ?> |
|
14
|
|
|
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_url( $next_url ); ?>"> |
|
15
|
|
|
|
|
16
|
|
|
<table class="gp-setup-maps w-100 " cellspacing="0"> |
|
17
|
|
|
<tbody> |
|
18
|
|
|
<?php |
|
19
|
|
|
|
|
20
|
|
|
global $wp_settings_fields; |
|
21
|
|
|
|
|
22
|
|
|
if ( isset( $wp_settings_fields[ $page ][ $section ] ) ) { |
|
23
|
|
|
$settings = $wp_settings_fields[ $page ][ $section ]; |
|
24
|
|
|
|
|
25
|
|
|
foreach ( $settings as $field ) { |
|
26
|
|
|
|
|
27
|
|
|
$name = esc_attr( $field['id'] ); |
|
28
|
|
|
$id = sanitize_key( $name ); |
|
29
|
|
|
$class = ''; |
|
30
|
|
|
$value = isset( $field['args']['std'] ) ? $field['args']['std'] : ''; |
|
31
|
|
|
$value = wpinv_clean( wpinv_get_option( $field['args']['id'], $value ) ); |
|
32
|
|
|
$help_text = isset( $field['args']['desc'] ) ? wp_kses_post( $field['args']['desc'] ) : ''; |
|
33
|
|
|
$type = str_replace( 'wpinv_', '', str_replace( '_callback', '', $field['callback'] ) ); |
|
34
|
|
|
$label = isset( $field['args']['name'] ) ? wp_kses_post( $field['args']['name'] ) : ''; |
|
35
|
|
|
$options = isset( $field['args']['options'] ) ? $field['args']['options'] : array(); |
|
36
|
|
|
|
|
37
|
|
|
if ( false !== strpos( $name, 'logo' ) ) { |
|
38
|
|
|
$type = 'hidden'; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
if ( 'country_states' == $type ) { |
|
42
|
|
|
|
|
43
|
|
|
if ( 0 == count( wpinv_get_country_states( wpinv_get_default_country() ) ) ) { |
|
44
|
|
|
$type = 'text'; |
|
45
|
|
|
} else { |
|
46
|
|
|
$type = 'select'; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
$class = 'getpaid_js_field-state'; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
if ( 'wpinv_settings[default_country]' == $name ) { |
|
53
|
|
|
$class = 'getpaid_js_field-country'; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
switch ( $type ) { |
|
57
|
|
|
|
|
58
|
|
|
case 'hidden': |
|
59
|
|
|
echo "<input type='hidden' id='" . esc_attr( $id ) . "' name='" . esc_attr( $name ) . "' value='" . esc_attr( $value ) . "' />"; |
|
|
|
|
|
|
60
|
|
|
break; |
|
61
|
|
|
case 'text': |
|
62
|
|
|
case 'number': |
|
63
|
|
|
aui()->input( |
|
64
|
|
|
array( |
|
65
|
|
|
'type' => $type, |
|
66
|
|
|
'id' => $id, |
|
67
|
|
|
'name' => $name, |
|
68
|
|
|
'value' => is_scalar( $value ) ? esc_attr( $value ) : '', |
|
69
|
|
|
'required' => false, |
|
70
|
|
|
'help_text' => $help_text, |
|
71
|
|
|
'label' => $label, |
|
72
|
|
|
'class' => $class, |
|
73
|
|
|
'label_type' => 'floating', |
|
74
|
|
|
'label_class' => 'settings-label', |
|
75
|
|
|
), |
|
76
|
|
|
true |
|
77
|
|
|
); |
|
78
|
|
|
break; |
|
79
|
|
|
case 'textarea': |
|
80
|
|
|
aui()->textarea( |
|
81
|
|
|
array( |
|
82
|
|
|
'id' => $id, |
|
83
|
|
|
'name' => $name, |
|
84
|
|
|
'value' => is_scalar( $value ) ? esc_textarea( $value ) : '', |
|
85
|
|
|
'required' => false, |
|
86
|
|
|
'help_text' => $help_text, |
|
87
|
|
|
'label' => $label, |
|
88
|
|
|
'rows' => '4', |
|
89
|
|
|
'class' => $class, |
|
90
|
|
|
'label_type' => 'floating', |
|
91
|
|
|
'label_class' => 'settings-label', |
|
92
|
|
|
), |
|
93
|
|
|
true |
|
94
|
|
|
); |
|
95
|
|
|
|
|
96
|
|
|
break; |
|
97
|
|
|
case 'select': |
|
98
|
|
|
aui()->select( |
|
99
|
|
|
array( |
|
100
|
|
|
'id' => $id, |
|
101
|
|
|
'name' => $name, |
|
102
|
|
|
'placeholder' => '', |
|
103
|
|
|
'value' => is_scalar( $value ) ? esc_attr( $value ) : '', |
|
104
|
|
|
'required' => false, |
|
105
|
|
|
'help_text' => $help_text, |
|
106
|
|
|
'label' => $label, |
|
107
|
|
|
'options' => $options, |
|
108
|
|
|
'label_type' => 'floating', |
|
109
|
|
|
'label_class' => 'settings-label', |
|
110
|
|
|
'class' => $class, |
|
111
|
|
|
), |
|
112
|
|
|
true |
|
113
|
|
|
); |
|
114
|
|
|
break; |
|
115
|
|
|
default: |
|
116
|
|
|
// Do something. |
|
117
|
|
|
break; |
|
118
|
|
|
} |
|
119
|
|
|
} |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
?> |
|
123
|
|
|
</tbody> |
|
124
|
|
|
|
|
125
|
|
|
<p class="gp-setup-actions step text-center mt-4"> |
|
126
|
|
|
<input |
|
127
|
|
|
type="submit" |
|
128
|
|
|
class="btn btn-primary button-next" |
|
129
|
|
|
value="<?php esc_attr_e( 'Continue', 'invoicing' ); ?>" name="save_step"/> |
|
130
|
|
|
</p> |
|
131
|
|
|
</table> |
|
132
|
|
|
</form> |
|
133
|
|
|
|
|
134
|
|
|
</div> |
|
135
|
|
|
|