Completed
Pull Request — master (#2)
by Jimmy
1216:52 queued 1185:43
created
includes/modules/wps_installer/templates/backend/step_two.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <table class="form-table" >
4 4
 	<tr>
5
-		<th><?php _e( 'Shop type', 'wpshop' ); ?></th>
5
+		<th><?php _e('Shop type', 'wpshop'); ?></th>
6 6
 		<td><?php wpshop_general_options::wpshop_shop_type(); ?></td>
7 7
 	</tr>
8 8
 	<tr>
9
-		<th><?php _e( 'Price piloting for the shop', 'wpshop' ); ?></th>
9
+		<th><?php _e('Price piloting for the shop', 'wpshop'); ?></th>
10 10
 		<td><?php wpshop_general_options::wpshop_shop_price_piloting_field(); ?></td>
11 11
 	</tr>
12 12
 	<tr>
13
-		<td colspan="2" ><label><input type="checkbox" name="wps-installer-data-insertion" value="yes" checked="checked" disabled="disabled" /><?php _e( 'Create necessary datas for wpshop (emails, pages)', 'wpshop'); ?></label></td>
13
+		<td colspan="2" ><label><input type="checkbox" name="wps-installer-data-insertion" value="yes" checked="checked" disabled="disabled" /><?php _e('Create necessary datas for wpshop (emails, pages)', 'wpshop'); ?></label></td>
14 14
 	</tr>
15 15
 	<!--
16 16
 	<tr>
17
-		<td colspan="2" ><label><input type="checkbox" name="wps-installer-data-insertion" value="yes" /><?php _e( 'Create sample datas (products)', 'wpshop'); ?></label></td>
17
+		<td colspan="2" ><label><input type="checkbox" name="wps-installer-data-insertion" value="yes" /><?php _e('Create sample datas (products)', 'wpshop'); ?></label></td>
18 18
 	</tr>
19 19
 	 -->
20 20
 </table>
21 21
\ No newline at end of file
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_installer/templates/backend/installer.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wpshop_full_page_tabs">
4
-	<h1><span class="wps-shop-icon" ></span><?php _e( 'Welcome on wpshop', 'wpshop'); ?></h1>
5
-	<h2><?php _e( 'Before you start to use WPShop you will need to configure some parameters', 'wpshop'); ?></h2>
4
+	<h1><span class="wps-shop-icon" ></span><?php _e('Welcome on wpshop', 'wpshop'); ?></h1>
5
+	<h2><?php _e('Before you start to use WPShop you will need to configure some parameters', 'wpshop'); ?></h2>
6 6
 	<div class="wpshop_admin_box">
7 7
 		<div class="wps-gridwrapper3-marged">
8 8
 		<?php
9 9
 			$step_finished = false;
10
-			foreach( $steps as $step_id => $step) :
10
+			foreach ($steps as $step_id => $step) :
11 11
 				$step_id += 1;
12
-				$step_class = ( $current_step == $step_id ) ? 'wps-checkout-step-current' : ( ( $current_step > $step_id) ? 'wps-checkout-step-finished' : 'wps-checkout-step' ) ;
13
-				$step_finished = ( ( $current_step > $step_id) ? true : false ) ;
14
-				require( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "step_indicator" ) );
12
+				$step_class = ($current_step == $step_id) ? 'wps-checkout-step-current' : (($current_step > $step_id) ? 'wps-checkout-step-finished' : 'wps-checkout-step');
13
+				$step_finished = (($current_step > $step_id) ? true : false);
14
+				require(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "step_indicator"));
15 15
 			endforeach;
16 16
 		?>
17 17
 		</div><!-- .wps-gridwrapper4-marged -->
18 18
 
19 19
 		<div class="wps-installer-step-container wps-installer-step-container-<?php echo $current_step; ?>" >
20
-		<?php if ( $current_step < count( $steps ) ) : ?>
21
-			<form action="<?php echo admin_url( 'admin.php?page=wps-installer&amp;wps-installation-step=' . ( $current_step + 1 ) ); ?>" method="post" id="wps_installer_form" enctype="multipart/form-data" >
20
+		<?php if ($current_step < count($steps)) : ?>
21
+			<form action="<?php echo admin_url('admin.php?page=wps-installer&amp;wps-installation-step=' . ($current_step + 1)); ?>" method="post" id="wps_installer_form" enctype="multipart/form-data" >
22 22
 				<input type="hidden" name="action" value="wps-installation" />
23 23
 				<div class="wps-installer-step-content wps-installer-step-content-<?php echo $current_step; ?>" >
24 24
 					<?php echo $current_step_output; ?>
25 25
 				</div>
26 26
 
27
-				<button class="button button-primary alignright" ><?php ( 2 == $current_step ) ? _e( 'Create my shop', 'wpshop') : _e( 'Next step', 'wpshop'); ?></button>
27
+				<button class="button button-primary alignright" ><?php (2 == $current_step) ? _e('Create my shop', 'wpshop') : _e('Next step', 'wpshop'); ?></button>
28 28
 				<span class="spinner" ></span>
29
-				<!-- <button class="button button-secondary alignright" ><?php _e( 'Ignore this step', 'wpshop'); ?></button>  -->
29
+				<!-- <button class="button button-secondary alignright" ><?php _e('Ignore this step', 'wpshop'); ?></button>  -->
30 30
 			</form><!-- #wps_installer_form -->
31 31
 		<?php else: ?>
32
-			<?php _e( 'Main informations have been setted up.', 'wpshop'); ?>
32
+			<?php _e('Main informations have been setted up.', 'wpshop'); ?>
33 33
 		<?php endif; ?>
34 34
 		</div><!-- .wps-installer-step-container -->
35 35
 	</div><!-- .wpshop_full_page_tabs -->
Please login to merge, or discard this patch.
Braces   +8 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
 <div class="wpshop_full_page_tabs">
4 6
 	<h1><span class="wps-shop-icon" ></span><?php _e( 'Welcome on wpshop', 'wpshop'); ?></h1>
@@ -28,8 +30,11 @@  discard block
 block discarded – undo
28 30
 				<span class="spinner" ></span>
29 31
 				<!-- <button class="button button-secondary alignright" ><?php _e( 'Ignore this step', 'wpshop'); ?></button>  -->
30 32
 			</form><!-- #wps_installer_form -->
31
-		<?php else: ?>
32
-			<?php _e( 'Main informations have been setted up.', 'wpshop'); ?>
33
+		<?php else {
34
+	: ?>
35
+			<?php _e( 'Main informations have been setted up.', 'wpshop');
36
+}
37
+?>
33 38
 		<?php endif; ?>
34 39
 		</div><!-- .wps-installer-step-container -->
35 40
 	</div><!-- .wpshop_full_page_tabs -->
Please login to merge, or discard this patch.
includes/modules/wps_installer/templates/backend/about-introduction.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,62 +1,62 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="changelog" >
4 4
 
5 5
 	<div class="feature-section changelog three-col">
6 6
 		<div class="col">
7
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/paiement.jpg'; ?>" alt="<?php _e( 'Payment methods', 'wpshop'); ?>" title="<?php _e( 'Payment methods', 'wpshop'); ?>" />
8
-			<h3><?php _e( 'Payment methods', 'wpshop'); ?></h3>
9
-			<p><?php printf( __( 'When installing WPShop you will have included by default, checks and paypal payment gateway. However there are more %spayment method%s developped for WPShop. If you are interested by a non existant payment method. You can contact us on our %sforum%s', 'wpshop'), '<a href="http://www.wpshop.fr/boutique/extensions/paiement/" target="_wps_about_extra">', '</a>', '<a href="http://forums.eoxia.com/" target="_eoxia_form">', '</a>' ); ?></p>
10
-			<a href="<?php echo admin_url( 'options-general.php?page=wpshop_option#wpshop_payments_option' ); ?>" class="button button-large button-primary"><?php _e( 'Manage payment methods', 'wpshop'); ?></a>
7
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/paiement.jpg'; ?>" alt="<?php _e('Payment methods', 'wpshop'); ?>" title="<?php _e('Payment methods', 'wpshop'); ?>" />
8
+			<h3><?php _e('Payment methods', 'wpshop'); ?></h3>
9
+			<p><?php printf(__('When installing WPShop you will have included by default, checks and paypal payment gateway. However there are more %spayment method%s developped for WPShop. If you are interested by a non existant payment method. You can contact us on our %sforum%s', 'wpshop'), '<a href="http://www.wpshop.fr/boutique/extensions/paiement/" target="_wps_about_extra">', '</a>', '<a href="http://forums.eoxia.com/" target="_eoxia_form">', '</a>'); ?></p>
10
+			<a href="<?php echo admin_url('options-general.php?page=wpshop_option#wpshop_payments_option'); ?>" class="button button-large button-primary"><?php _e('Manage payment methods', 'wpshop'); ?></a>
11 11
 		</div>
