Completed
Pull Request — master (#2)
by Jimmy
1216:52 queued 1185:43
created
includes/modules/wps_media_manager/wps_media_manager.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 DEFINE('WPS_MEDIA_MANAGER_DIR', basename(dirname(__FILE__)));
4
-DEFINE('WPS_MEDIA_MANAGER_PATH', str_replace( "\\", "/", str_replace( WPS_MEDIA_MANAGER_DIR, "", dirname( __FILE__ ) ) ) );
5
-DEFINE('WPS_MEDIA_MANAGER_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_MEDIA_MANAGER_PATH ) );
4
+DEFINE('WPS_MEDIA_MANAGER_PATH', str_replace("\\", "/", str_replace(WPS_MEDIA_MANAGER_DIR, "", dirname(__FILE__))));
5
+DEFINE('WPS_MEDIA_MANAGER_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_MEDIA_MANAGER_PATH));
6 6
 
7 7
 DEFINE('WPS_MEDIA_MANAGER_TEMPLATE_DIR', WPS_MEDIA_MANAGER_PATH . WPS_MEDIA_MANAGER_DIR . "/templates/");
8 8
 
9
-load_plugin_textdomain( 'wps_media_manager', false, basename(dirname(__FILE__)).'/languages/');
9
+load_plugin_textdomain('wps_media_manager', false, basename(dirname(__FILE__)) . '/languages/');
10 10
 
11
-include( plugin_dir_path( __FILE__ ).'/controller/wps_media_manager_backend_ctr.php' );
12
-include( plugin_dir_path( __FILE__ ).'/controller/wps_media_manager_frontend_ctr.php' );
11
+include(plugin_dir_path(__FILE__) . '/controller/wps_media_manager_backend_ctr.php');
12
+include(plugin_dir_path(__FILE__) . '/controller/wps_media_manager_frontend_ctr.php');
13 13
 
14 14
 new wps_media_manager_backend_ctr();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
includes/modules/wps_cart/templates/frontend/mini-cart/mini-cart.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wps-header-mini-cart wps-cart-activator">
4 4
 	<div class="wps-mini-cart-header">
5
-		<a href="<?php echo get_permalink( wpshop_tools::get_page_id( get_option('wpshop_checkout_page_id ') ) ); ?>" class="wps-mini-cart-opener">
6
-			<?php _e( 'My cart', 'wpshop' ); ?>
5
+		<a href="<?php echo get_permalink(wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id '))); ?>" class="wps-mini-cart-opener">
6
+			<?php _e('My cart', 'wpshop'); ?>
7 7
 			<i class="wps-icon-basket"></i>
8 8
 			<?php echo do_shortcode('[wps-numeration-cart]'); ?>
9 9
 		</a>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
modules/wps_cart/templates/frontend/mini-cart/mini-cart-content.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <span class="wps-mini-cart-body-title">
4 6
 <strong><?php echo $total_cart_item; ?></strong><?php _e( 'item(s)', 'wpshop'); ?><span><strong><?php echo number_format( $total_cart, 2, '.', ''); ?></strong><?php echo $currency; ?></span>
@@ -12,8 +14,7 @@  discard block
 block discarded – undo
12 14
 				$parent_post = $parent_def['parent_post'];
13 15
 				$item_id = $parent_post->ID;
14 16
 				$item_title =  $parent_post->post_title;
15
-			}
16
-			else {
17
+			} else {
17 18
 				$item_title = $item['item_name'];
18 19
 			}
19 20
 			?>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <span class="wps-mini-cart-body-title">
4
-<strong><?php echo $total_cart_item; ?></strong><?php _e( 'item(s)', 'wpshop'); ?><span><strong><?php echo number_format( $total_cart, 2, '.', ''); ?></strong><?php echo $currency; ?></span>
4
+<strong><?php echo $total_cart_item; ?></strong><?php _e('item(s)', 'wpshop'); ?><span><strong><?php echo number_format($total_cart, 2, '.', ''); ?></strong><?php echo $currency; ?></span>
5 5
 </span>
6 6
 <div class="wps-cart-resume">
7 7
 	<ul class="wps-fullcart">
8
-		<?php foreach( $cart_items as $item_id => $item ) :
9
-			$item_post_type = get_post_type( $item_id );
10
-			if ( $item_post_type == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION ) {
11
-				$parent_def = wpshop_products::get_parent_variation( $item_id );
8
+		<?php foreach ($cart_items as $item_id => $item) :
9
+			$item_post_type = get_post_type($item_id);
10
+			if ($item_post_type == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION) {
11
+				$parent_def = wpshop_products::get_parent_variation($item_id);
12 12
 				$parent_post = $parent_def['parent_post'];
13 13
 				$item_id = $parent_post->ID;
14
-				$item_title =  $parent_post->post_title;
14
+				$item_title = $parent_post->post_title;
15 15
 			}
16 16
 			else {
17 17
 				$item_title = $item['item_name'];
@@ -19,30 +19,30 @@  discard block
 block discarded – undo
19 19
 			?>
20 20
 			<li class="wps-clearfix" id="wps_min_cart_product_<?php echo $item['item_id']; ?>">
21 21
 				<div class="wps-cart-item-img">
22
-					<a href="<?php echo get_permalink( $item_id ); ?>" title="<?php echo $item_title; ?>">
23
-						<?php echo get_the_post_thumbnail( $item_id, 'thumbnail', array('class' => 'wps-circlerounded') ); ?>
22
+					<a href="<?php echo get_permalink($item_id); ?>" title="<?php echo $item_title; ?>">
23
+						<?php echo get_the_post_thumbnail($item_id, 'thumbnail', array('class' => 'wps-circlerounded')); ?>
24 24
 					</a>
25 25
 				</div>
26 26
 				<div class="wps-cart-item-content">
27
-					<a href="<?php echo get_permalink( $item_id ); ?>" title="<?php echo $item_title; ?>">
27
+					<a href="<?php echo get_permalink($item_id); ?>" title="<?php echo $item_title; ?>">
28 28
 						<?php echo $item_title; ?>
29 29
 					</a>
30 30
 				</div>
31 31
 				<div class="wps-cart-item-price">
32
-			    	<span class="wps-price"><?php echo wpshop_tools::formate_number( $item['item_total_ttc'] ); ?> <span><?php echo $currency; ?></span></span>
33
-			    	<span class="wps-tva"><?php _e( 'ATI', 'wpshop'); ?></span><br>
32
+			    	<span class="wps-price"><?php echo wpshop_tools::formate_number($item['item_total_ttc']); ?> <span><?php echo $currency; ?></span></span>
33
+			    	<span class="wps-tva"><?php _e('ATI', 'wpshop'); ?></span><br>
34 34
 				</div>
35 35
 				<div class="wps-cart-item-close">
36
-					<button type="button" class="wps-bton-icon-close wps_mini_cart_delete_product" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>"></button>
36
+					<button type="button" class="wps-bton-icon-close wps_mini_cart_delete_product" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>"></button>
37 37
 				</div>
38 38
 			</li>
39 39
 		<?php endforeach; ?>
40 40
 	</ul>
41
-	<p><?php _e( 'Shipping cost ATI', 'wpshop'); ?><span class="wps-alignRight"><strong><?php echo wpshop_tools::formate_number( $shipping_cost_ati ); ?></strong><?php echo $currency; ?></span></p>
42
-	<?php if ( !empty( $cart_content['coupon_id']) ) : ?>
43
-		<p><?php _e( 'Total ATI before discount', 'wpshop'); ?><span class="wps-alignRight"><strong><?php echo wpshop_tools::formate_number( $order_total_before_discount ); ?></strong><?php echo $currency; ?></span></p>
44
-		<p><?php _e( 'Discount', 'wpshop'); ?><span class="wps-inline-alignRight"><strong><?php echo wpshop_tools::formate_number( $coupon_value ); ?></strong><?php echo $currency; ?></span></p>
41
+	<p><?php _e('Shipping cost ATI', 'wpshop'); ?><span class="wps-alignRight"><strong><?php echo wpshop_tools::formate_number($shipping_cost_ati); ?></strong><?php echo $currency; ?></span></p>
42
+	<?php if (!empty($cart_content['coupon_id'])) : ?>
43
+		<p><?php _e('Total ATI before discount', 'wpshop'); ?><span class="wps-alignRight"><strong><?php echo wpshop_tools::formate_number($order_total_before_discount); ?></strong><?php echo $currency; ?></span></p>
44
+		<p><?php _e('Discount', 'wpshop'); ?><span class="wps-inline-alignRight"><strong><?php echo wpshop_tools::formate_number($coupon_value); ?></strong><?php echo $currency; ?></span></p>
45 45
 	<?php endif; ?>
46
-	<p class="wps-hightlight"><?php _e( 'Total ATI', 'wpshop'); ?><span class="wps-inline-alignRight"><strong><?php echo wpshop_tools::formate_number( $total_ati ); ?></strong><?php echo $currency; ?></span></p>
47
-	<a href="<?php echo get_permalink( wpshop_tools::get_page_id( get_option('wpshop_checkout_page_id') ) ); ?>" role="button" class="wps-bton-first"><?php _e( 'Order', 'wpshop' ); ?></a>
46
+	<p class="wps-hightlight"><?php _e('Total ATI', 'wpshop'); ?><span class="wps-inline-alignRight"><strong><?php echo wpshop_tools::formate_number($total_ati); ?></strong><?php echo $currency; ?></span></p>
47
+	<a href="<?php echo get_permalink(wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'))); ?>" role="button" class="wps-bton-first"><?php _e('Order', 'wpshop'); ?></a>
48 48
 </div>
Please login to merge, or discard this patch.
includes/modules/wps_cart/templates/frontend/cart/cart.php 2 patches
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
  if( !$account_origin ) : ?>
3 5
 <div id="wps_cart_error_container" class="wps-alert-error"></div>
4 6
 <?php endif; ?>
@@ -37,8 +39,9 @@  discard block
 block discarded – undo
37 39
 			if ( count($product_attribute_order_detail) > 0  && is_array($product_attribute_order_detail) ) {
38 40
 				foreach ( $product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) {
39 41
 					foreach ( $product_attr_group_detail['attribut'] as $position => $attribute_def) {
40
-						if ( !empty($attribute_def->code) )
41
-							$output_order[$attribute_def->code] = $position;
42
+						if ( !empty($attribute_def->code) ) {
43
+													$output_order[$attribute_def->code] = $position;
44
+						}
42 45
 					}
43 46
 				}
44 47
 			}
@@ -89,8 +92,7 @@  discard block
 block discarded – undo
89 92
 					$item_id_component = explode( "__", $item_id_for_download );
90 93
 					if ( !empty( $item_id_component ) && ( $item_id_component[ 0 ] != $item_id_for_download ) ) {
91 94
 						$item_id_for_download = $item_id_component[ 0 ];
92
-					}
93
-					else if ( !empty( $download_codes[ $item['item_id'] ] ) ) {
95
+					} else if ( !empty( $download_codes[ $item['item_id'] ] ) ) {
94 96
 						$item_id_for_download = $item['item_id'];
95 97
 					}
96 98
 				}
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,55 +1,55 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if( !$account_origin ) : ?>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!$account_origin) : ?>
3 3
 <div id="wps_cart_error_container" class="wps-alert-error"></div>
4 4
 <?php endif; ?>
5 5
 <ul class="wps-fullcart">
6 6
 	<li class="wps-clearfix cart_header">
7 7
 		<div class="wps-cart-item-img"></div>
8 8
 
9
-		<div class="wps-cart-item-content"><?php _e( 'Product name', 'wpshop'); ?></div>
9
+		<div class="wps-cart-item-content"><?php _e('Product name', 'wpshop'); ?></div>
10 10
 
11
-		<?php if( $cart_option == 'full_cart' || $cart_option == 'simplified_ati' ) : ?>
12
-		<div class="wps-cart-item-unit-price"><?php _e( 'P.U', 'wpshop' ); ?></div>
11
+		<?php if ($cart_option == 'full_cart' || $cart_option == 'simplified_ati') : ?>
12
+		<div class="wps-cart-item-unit-price"><?php _e('P.U', 'wpshop'); ?></div>
13 13
 		<?php endif; ?>
14
-		<?php if( $cart_option == 'simplified_et' ) : ?>
15
-		<div class="wps-cart-item-unit-price"><?php _e( 'Unit price ET', 'wpshop' ); ?></div>
14
+		<?php if ($cart_option == 'simplified_et') : ?>
15
+		<div class="wps-cart-item-unit-price"><?php _e('Unit price ET', 'wpshop'); ?></div>
16 16
 		<?php endif; ?>
17 17
 
18
-		<div class="wps-cart-item-quantity"><?php _e( 'Qty', 'wpshop'); ?></div>
18
+		<div class="wps-cart-item-quantity"><?php _e('Qty', 'wpshop'); ?></div>
19 19
 
20
-		<?php if( $cart_option == 'full_cart' || $cart_option == 'simplified_ati' ) : ?>
21
-		<div class="wps-cart-item-price"><?php _e( 'Total', 'wpshop' ); ?></div>
20
+		<?php if ($cart_option == 'full_cart' || $cart_option == 'simplified_ati') : ?>
21
+		<div class="wps-cart-item-price"><?php _e('Total', 'wpshop'); ?></div>
22 22
 		<?php endif; ?>
23
-		<?php if( $cart_option == 'simplified_et' ) : ?>
24
-		<div class="wps-cart-item-price"><?php _e( 'Total ET', 'wpshop' ); ?></div>
23
+		<?php if ($cart_option == 'simplified_et') : ?>
24
+		<div class="wps-cart-item-price"><?php _e('Total ET', 'wpshop'); ?></div>
25 25
 		<?php endif; ?>
26
-		<?php if ( empty($cart_type) || ( !empty($cart_type) && $cart_type != 'summary' ) ) : ?>
26
+		<?php if (empty($cart_type) || (!empty($cart_type) && $cart_type != 'summary')) : ?>
27 27
 		<div class="wps-cart-item-close"></div>
28 28
 		<?php endif; ?>
29 29
 	</li>
30 30
 	<?php
31
-		foreach( $cart_items as $item_id => $item ) :
31
+		foreach ($cart_items as $item_id => $item) :
32 32
 			$product_key = $item_id;
33 33
 			/** Check if it's a product or a variation **/
34
-			$item_post_type = get_post_type( $item['item_id'] );
35
-			$product_attribute_order_detail = wpshop_attributes_set::getAttributeSetDetails( get_post_meta($item['item_id'], WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY, true)  ) ;
34
+			$item_post_type = get_post_type($item['item_id']);
35
+			$product_attribute_order_detail = wpshop_attributes_set::getAttributeSetDetails(get_post_meta($item['item_id'], WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY, true));
36 36
 			$output_order = array();
37
-			if ( count($product_attribute_order_detail) > 0  && is_array($product_attribute_order_detail) ) {
38
-				foreach ( $product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) {
39
-					foreach ( $product_attr_group_detail['attribut'] as $position => $attribute_def) {
40
-						if ( !empty($attribute_def->code) )
37
+			if (count($product_attribute_order_detail) > 0 && is_array($product_attribute_order_detail)) {
38
+				foreach ($product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) {
39
+					foreach ($product_attr_group_detail['attribut'] as $position => $attribute_def) {
40
+						if (!empty($attribute_def->code))
41 41
 							$output_order[$attribute_def->code] = $position;
42 42
 					}
43 43
 				}
44 44
 			}
45
-			$variation_attribute_ordered = wpshop_products::get_selected_variation_display( $item['item_meta'], $output_order, 'cart' );
45
+			$variation_attribute_ordered = wpshop_products::get_selected_variation_display($item['item_meta'], $output_order, 'cart');
46 46
 			ksort($variation_attribute_ordered['attribute_list']);
47 47
 			$variations_indicator = '';
48
-			if( !empty($variation_attribute_ordered['attribute_list']) ) {
48
+			if (!empty($variation_attribute_ordered['attribute_list'])) {
49 49
 
50 50
 				$variations_indicator .= '<ul class="wps-cart-item-variations" >';
51
-				foreach ( $variation_attribute_ordered['attribute_list'] as $attribute_variation_to_output ) {
52
-					if ( !empty($attribute_variation_to_output) ) {
51
+				foreach ($variation_attribute_ordered['attribute_list'] as $attribute_variation_to_output) {
52
+					if (!empty($attribute_variation_to_output)) {
53 53
 						$variations_indicator .= $attribute_variation_to_output;
54 54
 					}
55 55
 				}
@@ -59,61 +59,61 @@  discard block
 block discarded – undo
59 59
 			$parent_def = array();
60 60
 			$item_title = $item['item_name'];
61 61
 			$item_id = $item['item_id'];
62
-			if ( $item_post_type == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION ) {
63
-				$parent_def = wpshop_products::get_parent_variation( $item['item_id'] );
64
-				if( !empty($parent_def) && !empty($parent_def['parent_post']) ) {
62
+			if ($item_post_type == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION) {
63
+				$parent_def = wpshop_products::get_parent_variation($item['item_id']);
64
+				if (!empty($parent_def) && !empty($parent_def['parent_post'])) {
65 65
 					$parent_post = $parent_def['parent_post'];
66 66
 					$item_id = $parent_post->ID;
67
-					$item_title =  $parent_post->post_title;
67
+					$item_title = $parent_post->post_title;
68 68
 				}
69 69
 			}
70 70
 
71 71
 			/** Downloadable link in Order recap **/
72 72
 			$download_link = '';
73
-			if( !empty($parent_def) ) {
73
+			if (!empty($parent_def)) {
74 74
 				$parent_meta = $parent_def['parent_post_meta'];
75
-				if ( !empty($parent_meta['is_downloadable_']) ) {
76
-					$query = $wpdb->prepare( 'SELECT value FROM '. WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS .' WHERE id = %d', $parent_meta['is_downloadable_'] );
77
-					$downloadable_option_value = $wpdb->get_var( $query );
78
-					if ( !empty( $downloadable_option_value) ) {
75
+				if (!empty($parent_meta['is_downloadable_'])) {
76
+					$query = $wpdb->prepare('SELECT value FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE id = %d', $parent_meta['is_downloadable_']);
77
+					$downloadable_option_value = $wpdb->get_var($query);
78
+					if (!empty($downloadable_option_value)) {
79 79
 						$item['item_is_downloadable_'] = $downloadable_option_value;
80 80
 					}
81 81
 				}
82 82
 			}
83 83
 
84
-			if ( !empty($item) && !empty($item['item_is_downloadable_']) && ( strtolower( __( $item['item_is_downloadable_'], 'wpshop') ) == strtolower( __('Yes', 'wpshop') ) ) ) {
84
+			if (!empty($item) && !empty($item['item_is_downloadable_']) && (strtolower(__($item['item_is_downloadable_'], 'wpshop')) == strtolower(__('Yes', 'wpshop')))) {
85 85
 				$item_id_for_download = $item_id;
86
-				$download_codes = get_user_meta( get_current_user_id(), '_order_download_codes_'.$oid, true);
86
+				$download_codes = get_user_meta(get_current_user_id(), '_order_download_codes_' . $oid, true);
87 87
 				/**	Check if the current product exist into download code list, if not check if there is a composition between parent product and children product	*/
88
-				if ( empty( $download_codes[$item_id_for_download] ) ) {
89
-					$item_id_component = explode( "__", $item_id_for_download );
90
-					if ( !empty( $item_id_component ) && ( $item_id_component[ 0 ] != $item_id_for_download ) ) {
91
-						$item_id_for_download = $item_id_component[ 0 ];
88
+				if (empty($download_codes[$item_id_for_download])) {
89
+					$item_id_component = explode("__", $item_id_for_download);
90
+					if (!empty($item_id_component) && ($item_id_component[0] != $item_id_for_download)) {
91
+						$item_id_for_download = $item_id_component[0];
92 92
 					}
93
-					else if ( !empty( $download_codes[ $item['item_id'] ] ) ) {
93
+					else if (!empty($download_codes[$item['item_id']])) {
94 94
 						$item_id_for_download = $item['item_id'];
95 95
 					}
96 96
 				}
97 97
 
98
-				if ( !empty($download_codes) && !empty($download_codes[$item_id_for_download]) && !empty($download_codes[$item_id_for_download]['download_code']) ) {
99
-					$download_link = '<a href="' .admin_url( 'admin-post.php?action=download_file&amp;oid=' . $oid . '&amp;download=' . $download_codes[$item_id_for_download]['download_code'] ) . '" target="_blank" class="wps-bton-fourth-mini-rounded">' .__('Download the product','wpshop'). '</a>';
98
+				if (!empty($download_codes) && !empty($download_codes[$item_id_for_download]) && !empty($download_codes[$item_id_for_download]['download_code'])) {
99
+					$download_link = '<a href="' . admin_url('admin-post.php?action=download_file&amp;oid=' . $oid . '&amp;download=' . $download_codes[$item_id_for_download]['download_code']) . '" target="_blank" class="wps-bton-fourth-mini-rounded">' . __('Download the product', 'wpshop') . '</a>';
100 100
 				}
101 101
 			}
102 102
 
103 103
 
104 104
 			/**	Check if product is an auto added product : don't display link to product, quantity and remover 	*/
105 105
 			$auto_added_product = false;
106
-			$item_options = get_post_meta( $item_id, '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_options', true );
107
-			if ( !empty($item_options['cart']) && !empty($item_options['cart']['auto_add']) && ($item_options['cart']['auto_add'] == 'yes')) :
106
+			$item_options = get_post_meta($item_id, '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_options', true);
107
+			if (!empty($item_options['cart']) && !empty($item_options['cart']['auto_add']) && ($item_options['cart']['auto_add'] == 'yes')) :
108 108
 				$auto_added_product = true;
109 109
 			endif;
110 110
 
111
-			require( wpshop_tools::get_template_part( WPS_CART_DIR, WPS_CART_TPL_DIR,"frontend", "cart/cart", "item") );
111
+			require(wpshop_tools::get_template_part(WPS_CART_DIR, WPS_CART_TPL_DIR, "frontend", "cart/cart", "item"));
112 112
 		endforeach;
113 113
 	?>
114 114
 </ul>
115
-<?php require_once( wpshop_tools::get_template_part( WPS_CART_DIR, WPS_CART_TPL_DIR,"frontend", "cart/cart", "total") ); ?>
116
-<?php if ( empty($cart_type) || ( !empty($cart_type) && $cart_type != 'summary' ) ) : ?>
117
-<?php echo apply_filters( 'wps_cart_footer_extra_content', ''); ?>
115
+<?php require_once(wpshop_tools::get_template_part(WPS_CART_DIR, WPS_CART_TPL_DIR, "frontend", "cart/cart", "total")); ?>
116
+<?php if (empty($cart_type) || (!empty($cart_type) && $cart_type != 'summary')) : ?>
117
+<?php echo apply_filters('wps_cart_footer_extra_content', ''); ?>
118 118
 <?php endif?>
119 119
 
Please login to merge, or discard this patch.
includes/modules/wps_cart/templates/frontend/cart/cart-item.php 2 patches
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <li class="wps-clearfix" id="wps_product_<?php echo $product_key; ?>">
4 6
 	<div class="wps-cart-item-img">
@@ -46,13 +48,19 @@  discard block
 block discarded – undo
46 48
 				<a href="" class="wps-cart-reduce-product-qty"><i class="wps-icon-minus"></i></a>
47 49
 				<input type="text" name="french-hens" id="wps-cart-product-qty-<?php echo $product_key; ?>" value="<?php echo $item['item_qty']; ?>" class="wps-circlerounded wps-cart-product-qty">
48 50
 				<a href="" class="wps-cart-add-product-qty"><i class="wps-icon-plus"></i></a>
49
-				<?php else : ?>
50
-					<?php echo $item['item_qty']; ?>
51
+				<?php else {
52
+	: ?>
53
+					<?php echo $item['item_qty'];
54
+}
55
+?>
51 56
 				<?php endif;?>
52 57
 		<?php elseif ( $auto_added_product ) : ?>
53 58
 			1
54
-		<?php else : ?>
55
-			<?php echo $item['item_qty']; ?>
59
+		<?php else {
60
+	: ?>
61
+			<?php echo $item['item_qty'];
62
+}
63
+?>
56 64
 		<?php endif; ?>
57 65
 	</div>
58 66
 
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,85 +1,85 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <li class="wps-clearfix" id="wps_product_<?php echo $product_key; ?>">
4 4
 	<div class="wps-cart-item-img">
5
-		<?php if ( !$auto_added_product ) : ?><a href="<?php echo get_permalink( $item_id ); ?>" title="<?php echo $item_title; ?>"><?php endif; ?>
6
-			<?php echo get_the_post_thumbnail($item['item_id'], 'thumbnail' ); ?>
7
-		<?php if ( !$auto_added_product ) : ?></a><?php endif; ?>
5
+		<?php if (!$auto_added_product) : ?><a href="<?php echo get_permalink($item_id); ?>" title="<?php echo $item_title; ?>"><?php endif; ?>
6
+			<?php echo get_the_post_thumbnail($item['item_id'], 'thumbnail'); ?>
7
+		<?php if (!$auto_added_product) : ?></a><?php endif; ?>
8 8
 	</div>
9 9
 	<div class="wps-cart-item-content">
10
-		<?php if ( !$auto_added_product && get_post_status( $item_id ) != 'free_product' ) : ?><a href="<?php echo get_permalink( $item_id ); ?>" title="<?php echo $item_title; ?>"><?php endif; ?>
10
+		<?php if (!$auto_added_product && get_post_status($item_id) != 'free_product') : ?><a href="<?php echo get_permalink($item_id); ?>" title="<?php echo $item_title; ?>"><?php endif; ?>
11 11
 			<?php echo $item_title; ?>
12
-		<?php if ( !$auto_added_product && get_post_status( $item_id ) != 'free_product' ) : ?></a><?php endif; ?>
12
+		<?php if (!$auto_added_product && get_post_status($item_id) != 'free_product') : ?></a><?php endif; ?>
13 13
 
14 14
 		<?php echo $variations_indicator; ?>
15 15
 
16
-		<?php if ( !empty( $cart_content ) && !empty( $cart_content[ 'order_status' ] ) && ( 'completed' == $cart_content[ 'order_status' ] ) && ( empty($cart_type) || ( !empty($cart_type) && $cart_type == 'summary' ) ) ) : ?>
16
+		<?php if (!empty($cart_content) && !empty($cart_content['order_status']) && ('completed' == $cart_content['order_status']) && (empty($cart_type) || (!empty($cart_type) && $cart_type == 'summary'))) : ?>
17 17
 			<?php echo $download_link; ?>
18 18
 		<?php endif; ?>
19 19
 
20
-		<?php echo apply_filters( 'wps_order_item_content_column', '', $item, $oid, $cart_content ); ?>
20
+		<?php echo apply_filters('wps_order_item_content_column', '', $item, $oid, $cart_content); ?>
21 21
 	</div>
22 22
 
23
-	<?php if( $cart_option == 'simplified_et' ) : ?>
23
+	<?php if ($cart_option == 'simplified_et') : ?>
24 24
 	<div class="wps-cart-item-unit-price">
25 25
 		<span class="wps-price">
26 26
 			<?php
27 27
 				$price_ati_to_display = $item['item_pu_ttc'];
28
-				if ( !empty( $item[ 'item_amount_to_pay_now' ] ) ) {
29
-					$price_ati_to_display = $item[ 'item_amount_to_pay_now' ];
28
+				if (!empty($item['item_amount_to_pay_now'])) {
29
+					$price_ati_to_display = $item['item_amount_to_pay_now'];
30 30
 				}
31 31
 			?>
32
-		 <?php echo wpshop_tools::formate_number( $price_ati_to_display ); ?><span><?php echo $currency; ?></span>
32
+		 <?php echo wpshop_tools::formate_number($price_ati_to_display); ?><span><?php echo $currency; ?></span>
33 33
 		</span>
34 34
 	</div>
35 35
 	<?php endif; ?>
36 36
 
37
-	<?php if( $cart_option == 'full_cart' || $cart_option == 'simplified_ati' ) : ?>
37
+	<?php if ($cart_option == 'full_cart' || $cart_option == 'simplified_ati') : ?>
38 38
 	<div class="wps-cart-item-unit-price">
39
-		<span class="wps-price"> <?php echo wpshop_tools::formate_number( $item['item_pu_ttc'] ); ?><span><?php echo $currency; ?></span></span>
39
+		<span class="wps-price"> <?php echo wpshop_tools::formate_number($item['item_pu_ttc']); ?><span><?php echo $currency; ?></span></span>
40 40
 	</div>
41 41
 	<?php endif; ?>
42 42
 
43 43
 	<div class="wps-cart-item-quantity wps-productQtyForm">
44
-		<?php if ( ( empty($cart_type) || ( !empty($cart_type) ) ) && !$auto_added_product  ) : ?>
45
-			<?php if( ( $cart_type != 'admin-panel' || ( $cart_type == 'admin-panel' && ( empty( $cart_content['order_status'] ) || $cart_content['order_status'] == 'awaiting_payment' || ( ( !empty( $cart_content['cart_type'] ) && $cart_content['cart_type'] == 'quotation' ) && $cart_content['order_status'] != 'completed' ) ) ) ) ) : ?>
46
-				<a href="" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" class="wps-cart-reduce-product-qty"><i class="wps-icon-minus"></i></a>
44
+		<?php if ((empty($cart_type) || (!empty($cart_type))) && !$auto_added_product) : ?>
45
+			<?php if (($cart_type != 'admin-panel' || ($cart_type == 'admin-panel' && (empty($cart_content['order_status']) || $cart_content['order_status'] == 'awaiting_payment' || ((!empty($cart_content['cart_type']) && $cart_content['cart_type'] == 'quotation') && $cart_content['order_status'] != 'completed'))))) : ?>
46
+				<a href="" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" class="wps-cart-reduce-product-qty"><i class="wps-icon-minus"></i></a>
47 47
 				<input type="text" name="french-hens" id="wps-cart-product-qty-<?php echo $product_key; ?>" value="<?php echo $item['item_qty']; ?>" class="wps-circlerounded wps-cart-product-qty">
48
-				<a href="" class="wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>"><i class="wps-icon-plus"></i></a>
48
+				<a href="" class="wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>"><i class="wps-icon-plus"></i></a>
49 49
 				<?php else : ?>
50 50
 					<?php echo $item['item_qty']; ?>
51
-				<?php endif;?>
52
-		<?php elseif ( $auto_added_product ) : ?>
51
+				<?php endif; ?>
52
+		<?php elseif ($auto_added_product) : ?>
53 53
 			1
54 54
 		<?php else : ?>
55 55
 			<?php echo $item['item_qty']; ?>
56 56
 		<?php endif; ?>
57 57
 	</div>
58 58
 
59
-	<?php if( $cart_option == 'full_cart' || $cart_option == 'simplified_et' ) : ?>
59
+	<?php if ($cart_option == 'full_cart' || $cart_option == 'simplified_et') : ?>
60 60
 	<div class="wps-cart-item-price">
61
-    	<span class="wps-price"> <?php echo wpshop_tools::formate_number( $item['item_total_ht'] ); ?><span><?php echo $currency; ?></span></span>
62
-    	<span class="wps-tva"><?php _e( 'ET', 'wpshop'); ?></span>
61
+    	<span class="wps-price"> <?php echo wpshop_tools::formate_number($item['item_total_ht']); ?><span><?php echo $currency; ?></span></span>
62
+    	<span class="wps-tva"><?php _e('ET', 'wpshop'); ?></span>
63 63
 	</div>
64 64
 	<?php endif; ?>
65 65
 
66
-	<?php if( $cart_option == 'full_cart' || $cart_option == 'simplified_ati' ) : ?>
66
+	<?php if ($cart_option == 'full_cart' || $cart_option == 'simplified_ati') : ?>
67 67
 	<div class="wps-cart-item-price">
68 68
 			<?php
69 69
 				$price_total_to_display = $item['item_total_ttc'];
70
-				if ( !empty( $item[ 'item_amount_to_pay_now' ] ) ) {
71
-					$price_total_to_display = $item[ 'item_amount_to_pay_now' ] * $item['item_qty'];
70
+				if (!empty($item['item_amount_to_pay_now'])) {
71
+					$price_total_to_display = $item['item_amount_to_pay_now'] * $item['item_qty'];
72 72
 				}
73 73
 			?>
74
-    	<span class="wps-price"> <?php echo wpshop_tools::formate_number( $price_total_to_display ); ?><span><?php echo $currency; ?></span></span>
74
+    	<span class="wps-price"> <?php echo wpshop_tools::formate_number($price_total_to_display); ?><span><?php echo $currency; ?></span></span>
75 75
 	</div>
76 76
 	<?php endif; ?>
77 77
 
78 78
 
79
-	<?php if ( empty($cart_type) || ( !empty($cart_type) && $cart_type != 'summary' ) ) : ?>
79
+	<?php if (empty($cart_type) || (!empty($cart_type) && $cart_type != 'summary')) : ?>
80 80
 	<div class="wps-cart-item-close">
81
-		<?php if( $cart_type != 'admin-panel' || ( $cart_type == 'admin-panel' && ( empty( $cart_content['order_status'] ) || $cart_content['order_status'] == 'awaiting_payment' || ( ( !empty( $cart_content['cart_type'] ) && $cart_content['cart_type'] == 'quotation' ) && $cart_content['order_status'] != 'completed' ) ) ) ) : ?>
82
-		<?php if ( !$auto_added_product ) : ?><button type="button" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" class="wps-bton-icon wps_cart_delete_product" id="wps-close-<?php echo $product_key; ?>"><i class="wps-icon-close"></i></button><?php endif; ?>
81
+		<?php if ($cart_type != 'admin-panel' || ($cart_type == 'admin-panel' && (empty($cart_content['order_status']) || $cart_content['order_status'] == 'awaiting_payment' || ((!empty($cart_content['cart_type']) && $cart_content['cart_type'] == 'quotation') && $cart_content['order_status'] != 'completed')))) : ?>
82
+		<?php if (!$auto_added_product) : ?><button type="button" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" class="wps-bton-icon wps_cart_delete_product" id="wps-close-<?php echo $product_key; ?>"><i class="wps-icon-close"></i></button><?php endif; ?>
83 83
 		<?php endif; ?>
84 84
 	</div>
85 85
 	<?php endif; ?>
Please login to merge, or discard this patch.
includes/modules/wps_cart/templates/frontend/cart/button-add-to-cart.php 2 patches
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,10 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if ( !defined( 'ABSPATH' ) ) exit; ?>
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
4
+ if ( !defined( 'ABSPATH' ) ) {
5
+ 	exit;
6
+ }
7
+ ?>
3 8
 
4 9
 <div class="wps-product-section">
5 10
 	<label><?php _e('Quantity', 'wpshop'); ?></label>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if ( !defined( 'ABSPATH' ) ) exit; ?>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!defined('ABSPATH')) exit; ?>
3 3
 
4 4
 <div class="wps-product-section">
5 5
 	<label><?php _e('Quantity', 'wpshop'); ?></label>
6 6
 	<div class="wps-productQtyForm">
7
-		<?php if ( $use_button ): ?>
8
-			<a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a>
7
+		<?php if ($use_button): ?>
8
+			<a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a>
9 9
 		<?php endif; ?>
10 10
 		<span class="wps-form"><input id="wps-cart-product-qty-<?php echo $args['pid']; ?>" class="wpshop_product_qty_input" type="text" value="1" /></span>
11
-		<?php if ( $use_button): ?>
12
-			<a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a>
11
+		<?php if ($use_button): ?>
12
+			<a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a>
13 13
 		<?php endif; ?>
14 14
 	</div>
15 15
 </div>
16 16
 
17
-<button itemprop="availability" content="in_stock" id="wpshop_add_to_cart_<?php echo $args['pid']; ?>" data-nonce="<?php echo wp_create_nonce( 'ajax_pos_product_variation_selection' ); ?>" class="wpshop_add_to_cart_button wps-bton-first-mini-rounded"><i class="wps-icon-basket"></i><?php echo $button_text; ?></button>
17
+<button itemprop="availability" content="in_stock" id="wpshop_add_to_cart_<?php echo $args['pid']; ?>" data-nonce="<?php echo wp_create_nonce('ajax_pos_product_variation_selection'); ?>" class="wpshop_add_to_cart_button wps-bton-first-mini-rounded"><i class="wps-icon-basket"></i><?php echo $button_text; ?></button>
Please login to merge, or discard this patch.
includes/modules/wps_cart/wps_cart.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /**
4 4
  * WpShop Cart bootstrap file
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 
12 12
 /** Template Global vars **/
13 13
 DEFINE('WPS_CART_DIR', basename(dirname(__FILE__)));
14
-DEFINE('WPS_CART_PATH', str_replace( "\\", "/", str_replace( WPS_CART_DIR, "", dirname( __FILE__ ) ) ) );
15
-DEFINE('WPS_CART_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_CART_PATH ) );
14
+DEFINE('WPS_CART_PATH', str_replace("\\", "/", str_replace(WPS_CART_DIR, "", dirname(__FILE__))));
15
+DEFINE('WPS_CART_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_CART_PATH));
16 16
 
17
-DEFINE('WPS_CART_TPL_DIR', WPS_CART_PATH . WPS_CART_DIR . "/templates/" );
17
+DEFINE('WPS_CART_TPL_DIR', WPS_CART_PATH . WPS_CART_DIR . "/templates/");
18 18
 
19 19
 // Include Controller
20
-include( plugin_dir_path( __FILE__ ).'controller/wps_cart_ctr.php' );
20
+include(plugin_dir_path(__FILE__) . 'controller/wps_cart_ctr.php');
21 21
 
22 22
 // Init Controller
23 23
 $wps_cart = new wps_cart();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
includes/modules/wps_help/wps_help.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /**
4 4
  * WpShop Help bootstrap file
@@ -8,17 +8,17 @@  discard block
 block discarded – undo
8 8
  * @subpackage modules
9 9
  *
10 10
  */
11
-DEFINE( 'WPS_HELP_VERSION', '1.0.1' );
12
-DEFINE( 'WPS_HELP_DIR', basename(dirname(__FILE__)));
13
-DEFINE( 'WPS_HELP_PATH', dirname( __FILE__ ) );
14
-DEFINE( 'WPS_HELP_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_HELP_PATH ) ) );
11
+DEFINE('WPS_HELP_VERSION', '1.0.1');
12
+DEFINE('WPS_HELP_DIR', basename(dirname(__FILE__)));
13
+DEFINE('WPS_HELP_PATH', dirname(__FILE__));
14
+DEFINE('WPS_HELP_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_HELP_PATH)));
15 15
 
16 16
 /**	Define the templates directories	*/
17
-DEFINE( 'WPS_HELP_TEMPLATES_MAIN_DIR', WPS_HELP_PATH . '/templates/');
17
+DEFINE('WPS_HELP_TEMPLATES_MAIN_DIR', WPS_HELP_PATH . '/templates/');
18 18
 
19
-require_once( WPS_HELP_PATH . '/controller/wps_help_menus_ctr.php' );
20
-require_once( WPS_HELP_PATH . '/controller/wps_help_bubble_ctr.php' );
21
-require_once( WPS_HELP_PATH . '/controller/wps_help_tabs_ctr.php' );
19
+require_once(WPS_HELP_PATH . '/controller/wps_help_menus_ctr.php');
20
+require_once(WPS_HELP_PATH . '/controller/wps_help_bubble_ctr.php');
21
+require_once(WPS_HELP_PATH . '/controller/wps_help_tabs_ctr.php');
22 22
 
23 23
 /**	Instanciate task management*/
24 24
 global $wps_help_menu;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
includes/modules/wps_help/controller/wps_help_tabs_ctr.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
 	}
27 27
 
28 28
 	public function help_tab_static()
29
-    {
29
+	{
30 30
 		ob_start();
31
-    	require( wpshop_tools::get_template_part( WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tabs_static_tpl") );
31
+		require( wpshop_tools::get_template_part( WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tabs_static_tpl") );
32 32
 		$result .= ob_get_contents();
33 33
 		ob_end_clean();
34 34
 		return $result;
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 class wps_help_tabs_ctr
3 3
 {
4 4
 	private $help_tabs;
5 5
 
6 6
 	public function __construct() {
7
-		add_action( "load-{$GLOBALS['pagenow']}", array( $this, 'create_help_tabs' ), 20 );
7
+		add_action("load-{$GLOBALS['pagenow']}", array($this, 'create_help_tabs'), 20);
8 8
 	}
9 9
 
10 10
 	public function create_help_tabs()
11 11
 	{
12
-		if( is_array( $this->help_tabs ) ) {
12
+		if (is_array($this->help_tabs)) {
13 13
 			$screen = get_current_screen();
14
-			foreach ( $this->help_tabs as $id => $data )
14
+			foreach ($this->help_tabs as $id => $data)
15 15
 			{
16
-				if( is_array($data['pages']) && in_array( $screen->id, $data['pages'] ) ) {
17
-					$screen->add_help_tab( array(
16
+				if (is_array($data['pages']) && in_array($screen->id, $data['pages'])) {
17
+					$screen->add_help_tab(array(
18 18
 						'id'        => $id
19 19
 						,'title'    => $data['title']
20 20
 						,'content'  => $this->help_tab_static()
21
-						,'callback' => array( $this, 'help_tab_content' )
22
-					) );
21
+						,'callback' => array($this, 'help_tab_content')
22
+					));
23 23
 				}
24 24
 			}
25 25
 		}
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 	public function help_tab_static()
29 29
     {
30 30
 		ob_start();
31
-    	require( wpshop_tools::get_template_part( WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tabs_static_tpl") );
31
+    	require(wpshop_tools::get_template_part(WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tabs_static_tpl"));
32 32
 		$result .= ob_get_contents();
33 33
 		ob_end_clean();
34 34
 		return $result;
35 35
 	}
36 36
 	
37
-	public function help_tab_content( $screen, $tab )
37
+	public function help_tab_content($screen, $tab)
38 38
 	{
39 39
 		$id = $tab['id'];
40
-		$title = $tab['callback'][0]->help_tabs[ $tab['id'] ]['title'];
41
-		$content = $tab['callback'][0]->help_tabs[ $tab['id'] ]['content'];
42
-		$pages = $tab['callback'][0]->help_tabs[ $tab['id'] ]['pages'];
43
-		require( wpshop_tools::get_template_part( WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tab_content_tpl") );
40
+		$title = $tab['callback'][0]->help_tabs[$tab['id']]['title'];
41
+		$content = $tab['callback'][0]->help_tabs[$tab['id']]['content'];
42
+		$pages = $tab['callback'][0]->help_tabs[$tab['id']]['pages'];
43
+		require(wpshop_tools::get_template_part(WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tab_content_tpl"));
44 44
 	}
45 45
 	
46
-	public function set_help_tab( $ID, $title, $content, $pages ) {
47
-		$this->help_tabs[$ID] = array( 'title' => $title, 'content' => $content, 'pages' => $pages );
46
+	public function set_help_tab($ID, $title, $content, $pages) {
47
+		$this->help_tabs[$ID] = array('title' => $title, 'content' => $content, 'pages' => $pages);
48 48
 	}
49 49
 	
50 50
 	/**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @return string
53 53
 	 */
54 54
 	public static function display_current_id_page() {
55
-		add_action( "load-{$GLOBALS['pagenow']}", array( 'wps_help_tabs_ctr', 'get_current_id_page' ), 20 );
55
+		add_action("load-{$GLOBALS['pagenow']}", array('wps_help_tabs_ctr', 'get_current_id_page'), 20);
56 56
 	}
57 57
 	public static function get_current_id_page() {
58 58
 		$screen = get_current_screen();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.