@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * WPShop Payment Mode bootstrap file |
4 | 4 | * @author Jérôme ALLEGRE - Eoxia dev team <[email protected]> |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | * |
9 | 9 | */ |
10 | 10 | |
11 | -if ( !class_exists("wps_payment_mode") ) { |
|
11 | +if (!class_exists("wps_payment_mode")) { |
|
12 | 12 | |
13 | 13 | /** Template Global vars **/ |
14 | 14 | DEFINE('WPS_PAYMENT_MODE_DIR', basename(dirname(__FILE__))); |
15 | - DEFINE('WPS_PAYMENT_MODE_PATH', str_replace( "\\", "/", str_replace( WPS_PAYMENT_MODE_DIR, "", dirname( __FILE__ ) ) ) ); |
|
16 | - DEFINE('WPS_PAYMENT_MODE_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_PAYMENT_MODE_PATH ) ); |
|
15 | + DEFINE('WPS_PAYMENT_MODE_PATH', str_replace("\\", "/", str_replace(WPS_PAYMENT_MODE_DIR, "", dirname(__FILE__)))); |
|
16 | + DEFINE('WPS_PAYMENT_MODE_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_PAYMENT_MODE_PATH)); |
|
17 | 17 | |
18 | 18 | |
19 | 19 | class wps_payment_mode { |
@@ -32,52 +32,52 @@ discard block |
||
32 | 32 | $this->template_dir = WPS_PAYMENT_MODE_PATH . WPS_PAYMENT_MODE_DIR . "/templates/"; |
33 | 33 | |
34 | 34 | /** Checking Payment Mode Option **/ |
35 | - $payment_option = get_option( 'wps_payment_mode' ); |
|
36 | - if ( empty($payment_option) ) { |
|
35 | + $payment_option = get_option('wps_payment_mode'); |
|
36 | + if (empty($payment_option)) { |
|
37 | 37 | self::migrate_payment_modes(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | /** Check if SystemPay is registred in Payment Main Option **/ |
41 | - $payment_option = get_option( 'wps_payment_mode' ); |
|
42 | - if ( !empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('checks', $payment_option['mode']) ) { |
|
41 | + $payment_option = get_option('wps_payment_mode'); |
|
42 | + if (!empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('checks', $payment_option['mode'])) { |
|
43 | 43 | $payment_option['mode']['checks']['name'] = __('Checks', 'wpshop'); |
44 | - $payment_option['mode']['checks']['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/cheque.png'; |
|
44 | + $payment_option['mode']['checks']['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/cheque.png'; |
|
45 | 45 | $payment_option['mode']['checks']['description'] = __('Reservation of products upon receipt of the check.', 'wpshop'); |
46 | - update_option( 'wps_payment_mode', $payment_option ); |
|
46 | + update_option('wps_payment_mode', $payment_option); |
|
47 | 47 | } |
48 | 48 | |
49 | - if ( !empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('banktransfer', $payment_option['mode']) ) { |
|
49 | + if (!empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('banktransfer', $payment_option['mode'])) { |
|
50 | 50 | $payment_modes['mode']['banktransfer']['name'] = __('Banktransfer', 'wpshop'); |
51 | - $payment_modes['mode']['banktransfer']['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/cheque.png'; |
|
51 | + $payment_modes['mode']['banktransfer']['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/cheque.png'; |
|
52 | 52 | $payment_modes['mode']['banktransfer']['description'] = __('Reservation of products upon confirmation of payment.', 'wpshop'); |
53 | - update_option( 'wps_payment_mode', $payment_option ); |
|
53 | + update_option('wps_payment_mode', $payment_option); |
|
54 | 54 | } |
55 | 55 | |
56 | - add_action( 'wp_enqueue_scripts', array( $this, 'add_script') ); |
|
57 | - add_action( 'admin_enqueue_scripts', array( $this, 'add_admin_scripts') ); |
|
56 | + add_action('wp_enqueue_scripts', array($this, 'add_script')); |
|
57 | + add_action('admin_enqueue_scripts', array($this, 'add_admin_scripts')); |
|
58 | 58 | |
59 | 59 | /** Create Options **/ |
60 | - add_action('wsphop_options', array(&$this, 'create_options') ); |
|
60 | + add_action('wsphop_options', array(&$this, 'create_options')); |
|
61 | 61 | |
62 | - add_filter( 'wps_payment_mode_interface_checks', array( &$this, 'display_interface_check') ); |
|
63 | - add_filter( 'wps_payment_mode_interface_banktransfer', array( &$this, 'display_admin_interface_banktransfer') ); |
|
64 | - add_filter( 'wps_payment_mode_interface_cic', array( 'wpshop_CIC', 'display_admin_part') ); |
|
62 | + add_filter('wps_payment_mode_interface_checks', array(&$this, 'display_interface_check')); |
|
63 | + add_filter('wps_payment_mode_interface_banktransfer', array(&$this, 'display_admin_interface_banktransfer')); |
|
64 | + add_filter('wps_payment_mode_interface_cic', array('wpshop_CIC', 'display_admin_part')); |
|
65 | 65 | |
66 | - add_shortcode( 'wps_payment', array( &$this, 'display_payment_modes' )); |
|
66 | + add_shortcode('wps_payment', array(&$this, 'display_payment_modes')); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 | |
70 | 70 | function add_script() { |
71 | - wp_enqueue_script( 'jquery'); |
|
72 | - wp_enqueue_script( 'wps_payment_mode', plugins_url('assets/frontend/js/wps_payment_mode.js', __FILE__) ); |
|
71 | + wp_enqueue_script('jquery'); |
|
72 | + wp_enqueue_script('wps_payment_mode', plugins_url('assets/frontend/js/wps_payment_mode.js', __FILE__)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | function add_admin_scripts() { |
76 | 76 | add_thickbox(); |
77 | - wp_enqueue_script( 'jquery'); |
|
77 | + wp_enqueue_script('jquery'); |
|
78 | 78 | wp_enqueue_script('jquery-ui'); |
79 | 79 | wp_enqueue_script('jquery-ui-sortable'); |
80 | - wp_enqueue_script( 'wps_payment_mode_js', plugins_url('assets/backend/js/wps_payment_mode.js', __FILE__) ); |
|
80 | + wp_enqueue_script('wps_payment_mode_js', plugins_url('assets/backend/js/wps_payment_mode.js', __FILE__)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -95,25 +95,25 @@ discard block |
||
95 | 95 | * @param array $input |
96 | 96 | * @return array |
97 | 97 | */ |
98 | - function wps_validate_payment_option( $input ) { |
|
99 | - if( is_array($input) ) { |
|
100 | - foreach( $input['mode'] as $mode_key => $mode_config ) { |
|
101 | - if ( !empty($_FILES[$mode_key.'_logo']['name']) && empty($_FILES[$mode_key.'_logo']['error']) ) { |
|
102 | - $filename = $_FILES[$mode_key.'_logo']; |
|
103 | - $upload = wp_handle_upload($filename, array('test_form' => false)); |
|
104 | - $wp_filetype = wp_check_filetype(basename($filename['name']), null ); |
|
98 | + function wps_validate_payment_option($input) { |
|
99 | + if (is_array($input)) { |
|
100 | + foreach ($input['mode'] as $mode_key => $mode_config) { |
|
101 | + if (!empty($_FILES[$mode_key . '_logo']['name']) && empty($_FILES[$mode_key . '_logo']['error'])) { |
|
102 | + $filename = $_FILES[$mode_key . '_logo']; |
|
103 | + $upload = wp_handle_upload($filename, array('test_form' => false)); |
|
104 | + $wp_filetype = wp_check_filetype(basename($filename['name']), null); |
|
105 | 105 | $wp_upload_dir = wp_upload_dir(); |
106 | 106 | $attachment = array( |
107 | - 'guid' => $wp_upload_dir['url'] . '/' . basename( $filename['name'] ), |
|
107 | + 'guid' => $wp_upload_dir['url'] . '/' . basename($filename['name']), |
|
108 | 108 | 'post_mime_type' => $wp_filetype['type'], |
109 | 109 | 'post_title' => preg_replace(' /\.[^.]+$/', '', basename($filename['name'])), |
110 | 110 | 'post_content' => '', |
111 | 111 | 'post_status' => 'inherit' |
112 | 112 | ); |
113 | - $attach_id = wp_insert_attachment( $attachment, $upload['file']); |
|
113 | + $attach_id = wp_insert_attachment($attachment, $upload['file']); |
|
114 | 114 | require_once(ABSPATH . 'wp-admin/includes/image.php'); |
115 | - $attach_data = wp_generate_attachment_metadata( $attach_id, $upload['file'] ); |
|
116 | - wp_update_attachment_metadata( $attach_id, $attach_data ); |
|
115 | + $attach_data = wp_generate_attachment_metadata($attach_id, $upload['file']); |
|
116 | + wp_update_attachment_metadata($attach_id, $attach_data); |
|
117 | 117 | |
118 | 118 | $input['mode'][$mode_key]['logo'] = $attach_id; |
119 | 119 | } |
@@ -127,68 +127,68 @@ discard block |
||
127 | 127 | */ |
128 | 128 | function display_payment_modes_in_admin() { |
129 | 129 | $output = ''; |
130 | - $payment_option = get_option( 'wps_payment_mode' ); |
|
130 | + $payment_option = get_option('wps_payment_mode'); |
|
131 | 131 | |
132 | - require_once( wpshop_tools::get_template_part( WPS_PAYMENT_MODE_DIR, $this->template_dir, "backend", "payment-modes") ); |
|
132 | + require_once(wpshop_tools::get_template_part(WPS_PAYMENT_MODE_DIR, $this->template_dir, "backend", "payment-modes")); |
|
133 | 133 | |
134 | 134 | } |
135 | 135 | |
136 | 136 | |
137 | 137 | public static function migrate_payment_modes() { |
138 | 138 | $payment_modes = array(); |
139 | - $payment_option = get_option( 'wpshop_paymentMethod' ); |
|
139 | + $payment_option = get_option('wpshop_paymentMethod'); |
|
140 | 140 | $methods = array(); |
141 | - $methods['display_position']['paypal'] = ( !empty($payment_option) && !empty($payment_option['paypal']) ) ? 'on' : ''; |
|
142 | - $methods['display_position']['checks'] = ( !empty($payment_option) && !empty($payment_option['checks']) ) ? 'on' : ''; |
|
143 | - $methods['display_position']['banktransfer'] = ( !empty($payment_option) && !empty($payment_option['banktransfer']) ) ? 'on' : ''; |
|
144 | - $methods['default_method'] = ( !empty($payment_option['default_method']) ) ? $payment_option['default_method'] : 'checks'; |
|
145 | - |
|
146 | - if ( !empty($payment_option['display_position']) ) { |
|
147 | - $methods['display_position'] = array_merge( $methods['display_position'], $payment_option['display_position'] ); |
|
148 | - foreach( $methods['display_position'] as $k => $v ) { |
|
149 | - if ( !empty($payment_option[$k]) ) { |
|
141 | + $methods['display_position']['paypal'] = (!empty($payment_option) && !empty($payment_option['paypal'])) ? 'on' : ''; |
|
142 | + $methods['display_position']['checks'] = (!empty($payment_option) && !empty($payment_option['checks'])) ? 'on' : ''; |
|
143 | + $methods['display_position']['banktransfer'] = (!empty($payment_option) && !empty($payment_option['banktransfer'])) ? 'on' : ''; |
|
144 | + $methods['default_method'] = (!empty($payment_option['default_method'])) ? $payment_option['default_method'] : 'checks'; |
|
145 | + |
|
146 | + if (!empty($payment_option['display_position'])) { |
|
147 | + $methods['display_position'] = array_merge($methods['display_position'], $payment_option['display_position']); |
|
148 | + foreach ($methods['display_position'] as $k => $v) { |
|
149 | + if (!empty($payment_option[$k])) { |
|
150 | 150 | $methods['display_position'][$k] = $payment_option[$k]; |
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if ( !empty($methods) && !empty($methods['display_position']) ) { |
|
156 | - foreach( $methods['display_position'] as $key => $value ) { |
|
157 | - $payment_modes['mode'][$key]['active'] = ( !empty($methods['display_position'][ $key ]) && $methods['display_position'][ $key ] == 'on' ) ? $methods['display_position'][ $key ] : ''; |
|
158 | - switch( $key ) { |
|
155 | + if (!empty($methods) && !empty($methods['display_position'])) { |
|
156 | + foreach ($methods['display_position'] as $key => $value) { |
|
157 | + $payment_modes['mode'][$key]['active'] = (!empty($methods['display_position'][$key]) && $methods['display_position'][$key] == 'on') ? $methods['display_position'][$key] : ''; |
|
158 | + switch ($key) { |
|
159 | 159 | case 'paypal' : |
160 | 160 | $payment_modes['mode'][$key]['name'] = __('Paypal', 'wpshop'); |
161 | - $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/paypal.png'; |
|
161 | + $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/paypal.png'; |
|
162 | 162 | $payment_modes['mode'][$key]['description'] = __('Tips : If you have a Paypal account, by choosing this payment method, you will be redirected to the secure payment site Paypal to make your payment. Debit your PayPal account, immediate booking products.', 'wpshop'); |
163 | 163 | break; |
164 | 164 | case 'banktransfer' : |
165 | 165 | $payment_modes['mode'][$key]['name'] = __('Banktransfer', 'wpshop'); |
166 | - $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/cheque.png'; |
|
166 | + $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/cheque.png'; |
|
167 | 167 | $payment_modes['mode'][$key]['description'] = __('Reservation of products upon confirmation of payment.', 'wpshop'); |
168 | 168 | break; |
169 | 169 | case 'checks' : |
170 | 170 | $payment_modes['mode'][$key]['name'] = __('Checks', 'wpshop'); |
171 | - $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/cheque.png'; |
|
171 | + $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/cheque.png'; |
|
172 | 172 | $payment_modes['mode'][$key]['description'] = __('Reservation of products upon receipt of the check.', 'wpshop'); |
173 | 173 | $payment_modes['mode'][$key]['active'] = 'on'; |
174 | 174 | break; |
175 | 175 | case 'systempay' : |
176 | 176 | $payment_modes['mode'][$key]['name'] = __('Systempay', 'wpshop'); |
177 | - $payment_modes['mode'][$key]['logo'] = plugins_url().'/wpshop_systemPay/img/systemPay.png'; |
|
177 | + $payment_modes['mode'][$key]['logo'] = plugins_url() . '/wpshop_systemPay/img/systemPay.png'; |
|
178 | 178 | $payment_modes['mode'][$key]['description'] = __('SystemPay - Banque Populaire', 'wpshop_systemPay'); |
179 | 179 | break; |
180 | 180 | case 'cic' : |
181 | 181 | $payment_modes['mode'][$key]['name'] = __('CIC', 'wpshop'); |
182 | - $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/cic_payment_logo.jpg'; |
|
182 | + $payment_modes['mode'][$key]['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/cic_payment_logo.jpg'; |
|
183 | 183 | $payment_modes['mode'][$key]['description'] = __('Reservation of products upon confirmation of payment.', 'wpshop'); |
184 | 184 | break; |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - if ( $methods['default_method'] ) { |
|
188 | + if ($methods['default_method']) { |
|
189 | 189 | $payment_modes['default_choice'] = $methods['default_method']; |
190 | 190 | } |
191 | - update_option( 'wps_payment_mode', $payment_modes); |
|
191 | + update_option('wps_payment_mode', $payment_modes); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | } |
@@ -209,31 +209,31 @@ discard block |
||
209 | 209 | |
210 | 210 | $wpshop_paymentMethod_options = get_option('wpshop_paymentMethod_options'); |
211 | 211 | $output = '<div class="wps-boxed">'; |
212 | - $output .= '<div class="wps-form-group"><label>'.__('Bank name', 'wpshop').'</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][bank_name]" type="text" value="'.(!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['bank_name'])?$wpshop_paymentMethod_options['banktransfer']['bank_name']:'').'" /></div></div>'; |
|
213 | - $output .= '<div class="wps-form-group"><label>'.__('IBAN', 'wpshop').'</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][iban]" type="text" value="'.(!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['iban'])?$wpshop_paymentMethod_options['banktransfer']['iban']:'').'" /></div></div>'; |
|
214 | - $output .= '<div class="wps-form-group"><label>'.__('BIC/SWIFT', 'wpshop').'</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][bic]" type="text" value="'.(!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['bic'])?$wpshop_paymentMethod_options['banktransfer']['bic']:'').'" /></div></div>'; |
|
215 | - $output .= '<div class="wps-form-group"><label>'.__('Account owner name', 'wpshop').'</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][accountowner]" type="text" value="'.(!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['accountowner'])?$wpshop_paymentMethod_options['banktransfer']['accountowner']:'').'" /></div></div>'; |
|
212 | + $output .= '<div class="wps-form-group"><label>' . __('Bank name', 'wpshop') . '</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][bank_name]" type="text" value="' . (!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['bank_name']) ? $wpshop_paymentMethod_options['banktransfer']['bank_name'] : '') . '" /></div></div>'; |
|
213 | + $output .= '<div class="wps-form-group"><label>' . __('IBAN', 'wpshop') . '</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][iban]" type="text" value="' . (!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['iban']) ? $wpshop_paymentMethod_options['banktransfer']['iban'] : '') . '" /></div></div>'; |
|
214 | + $output .= '<div class="wps-form-group"><label>' . __('BIC/SWIFT', 'wpshop') . '</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][bic]" type="text" value="' . (!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['bic']) ? $wpshop_paymentMethod_options['banktransfer']['bic'] : '') . '" /></div></div>'; |
|
215 | + $output .= '<div class="wps-form-group"><label>' . __('Account owner name', 'wpshop') . '</label><div class="wps-form"><input name="wpshop_paymentMethod_options[banktransfer][accountowner]" type="text" value="' . (!empty($wpshop_paymentMethod_options) && !empty($wpshop_paymentMethod_options['banktransfer']) && !empty($wpshop_paymentMethod_options['banktransfer']['accountowner']) ? $wpshop_paymentMethod_options['banktransfer']['accountowner'] : '') . '" /></div></div>'; |
|
216 | 216 | $output .= '</div>'; |
217 | 217 | return $output; |
218 | 218 | } |
219 | 219 | |
220 | 220 | function display_payment_modes() { |
221 | 221 | $output = ''; |
222 | - $payment_modes = get_option( 'wps_payment_mode' ); |
|
222 | + $payment_modes = get_option('wps_payment_mode'); |
|
223 | 223 | |
224 | - if ( !empty($payment_modes) && !empty($payment_modes['mode']) ) { |
|
225 | - $default_choice = ( !empty($payment_modes['default_choice']) ) ? $payment_modes['default_choice'] : ''; |
|
224 | + if (!empty($payment_modes) && !empty($payment_modes['mode'])) { |
|
225 | + $default_choice = (!empty($payment_modes['default_choice'])) ? $payment_modes['default_choice'] : ''; |
|
226 | 226 | $payment_modes = $payment_modes['mode']; |
227 | 227 | $tmp_array = array(); |
228 | - foreach( $payment_modes as $payment_mode_id => $payment_mode ) { |
|
229 | - if( !empty($payment_mode['active']) ) { |
|
230 | - $tmp_array[ $payment_mode_id ] = $payment_mode; |
|
228 | + foreach ($payment_modes as $payment_mode_id => $payment_mode) { |
|
229 | + if (!empty($payment_mode['active'])) { |
|
230 | + $tmp_array[$payment_mode_id] = $payment_mode; |
|
231 | 231 | } |
232 | 232 | } |
233 | - $payment_modes = apply_filters( 'wps-paymentmode-filter', $tmp_array ); |
|
233 | + $payment_modes = apply_filters('wps-paymentmode-filter', $tmp_array); |
|
234 | 234 | |
235 | 235 | ob_start(); |
236 | - require_once( wpshop_tools::get_template_part( WPS_PAYMENT_MODE_DIR, $this->template_dir, "frontend", "payment-modes") ); |
|
236 | + require_once(wpshop_tools::get_template_part(WPS_PAYMENT_MODE_DIR, $this->template_dir, "frontend", "payment-modes")); |
|
237 | 237 | $output = ob_get_contents(); |
238 | 238 | ob_end_clean(); |
239 | 239 | } |
@@ -246,6 +246,6 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | /** Instanciate the module utilities if not */ |
249 | -if ( class_exists("wps_payment_mode") ) { |
|
249 | +if (class_exists("wps_payment_mode")) { |
|
250 | 250 | $wps_shipping_mode = new wps_payment_mode(); |
251 | 251 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div><span class="wps-h2"><?php _e( 'Payment mode choice', 'wpshop' ); ?> :</span></div> |
4 | 6 | <?php if( !empty($payment_modes) ) : ?> |
@@ -7,8 +9,10 @@ discard block |
||
7 | 9 | <?php foreach( $payment_modes as $payment_mode_id => $payment_mode ) : ?> |
8 | 10 | <?php if( $default_choice == $payment_mode_id ): |
9 | 11 | $class = 'wps-activ'; $checked = 'checked="checked"'; |
10 | - else : |
|
12 | + else { |
|
13 | + : |
|
11 | 14 | $checked = $class = ''; |
15 | + } |
|
12 | 16 | endif; ?> |
13 | 17 | <li class="<?php echo $class; ?> wps-bloc-loader"> |
14 | 18 | <label> |
@@ -24,6 +28,9 @@ discard block |
||
24 | 28 | </li> |
25 | 29 | <?php endforeach; ?> |
26 | 30 | </ul> |
27 | -<?php else : ?> |
|
28 | - <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop' ); ?> </div> |
|
31 | +<?php else { |
|
32 | + : ?> |
|
33 | + <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop' ); |
|
34 | +} |
|
35 | +?> </div> |
|
29 | 36 | <?php endif; ?> |
@@ -1,29 +1,29 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | -<div><span class="wps-h2"><?php _e( 'Payment mode choice', 'wpshop' ); ?> :</span></div> |
|
4 | -<?php if( !empty($payment_modes) ) : ?> |
|
5 | -<?php $count_payment_mode = count( $payment_modes ); ?> |
|
6 | -<ul class="wps-itemList" id="wps-shipping-method-list-container" data-nonce="<?php echo wp_create_nonce( 'wps_load_shipping_methods' ); ?>"> |
|
7 | - <?php foreach( $payment_modes as $payment_mode_id => $payment_mode ) : ?> |
|
8 | - <?php if( $default_choice == $payment_mode_id ): |
|
3 | +<div><span class="wps-h2"><?php _e('Payment mode choice', 'wpshop'); ?> :</span></div> |
|
4 | +<?php if (!empty($payment_modes)) : ?> |
|
5 | +<?php $count_payment_mode = count($payment_modes); ?> |
|
6 | +<ul class="wps-itemList" id="wps-shipping-method-list-container" data-nonce="<?php echo wp_create_nonce('wps_load_shipping_methods'); ?>"> |
|
7 | + <?php foreach ($payment_modes as $payment_mode_id => $payment_mode) : ?> |
|
8 | + <?php if ($default_choice == $payment_mode_id): |
|
9 | 9 | $class = 'wps-activ'; $checked = 'checked="checked"'; |
10 | 10 | else : |
11 | 11 | $checked = $class = ''; |
12 | 12 | endif; ?> |
13 | 13 | <li class="<?php echo $class; ?> wps-bloc-loader"> |
14 | 14 | <label> |
15 | - <span><input type="radio" name="wps-payment-method" value="<?php echo $payment_mode_id; ?>" id="<?php echo $payment_mode_id ; ?>" <?php echo $checked; ?> /></span> |
|
15 | + <span><input type="radio" name="wps-payment-method" value="<?php echo $payment_mode_id; ?>" id="<?php echo $payment_mode_id; ?>" <?php echo $checked; ?> /></span> |
|
16 | 16 | <span class="wps-shipping-method-logo"> |
17 | - <?php echo ( !empty($payment_mode['logo']) ? ( (strstr($payment_mode['logo'], 'http://') === FALSE ) ? wp_get_attachment_image( $payment_mode['logo'], 'full' ) : '<img src="' .$payment_mode['logo']. '" alt="" />' ) : '' ); ?> |
|
17 | + <?php echo (!empty($payment_mode['logo']) ? ((strstr($payment_mode['logo'], 'http://') === FALSE) ? wp_get_attachment_image($payment_mode['logo'], 'full') : '<img src="' . $payment_mode['logo'] . '" alt="" />') : ''); ?> |
|
18 | 18 | </span> |
19 | - <span class="wps-shipping-method-name"><strong><?php _e( $payment_mode['name'], 'wpshop' ); ?></strong></span> |
|
19 | + <span class="wps-shipping-method-name"><strong><?php _e($payment_mode['name'], 'wpshop'); ?></strong></span> |
|
20 | 20 | </label> |
21 | 21 | <div class="wps-itemList-content"> |
22 | - <?php _e( $payment_mode['description'], 'wpshop' ); ?> |
|
22 | + <?php _e($payment_mode['description'], 'wpshop'); ?> |
|
23 | 23 | </div> |
24 | 24 | </li> |
25 | 25 | <?php endforeach; ?> |
26 | 26 | </ul> |
27 | 27 | <?php else : ?> |
28 | - <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop' ); ?> </div> |
|
28 | + <div class="wps-alert-info"><?php _e('No payment mode available', 'wpshop'); ?> </div> |
|
29 | 29 | <?php endif; ?> |
@@ -1,38 +1,38 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | -<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf( __( 'Boost your WPShop with a Credit card payment solution, <a href="%s" target="_blank">click here to select your payment solution adapted to your Bank</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-paiement/'); ?></div> |
|
4 | -<?php if( !empty($payment_option) && !empty($payment_option['mode']) ) : ?> |
|
5 | -<div class="wps-alert-error" id="wps_payment_config_save_message" style="display : none"><span class="dashicons dashicons-info"></span> <?php _e( 'Process saving, please wait...', 'wpshop'); ?></div> |
|
3 | +<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf(__('Boost your WPShop with a Credit card payment solution, <a href="%s" target="_blank">click here to select your payment solution adapted to your Bank</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-paiement/'); ?></div> |
|
4 | +<?php if (!empty($payment_option) && !empty($payment_option['mode'])) : ?> |
|
5 | +<div class="wps-alert-error" id="wps_payment_config_save_message" style="display : none"><span class="dashicons dashicons-info"></span> <?php _e('Process saving, please wait...', 'wpshop'); ?></div> |
|
6 | 6 | <div class="wps-table" id="wps_payment_mode_list_container"> |
7 | 7 | <div class="wps-table-header wps-table-row" > |
8 | 8 | <div class="wps-table-cell"></div> |
9 | - <div class="wps-table-cell"><?php _e( 'Logo', 'wpshop'); ?></div> |
|
10 | - <div class="wps-table-cell"><?php _e( 'Payment mode Name', 'wpshop'); ?></div> |
|
11 | - <div class="wps-table-cell"><?php _e( 'Configure', 'wpshop'); ?></div> |
|
12 | - <div class="wps-table-cell"><?php _e( 'Activate', 'wpshop'); ?></div> |
|
13 | - <div class="wps-table-cell"><?php _e( 'Default payment mode', 'wpshop'); ?></div> |
|
9 | + <div class="wps-table-cell"><?php _e('Logo', 'wpshop'); ?></div> |
|
10 | + <div class="wps-table-cell"><?php _e('Payment mode Name', 'wpshop'); ?></div> |
|
11 | + <div class="wps-table-cell"><?php _e('Configure', 'wpshop'); ?></div> |
|
12 | + <div class="wps-table-cell"><?php _e('Activate', 'wpshop'); ?></div> |
|
13 | + <div class="wps-table-cell"><?php _e('Default payment mode', 'wpshop'); ?></div> |
|
14 | 14 | </div> |
15 | - <?php foreach( $payment_option['mode'] as $k => $payment_mode ) : |
|
16 | - if( $k != 'default_shipping_mode' ) : |
|
15 | + <?php foreach ($payment_option['mode'] as $k => $payment_mode) : |
|
16 | + if ($k != 'default_shipping_mode') : |
|
17 | 17 | ?> |
18 | 18 | |
19 | 19 | <div class="wps-table-content wps-table-row wps_payment_mode_container"> |
20 | 20 | <div class="wps-table-cell wps-cart-item-img" id="wps_payment_mode_logo_container_<?php echo $k; ?>"> |
21 | - <?php echo ( !empty($payment_mode['logo']) ? ( (strstr($payment_mode['logo'], 'http://') === FALSE ) ? wp_get_attachment_image( $payment_mode['logo'], 'thumbnail') : '<img src="' .$payment_mode['logo']. '" alt="" />' ) : '' ); ?> |
|
21 | + <?php echo (!empty($payment_mode['logo']) ? ((strstr($payment_mode['logo'], 'http://') === FALSE) ? wp_get_attachment_image($payment_mode['logo'], 'thumbnail') : '<img src="' . $payment_mode['logo'] . '" alt="" />') : ''); ?> |
|
22 | 22 | </div> |
23 | 23 | <div class="wps-table-cell"> |
24 | - <a class="wps-bton-first-mini-rounded add_logo_to_payment_mode" id="add_logo_to_payment_mode_<?php echo $k; ?>" href="#" style="display : inline-block"><?php _e( 'Add a logo', 'wpshop'); ?></a> |
|
25 | - <input type="hidden" name="wps_payment_mode[mode][<?php echo $k; ?>][logo]" id="wps_payment_mode_logo_<?php echo $k; ?>" value="<?php echo ( !empty($payment_mode['logo']) ) ? $payment_mode['logo'] : ''; ?>" /> |
|
24 | + <a class="wps-bton-first-mini-rounded add_logo_to_payment_mode" id="add_logo_to_payment_mode_<?php echo $k; ?>" href="#" style="display : inline-block"><?php _e('Add a logo', 'wpshop'); ?></a> |
|
25 | + <input type="hidden" name="wps_payment_mode[mode][<?php echo $k; ?>][logo]" id="wps_payment_mode_logo_<?php echo $k; ?>" value="<?php echo (!empty($payment_mode['logo'])) ? $payment_mode['logo'] : ''; ?>" /> |
|
26 | 26 | </div> |
27 | 27 | <div class="wps-table-cell"> |
28 | - <input type="text" name="wps_payment_mode[mode][<?php echo $k; ?>][name]" value="<?php echo ( !empty($payment_mode['name']) ) ? $payment_mode['name'] : ''; ?>" /> |
|
28 | + <input type="text" name="wps_payment_mode[mode][<?php echo $k; ?>][name]" value="<?php echo (!empty($payment_mode['name'])) ? $payment_mode['name'] : ''; ?>" /> |
|
29 | 29 | </div> |
30 | - <div class="wps-table-cell"><a href="#TB_inline?width=780&height=700&inlineId=<?php echo $k; ?>_configuration_interface" class="thickbox wps-bton-first-mini-rounded" title="<?php _e('Configure the payment mode', 'wpshop'); ?>" ><?php _e( 'Configure', 'wpshop'); ?></a></div> |
|
30 | + <div class="wps-table-cell"><a href="#TB_inline?width=780&height=700&inlineId=<?php echo $k; ?>_configuration_interface" class="thickbox wps-bton-first-mini-rounded" title="<?php _e('Configure the payment mode', 'wpshop'); ?>" ><?php _e('Configure', 'wpshop'); ?></a></div> |
|
31 | 31 | <div class="wps-table-cell"> |
32 | - <input type="checkbox" id="wps_payment_active_<?php echo $k; ?>" class="wps_payment_active" name="wps_payment_mode[mode][<?php echo $k; ?>][active]" <?php echo ( (!empty($payment_mode) && !empty($payment_mode['active']) ) ? 'checked="checked"' : '' ); ?> /> |
|
32 | + <input type="checkbox" id="wps_payment_active_<?php echo $k; ?>" class="wps_payment_active" name="wps_payment_mode[mode][<?php echo $k; ?>][active]" <?php echo ((!empty($payment_mode) && !empty($payment_mode['active'])) ? 'checked="checked"' : ''); ?> /> |
|
33 | 33 | </div> |
34 | 34 | <div class="wps-table-cell"> |
35 | - <input type="radio" id="wps_payment_active_<?php echo $k; ?>_radio_default" name="wps_payment_mode[default_choice]" value="<?php echo $k; ?>" <?php echo ( !empty( $payment_option['default_choice'] ) && $payment_option['default_choice'] == $k ) ? 'checked="checked"' : ''; echo ( (!empty($payment_mode) && !empty($payment_mode['active']) ) ? '' : 'disabled="disabled"' ); ?> /> |
|
35 | + <input type="radio" id="wps_payment_active_<?php echo $k; ?>_radio_default" name="wps_payment_mode[default_choice]" value="<?php echo $k; ?>" <?php echo (!empty($payment_option['default_choice']) && $payment_option['default_choice'] == $k) ? 'checked="checked"' : ''; echo ((!empty($payment_mode) && !empty($payment_mode['active'])) ? '' : 'disabled="disabled"'); ?> /> |
|
36 | 36 | </div> |
37 | 37 | |
38 | 38 | |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | <div class="wps-form-group"> |
42 | 42 | <label><?php _e('Displayed description on front', 'wpshop'); ?></label> |
43 | 43 | <div class="wps-form"> |
44 | - <textarea name="wps_payment_mode[mode][<?php echo $k; ?>][description]" style="width : 100%; height: 120px;"><?php echo ( !empty($payment_mode['description']) ) ? trim($payment_mode['description']) : ''; ?></textarea> |
|
44 | + <textarea name="wps_payment_mode[mode][<?php echo $k; ?>][description]" style="width : 100%; height: 120px;"><?php echo (!empty($payment_mode['description'])) ? trim($payment_mode['description']) : ''; ?></textarea> |
|
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | </div> |
48 | - <?php echo apply_filters('wps_payment_mode_interface_'.$k, ''); ?> |
|
49 | - <div><center><a href="#" role="button" class="wps-bton-first-rounded wps_save_payment_mode_configuration"><?php _e( 'Save', 'wpshop'); ?></a></center><br/></div> |
|
48 | + <?php echo apply_filters('wps_payment_mode_interface_' . $k, ''); ?> |
|
49 | + <div><center><a href="#" role="button" class="wps-bton-first-rounded wps_save_payment_mode_configuration"><?php _e('Save', 'wpshop'); ?></a></center><br/></div> |
|
50 | 50 | </div> |
51 | 51 | |
52 | 52 | </div> |
@@ -56,5 +56,5 @@ discard block |
||
56 | 56 | </div> |
57 | 57 | |
58 | 58 | <?php else : ?> |
59 | - <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop'); ?></div> |
|
59 | + <div class="wps-alert-info"><?php _e('No payment mode available', 'wpshop'); ?></div> |
|
60 | 60 | <?php endif; ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf( __( 'Boost your WPShop with a Credit card payment solution, <a href="%s" target="_blank">click here to select your payment solution adapted to your Bank</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-paiement/'); ?></div> |
4 | 6 | <?php if( !empty($payment_option) && !empty($payment_option['mode']) ) : ?> |
@@ -55,6 +57,9 @@ discard block |
||
55 | 57 | endforeach; ?> |
56 | 58 | </div> |
57 | 59 | |
58 | -<?php else : ?> |
|
59 | - <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop'); ?></div> |
|
60 | +<?php else { |
|
61 | + : ?> |
|
62 | + <div class="wps-alert-info"><?php _e( 'No payment mode available', 'wpshop'); |
|
63 | +} |
|
64 | +?></div> |
|
60 | 65 | <?php endif; ?> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * Bootstrap file for plugin. Do main includes and create new instance for plugin components |
4 | 4 | * |
@@ -6,18 +6,18 @@ discard block |
||
6 | 6 | * @version 1.0 |
7 | 7 | */ |
8 | 8 | /** Define */ |
9 | -DEFINE( 'WPS_GUIDED_VERSION', '1.0.0' ); |
|
10 | -DEFINE( 'WPS_GUIDED_DIR', basename(dirname(__FILE__))); |
|
11 | -DEFINE( 'WPS_GUIDED_PATH', dirname( __FILE__ ) ); |
|
12 | -DEFINE( 'WPS_GUIDED_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_GUIDED_PATH ) ) ); |
|
9 | +DEFINE('WPS_GUIDED_VERSION', '1.0.0'); |
|
10 | +DEFINE('WPS_GUIDED_DIR', basename(dirname(__FILE__))); |
|
11 | +DEFINE('WPS_GUIDED_PATH', dirname(__FILE__)); |
|
12 | +DEFINE('WPS_GUIDED_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_GUIDED_PATH))); |
|
13 | 13 | /** Define the templates directories */ |
14 | -DEFINE( 'WPS_GUIDED_TEMPLATES_MAIN_DIR', WPS_GUIDED_PATH . '/templates/'); |
|
14 | +DEFINE('WPS_GUIDED_TEMPLATES_MAIN_DIR', WPS_GUIDED_PATH . '/templates/'); |
|
15 | 15 | /** Translate */ |
16 | -load_plugin_textdomain( 'wps_guided_tour', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
16 | +load_plugin_textdomain('wps_guided_tour', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
17 | 17 | /** Require */ |
18 | -require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
19 | -require_once( WPS_GUIDED_PATH . '/controller/wpsBubble_ctr.php' ); |
|
20 | -require_once( WPS_GUIDED_PATH . '/controller/wpsBubbleTemplate_ctr.php' ); |
|
18 | +require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
19 | +require_once(WPS_GUIDED_PATH . '/controller/wpsBubble_ctr.php'); |
|
20 | +require_once(WPS_GUIDED_PATH . '/controller/wpsBubbleTemplate_ctr.php'); |
|
21 | 21 | |
22 | 22 | new wpsBubble_ctr(); |
23 | 23 | ?> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * wpsBubbleTemplate file definition for project plugin |
4 | 4 | * |
@@ -27,42 +27,42 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return string The template file path to use |
29 | 29 | */ |
30 | - static function get_template_part( $plugin_dir_name, $main_template_dir, $side, $slug, $name=null, $debug = null ) { |
|
30 | + static function get_template_part($plugin_dir_name, $main_template_dir, $side, $slug, $name = null, $debug = null) { |
|
31 | 31 | $path = ''; |
32 | 32 | |
33 | 33 | $templates = array(); |
34 | 34 | $name = (string)$name; |
35 | - if ( '' !== $name ) |
|
35 | + if ('' !== $name) |
|
36 | 36 | $templates[] = "{$side}/{$slug}-{$name}.php"; |
37 | 37 | $templates[] = "{$side}/{$slug}.php"; |
38 | 38 | |
39 | 39 | /** Check if required template exists into current theme */ |
40 | 40 | $check_theme_template = array(); |
41 | - foreach ( $templates as $template ) { |
|
41 | + foreach ($templates as $template) { |
|
42 | 42 | $check_theme_template = $plugin_dir_name . "/" . $template; |
43 | - $path = locate_template( $check_theme_template, false ); |
|
44 | - if ( !empty( $path ) ) { |
|
43 | + $path = locate_template($check_theme_template, false); |
|
44 | + if (!empty($path)) { |
|
45 | 45 | break; |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** Allow debugging */ |
50 | - if ( !empty( $debug ) ) { |
|
50 | + if (!empty($debug)) { |
|
51 | 51 | echo '--- Debug mode ON - Start ---<br/>'; |
52 | 52 | echo __FILE__ . '<br/>'; |
53 | 53 | echo 'Debug for display method<br/>'; |
54 | 54 | } |
55 | 55 | |
56 | - if ( empty( $path ) ) { |
|
57 | - foreach ( (array) $templates as $template_name ) { |
|
58 | - if ( !$template_name ) |
|
56 | + if (empty($path)) { |
|
57 | + foreach ((array)$templates as $template_name) { |
|
58 | + if (!$template_name) |
|
59 | 59 | continue; |
60 | 60 | |
61 | - if ( !empty( $debug ) ) { |
|
61 | + if (!empty($debug)) { |
|
62 | 62 | echo __LINE__ . ' - ' . $main_template_dir . $template_name . '<hr/>'; |
63 | 63 | } |
64 | 64 | |
65 | - if ( file_exists( $main_template_dir . $template_name ) ) { |
|
65 | + if (file_exists($main_template_dir . $template_name)) { |
|
66 | 66 | $path = $main_template_dir . $template_name; |
67 | 67 | break; |
68 | 68 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** Allow debugging */ |
76 | - if ( !empty( $debug ) ) { |
|
76 | + if (!empty($debug)) { |
|
77 | 77 | echo '--- Debug mode ON - END ---<br/><br/>'; |
78 | 78 | } |
79 | 79 |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * wpsBubbleTemplate file definition for project plugin |
4 | 6 | * |
@@ -32,8 +34,9 @@ discard block |
||
32 | 34 | |
33 | 35 | $templates = array(); |
34 | 36 | $name = (string)$name; |
35 | - if ( '' !== $name ) |
|
36 | - $templates[] = "{$side}/{$slug}-{$name}.php"; |
|
37 | + if ( '' !== $name ) { |
|
38 | + $templates[] = "{$side}/{$slug}-{$name}.php"; |
|
39 | + } |
|
37 | 40 | $templates[] = "{$side}/{$slug}.php"; |
38 | 41 | |
39 | 42 | /** Check if required template exists into current theme */ |
@@ -55,8 +58,9 @@ discard block |
||
55 | 58 | |
56 | 59 | if ( empty( $path ) ) { |
57 | 60 | foreach ( (array) $templates as $template_name ) { |
58 | - if ( !$template_name ) |
|
59 | - continue; |
|
61 | + if ( !$template_name ) { |
|
62 | + continue; |
|
63 | + } |
|
60 | 64 | |
61 | 65 | if ( !empty( $debug ) ) { |
62 | 66 | echo __LINE__ . ' - ' . $main_template_dir . $template_name . '<hr/>'; |
@@ -67,8 +71,7 @@ discard block |
||
67 | 71 | break; |
68 | 72 | } |
69 | 73 | } |
70 | - } |
|
71 | - else { |
|
74 | + } else { |
|
72 | 75 | echo ''; |
73 | 76 | } |
74 | 77 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <label for="use_next_button"><span><?php _e("Use next button", self::$name_i18n); ?></span> |
4 | 4 | <input type="checkbox" name="meta[actions][use_next_button]" id="use_next_button" <?php echo (!empty($meta['actions']['use_next_button'])) ? 'checked="checked"' : ''; ?> > |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | |
7 | 7 | <label for="type_next"><span><?php _e("Type next", self::$name_i18n); ?></span> |
8 | 8 | <select class="wpeo-bubble-select-type-next" name="meta[actions][type_next]"> |
9 | - <?php if(!empty($array_type_next)): ?> |
|
10 | - <?php foreach($array_type_next as $type_next): ?> |
|
9 | + <?php if (!empty($array_type_next)): ?> |
|
10 | + <?php foreach ($array_type_next as $type_next): ?> |
|
11 | 11 | <option <?php selected($type_next, !empty($meta['actions']['type_next']) ? $meta['actions']['type_next'] : '', true); ?> value="<?php echo $type_next; ?>"><?php echo $type_next; ?></option> |
12 | 12 | <?php endforeach; ?> |
13 | 13 | <?php endif; ?> |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | <input <?php echo (!empty($meta) && !empty($meta['actions']) && !empty($meta['actions']['type_next']) && 'link' != $meta['actions']['type_next']) ? 'style="display: none;" disabled' : ''; ?> type="text" id="next" class="wpeo-next wpeo-bubble-next-link" name="meta[actions][next]" value="<?php echo !empty($meta['actions']['next']) ? $meta['actions']['next'] : ""; ?>" /> |
20 | 20 | |
21 | 21 | <!-- For Bubble --> |
22 | - <?php if(!empty($array_bubbles)): ?> |
|
22 | + <?php if (!empty($array_bubbles)): ?> |
|
23 | 23 | <select <?php echo ((!empty($meta) && !empty($meta['actions']) && !empty($meta['actions']['type_next']) && 'bubble' != $meta['actions']['type_next'])) || empty($meta['actions']) ? 'style="display: none;" disabled' : ''; ?> class="wpeo-next wpeo-bubble-next-bubble" id="next" name="meta[actions][next]"> |
24 | - <?php foreach($array_bubbles as $bubble): ?> |
|
24 | + <?php foreach ($array_bubbles as $bubble): ?> |
|
25 | 25 | <option <?php selected($bubble->post_name, !empty($meta['actions']['next']) ? $meta['actions']['next'] : '', true); ?> value="<?php echo $bubble->post_name; ?>"><?php echo $bubble->post_title . ' (' . $bubble->post_name . ')'; ?></option> |
26 | 26 | <?php endforeach; ?> |
27 | 27 | </select> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <label for="use_next_button"><span><?php _e("Use next button", self::$name_i18n); ?></span> |
4 | 6 | <input type="checkbox" name="meta[actions][use_next_button]" id="use_next_button" <?php echo (!empty($meta['actions']['use_next_button'])) ? 'checked="checked"' : ''; ?> > |
@@ -25,7 +27,10 @@ discard block |
||
25 | 27 | <option <?php selected($bubble->post_name, !empty($meta['actions']['next']) ? $meta['actions']['next'] : '', true); ?> value="<?php echo $bubble->post_name; ?>"><?php echo $bubble->post_title . ' (' . $bubble->post_name . ')'; ?></option> |
26 | 28 | <?php endforeach; ?> |
27 | 29 | </select> |
28 | - <?php else: ?> |
|
29 | - <p><?php _e("No bubble found", self::$name_i18n); ?></p> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
32 | + <p><?php _e("No bubble found", self::$name_i18n); |
|
33 | +} |
|
34 | +?></p> |
|
30 | 35 | <?php endif; ?> |
31 | 36 | </label> |
@@ -1,16 +1,16 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <label for="page"><span><?php _e("Page", self::$name_i18n); ?></span> |
4 | 4 | <select class="wpeo-bubble-select-page" name="meta[position][page]"> |
5 | - <?php if(!empty($array_pages)): ?> |
|
6 | - <?php foreach($array_pages as $key => $page): ?> |
|
5 | + <?php if (!empty($array_pages)): ?> |
|
6 | + <?php foreach ($array_pages as $key => $page): ?> |
|
7 | 7 | <option <?php selected($key, !empty($meta['position']['page']) ? $meta['position']['page'] : 'menu-dashboard', true); ?> value="<?php echo $key; ?>"><?php echo str_replace('0', '', $page . ' (' . $key . ')'); ?></option> |
8 | 8 | <?php endforeach; ?> |
9 | 9 | <?php endif; ?> |
10 | 10 | </select> |
11 | 11 | </label> |
12 | 12 | |
13 | -<label for="filter"><span><?php _e("Filter" ,self::$name_i18n); ?></span> |
|
13 | +<label for="filter"><span><?php _e("Filter", self::$name_i18n); ?></span> |
|
14 | 14 | <input type="text" id="filter" name="meta[position][filter]" value="<?php echo !empty($meta['position']['filter']) ? $meta['position']['filter'] : ""; ?>" /> |
15 | 15 | </label> |
16 | 16 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,14 +1,14 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <input type="hidden" class="wpeo-bubble-url-key" value="<?php echo !empty($meta['urls']) ? count($meta['urls']) : 1; ?>" /> |
4 | 4 | <ul class="wpeo-bubble-urls"> |
5 | - <?php if(!empty($meta['urls'])): ?> |
|
6 | - <?php foreach($meta['urls'] as $key => $url): ?> |
|
7 | - <?php require( wpsBubbleTemplate_ctr::get_template_part( WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
|
5 | + <?php if (!empty($meta['urls'])): ?> |
|
6 | + <?php foreach ($meta['urls'] as $key => $url): ?> |
|
7 | + <?php require(wpsBubbleTemplate_ctr::get_template_part(WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
|
8 | 8 | <?php endforeach; ?> |
9 | 9 | <?php else: ?> |
10 | 10 | <?php $key = 0; $url = array('paramater' => '', 'value' => ''); ?> |
11 | - <?php require( wpsBubbleTemplate_ctr::get_template_part( WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
|
11 | + <?php require(wpsBubbleTemplate_ctr::get_template_part(WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
|
12 | 12 | <?php endif; ?> |
13 | 13 | </ul> |
14 | 14 | <span class="dashicons dashicons-plus-alt wpeo-bubble-add-url"></span> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <input type="hidden" class="wpeo-bubble-url-key" value="<?php echo !empty($meta['urls']) ? count($meta['urls']) : 1; ?>" /> |
4 | 6 | <ul class="wpeo-bubble-urls"> |
@@ -6,8 +8,11 @@ discard block |
||
6 | 8 | <?php foreach($meta['urls'] as $key => $url): ?> |
7 | 9 | <?php require( wpsBubbleTemplate_ctr::get_template_part( WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
8 | 10 | <?php endforeach; ?> |
9 | - <?php else: ?> |
|
10 | - <?php $key = 0; $url = array('paramater' => '', 'value' => ''); ?> |
|
11 | + <?php else { |
|
12 | + : ?> |
|
13 | + <?php $key = 0; |
|
14 | +} |
|
15 | +$url = array('paramater' => '', 'value' => ''); ?> |
|
11 | 16 | <?php require( wpsBubbleTemplate_ctr::get_template_part( WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input')); ?> |
12 | 17 | <?php endif; ?> |
13 | 18 | </ul> |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** Create a new product */ |
3 | 3 | __('Create a new product', $this->name_i18n); |
4 | 4 | __('As a Wordpress page or article, you must: |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** Create a new product */ |
3 | 5 | __('Create a new product', $this->name_i18n); |
4 | 6 | __('As a Wordpress page or article, you must: |