12 12
 		<div class="col">
13
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/livraison.jpg'; ?>" alt="<?php _e( 'Shipping methods', 'wpshop'); ?>" title="<?php _e( 'Shipping methods', 'wpshop'); ?>" />
14
-			<h3><?php _e( 'Shipping methods', 'wpshop'); ?></h3>
15
-			<p><?php printf( __( 'By default you have one shipping method available into WPShop. You can create as much as you want using %ssettings interface%s. You will also find on our %swebsite%s additionnals shipping methods. You can contact us on our %sforum%s', 'wpshop'), '<a href="' . admin_url( 'options-general.php?page=wpshop_option#wpshop_shipping_option' ) . '" target="_wps_settings_interface" >', '</a>', '<a href="http://www.wpshop.fr/shop-theme/" target="_wps_about_extra" >', '</a>',  '<a href="http://forums.eoxia.com/" target="_eoxia_form">', '</a>' ); ?></p>
16
-			<a href="<?php echo admin_url( 'options-general.php?page=wpshop_option#wpshop_shipping_option' ); ?>" class="button button-large button-primary"><?php _e( 'Manage shipping methods', 'wpshop'); ?></a>
13
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/livraison.jpg'; ?>" alt="<?php _e('Shipping methods', 'wpshop'); ?>" title="<?php _e('Shipping methods', 'wpshop'); ?>" />
14
+			<h3><?php _e('Shipping methods', 'wpshop'); ?></h3>
15
+			<p><?php printf(__('By default you have one shipping method available into WPShop. You can create as much as you want using %ssettings interface%s. You will also find on our %swebsite%s additionnals shipping methods. You can contact us on our %sforum%s', 'wpshop'), '<a href="' . admin_url('options-general.php?page=wpshop_option#wpshop_shipping_option') . '" target="_wps_settings_interface" >', '</a>', '<a href="http://www.wpshop.fr/shop-theme/" target="_wps_about_extra" >', '</a>', '<a href="http://forums.eoxia.com/" target="_eoxia_form">', '</a>'); ?></p>
16
+			<a href="<?php echo admin_url('options-general.php?page=wpshop_option#wpshop_shipping_option'); ?>" class="button button-large button-primary"><?php _e('Manage shipping methods', 'wpshop'); ?></a>
17 17
 		</div>
18 18
 		<div class="col last-feature">
19
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/produit.jpg'; ?>" alt="<?php _e( 'Create products', 'wpshop'); ?>" title="<?php _e( 'Create products', 'wpshop'); ?>" />
20
-			<h3><?php _e( 'Create products', 'wpshop'); ?></h3>
21
-			<p><?php _e( 'With WPshop plugin you can now create your product catalog on WordPress and market them. A catalog and clear product information, easy to create and fully customizable through shortcodes.', 'wpshop'); ?></p>
22
-			<a href="<?php echo admin_url( 'edit.php?post_type=wpshop_product' ); ?>" class="button button-large button-primary wpshop-about-btn-create-products"><?php _e( 'Create products', 'wpshop'); ?></a>
19
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/produit.jpg'; ?>" alt="<?php _e('Create products', 'wpshop'); ?>" title="<?php _e('Create products', 'wpshop'); ?>" />
20
+			<h3><?php _e('Create products', 'wpshop'); ?></h3>
21
+			<p><?php _e('With WPshop plugin you can now create your product catalog on WordPress and market them. A catalog and clear product information, easy to create and fully customizable through shortcodes.', 'wpshop'); ?></p>
22
+			<a href="<?php echo admin_url('edit.php?post_type=wpshop_product'); ?>" class="button button-large button-primary wpshop-about-btn-create-products"><?php _e('Create products', 'wpshop'); ?></a>
23 23
 		</div>
24 24
 	</div>
25 25
 
26 26
 	<div class="feature-section col three-col">
27 27
 		<div class="col">
28
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/commande.jpg'; ?>" alt="<?php _e( 'Manage orders', 'wpshop'); ?>" title="<?php _e( 'Manage orders', 'wpshop'); ?>" />
29
-			<h3><?php _e( 'Manage orders', 'wpshop'); ?></h3>
30
-			<p><?php _e( 'You can manage all your orders and stay in touch with your customers. The dashboard controls will allow you to quickly view your most visited pages , static of your orders ...', 'wpshop'); ?></p>
31
-			<a href="<?php echo admin_url( 'edit.php?post_type=wpshop_shop_order' ); ?>" class="button button-large button-primary"><?php _e( 'Manage orders', 'wpshop'); ?></a>
28
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/commande.jpg'; ?>" alt="<?php _e('Manage orders', 'wpshop'); ?>" title="<?php _e('Manage orders', 'wpshop'); ?>" />
29
+			<h3><?php _e('Manage orders', 'wpshop'); ?></h3>
30
+			<p><?php _e('You can manage all your orders and stay in touch with your customers. The dashboard controls will allow you to quickly view your most visited pages , static of your orders ...', 'wpshop'); ?></p>
31
+			<a href="<?php echo admin_url('edit.php?post_type=wpshop_shop_order'); ?>" class="button button-large button-primary"><?php _e('Manage orders', 'wpshop'); ?></a>
32 32
 		</div>
33 33
 		<div class="col">
34
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/reglage-boutique.jpg'; ?>" alt="<?php _e( 'Configure my shop', 'wpshop'); ?>" title="<?php _e( 'Configure my shop', 'wpshop'); ?>" />
35
-			<h3><?php _e( 'Configure my shop', 'wpshop'); ?></h3>
36
-			<p><?php printf( __( 'We update WPShop in order to improve speed, accessibility and mobile usage. Go on %smain settings interface%s in order to configure your new shop, payment gateways or shipping methods', 'wpshop'), '<a href="' . admin_url( 'options-general.php?page=wpshop_option' ) . '" target="_wps_settings_interface" >', '</a>' ); ?></p>
37
-			<a href="<?php echo admin_url( 'options-general.php?page=wpshop_option' ); ?>" class="button button-large button-primary"><?php _e( 'Configure my shop', 'wpshop'); ?></a>
34
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/reglage-boutique.jpg'; ?>" alt="<?php _e('Configure my shop', 'wpshop'); ?>" title="<?php _e('Configure my shop', 'wpshop'); ?>" />
35
+			<h3><?php _e('Configure my shop', 'wpshop'); ?></h3>
36
+			<p><?php printf(__('We update WPShop in order to improve speed, accessibility and mobile usage. Go on %smain settings interface%s in order to configure your new shop, payment gateways or shipping methods', 'wpshop'), '<a href="' . admin_url('options-general.php?page=wpshop_option') . '" target="_wps_settings_interface" >', '</a>'); ?></p>
37
+			<a href="<?php echo admin_url('options-general.php?page=wpshop_option'); ?>" class="button button-large button-primary"><?php _e('Configure my shop', 'wpshop'); ?></a>
38 38
 		</div>
39 39
 		<div class="col last-feature">
40
-			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/contenu.jpg'; ?>" alt="<?php _e( 'Full content customization', 'wpshop'); ?>" title="<?php _e( 'Full content customization', 'wpshop'); ?>" />
41
-			<h3><?php _e( 'Full content customization', 'wpshop'); ?></h3>
42
-			<p><?php printf( __( 'You can design all you %stransactionnal emails%s, change the different %spage layout%s (as cart page, checkout page, and so on)', 'wpshop'), '<a href="' . admin_url( 'edit.php?post_type=wpshop_shop_message' ) . '" target="_wps_settings_interface" >', '</a>', '<a href="' . admin_url( 'edit.php?post_type=page' ) . '" target="_wps_settings_interface" >', '</a>' ); ?></p>
40
+			<img src="<?php echo WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/medias/contenu.jpg'; ?>" alt="<?php _e('Full content customization', 'wpshop'); ?>" title="<?php _e('Full content customization', 'wpshop'); ?>" />
41
+			<h3><?php _e('Full content customization', 'wpshop'); ?></h3>
42
+			<p><?php printf(__('You can design all you %stransactionnal emails%s, change the different %spage layout%s (as cart page, checkout page, and so on)', 'wpshop'), '<a href="' . admin_url('edit.php?post_type=wpshop_shop_message') . '" target="_wps_settings_interface" >', '</a>', '<a href="' . admin_url('edit.php?post_type=page') . '" target="_wps_settings_interface" >', '</a>'); ?></p>
43 43
 		</div>
44 44
 	</div>
45 45
 
46
-	<h2 class="about-headline-callout"><?php _e( 'Extend default WPShop functionnalities', 'wpshop'); ?></h2>
46
+	<h2 class="about-headline-callout"><?php _e('Extend default WPShop functionnalities', 'wpshop'); ?></h2>
47 47
 	<div class="feature-section col two-col">
48 48
 		<div class="col">
