@@ -1,4 +1,7 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit;?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | <hr/> |
3 | 6 | <div class="wps-quotation-addon-state-message-container" ></div> |
4 | 7 | <div class="wps-quotation-addon-state-container" > |
@@ -1,8 +1,8 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit;?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | <hr/> |
3 | 3 | <div class="wps-quotation-addon-state-message-container" ></div> |
4 | 4 | <div class="wps-quotation-addon-state-container" > |
5 | - <?php printf( __( 'Extend WPShop basic quotation functionnality with %1$sour quotation extra module%2$s', 'wpshop' ), '<a target="shop_eoxia_quotaion_addon" href="' . $quotation_module_def[ 'PluginURI' ] . '" >', '</a>' ); ?><br/> |
|
6 | - <?php _e( 'Already have bought the module? Simply type your code below to activate module', 'wpshop' ); ?> |
|
7 | - <input type="text" name="wps-quotation-check-code-value" id="wps-quotation-check-code-value" value="" placeholder="<?php _e( 'Type your code here', 'wpshop' ); ?>" /><button class="wps-bton-mini-third-rounded wps-bton-loading" data-nonce="<?php echo wp_create_nonce( 'check_code_for_activation' ); ?>" id="wps-quotation-check-code-button" ><?php _e( 'Check code', 'wpshop' ); ?></button> |
|
5 | + <?php printf(__('Extend WPShop basic quotation functionnality with %1$sour quotation extra module%2$s', 'wpshop'), '<a target="shop_eoxia_quotaion_addon" href="' . $quotation_module_def['PluginURI'] . '" >', '</a>'); ?><br/> |
|
6 | + <?php _e('Already have bought the module? Simply type your code below to activate module', 'wpshop'); ?> |
|
7 | + <input type="text" name="wps-quotation-check-code-value" id="wps-quotation-check-code-value" value="" placeholder="<?php _e('Type your code here', 'wpshop'); ?>" /><button class="wps-bton-mini-third-rounded wps-bton-loading" data-nonce="<?php echo wp_create_nonce('check_code_for_activation'); ?>" id="wps-quotation-check-code-button" ><?php _e('Check code', 'wpshop'); ?></button> |
|
8 | 8 | </div> |
@@ -1,22 +1,22 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | 3 | /** |
4 | 4 | * Define the current version for the plugin. Interresting for clear cache for plugin style and script |
5 | 5 | * @var string Plugin current version number |
6 | 6 | */ |
7 | -DEFINE( 'WPS_QUOTATION_VERSION', '1.0'); |
|
7 | +DEFINE('WPS_QUOTATION_VERSION', '1.0'); |
|
8 | 8 | |
9 | 9 | /** Définition des constantes pour le module / Define constant for module */ |
10 | -DEFINE( 'WPS_QUOTATION_DIR', basename(dirname(__FILE__))); |
|
11 | -DEFINE( 'WPS_QUOTATION_PATH_TO_MODULE', str_replace( str_replace( "\\", "/", WP_PLUGIN_DIR ), "", str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ) ); |
|
12 | -DEFINE( 'WPS_QUOTATION_PATH', str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ); |
|
13 | -DEFINE( 'WPS_QUOTATION_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_QUOTATION_PATH ) ); |
|
10 | +DEFINE('WPS_QUOTATION_DIR', basename(dirname(__FILE__))); |
|
11 | +DEFINE('WPS_QUOTATION_PATH_TO_MODULE', str_replace(str_replace("\\", "/", WP_PLUGIN_DIR), "", str_replace("\\", "/", plugin_dir_path(__FILE__)))); |
|
12 | +DEFINE('WPS_QUOTATION_PATH', str_replace("\\", "/", plugin_dir_path(__FILE__))); |
|
13 | +DEFINE('WPS_QUOTATION_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_QUOTATION_PATH)); |
|
14 | 14 | |
15 | 15 | /** Définition du chemin absolu vers les templates / Define the templates absolute directories */ |
16 | -DEFINE( 'WPS_QUOTATION_TEMPLATES_MAIN_DIR', WPS_QUOTATION_PATH . '/templates/'); |
|
16 | +DEFINE('WPS_QUOTATION_TEMPLATES_MAIN_DIR', WPS_QUOTATION_PATH . '/templates/'); |
|
17 | 17 | |
18 | -load_plugin_textdomain( 'wps_quotation', false, basename(dirname(__FILE__)).'/languages/'); |
|
18 | +load_plugin_textdomain('wps_quotation', false, basename(dirname(__FILE__)) . '/languages/'); |
|
19 | 19 | |
20 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_quotation_backend_ctr.php' ); |
|
20 | +include(plugin_dir_path(__FILE__) . '/controller/wps_quotation_backend_ctr.php'); |
|
21 | 21 | |
22 | 22 | new wps_quotation_backend_ctr(); |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /** |
4 | 6 | * Define the current version for the plugin. Interresting for clear cache for plugin style and script |
@@ -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 | * Bootstrap file for plugin. Do main includes and create new instance for plugin components |
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,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if(!empty($this->array_bubble)): ?> |
3 | 5 | <script type="text/javascript"> |
4 | 6 | /* <![CDATA[ */ |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | jQuery(document).ready(function() { |
8 | 8 | <?php foreach($this->array_bubble as $key => $bubble): ?> |
9 | 9 | <?php |
10 | - $meta = get_post_meta($bubble->ID, $this->post_metakey, true); |
|
11 | - if( !empty( $meta ) ) : |
|
12 | - $data_next = (!empty($meta) && !empty($meta['actions']['next'])) ? $meta['actions']['next'] : ''; |
|
13 | - $button_next = (!empty($meta) && !empty($meta['actions']['use_next_button'])) ? '<input data-name="wpeo_bubble_' . $bubble->post_name . '" data-action="' . $meta['actions']['type_next'] . '" data-nonce="' . wp_create_nonce( 'dismiss_my_pointer' ) . '" data-next="' . $data_next . '" type="button" class="button-primary wpeo-bubble-next" value="' . __('Next', self::$name_i18n) . '" />' : ''; |
|
14 | - $content = $this->format_string_php_to_js("<h3>" . $bubble->post_title . "</h3><p>" . $bubble->post_content . "<br />" . $button_next . "</p>"); |
|
15 | - ?> |
|
10 | + $meta = get_post_meta($bubble->ID, $this->post_metakey, true); |
|
11 | + if( !empty( $meta ) ) : |
|
12 | + $data_next = (!empty($meta) && !empty($meta['actions']['next'])) ? $meta['actions']['next'] : ''; |
|
13 | + $button_next = (!empty($meta) && !empty($meta['actions']['use_next_button'])) ? '<input data-name="wpeo_bubble_' . $bubble->post_name . '" data-action="' . $meta['actions']['type_next'] . '" data-nonce="' . wp_create_nonce( 'dismiss_my_pointer' ) . '" data-next="' . $data_next . '" type="button" class="button-primary wpeo-bubble-next" value="' . __('Next', self::$name_i18n) . '" />' : ''; |
|
14 | + $content = $this->format_string_php_to_js("<h3>" . $bubble->post_title . "</h3><p>" . $bubble->post_content . "<br />" . $button_next . "</p>"); |
|
15 | + ?> |
|
16 | 16 | <?php $meta = get_post_meta($bubble->ID, $this->post_metakey, true); ?> |
17 | 17 | $('<?php echo $meta['position']["anchor_id"]; ?>').pointer({ |
18 | 18 | content: '<?php echo $content; ?>', |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | }).pointer('open'); |
31 | 31 | /** Unset */ |
32 | 32 | <?php |
33 | - unset($data_next); |
|
34 | - unset($button_next); |
|
35 | - ?> |
|
33 | + unset($data_next); |
|
34 | + unset($button_next); |
|
35 | + ?> |
|
36 | 36 | /** Get first pointer */ |
37 | 37 | if("" === first_pointer && "" != $('.wpeo_bubble_<?php echo $bubble->post_name; ?>').text()) { |
38 | 38 | first_pointer = '<?php echo $bubble->post_name; ?>'; |
@@ -1,16 +1,16 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if(!empty($this->array_bubble)): ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($this->array_bubble)): ?> |
|
3 | 3 | <script type="text/javascript"> |
4 | 4 | /* <![CDATA[ */ |
5 | 5 | ( function($) { |
6 | 6 | var first_pointer = ""; |
7 | 7 | jQuery(document).ready(function() { |
8 | - <?php foreach($this->array_bubble as $key => $bubble): ?> |
|
8 | + <?php foreach ($this->array_bubble as $key => $bubble): ?> |
|
9 | 9 | <?php |
10 | 10 | $meta = get_post_meta($bubble->ID, $this->post_metakey, true); |
11 | - if( !empty( $meta ) ) : |
|
11 | + if (!empty($meta)) : |
|
12 | 12 | $data_next = (!empty($meta) && !empty($meta['actions']['next'])) ? $meta['actions']['next'] : ''; |
13 | - $button_next = (!empty($meta) && !empty($meta['actions']['use_next_button'])) ? '<input data-name="wpeo_bubble_' . $bubble->post_name . '" data-action="' . $meta['actions']['type_next'] . '" data-nonce="' . wp_create_nonce( 'dismiss_my_pointer' ) . '" data-next="' . $data_next . '" type="button" class="button-primary wpeo-bubble-next" value="' . __('Next', self::$name_i18n) . '" />' : ''; |
|
13 | + $button_next = (!empty($meta) && !empty($meta['actions']['use_next_button'])) ? '<input data-name="wpeo_bubble_' . $bubble->post_name . '" data-action="' . $meta['actions']['type_next'] . '" data-nonce="' . wp_create_nonce('dismiss_my_pointer') . '" data-next="' . $data_next . '" type="button" class="button-primary wpeo-bubble-next" value="' . __('Next', self::$name_i18n) . '" />' : ''; |
|
14 | 14 | $content = $this->format_string_php_to_js("<h3>" . $bubble->post_title . "</h3><p>" . $bubble->post_content . "<br />" . $button_next . "</p>"); |
15 | 15 | ?> |
16 | 16 | <?php $meta = get_post_meta($bubble->ID, $this->post_metakey, true); ?> |
@@ -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 | <label for="page"><span><?php _e("Page", self::$name_i18n); ?></span> |
4 | 6 | <select class="wpeo-bubble-select-page" name="meta[position][page]"> |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <li> |
4 | 4 | <h4><?php _e("Url", self::$name_i18n); ?> #<span><?php echo $key; ?></span></h4> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <li> |
4 | 6 | <h4><?php _e("Url", self::$name_i18n); ?> #<span><?php echo $key; ?></span></h4> |