49
-			<h3><?php _e( 'External addons', 'wpshop'); ?></h3>
50
-			<p><?php printf( __( 'Need a theme? or a payment gateway? or a shipping addons? Anythong else? Check %sour website%s in order to find the addons for WPShop that you need. If you don\'t find it please contact us through the forum with the link below.', 'wpshop'), '<a href="http://www.wpshop.fr/shop-theme/" >', '</a>' ); ?></p>
49
+			<h3><?php _e('External addons', 'wpshop'); ?></h3>
50
+			<p><?php printf(__('Need a theme? or a payment gateway? or a shipping addons? Anythong else? Check %sour website%s in order to find the addons for WPShop that you need. If you don\'t find it please contact us through the forum with the link below.', 'wpshop'), '<a href="http://www.wpshop.fr/shop-theme/" >', '</a>'); ?></p>
51 51
 		</div>
52 52
 		<div class="col last-feature">
53
-			<h3><?php _e( 'Custom hooks', 'wpshop'); ?></h3>
54
-			<p><?php printf( __( 'We inserted some custom hook through WPShop code. That will give you some possibilities to add functionnalities when it is already planned.', 'wpshop') ); ?></p>
53
+			<h3><?php _e('Custom hooks', 'wpshop'); ?></h3>
54
+			<p><?php printf(__('We inserted some custom hook through WPShop code. That will give you some possibilities to add functionnalities when it is already planned.', 'wpshop')); ?></p>
55 55
 		</div>
56 56
 	</div>
57 57
 
58
-	<h3 class="about-headline-callout"><?php printf( __( 'A question ? A comment ? A need ? Join us on %sWPShop forum%s', 'wpshop'), '<a href="http://forums.eoxia.com/login" taget="_wpshop_forums" >', '</a>' ); ?></h3>
58
+	<h3 class="about-headline-callout"><?php printf(__('A question ? A comment ? A need ? Join us on %sWPShop forum%s', 'wpshop'), '<a href="http://forums.eoxia.com/login" taget="_wpshop_forums" >', '</a>'); ?></h3>
59 59
 
60 60
 	<hr>
61
-	<div class="return-to-dashboard"><a href="<?php echo admin_url( 'admin.php?page=wpshop_dashboard' ); ?>"><?php _e( 'Go to your shop dashboard', 'wpshop'); ?></a></div>
61
+	<div class="return-to-dashboard"><a href="<?php echo admin_url('admin.php?page=wpshop_dashboard'); ?>"><?php _e('Go to your shop dashboard', 'wpshop'); ?></a></div>
62 62
 </div>
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_installer/templates/backend/step_indicator.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="<?php echo $step_class; ?>">
4
-	<?php if( $step_finished ) : ?>
5
-		<a href="<?php echo admin_url( 'admin.php?page=wps-installer&amp;wps-installation-step=' . $step_id ); ?>"><i class="wps-circlerounded"><?php echo _e( $step_id, 'wpshop'); ?></i><span><?php echo _e( $step, 'wpshop'); ?></span></a>
4
+	<?php if ($step_finished) : ?>
5
+		<a href="<?php echo admin_url('admin.php?page=wps-installer&amp;wps-installation-step=' . $step_id); ?>"><i class="wps-circlerounded"><?php echo _e($step_id, 'wpshop'); ?></i><span><?php echo _e($step, 'wpshop'); ?></span></a>
6 6
 	<?php else : ?>
7
-		<i class="wps-circlerounded"><?php _e( $step_id, 'wpshop'); ?></i><span><?php _e( $step, 'wpshop'); ?></span>
7
+		<i class="wps-circlerounded"><?php _e($step_id, 'wpshop'); ?></i><span><?php _e($step, 'wpshop'); ?></span>
8 8
 	<?php endif ?>
9 9
 </div>
10 10
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,15 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <div class="<?php echo $step_class; ?>">
4 6
 	<?php if( $step_finished ) : ?>
5 7
 		<a href="<?php echo admin_url( 'admin.php?page=wps-installer&amp;wps-installation-step=' . $step_id ); ?>"><i class="wps-circlerounded"><?php echo _e( $step_id, 'wpshop'); ?></i><span><?php echo _e( $step, 'wpshop'); ?></span></a>
6
-	<?php else : ?>
7
-		<i class="wps-circlerounded"><?php _e( $step_id, 'wpshop'); ?></i><span><?php _e( $step, 'wpshop'); ?></span>
8
+	<?php else {
9
+	: ?>
10
+		<i class="wps-circlerounded"><?php _e( $step_id, 'wpshop');
11
+}
12
+?></i><span><?php _e( $step, 'wpshop'); ?></span>
8 13
 	<?php endif ?>
9 14
 </div>
10 15
 
Please login to merge, or discard this patch.
modules/wps_customer/controller/wps_customer_metaboxes.controller.01.php 2 patches
Spacing   +22 added lines, -22 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
  * Fichier du controleur des metaboxes pour l'administration des clients dans wpshop / Controller file for managing metaboxes into customer administration interface
4 4
  *
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * Instanciation de la gestion des metaboxes / Insctanciate metaboxes management
19 19
 	 */
20 20
 	function __construct() {
21
-		add_action( 'add_meta_boxes_' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, array( $this, 'add_meta_box' ) );
21
+		add_action('add_meta_boxes_' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, array($this, 'add_meta_box'));
22 22
 	}
23 23
 
24 24
 
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param WP_Post $customer Le client actuel / The current customer
29 29
 	 */
30
-	function add_meta_box( $customer ) {
31
-		remove_meta_box( 'submitdiv', WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal' );
32
-		add_meta_box( 'submitdiv', __( 'Save' ), array( $this, 'wps_customer_informations_save' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'high' );
33
-		add_meta_box( 'wps_customer_informations', __( 'Customer\'s account informations', 'wpshop' ), array( $this, 'wps_customer_account_informations' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'high' );
34
-		if ( 'auto-draft' !== $customer->post_status ) {
35
-			add_meta_box( 'wps_customer_orders', __( 'Customer\'s orders', 'wpshop' ), array( $this, 'wps_customer_orders_list' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'low' );
36
-			add_meta_box( 'wps_customer_messages_list', __( 'Customer\'s send messages', 'wpshop' ), array( $this, 'wps_customer_messages_list' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'low' );
37
-			add_meta_box( 'wps_customer_coupons_list', __( 'Customer\'s coupons list', 'wpshop' ), array( $this, 'wps_customer_coupons_list' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'low' );
38
-			add_meta_box( 'wps_customer_addresses_list', __( 'Customer\'s addresses', 'wpshop' ), array( $this, 'wps_customer_addresses_list' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'low' );
30
+	function add_meta_box($customer) {
31
+		remove_meta_box('submitdiv', WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal');
32
+		add_meta_box('submitdiv', __('Save'), array($this, 'wps_customer_informations_save'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'high');
33
+		add_meta_box('wps_customer_informations', __('Customer\'s account informations', 'wpshop'), array($this, 'wps_customer_account_informations'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'high');
34
+		if ('auto-draft' !== $customer->post_status) {
35
+			add_meta_box('wps_customer_orders', __('Customer\'s orders', 'wpshop'), array($this, 'wps_customer_orders_list'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'low');
36
+			add_meta_box('wps_customer_messages_list', __('Customer\'s send messages', 'wpshop'), array($this, 'wps_customer_messages_list'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'low');
37
+			add_meta_box('wps_customer_coupons_list', __('Customer\'s coupons list', 'wpshop'), array($this, 'wps_customer_coupons_list'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'side', 'low');
38
+			add_meta_box('wps_customer_addresses_list', __('Customer\'s addresses', 'wpshop'), array($this, 'wps_customer_addresses_list'), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'low');
39 39
 		}
40 40
 	}
41 41
 
@@ -43,49 +43,49 @@  discard block
 block discarded – undo
43 43
 	/**
44 44
 	 * META-BOX CONTENT - Display customer's order list in customer back-office interface
45 45
 	 */
46
-	function wps_customer_orders_list( $post ) {
46
+	function wps_customer_orders_list($post) {
47 47
 		$output = '';
48 48
 		$wps_orders = new wps_orders_ctr();
49
-		$output = $wps_orders->display_orders_in_account( $post->post_author);
49
+		$output = $wps_orders->display_orders_in_account($post->post_author);
50 50
 		echo $output;
51 51
 	}
52 52
 
53 53
 	/**
54 54
 	 * META-BOX CONTENT - Display Customer's addresses in customer back-office interface
55 55
 	 */
56
-	function wps_customer_addresses_list( $post ) {
56
+	function wps_customer_addresses_list($post) {
57 57
 		global $wpdb;
58 58
 
59 59
 		$wps_addresses = new wps_address();
60
-		$output = $wps_addresses->display_addresses_interface( $post->post_author, true );
60
+		$output = $wps_addresses->display_addresses_interface($post->post_author, true);
61 61
 		echo '<input type="hidden" name="wps_customer_id" id="wps_orders_selected_customer" value="' . $post->post_author . '">';
62
-		echo '<div data-nonce="' . wp_create_nonce( 'reload_addresses_for_customer' ) . '" id="wps_customer_addresses" class="wps-gridwrapper2-padded">' . $output . '</div>';
62
+		echo '<div data-nonce="' . wp_create_nonce('reload_addresses_for_customer') . '" id="wps_customer_addresses" class="wps-gridwrapper2-padded">' . $output . '</div>';
63 63
 	}
64 64
 
65 65
 	/**
66 66
 	 * META-BOX CONTENT - Display customer's send messages
67 67
 	 */
68
-	function wps_customer_messages_list( $post ) {
68
+	function wps_customer_messages_list($post) {
69 69
 		$wps_messages = new wps_message_ctr();
70
-		$output = $wps_messages->display_message_histo_per_customer( array(),$post->post_author);
70
+		$output = $wps_messages->display_message_histo_per_customer(array(), $post->post_author);
71 71
 		echo $output;
72 72
 	}
73 73
 
74 74
 	/**
75 75
 	 * META-BOX CONTENT - Display wps_customer's coupons list
76 76
 	 */
77
-	function wps_customer_coupons_list( $post ) {
77
+	function wps_customer_coupons_list($post) {
78 78
 		$wps_customer = new wps_coupon_ctr();
79
-		$output = $wps_customer->display_coupons( $post->post_author );
79
+		$output = $wps_customer->display_coupons($post->post_author);
80 80
 		echo $output;
81 81
 	}
82 82
 
83 83
 	/**
84 84
 	 * META-BOX CONTENT - Display Customer's account informations in administration panel
85 85
 	 */
86
-	function wps_customer_account_informations( $post ) {
86
+	function wps_customer_account_informations($post) {
87 87
 		$wps_account = new wps_account_ctr();
88
-		$output = $wps_account->display_account_informations( $post->post_author );
88
+		$output = $wps_account->display_account_informations($post->post_author);
89 89
 		echo $output;
90 90
 	}
91 91
 
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_customer/controller/wp_list_custom_groups.class.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		 * to keep hidden, and a list of columns that are sortable. Each of these
235 235
 		 * can be defined in another method (as we've done here) before being
236 236
 		 * used to build the value for our _column_headers property.
237
-		*/
237
+		 */
238 238
 		$columns = $this->get_columns();
239 239
 		$hidden = array();
240 240
 		$sortable = $this->get_sortable_columns();
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
 		 * headers. The $this->_column_headers property takes an array which contains
245 245
 		 * 3 other arrays. One for all columns, one for hidden columns, and one
246 246
 		 * for sortable columns.
247
-		*/
247
+		 */
248 248
 		$this->_column_headers = array($columns, $hidden, $sortable);
249 249
 
250 250
 		/**
251 251
 		 * Optional. You can handle your bulk actions however you see fit. In this
252 252
 		 * case, we'll handle them within our package just to keep things clean.
253
-		*/
253
+		 */
254 254
 		$this->process_bulk_action();
255 255
 
256 256
 		/**
@@ -261,14 +261,14 @@  discard block
 block discarded – undo
261 261
 		 * our data. In a real-world implementation, you will probably want to
262 262
 		 * use sort and pagination data to build a custom query instead, as you'll
263 263
 		 * be able to use your precisely-queried data immediately.
264
-		*/
264
+		 */
265 265
 		// $data = ;
266 266
 
267 267
 		/**
268 268
 		 * REQUIRED for pagination. Let's figure out what page the user is currently
269 269
 		 * looking at. We'll need this later, so you should always include it in
270 270
 		 * your own package classes.
271
-		*/
271
+		 */
272 272
 		$current_page = $this->get_pagenum();
273 273
 
274 274
 		/**
@@ -276,20 +276,20 @@  discard block
 block discarded – undo
276 276
 		 * In real-world use, this would be the total number of items in your database,
277 277
 		 * without filtering. We'll need this later, so you should always include it
278 278
 		 * in your own package classes.
279
-		*/
279
+		 */
280 280
 		$total_items = count($data);
281 281
 
282 282
 		/**
283 283
 		 * The WP_List_Table class does not handle pagination for us, so we need
284 284
 		 * to ensure that the data is trimmed to only the current page. We can use
285 285
 		 * array_slice() to
286
-		*/
286
+		 */
287 287
 		$data = array_slice($data,(($current_page-1)*$per_page),$per_page);
288 288
 
289 289
 		/**
290 290
 		 * REQUIRED. Now we can add our *sorted* data to the items property, where
291 291
 		 * it can be used by the rest of the class.
292
-		*/
292
+		 */
293 293
 		$this->items = $data;
294 294
 
295 295
 		/*	REQUIRED. We also have to register our pagination options & calculations.	*/
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /*	Check if file is include. No direct access possible with file url	*/
4
-if ( !defined( 'WPSHOP_VERSION' ) ) {
5
-	die( __('Access is not allowed by this way', 'wpshop') );
4
+if (!defined('WPSHOP_VERSION')) {
5
+	die(__('Access is not allowed by this way', 'wpshop'));
6 6
 }
7 7
 
8 8
 
9
-if(!class_exists('WP_List_Table')){
10
-	require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
9
+if (!class_exists('WP_List_Table')) {
10
+	require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
11 11
 }
12 12
 /**
13 13
  * Define the different method to manage groups listing with wordpress methods
14 14
  * @package wpshop
15 15
  * @subpackage librairies
16 16
  */
17
-class wpshop_groups_custom_List_table extends WP_List_Table{
17
+class wpshop_groups_custom_List_table extends WP_List_Table {
18 18
 
19 19
 	/** ************************************************************************
20 20
 	 * REQUIRED. Set up a constructor that references the parent constructor. We
21 21
 	 * use the parent reference to set some default configs.
22 22
 	 ***************************************************************************/
23
-	function __construct(){
23
+	function __construct() {
24 24
 		global $status, $page;
25 25
 
26 26
 		//Set parent defaults
27
-		parent::__construct( array(
28
-			'singular'  => __('group\'s', 'wpshop'),    //singular name of the listed records
29
-			'plural'    => __('groups\'', 'wpshop'),    //plural name of the listed records
27
+		parent::__construct(array(
28
+			'singular'  => __('group\'s', 'wpshop'), //singular name of the listed records
29
+			'plural'    => __('groups\'', 'wpshop'), //plural name of the listed records
30 30
 			'ajax'     => true       //does this table support ajax?
31
-		) );
31
+		));
32 32
 	}
33 33
 
34 34
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 * @see WP_List_Table::::single_row_columns()
46 46
 	 * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
47 47
 	 **************************************************************************/
48
-	function get_columns(){
48
+	function get_columns() {
49 49
 		$columns = array(
50
-			'cb'       => '',//'<input type="checkbox" />', //Render a checkbox instead of text
50
+			'cb'       => '', //'<input type="checkbox" />', //Render a checkbox instead of text
51 51
 			'name'    => __('Name', 'wpshop'),
52 52
 			'description'    => __('Description', 'wpshop')
53 53
 		);
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 * @param array $column_name The name/slug of the column to be processed
76 76
 	 * @return string Text or HTML to be placed inside the column <td>
77 77
 	 **************************************************************************/
78
-	function column_default($item, $column_name){
79
-		switch($column_name){
78
+	function column_default($item, $column_name) {
79
+		switch ($column_name) {
80 80
 			default:
81
-				return print_r($item,true); //Show the whole array for troubleshooting purposes
81
+				return print_r($item, true); //Show the whole array for troubleshooting purposes
82 82
 		}
83 83
 	}
84 84
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param array $item A singular item (one full row's worth of data)
99 99
 	 * @return string Text to be placed inside the column <td> (movie title only)
100 100
 	 **************************************************************************/
101
-	function column_description($item){
101
+	function column_description($item) {
102 102
 		return $item['description'];
103 103
 	}
104 104
 	/** ************************************************************************
@@ -117,21 +117,21 @@  discard block
 block discarded – undo
117 117
 	 * @param array $item A singular item (one full row's worth of data)
118 118
 	 * @return string Text to be placed inside the column <td> (movie title only)
119 119
 	 **************************************************************************/
120
-	function column_name($item){
120
+	function column_name($item) {
121 121
 
122
-		$link_format = admin_url('admin.php').'?page=%s&amp;action=%s&amp;code=%s';
123
-		$default_action='edit';
124
-		$default_action_text=__('Edit', 'wpshop');
122
+		$link_format = admin_url('admin.php') . '?page=%s&amp;action=%s&amp;code=%s';
123
+		$default_action = 'edit';
124
+		$default_action_text = __('Edit', 'wpshop');
125 125
 
126 126
 		//Build row actions
127 127
 		$actions = array(
128
-			'edit'     => sprintf('<a href="'.$link_format.'">'.$default_action_text.'</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, $default_action, $item['code'])
128
+			'edit'     => sprintf('<a href="' . $link_format . '">' . $default_action_text . '</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, $default_action, $item['code'])
129 129
 		);
130
-		$actions['delete'] = sprintf('<a href="'.$link_format.'">'.__('Delete', 'wpshop').'</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, 'delete', $item['code']);
130
+		$actions['delete'] = sprintf('<a href="' . $link_format . '">' . __('Delete', 'wpshop') . '</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, 'delete', $item['code']);
131 131
 
132 132
 		//Return the title contents
133 133
 		return sprintf('%1$s%2$s',
134
-			/*$1%s*/ sprintf('<a href="'.$link_format.'">'.__($item['name'], 'wpshop').'</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, $default_action, $item['code']),
134
+			/*$1%s*/ sprintf('<a href="' . $link_format . '">' . __($item['name'], 'wpshop') . '</a>', WPSHOP_NEWTYPE_IDENTIFIER_GROUP, $default_action, $item['code']),
135 135
 			/*$3%s*/ $this->row_actions($actions)
136 136
 		);
137 137
 	}
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 	 * @param array $item A singular item (one full row's worth of data)
145 145
 	 * @return string Text to be placed inside the column <td> (movie title only)
146 146
 	 **************************************************************************/
147
-	function column_cb($item){
147
+	function column_cb($item) {
148 148
 		return '';
149 149
 		return sprintf(
150 150
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
151
-			/*$1%s*/ $this->_args['singular'],  //Let's simply repurpose the table's singular label ("movie")
151
+			/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie")
152 152
 			/*$2%s*/ $item['id']             //The value of the checkbox should be the record's id
153 153
 		);
154 154
 	}
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 **************************************************************************/
170 170
 	function get_sortable_columns() {
171 171
 		$sortable_columns = array(
172
-			'name'    => array('frontend_label',true),    //true means its already sorted
173
-			'status'  => array('status',true)
172
+			'name'    => array('frontend_label', true), //true means its already sorted
173
+			'status'  => array('status', true)
174 174
 		);
175 175
 		return $sortable_columns;
176 176
 	}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 **************************************************************************/
206 206
 	function process_bulk_action() {
207 207
 		//Detect when a bulk action is being triggered...
208
-		if( 'delete'===$this->current_action() ) {
208
+		if ('delete' === $this->current_action()) {
209 209
 			wp_die('Items deleted (or they would be if we had items to delete)!');
210 210
 		}
211 211
 	}
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		 * to ensure that the data is trimmed to only the current page. We can use
285 285
 		 * array_slice() to
286 286
 		*/
287
-		$data = array_slice($data,(($current_page-1)*$per_page),$per_page);
287
+		$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
288 288
 
289 289
 		/**
290 290
 		 * REQUIRED. Now we can add our *sorted* data to the items property, where
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
 		$this->items = $data;
294 294
 
295 295
 		/*	REQUIRED. We also have to register our pagination options & calculations.	*/
296
-		$this->set_pagination_args( array(
297
-			'total_items' => $total_items,               		//WE have to calculate the total number of items
298
-			'per_page'    => $per_page,                 		//WE have to determine how many items to show on a page
299
-			'total_pages' => ceil($total_items/$per_page)   //WE have to calculate the total number of pages
300
-		) );
296
+		$this->set_pagination_args(array(
297
+			'total_items' => $total_items, //WE have to calculate the total number of items
298
+			'per_page'    => $per_page, //WE have to determine how many items to show on a page
299
+			'total_pages' => ceil($total_items / $per_page)   //WE have to calculate the total number of pages
300
+		));
301 301
 	}
302 302
 }
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_customer/controller/wp_list_custom_entities_customers.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		 * to keep hidden, and a list of columns that are sortable. Each of these
215 215
 		 * can be defined in another method (as we've done here) before being
216 216
 		 * used to build the value for our _column_headers property.
217
-		*/
217
+		 */
218 218
 		$columns = $this->get_columns();
219 219
 		$hidden = array();
220 220
 		$sortable = $this->get_sortable_columns();
@@ -235,14 +235,14 @@  discard block
 block discarded – undo
235 235
 		 * headers. The $this->_column_headers property takes an array which contains
236 236
 		 * 3 other arrays. One for all columns, one for hidden columns, and one
237 237
 		 * for sortable columns.
238
-		*/
238
+		 */
239 239
 		$this->_column_headers = array($columns, $hidden, $sortable);
240 240
 
241 241
 		/**
242 242
 		 * REQUIRED for pagination. Let's figure out what page the user is currently
243 243
 		 * looking at. We'll need this later, so you should always include it in
244 244
 		 * your own package classes.
245
-		*/
245
+		 */
246 246
 		$current_page = $this->get_pagenum();
247 247
 
248 248
 		/**
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
 		 * In real-world use, this would be the total number of items in your database,
251 251
 		 * without filtering. We'll need this later, so you should always include it
252 252
 		 * in your own package classes.
253
-		*/
253
+		 */
254 254
 		$total_items = count($data);
255 255
 
256 256
 		/**
257 257
 		 * The WP_List_Table class does not handle pagination for us, so we need
258 258
 		 * to ensure that the data is trimmed to only the current page. We can use
259 259
 		 * array_slice() to
260
-		*/
260
+		 */
261 261
 		$data = array_slice($data,(($current_page-1)*$per_page),$per_page);
262 262
 
263 263
 		/**
264 264
 		 * REQUIRED. Now we can add our *sorted* data to the items property, where
265 265
 		 * it can be used by the rest of the class.
266
-		*/
266
+		 */
267 267
 		$this->items = $data;
268 268
 
269 269
 		/*	REQUIRED. We also have to register our pagination options & calculations.	*/
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /*	Check if file is include. No direct access possible with file url	*/
4
-if ( !defined( 'WPSHOP_VERSION' ) ) {
5
-	die( __('Access is not allowed by this way', 'wpshop') );
4
+if (!defined('WPSHOP_VERSION')) {
5
+	die(__('Access is not allowed by this way', 'wpshop'));
6 6
 }
7 7
 
8 8
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @package wpshop
13 13
  * @subpackage librairies
14 14
  */
15
-class wpshop_customer_entities_custom_List_table extends WP_List_Table{
15
+class wpshop_customer_entities_custom_List_table extends WP_List_Table {
16 16
 
17 17
 	var $datas;
18 18
 
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 	 * REQUIRED. Set up a constructor that references the parent constructor. We
21 21
 	 * use the parent reference to set some default configs.
22 22
 	 ***************************************************************************/
23
-	function __construct(){
23
+	function __construct() {
24 24
 		global $status, $page;
25 25
 
26 26
 		//Set parent defaults
27
-		parent::__construct( array(
28
-			'singular'  => __('attribute\'s', 'wpshop'),    //singular name of the listed records
29
-			'plural'    => __('attributes\'', 'wpshop'),    //plural name of the listed records
27
+		parent::__construct(array(
28
+			'singular'  => __('attribute\'s', 'wpshop'), //singular name of the listed records
29
+			'plural'    => __('attributes\'', 'wpshop'), //plural name of the listed records
30 30
 			'ajax'     => true       //does this table support ajax?
31
-		) );
31
+		));
32 32
 	}
33 33
 
34 34
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * @see WP_List_Table::::single_row_columns()
47 47
 	 * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
48 48
 	 **************************************************************************/
49
-	function get_columns(){
49
+	function get_columns() {
50 50
 		$columns = array(
51 51
 			'date'       	=> __('Date', 'wpshop'),
52 52
 			'order_number'    	=> __('Order number', 'wpshop'),
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	 * @param array $column_name The name/slug of the column to be processed
79 79
 	 * @return string Text or HTML to be placed inside the column <td>
80 80
 	 **************************************************************************/
81
-	function column_default($item, $column_name){
82
-		switch($column_name){
81
+	function column_default($item, $column_name) {
82
+		switch ($column_name) {
83 83
 			default:
84
-				return print_r($item,true); //Show the whole array for troubleshooting purposes
84
+				return print_r($item, true); //Show the whole array for troubleshooting purposes
85 85
 		}
86 86
 	}
87 87
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @param array $item A singular item (one full row's worth of data)
102 102
 	 * @return string Text to be placed inside the column <td> (movie title only)
103 103
 	 **************************************************************************/
104
-	function column_date($item){
104
+	function column_date($item) {
105 105
 		return $item['date'];
106 106
 	}
107 107
 	/** ************************************************************************
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 * @param array $item A singular item (one full row's worth of data)
121 121
 	 * @return string Text to be placed inside the column <td> (movie title only)
122 122
 	 **************************************************************************/
123
-	function column_status($item){
123
+	function column_status($item) {
124 124
 		return __($item['status'], 'wpshop');
125 125
 	}
126 126
 	/** ************************************************************************
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @param array $item A singular item (one full row's worth of data)
140 140
 	 * @return string Text to be placed inside the column <td> (movie title only)
141 141
 	 **************************************************************************/
142
-	function column_order_number($item){
142
+	function column_order_number($item) {
143 143
 		return $item['order_number'];
144 144
 	}
145 145
 	/** ************************************************************************
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
 	 * @param array $item A singular item (one full row's worth of data)
159 159
 	 * @return string Text to be placed inside the column <td> (movie title only)
160 160
 	 **************************************************************************/
161
-	function column_total($item){
161
+	function column_total($item) {
162 162
 		return $item['total'];
163 163
 	}
164 164
 
165
-	function column_action($item){
166
-		return '<a class="button alignright" href="'.admin_url('post.php?post='. $item['action'].'&action=edit').'">'.__('View', 'wpshop').'</a>';
165
+	function column_action($item) {
166
+		return '<a class="button alignright" href="' . admin_url('post.php?post=' . $item['action'] . '&action=edit') . '">' . __('View', 'wpshop') . '</a>';
167 167
 	}
168 168
 
169 169
 	/** ************************************************************************
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		 * to ensure that the data is trimmed to only the current page. We can use
259 259
 		 * array_slice() to
260 260
 		*/
261
-		$data = array_slice($data,(($current_page-1)*$per_page),$per_page);
261
+		$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
262 262
 
263 263
 		/**
264 264
 		 * REQUIRED. Now we can add our *sorted* data to the items property, where
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 		$this->items = $data;
268 268
 
269 269
 		/*	REQUIRED. We also have to register our pagination options & calculations.	*/
270
-		$this->set_pagination_args( array(
271
-			'total_items' => $total_items,               		//WE have to calculate the total number of items
272
-			'per_page'    => $per_page,                 		//WE have to determine how many items to show on a page
273
-			'total_pages' => ceil($total_items/$per_page)   	//WE have to calculate the total number of pages
274
-		) );
270
+		$this->set_pagination_args(array(
271
+			'total_items' => $total_items, //WE have to calculate the total number of items
272
+			'per_page'    => $per_page, //WE have to determine how many items to show on a page
273
+			'total_pages' => ceil($total_items / $per_page)   	//WE have to calculate the total number of pages
274
+		));
275 275
 	}
276 276
 }
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_customer/controller/wps_provider_ctr.php 2 patches
Braces   +6 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
  * Fichier du controleur des metaboxes pour l'administration des clients dans wpshop / Controller file for managing metaboxes into customer administration interface
4 6
  *
@@ -43,8 +45,9 @@  discard block
 block discarded – undo
43 45
 		}
44 46
 	}
45 47
 	public function save_post( $post_id, $post, $update ) {
46
-		if( wp_is_post_revision( $post_id ) || $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS )
47
-			return;
48
+		if( wp_is_post_revision( $post_id ) || $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS ) {
49
+					return;
50
+		}
48 51
 		$is_provider = $this->read( $post_id );
49 52
 		if( isset( $is_provider ) && !empty( $_REQUEST['wps_provider_product'] ) ) {
50 53
 			foreach( $_REQUEST['wps_provider_product'] as $product_id => $product ) {
Please login to merge, or discard this patch.
Spacing   +85 added lines, -85 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
  * Fichier du controleur des metaboxes pour l'administration des clients dans wpshop / Controller file for managing metaboxes into customer administration interface
4 4
  *
@@ -14,82 +14,82 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class wps_provider_ctr {
16 16
 	public function __construct() {
17
-		for( $i = 0; method_exists( $this, 'sub_construct_' . $i ); $i++ ) {
17
+		for ($i = 0; method_exists($this, 'sub_construct_' . $i); $i++) {
18 18
 			$func = 'sub_construct_' . $i;
19 19
 			$this->$func();
20 20
 		}
21 21
 	}
22 22
 	// WORDPRESS
23 23
 	public function sub_construct_0() {
24
-		add_action( 'save_post', array( $this, 'save_post' ), 10, 3 );
25
-		add_action( 'add_meta_boxes_' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, array( $this, 'add_meta_box' ) );
26
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
24
+		add_action('save_post', array($this, 'save_post'), 10, 3);
25
+		add_action('add_meta_boxes_' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, array($this, 'add_meta_box'));
26
+		add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
27 27
 	}
28
-	public function add_meta_box( $third ) {
28
+	public function add_meta_box($third) {
29 29
 		/*$is_provider = $this->read( $third->ID );
30 30
 		if( isset( $is_provider ) ) {
31 31
 			add_meta_box( 'provider_products', __( 'Provider\'s products' ), array( $this, 'provider_products_box' ), WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, 'normal', 'low', $third );
32 32
 		}*/
33 33
 	}
34
-	function admin_enqueue_scripts( $hook ) {
35
-		if( 'post.php' != $hook ) {
34
+	function admin_enqueue_scripts($hook) {
35
+		if ('post.php' != $hook) {
36 36
 			return;
37 37
 		}
38 38
 
39
-		$post = !empty( $_GET['post'] ) ? (array)$_GET['post'] : array();
40
-		$action = !empty( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : '';
39
+		$post = !empty($_GET['post']) ? (array)$_GET['post'] : array();
40
+		$action = !empty($_GET['action']) ? sanitize_text_field($_GET['action']) : '';
41 41
 
42
-		if( isset( $post ) && $action == 'edit' ) {
43
-			$is_provider = $this->read( $post );
44
-			if( isset( $is_provider ) ) {
45
-				wp_enqueue_script( 'wps_provider_products', WPS_ACCOUNT_URL . WPS_ACCOUNT_DIR . '/assets/backend/js/wps_provider_products.js' );
42
+		if (isset($post) && $action == 'edit') {
43
+			$is_provider = $this->read($post);
44
+			if (isset($is_provider)) {
45
+				wp_enqueue_script('wps_provider_products', WPS_ACCOUNT_URL . WPS_ACCOUNT_DIR . '/assets/backend/js/wps_provider_products.js');
46 46
 			}
47 47
 		}
48 48
 	}
49
-	public function save_post( $post_id, $post, $update ) {
50
-		if( wp_is_post_revision( $post_id ) || $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS )
49
+	public function save_post($post_id, $post, $update) {
50
+		if (wp_is_post_revision($post_id) || $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS)
51 51
 			return;
52 52
 
53
-		$wps_provider_product = !empty( $_REQUEST['wps_provider_product'] ) ? (array)$_REQUEST['wps_provider_product'] : array();
54
-		$is_provider = $this->read( $post_id );
55
-		if( isset( $is_provider ) && !empty( $wps_provider_product ) ) {
56
-			foreach( $wps_provider_product as $product_id => $product ) {
57
-				switch( $product['special_provider'] ) {
53
+		$wps_provider_product = !empty($_REQUEST['wps_provider_product']) ? (array)$_REQUEST['wps_provider_product'] : array();
54
+		$is_provider = $this->read($post_id);
55
+		if (isset($is_provider) && !empty($wps_provider_product)) {
56
+			foreach ($wps_provider_product as $product_id => $product) {
57
+				switch ($product['special_provider']) {
58 58
 					case 'update':
59 59
 						$product['ID'] = $product_id;
60
-						$this->update_product( $product );
60
+						$this->update_product($product);
61 61
 						break;
62 62
 					case 'delete':
63
-						$this->delete_product( $product_id );
63
+						$this->delete_product($product_id);
64 64
 						break;
65 65
 				}
66 66
 			}
67 67
 		}
68 68
 	}
69
-	public function provider_products_box( $third ) {
69
+	public function provider_products_box($third) {
70 70
 		global $wpdb;
71
-		foreach( $this->read_product( $third->ID ) as $post ) {
71
+		foreach ($this->read_product($third->ID) as $post) {
72 72
 			$attributes_display = '';
73
-			$product_entity_id = wpshop_entities::get_entity_identifier_from_code( WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT );
74
-			$query = $wpdb->prepare( 'SELECT * FROM '. WPSHOP_DBT_ATTRIBUTE . ' WHERE entity_id = %d AND is_used_in_quick_add_form = %s AND status = %s', $product_entity_id, 'yes', 'valid' );
75
-			$attributes = $wpdb->get_results( $query, ARRAY_A );
76
-			if( !empty($attributes) ) {
77
-				foreach( $attributes as $attribute_id => $att_def ) {
78
-					$current_value = wpshop_attributes::getAttributeValueForEntityInSet( $att_def['data_type'], $att_def['id'], $product_entity_id, $post->ID );
79
-					$output_specs =  array(
73
+			$product_entity_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT);
74
+			$query = $wpdb->prepare('SELECT * FROM ' . WPSHOP_DBT_ATTRIBUTE . ' WHERE entity_id = %d AND is_used_in_quick_add_form = %s AND status = %s', $product_entity_id, 'yes', 'valid');
75
+			$attributes = $wpdb->get_results($query, ARRAY_A);
76
+			if (!empty($attributes)) {
77
+				foreach ($attributes as $attribute_id => $att_def) {
78
+					$current_value = wpshop_attributes::getAttributeValueForEntityInSet($att_def['data_type'], $att_def['id'], $product_entity_id, $post->ID);
79
+					$output_specs = array(
80 80
 						'page_code' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT,
81 81
 						'element_identifier' => $post->ID,
82
-						'field_id' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT.'_'.$post->ID. '_',
83
-						'current_value' => ( !empty($current_value->value) ? $current_value->value : '' )
82
+						'field_id' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_' . $post->ID . '_',
83
+						'current_value' => (!empty($current_value->value) ? $current_value->value : '')
84 84
 					);
85
-					$att = wpshop_attributes::display_attribute( $att_def['code'], 'admin', $output_specs );
85
+					$att = wpshop_attributes::display_attribute($att_def['code'], 'admin', $output_specs);
86 86
 					ob_start();
87
-					require( wpshop_tools::get_template_part( WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . '/templates/', 'backend', 'provider_products/product_provider_attribute' ) );
87
+					require(wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . '/templates/', 'backend', 'provider_products/product_provider_attribute'));
88 88
 					$attributes_display .= ob_get_contents();
89 89
 					ob_end_clean();
90 90
 				}
91 91
 			}
92
-			require( wpshop_tools::get_template_part( WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . '/templates/', 'backend', 'provider_products/product_provider' ) );
92
+			require(wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . '/templates/', 'backend', 'provider_products/product_provider'));
93 93
 		}
94 94
 	}
95 95
 	// PROVIDER
@@ -97,29 +97,29 @@  discard block
 block discarded – undo
97 97
 	private $value_attr;
98 98
 	public function sub_construct_1() {
99 99
 		global $wpdb;
100
-		$entity_id = wpshop_entities::get_entity_identifier_from_code( WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS );
101
-		$query = $wpdb->prepare( 'SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE . ' WHERE code = %s AND entity_id = %d', 'is_provider', $entity_id );
102
-		$this->id_attr = $wpdb->get_var( $query );
103
-		$query = $wpdb->prepare( 'SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE attribute_id = %d AND LOWER( value ) = %s', $this->id_attr, strtolower( __( 'yes', 'wpshop' ) ) );
104
-		$this->value_attr = $wpdb->get_var( $query );
100
+		$entity_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS);
101
+		$query = $wpdb->prepare('SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE . ' WHERE code = %s AND entity_id = %d', 'is_provider', $entity_id);
102
+		$this->id_attr = $wpdb->get_var($query);
103
+		$query = $wpdb->prepare('SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE attribute_id = %d AND LOWER( value ) = %s', $this->id_attr, strtolower(__('yes', 'wpshop')));
104
+		$this->value_attr = $wpdb->get_var($query);
105 105
 	}
106
-	public function read( $args = array() ) {
106
+	public function read($args = array()) {
107 107
 		global $wpdb;
108
-		if( is_array( $args ) ) {
108
+		if (is_array($args)) {
109 109
 			$args['post_type'] = WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS;
110
-			if( isset( $args['posts_per_page'] ) ) {
110
+			if (isset($args['posts_per_page'])) {
111 111
 				$args['posts_per_page'] = -1;
112 112
 			}
113
-			$query = $wpdb->prepare( 'SELECT entity_id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER . ' WHERE attribute_id = %d AND value = %d', $this->id_attr, $this->value_attr );
114
-			$args['post__in'] = $wpdb->get_col( $query );
115
-			$query = new WP_Query( $args );
113
+			$query = $wpdb->prepare('SELECT entity_id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER . ' WHERE attribute_id = %d AND value = %d', $this->id_attr, $this->value_attr);
114
+			$args['post__in'] = $wpdb->get_col($query);
115
+			$query = new WP_Query($args);
116 116
 			$return = $query->get_posts();
117
-		} elseif( is_numeric( $args ) ) {
118
-			$query = $wpdb->prepare( 'SELECT value_id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER . ' WHERE entity_id = %d AND attribute_id = %d AND value = %d', $args, $this->id_attr, $this->value_attr );
119
-			$id = $wpdb->get_var( $query );
120
-			$exist = (bool) isset( $id );
121
-			if( $exist ) {
122
-				$return = get_post( $args );
117
+		} elseif (is_numeric($args)) {
118
+			$query = $wpdb->prepare('SELECT value_id FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER . ' WHERE entity_id = %d AND attribute_id = %d AND value = %d', $args, $this->id_attr, $this->value_attr);
119
+			$id = $wpdb->get_var($query);
120
+			$exist = (bool)isset($id);
121
+			if ($exist) {
122
+				$return = get_post($args);
123 123
 			} else {
124 124
 				$return = null;
125 125
 			}
@@ -127,67 +127,67 @@  discard block
 block discarded – undo
127 127
 		return $return;
128 128
 	}
129 129
 	// CRUD PROVIDER'S PRODUCTS
130
-	public function create_product( $id_provider = 0, $product ) {
131
-		if( is_array( $product ) || is_object( $product ) ) {
132
-			if( is_array( $product ) ) {
130
+	public function create_product($id_provider = 0, $product) {
131
+		if (is_array($product) || is_object($product)) {
132
+			if (is_array($product)) {
133 133
 				$data_to_save = $product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute'];
134
-				unset( $product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute'] );
135
-			} elseif( is_object( $product ) ) {
134
+				unset($product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute']);
135
+			} elseif (is_object($product)) {
136 136
 				$var = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute';
137 137
 				$data_to_save = $product->$var;
138
-				unset( $product->$var );
138
+				unset($product->$var);
139 139
 			}
140 140
 			$product_class = new wpshop_products();
141
-			$data_to_save = apply_filters( 'create_provider_product_data_to_save', array( WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute' => $data_to_save, 'action' => 'autosave' ) );
141
+			$data_to_save = apply_filters('create_provider_product_data_to_save', array(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute' => $data_to_save, 'action' => 'autosave'));
142 142
 			$product['post_status'] = 'pending';
143 143
 			$product['post_type'] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT;
144
-			if( !isset( $product['post_title'] ) ) {
145
-				$product['post_title'] = __( 'New product', 'wpshop' );
144
+			if (!isset($product['post_title'])) {
145
+				$product['post_title'] = __('New product', 'wpshop');
146 146
 			}
147
-			$product_id = wp_insert_post( $product );
148
-			if( $id_provider != 0 ) {
149
-				update_post_meta( $product_id, WPSHOP_PRODUCT_PROVIDER, array( (string) $id_provider ) );
147
+			$product_id = wp_insert_post($product);
148
+			if ($id_provider != 0) {
149
+				update_post_meta($product_id, WPSHOP_PRODUCT_PROVIDER, array((string)$id_provider));
150 150
 			}
151 151
 			$data_to_save['post_ID'] = $product_id;
152
-			$product_class->save_product_custom_informations( $product_id, $data_to_save );
152
+			$product_class->save_product_custom_informations($product_id, $data_to_save);
153 153
 			return $product_id;
154 154
 		}
155 155
 	}
156
-	public function read_product( $id_provider = 0, $args = array() ) {
156
+	public function read_product($id_provider = 0, $args = array()) {
157 157
 		$args['post_type'] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT;
158
-		$args['post_status'] = array( 'pending', 'publish', 'draft', 'private' );
158
+		$args['post_status'] = array('pending', 'publish', 'draft', 'private');
159 159
 		$args['meta_key'] = WPSHOP_PRODUCT_PROVIDER;
160
-		if( !isset( $args['posts_per_page'] ) ) {
160
+		if (!isset($args['posts_per_page'])) {
161 161
 			$args['posts_per_page'] = -1;
162 162
 		}
163
-		if( is_numeric( $id_provider ) && $id_provider != 0 ) {
164
-			$args['meta_value'] = serialize( (string) $id_provider );
163
+		if (is_numeric($id_provider) && $id_provider != 0) {
164
+			$args['meta_value'] = serialize((string)$id_provider);
165 165
 			$args['meta_compare'] = 'LIKE';
166 166
 		}
167
-		$query = new WP_Query( $args );
167
+		$query = new WP_Query($args);
168 168
 		return $query->get_posts();
169 169
 	}
170
-	public function update_product( $product ) {
171
-		if( is_array( $product ) || is_object( $product ) ) {
172
-			if( is_array( $product ) ) {
170
+	public function update_product($product) {
171
+		if (is_array($product) || is_object($product)) {
172
+			if (is_array($product)) {
173 173
 				$product_id = $product['ID'];
174 174
 				$data_to_save = $product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute'];
175
-				unset( $product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute'] );
176
-			} elseif( is_object( $product ) ) {
175
+				unset($product[WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute']);
176
+			} elseif (is_object($product)) {
177 177
 				$product_id = $product->ID;
178 178
 				$var = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute';
179 179
 				$data_to_save = $product->$var;
180
-				unset( $product->$var );
180
+				unset($product->$var);
181 181
 			}
182 182
 			$product_class = new wpshop_products();
183
-			$data_to_save = apply_filters( 'update_provider_product_data_to_save', array( 'post_ID' => $product_id, 'action' => 'autosave', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute' => $data_to_save ) );
184
-			$product_class->save_product_custom_informations( $product_id, $data_to_save );
185
-			wp_update_post( $product );
183
+			$data_to_save = apply_filters('update_provider_product_data_to_save', array('post_ID' => $product_id, 'action' => 'autosave', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute' => $data_to_save));
184
+			$product_class->save_product_custom_informations($product_id, $data_to_save);
185
+			wp_update_post($product);
186 186
 		}
187 187
 	}
188
-	public function delete_product( $args ) {
189
-		if( is_numeric( $args ) || is_object( $args ) ) {
190
-			wp_trash_post( $args );
188
+	public function delete_product($args) {
189
+		if (is_numeric($args) || is_object($args)) {
190
+			wp_trash_post($args);
191 191
 		}
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
modules/wps_customer/controller/customer_custom_list_table.class.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 	var $datas;
16 16
 
17 17
 	/**
18
-	* Constructor, we override the parent to pass our own arguments
19
-	* We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.
20
-	*/
18
+	 * Constructor, we override the parent to pass our own arguments
19
+	 * We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.
20
+	 */
21 21
 	function __construct(){
22 22
 			parent::__construct( array(
23 23
 			'singular'=> 'wp_list_customer', //Singular label
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 
29 29
 	/**
30
-	*	Define the output for each column if specific column output has not been defined
31
-	*
32
-	*	@param object|array $item The item to output column content for
33
-	*	@param string $column_name The column that we are trying to output
34
-	*
35
-	*	@return mixed The column output if found, or defaut is an complete output of the item
36
-	*/
30
+	 *	Define the output for each column if specific column output has not been defined
31
+	 *
32
+	 *	@param object|array $item The item to output column content for
33
+	 *	@param string $column_name The column that we are trying to output
34
+	 *
35
+	 *	@return mixed The column output if found, or defaut is an complete output of the item
36
+	 */
37 37
 	function column_default($item, $column_name){
38 38
 		switch($column_name){
39 39
 			case 'customer_id':{
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	/**
55
-	*	Define specific outptu for a given column
56
-	*
57
-	*	@param object|array $item The item we want to get the specific output for the current column
58
-	*
59
-	*	@return string The output build specificly for the given column
60
-	*/
55
+	 *	Define specific outptu for a given column
56
+	 *
57
+	 *	@param object|array $item The item we want to get the specific output for the current column
58
+	 *
59
+	 *	@return string The output build specificly for the given column
60
+	 */
61 61
 	function column_cb($item){
62 62
 		return sprintf(
63 63
 				'<input type="radio" name="%1$s" value="%2$s" class="wpshop_customer_order_cb_dialog" id="wpshop_customer_order_cb_dialog_%2$s" name="customer_order" />',
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 	}
68 68
 
69 69
 	/**
70
-	* Define the columns that are going to be used in the table
71
-	* @return array $columns, the array of columns to use with the table
72
-	*/
70
+	 * Define the columns that are going to be used in the table
71
+	 * @return array $columns, the array of columns to use with the table
72
+	 */
73 73
 	function get_columns() {
74 74
 		return $columns= array(
75 75
 			'cb'=>'',
@@ -80,23 +80,23 @@  discard block
 block discarded – undo
80 80
 	}
81 81
 
82 82
 	/**
83
-	* Define the columns that are going to be used for sorting the table
84
-	* @return array $columns, the array of sortable columns in the table
85
-	*/
83
+	 * Define the columns that are going to be used for sorting the table
84
+	 * @return array $columns, the array of sortable columns in the table
85
+	 */
86 86
 	function get_sortable_columns() {
87 87
 		$sortable_columns = array();
88 88
 		return $sortable_columns;
89 89
 	}
90 90
 
91 91
 	/**
92
-	*	Build The table output for future display
93
-	*
94
-	*	@param array|object $data, The list of item to display in the table
95
-	*	@param int $per_page, The number of items per page in the table
96
-	*	@param int $current_page, The current page number allowing to know wich item to display
97
-	*
98
-	*	@return void
99
-	*/
92
+	 *	Build The table output for future display
93
+	 *
94
+	 *	@param array|object $data, The list of item to display in the table
95
+	 *	@param int $per_page, The number of items per page in the table
96
+	 *	@param int $current_page, The current page number allowing to know wich item to display
97
+	 *
98
+	 *	@return void
99
+	 */
100 100
 	function prepare_items($data, $per_page, $current_page){
101 101
 
102 102
 
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
 
106 106
 
107 107
 		/**
108
-		* REQUIRED. Now we need to define our column headers. This includes a complete
109
-		* array of columns to be displayed (slugs & titles), a list of columns
110
-		* to keep hidden, and a list of columns that are sortable. Each of these
111
-		* can be defined in another method (as we've done here) before being
112
-		* used to build the value for our _column_headers property.
113
-		*/
108
+		 * REQUIRED. Now we need to define our column headers. This includes a complete
109
+		 * array of columns to be displayed (slugs & titles), a list of columns
110
+		 * to keep hidden, and a list of columns that are sortable. Each of these
111
+		 * can be defined in another method (as we've done here) before being
112
+		 * used to build the value for our _column_headers property.
113
+		 */
114 114
 		$columns = $this->get_columns();
115 115
 		$hidden = array();
116 116
 		$sortable = $this->get_sortable_columns();
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /*	Check if file is include. No direct access possible with file url	*/
4
-if ( !defined( 'WPSHOP_VERSION' ) ) {
5
-	die( __('Access is not allowed by this way', 'wpshop') );
4
+if (!defined('WPSHOP_VERSION')) {
5
+	die(__('Access is not allowed by this way', 'wpshop'));
6 6
 }
7 7
 
8 8
 
9 9
 //Our class extends the WP_List_Table class, so we need to make sure that it's there
10
-if(!class_exists('WP_List_Table')){
11
-	require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
10
+if (!class_exists('WP_List_Table')) {
11
+	require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
12 12
 }
13 13
 class Customer_List_Table extends WP_List_Table {
14 14
 
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 	* Constructor, we override the parent to pass our own arguments
19 19
 	* We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.
20 20
 	*/
21
-	function __construct(){
22
-			parent::__construct( array(
21
+	function __construct() {
22
+			parent::__construct(array(
23 23
 			'singular'=> 'wp_list_customer', //Singular label
24 24
 			'plural' => 'wp_list_customers', //plural label, also this well be one of the table css class
25 25
 			'ajax' => false
26
-		) );
26
+		));
27 27
 	}
28 28
 
29 29
 	/**
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	*
35 35
 	*	@return mixed The column output if found, or defaut is an complete output of the item
36 36
 	*/
37
-	function column_default($item, $column_name){
38
-		switch($column_name){
37
+	function column_default($item, $column_name) {
38
+		switch ($column_name) {
39 39
 			case 'customer_id':{
40 40
 				return '<label for="wpshop_customer_order_cb_dialog_' . $item->ID . '" >' . WPSHOP_IDENTIFIER_CUSTOMER . $item->ID . '</label>';
41 41
 			}break;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 				return $item->user_firstname;
47 47
 			}break;
48 48
 			default:
49
-				return print_r($item,true); //Show the whole array for troubleshooting purposes
49
+				return print_r($item, true); //Show the whole array for troubleshooting purposes
50 50
 			break;
51 51
 		}
52 52
 	}
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	*
59 59
 	*	@return string The output build specificly for the given column
60 60
 	*/
61
-	function column_cb($item){
61
+	function column_cb($item) {
62 62
 		return sprintf(
63 63
 				'<input type="radio" name="%1$s" value="%2$s" class="wpshop_customer_order_cb_dialog" id="wpshop_customer_order_cb_dialog_%2$s" name="customer_order" />',
64
-				/*$1%s*/ $this->_args['singular'],  //Let's simply repurpose the table's singular label ("movie")
64
+				/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie")
65 65
 				/*$2%s*/ $item->ID                //The value of the checkbox should be the record's id
66 66
 		);
67 67
 	}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	* @return array $columns, the array of columns to use with the table
72 72
 	*/
73 73
 	function get_columns() {
74
-		return $columns= array(
74
+		return $columns = array(
75 75
 			'cb'=>'',
76 76
 			'customer_id'=>'',
77 77
 			'customer_lastname'=>__('Lastname', 'wpshop'),
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	*
98 98
 	*	@return void
99 99
 	*/
100
-	function prepare_items($data, $per_page, $current_page){
100
+	function prepare_items($data, $per_page, $current_page) {
101 101
 
102 102
 
103 103
 
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.