Completed
Pull Request — master (#2)
by Jimmy
1216:52 queued 1185:43
created
includes/librairies/pdf/font/zapfdingbats.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
-$fpdf_charwidths['zapfdingbats']=array(
3
-	chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
4
-	chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
5
-	','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
6
-	'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
7
-	'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
8
-	'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
9
-	chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
10
-	chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
11
-	chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
12
-	chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
13
-	chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
14
-	chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
1
+<?php if (!defined('ABSPATH')) exit;
2
+$fpdf_charwidths['zapfdingbats'] = array(
3
+	chr(0)=>0, chr(1)=>0, chr(2)=>0, chr(3)=>0, chr(4)=>0, chr(5)=>0, chr(6)=>0, chr(7)=>0, chr(8)=>0, chr(9)=>0, chr(10)=>0, chr(11)=>0, chr(12)=>0, chr(13)=>0, chr(14)=>0, chr(15)=>0, chr(16)=>0, chr(17)=>0, chr(18)=>0, chr(19)=>0, chr(20)=>0, chr(21)=>0,
4
+	chr(22)=>0, chr(23)=>0, chr(24)=>0, chr(25)=>0, chr(26)=>0, chr(27)=>0, chr(28)=>0, chr(29)=>0, chr(30)=>0, chr(31)=>0, ' '=>278, '!'=>974, '"'=>961, '#'=>974, '$'=>980, '%'=>719, '&'=>789, '\''=>790, '('=>791, ')'=>690, '*'=>960, '+'=>939,
5
+	','=>549, '-'=>855, '.'=>911, '/'=>933, '0'=>911, '1'=>945, '2'=>974, '3'=>755, '4'=>846, '5'=>762, '6'=>761, '7'=>571, '8'=>677, '9'=>763, ':'=>760, ';'=>759, '<'=>754, '='=>494, '>'=>552, '?'=>537, '@'=>577, 'A'=>692,
6
+	'B'=>786, 'C'=>788, 'D'=>788, 'E'=>790, 'F'=>793, 'G'=>794, 'H'=>816, 'I'=>823, 'J'=>789, 'K'=>841, 'L'=>823, 'M'=>833, 'N'=>816, 'O'=>831, 'P'=>923, 'Q'=>744, 'R'=>723, 'S'=>749, 'T'=>790, 'U'=>792, 'V'=>695, 'W'=>776,
7
+	'X'=>768, 'Y'=>792, 'Z'=>759, '['=>707, '\\'=>708, ']'=>682, '^'=>701, '_'=>826, '`'=>815, 'a'=>789, 'b'=>789, 'c'=>707, 'd'=>687, 'e'=>696, 'f'=>689, 'g'=>786, 'h'=>787, 'i'=>713, 'j'=>791, 'k'=>785, 'l'=>791, 'm'=>873,
8
+	'n'=>761, 'o'=>762, 'p'=>762, 'q'=>759, 'r'=>759, 's'=>892, 't'=>892, 'u'=>788, 'v'=>784, 'w'=>438, 'x'=>138, 'y'=>277, 'z'=>415, '{'=>392, '|'=>392, '}'=>668, '~'=>668, chr(127)=>0, chr(128)=>390, chr(129)=>390, chr(130)=>317, chr(131)=>317,
9
+	chr(132)=>276, chr(133)=>276, chr(134)=>509, chr(135)=>509, chr(136)=>410, chr(137)=>410, chr(138)=>234, chr(139)=>234, chr(140)=>334, chr(141)=>334, chr(142)=>0, chr(143)=>0, chr(144)=>0, chr(145)=>0, chr(146)=>0, chr(147)=>0, chr(148)=>0, chr(149)=>0, chr(150)=>0, chr(151)=>0, chr(152)=>0, chr(153)=>0,
10
+	chr(154)=>0, chr(155)=>0, chr(156)=>0, chr(157)=>0, chr(158)=>0, chr(159)=>0, chr(160)=>0, chr(161)=>732, chr(162)=>544, chr(163)=>544, chr(164)=>910, chr(165)=>667, chr(166)=>760, chr(167)=>760, chr(168)=>776, chr(169)=>595, chr(170)=>694, chr(171)=>626, chr(172)=>788, chr(173)=>788, chr(174)=>788, chr(175)=>788,
11
+	chr(176)=>788, chr(177)=>788, chr(178)=>788, chr(179)=>788, chr(180)=>788, chr(181)=>788, chr(182)=>788, chr(183)=>788, chr(184)=>788, chr(185)=>788, chr(186)=>788, chr(187)=>788, chr(188)=>788, chr(189)=>788, chr(190)=>788, chr(191)=>788, chr(192)=>788, chr(193)=>788, chr(194)=>788, chr(195)=>788, chr(196)=>788, chr(197)=>788,
12
+	chr(198)=>788, chr(199)=>788, chr(200)=>788, chr(201)=>788, chr(202)=>788, chr(203)=>788, chr(204)=>788, chr(205)=>788, chr(206)=>788, chr(207)=>788, chr(208)=>788, chr(209)=>788, chr(210)=>788, chr(211)=>788, chr(212)=>894, chr(213)=>838, chr(214)=>1016, chr(215)=>458, chr(216)=>748, chr(217)=>924, chr(218)=>748, chr(219)=>918,
13
+	chr(220)=>927, chr(221)=>928, chr(222)=>928, chr(223)=>834, chr(224)=>873, chr(225)=>828, chr(226)=>924, chr(227)=>924, chr(228)=>917, chr(229)=>930, chr(230)=>931, chr(231)=>463, chr(232)=>883, chr(233)=>836, chr(234)=>836, chr(235)=>867, chr(236)=>867, chr(237)=>696, chr(238)=>696, chr(239)=>874, chr(240)=>0, chr(241)=>874,
14
+	chr(242)=>760, chr(243)=>946, chr(244)=>771, chr(245)=>865, chr(246)=>771, chr(247)=>888, chr(248)=>967, chr(249)=>888, chr(250)=>831, chr(251)=>873, chr(252)=>927, chr(253)=>970, chr(254)=>918, chr(255)=>0);
15 15
 ?>
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/librairies/display/widgets/products.widget.php 2 patches
Spacing   +47 added lines, -47 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
 class WP_Widget_Wpshop_Products extends WP_Widget {
4 4
 
@@ -8,54 +8,54 @@  discard block
 block discarded – undo
8 8
 	 * @return void
9 9
 	 */
10 10
 	function __construct() {
11
-		add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_Wpshop_Products");' ) );
11
+		add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_Wpshop_Products");'));
12 12
 		
13
-		$widget_ops = array( 'classname' => 'WP_Widget_Wpshop_Products', 'description' => __('Allows you to display a widget with a list of product into your shop', 'wpshop') );
14
-		parent::__construct( 'WP_Widget_Wpshop_Products', __( '• Wpshop products', 'wpshop' ), $widget_ops );
13
+		$widget_ops = array('classname' => 'WP_Widget_Wpshop_Products', 'description' => __('Allows you to display a widget with a list of product into your shop', 'wpshop'));
14
+		parent::__construct('WP_Widget_Wpshop_Products', __('• Wpshop products', 'wpshop'), $widget_ops);
15 15
 	}
16 16
 
17 17
 	/**
18 18
 	 * (non-PHPdoc)
19 19
 	 * @see WP_Widget::widget()
20 20
 	 */
21
-	function widget( $args, $instance ) {
21
+	function widget($args, $instance) {
22 22
 
23 23
 		extract($args);
24 24
 
25
-		$wpshop_select_wpshop_products = isset( $instance['wpshop_select_wpshop_products'] ) ? $instance['wpshop_select_wpshop_products'] : false;
26
-		$wpshop_select_wpshop_categorie = isset( $instance['wpshop_select_wpshop_categorie'] ) ? $instance['wpshop_select_wpshop_categorie'] : false;
27
-		$wpshop_nb_wpshop_products = isset( $instance['wpshop_nb_wpshop_products'] ) ? $instance['wpshop_nb_wpshop_products'] : false;
28
-		$wpshop_select_wpshop_products_mode = isset( $instance['wpshop_select_wpshop_products_mode'] ) ? $instance['wpshop_select_wpshop_products_mode'] : false;
29
-		$wpshop_wpshop_products_title = isset( $instance['wpshop_wpshop_products_title'] ) ? $instance['wpshop_wpshop_products_title'] : false;
25
+		$wpshop_select_wpshop_products = isset($instance['wpshop_select_wpshop_products']) ? $instance['wpshop_select_wpshop_products'] : false;
26
+		$wpshop_select_wpshop_categorie = isset($instance['wpshop_select_wpshop_categorie']) ? $instance['wpshop_select_wpshop_categorie'] : false;
27
+		$wpshop_nb_wpshop_products = isset($instance['wpshop_nb_wpshop_products']) ? $instance['wpshop_nb_wpshop_products'] : false;
28
+		$wpshop_select_wpshop_products_mode = isset($instance['wpshop_select_wpshop_products_mode']) ? $instance['wpshop_select_wpshop_products_mode'] : false;
29
+		$wpshop_wpshop_products_title = isset($instance['wpshop_wpshop_products_title']) ? $instance['wpshop_wpshop_products_title'] : false;
30 30
 
31
-		$wpshop_nb_par_ligne_wpshop_products = isset( $instance['wpshop_nb_par_ligne_wpshop_products'] ) ? $instance['wpshop_nb_par_ligne_wpshop_products'] : false;
31
+		$wpshop_nb_par_ligne_wpshop_products = isset($instance['wpshop_nb_par_ligne_wpshop_products']) ? $instance['wpshop_nb_par_ligne_wpshop_products'] : false;
32 32
 
33
-		$wpshop_tri_wpshop_products = isset( $instance['wpshop_tri_wpshop_products'] ) ? $instance['wpshop_tri_wpshop_products'] : false;
33
+		$wpshop_tri_wpshop_products = isset($instance['wpshop_tri_wpshop_products']) ? $instance['wpshop_tri_wpshop_products'] : false;
34 34
 		$display_pagination = !empty($instance['wpshop_display_pagination']) ? $instance['wpshop_display_pagination'] : "yes";
35 35
 
36 36
 		echo $before_widget; ?>
37
-		<?php if ($wpshop_wpshop_products_title){ ?>
37
+		<?php if ($wpshop_wpshop_products_title) { ?>
38 38
 		<h3 class="widget-title"><?php echo $wpshop_wpshop_products_title; ?></h3>
39 39
 		<?php }
40 40
 
41
-		$chaine_shortcode = '[wpshop_products sorting="no" limit="'.$wpshop_nb_wpshop_products.'" ';
42
-		if($wpshop_select_wpshop_products == 'random'){
41
+		$chaine_shortcode = '[wpshop_products sorting="no" limit="' . $wpshop_nb_wpshop_products . '" ';
42
+		if ($wpshop_select_wpshop_products == 'random') {
43 43
 			$chaine_shortcode .= 'order="rand" ';
44
-		}else if ($wpshop_select_wpshop_products == 'vedette'){
44
+		} else if ($wpshop_select_wpshop_products == 'vedette') {
45 45
 			$chaine_shortcode .= 'att_name="highlight_product" att_value="yes" ';
46
-		}else if ($wpshop_select_wpshop_products == 'nouveaux'){
46
+		} else if ($wpshop_select_wpshop_products == 'nouveaux') {
47 47
 			$chaine_shortcode .= 'att_name="declare_new" att_value="yes" ';
48
-		}else {
49
-			$chaine_shortcode .= 'cid="'.$wpshop_select_wpshop_categorie.'" type="'.$wpshop_select_wpshop_products_mode.'" ';
48
+		} else {
49
+			$chaine_shortcode .= 'cid="' . $wpshop_select_wpshop_categorie . '" type="' . $wpshop_select_wpshop_products_mode . '" ';
50 50
 		}
51
-		if($wpshop_select_wpshop_products_mode == 'list'){
51
+		if ($wpshop_select_wpshop_products_mode == 'list') {
52 52
 			$chaine_shortcode .= 'type="list" ';
53 53
 		}
54
-		elseif( $wpshop_select_wpshop_products_mode == 'grid' ) {
54
+		elseif ($wpshop_select_wpshop_products_mode == 'grid') {
55 55
 			$chaine_shortcode .= 'type="grid" ';
56 56
 		}
57
-		if($wpshop_nb_par_ligne_wpshop_products){
58
-			$chaine_shortcode .= 'grid_element_nb_per_line="'.$wpshop_nb_par_ligne_wpshop_products.'" ';
57
+		if ($wpshop_nb_par_ligne_wpshop_products) {
58
+			$chaine_shortcode .= 'grid_element_nb_per_line="' . $wpshop_nb_par_ligne_wpshop_products . '" ';
59 59
 		}
60 60
 		$chaine_shortcode .= ' display_pagination="' . $display_pagination . '" ';
61 61
 		// [grid_element_nb_per_line]
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * (non-PHPdoc)
72 72
 	 * @see WP_Widget::update()
73 73
 	 */
74
-	function update( $new, $old ) {
74
+	function update($new, $old) {
75 75
 		return $new;
76 76
 	}
77 77
 
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 * (non-PHPdoc)
80 80
 	 * @see WP_Widget::form()
81 81
 	 */
82
-	function form( $instance ) {
83
-		$instance = wp_parse_args((array) $instance, array(
82
+	function form($instance) {
83
+		$instance = wp_parse_args((array)$instance, array(
84 84
 			'wpshop_select_wpshop_products' => false,
85 85
 			'wpshop_type_wpshop_product' => false,
86 86
 			'wpshop_tri_wpshop_products' => false,
@@ -93,23 +93,23 @@  discard block
 block discarded – undo
93 93
 ?>
94 94
 <fieldset>
95 95
 	<p>
96
-		<label for="<?php echo $this->get_field_id( 'wpshop_wpshop_products_title' ); ?>"><?php _e('Widget title', 'wpshop'); ?> : <br></label>
97
-		<input value="<?php echo $instance['wpshop_wpshop_products_title']; ?>" type="text"  id="<?php echo $this->get_field_id( 'wpshop_wpshop_products_title' ); ?>" name="<?php echo $this->get_field_name( 'wpshop_wpshop_products_title' ); ?>" />
96
+		<label for="<?php echo $this->get_field_id('wpshop_wpshop_products_title'); ?>"><?php _e('Widget title', 'wpshop'); ?> : <br></label>
97
+		<input value="<?php echo $instance['wpshop_wpshop_products_title']; ?>" type="text"  id="<?php echo $this->get_field_id('wpshop_wpshop_products_title'); ?>" name="<?php echo $this->get_field_name('wpshop_wpshop_products_title'); ?>" />
98 98
 	</p>
99 99
 
100 100
 	<p class="<?php echo $this->id; ?>-select">
101
-		<label for="<?php echo $this->get_field_id( 'wpshop_select_wpshop_products' ); ?>"><?php _e('Choose what type of product to display', 'wpshop'); ?> : <br></label>
102
-	 	<select name="<?php echo $this->get_field_name( 'wpshop_select_wpshop_products' ); ?>" class="widefat wpshop_widget_wpshop_pdt_display_selector">
103
-			<option value="random" <?php selected( $instance['wpshop_select_wpshop_products'], 'random' ); ?>><?php _e('Random products', 'wpshop'); ?></option>
104
-			<option value="vedette" <?php selected( $instance['wpshop_select_wpshop_products'], 'vedette' ); ?>><?php _e('Featured products', 'wpshop'); ?></option>
105
-			<option value="nouveaux" <?php selected( $instance['wpshop_select_wpshop_products'], 'nouveaux' ); ?>><?php _e('New products', 'wpshop'); ?></option>
106
-			<option value="categorie" <?php selected( $instance['wpshop_select_wpshop_products'], 'categorie' ); ?>><?php _e('Product from a category', 'wpshop'); ?></option>
101
+		<label for="<?php echo $this->get_field_id('wpshop_select_wpshop_products'); ?>"><?php _e('Choose what type of product to display', 'wpshop'); ?> : <br></label>
102
+	 	<select name="<?php echo $this->get_field_name('wpshop_select_wpshop_products'); ?>" class="widefat wpshop_widget_wpshop_pdt_display_selector">
103
+			<option value="random" <?php selected($instance['wpshop_select_wpshop_products'], 'random'); ?>><?php _e('Random products', 'wpshop'); ?></option>
104
+			<option value="vedette" <?php selected($instance['wpshop_select_wpshop_products'], 'vedette'); ?>><?php _e('Featured products', 'wpshop'); ?></option>
105
+			<option value="nouveaux" <?php selected($instance['wpshop_select_wpshop_products'], 'nouveaux'); ?>><?php _e('New products', 'wpshop'); ?></option>
106
+			<option value="categorie" <?php selected($instance['wpshop_select_wpshop_products'], 'categorie'); ?>><?php _e('Product from a category', 'wpshop'); ?></option>
107 107
 		</select>
108 108
 	</p>
109 109
 
110 110
 	<p class="<?php echo $this->id; ?>-select-cat wpshop_widget_wpshop_pdt_display_container" >
111
-		<label for="<?php echo $this->get_field_id( 'wpshop_select_wpshop_categorie' ); ?>"><?php _e('Choose the category', 'wpshop'); ?> : <br></label>
112
-		<select name="<?php echo $this->get_field_name( 'wpshop_select_wpshop_categorie' ); ?>" class="widefat">
111
+		<label for="<?php echo $this->get_field_id('wpshop_select_wpshop_categorie'); ?>"><?php _e('Choose the category', 'wpshop'); ?> : <br></label>
112
+		<select name="<?php echo $this->get_field_name('wpshop_select_wpshop_categorie'); ?>" class="widefat">
113 113
 <?php
114 114
 			$options_wpshop_categories = array();
115 115
 			$args = array(
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 			foreach ($options_categories_obj as $category) {
121 121
 				$options_wpshop_categories[$category->cat_ID] = $category->cat_name;
122 122
 ?>
123
-				<option value="<?php echo $category->cat_ID; ?>" <?php selected( $instance['wpshop_select_wpshop_categorie'], $category->cat_ID ); ?>><?php echo $category->cat_name; ?></option>
123
+				<option value="<?php echo $category->cat_ID; ?>" <?php selected($instance['wpshop_select_wpshop_categorie'], $category->cat_ID); ?>><?php echo $category->cat_name; ?></option>
124 124
 <?php
125 125
 			}
126 126
 ?>
@@ -128,28 +128,28 @@  discard block
 block discarded – undo
128 128
 	</p>
129 129
 
130 130
 	<p>
131
-		<label for="<?php echo $this->get_field_id( 'wpshop_nb_wpshop_products' ); ?>"><?php _e('Number of product to display', 'wpshop'); ?> : <br></label>
132
-		<input value="<?php echo $instance['wpshop_nb_wpshop_products']; ?>" type="text"  id="<?php echo $this->get_field_id( 'wpshop_nb_wpshop_products' ); ?>" name="<?php echo $this->get_field_name( 'wpshop_nb_wpshop_products' ); ?>" />
131
+		<label for="<?php echo $this->get_field_id('wpshop_nb_wpshop_products'); ?>"><?php _e('Number of product to display', 'wpshop'); ?> : <br></label>
132
+		<input value="<?php echo $instance['wpshop_nb_wpshop_products']; ?>" type="text"  id="<?php echo $this->get_field_id('wpshop_nb_wpshop_products'); ?>" name="<?php echo $this->get_field_name('wpshop_nb_wpshop_products'); ?>" />
133 133
 	</p>
134 134
 
135 135
 	<p class="<?php echo $this->id; ?>-select_nb_ligne">
136
-		<label for="<?php echo $this->get_field_id( 'wpshop_select_wpshop_products_mode' ); ?>"><?php _e("Display mode", 'wpshop'); ?> : <br></label>
137
-	 	<select name="<?php echo $this->get_field_name( 'wpshop_select_wpshop_products_mode' ); ?>" class="widefat wpshop_widget_wpshop_nb_ligne_selector">
138
-			<option value="grid" <?php selected( $instance['wpshop_select_wpshop_products_mode'], 'grid' ); ?>><?php _e("Grid mode", 'wpshop'); ?></option>
139
-			<option value="list" <?php selected( $instance['wpshop_select_wpshop_products_mode'], 'list' ); ?>><?php _e("List mode", 'wpshop'); ?></option>
136
+		<label for="<?php echo $this->get_field_id('wpshop_select_wpshop_products_mode'); ?>"><?php _e("Display mode", 'wpshop'); ?> : <br></label>
137
+	 	<select name="<?php echo $this->get_field_name('wpshop_select_wpshop_products_mode'); ?>" class="widefat wpshop_widget_wpshop_nb_ligne_selector">
138
+			<option value="grid" <?php selected($instance['wpshop_select_wpshop_products_mode'], 'grid'); ?>><?php _e("Grid mode", 'wpshop'); ?></option>
139
+			<option value="list" <?php selected($instance['wpshop_select_wpshop_products_mode'], 'list'); ?>><?php _e("List mode", 'wpshop'); ?></option>
140 140
 		</select>
141 141
 	</p>
142 142
 	<p class="<?php echo $this->id; ?>-select-container_nb_ligne wpshop_widget_wpshop_nb_ligne_container">
143
-		<label for="<?php echo $this->get_field_id( 'wpshop_nb_par_ligne_wpshop_products' ); ?>"><?php _e('Product number per line', 'wpshop'); ?> : <br></label>
144
-		<input value="<?php echo $instance['wpshop_nb_par_ligne_wpshop_products']; ?>" type="text"  id="<?php echo $this->get_field_id( 'wpshop_nb_par_ligne_wpshop_products' ); ?>" name="<?php echo $this->get_field_name( 'wpshop_nb_par_ligne_wpshop_products' ); ?>" />
143
+		<label for="<?php echo $this->get_field_id('wpshop_nb_par_ligne_wpshop_products'); ?>"><?php _e('Product number per line', 'wpshop'); ?> : <br></label>
144
+		<input value="<?php echo $instance['wpshop_nb_par_ligne_wpshop_products']; ?>" type="text"  id="<?php echo $this->get_field_id('wpshop_nb_par_ligne_wpshop_products'); ?>" name="<?php echo $this->get_field_name('wpshop_nb_par_ligne_wpshop_products'); ?>" />
145 145
 	</p>
146 146
 
147 147
 	<!-- Display pagination -->
148 148
 	<p class="<?php echo $this->id; ?>-display_pagination">
149 149
 			<label for="<?php echo $this->get_field_id('wpshop_display_pagination'); ?>"><?php _e("Display pagination", "wpshop"); ?> : <br /></label>
150 150
 			<select name="<?php echo $this->get_field_name('wpshop_display_pagination'); ?> " class="widefat wpshop_widget_wpshop_nb_ligne_selector">
151
-				<option value="yes" <?php echo selected( !empty($instance['wpshop_display_pagination']) ? $instance['wpshop_display_pagination'] : "", 'yes' ); ?>><?php _e("Yes", "wpshop"); ?></option>
152
-				<option value="no" <?php echo selected( !empty($instance['wpshop_display_pagination']) ? $instance['wpshop_display_pagination'] : "", 'no' ); ?>><?php _e("No", "wpshop"); ?></option>
151
+				<option value="yes" <?php echo selected(!empty($instance['wpshop_display_pagination']) ? $instance['wpshop_display_pagination'] : "", 'yes'); ?>><?php _e("Yes", "wpshop"); ?></option>
152
+				<option value="no" <?php echo selected(!empty($instance['wpshop_display_pagination']) ? $instance['wpshop_display_pagination'] : "", 'no'); ?>><?php _e("No", "wpshop"); ?></option>
153 153
 			</select>
154 154
 	</p>
155 155
 </fieldset>
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 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
 class WP_Widget_Wpshop_Products extends WP_Widget {
4 6
 
@@ -41,17 +43,16 @@  discard block
 block discarded – undo
41 43
 		$chaine_shortcode = '[wpshop_products sorting="no" limit="'.$wpshop_nb_wpshop_products.'" ';
42 44
 		if($wpshop_select_wpshop_products == 'random'){
43 45
 			$chaine_shortcode .= 'order="rand" ';
44
-		}else if ($wpshop_select_wpshop_products == 'vedette'){
46
+		} else if ($wpshop_select_wpshop_products == 'vedette'){
45 47
 			$chaine_shortcode .= 'att_name="highlight_product" att_value="yes" ';
46
-		}else if ($wpshop_select_wpshop_products == 'nouveaux'){
48
+		} else if ($wpshop_select_wpshop_products == 'nouveaux'){
47 49
 			$chaine_shortcode .= 'att_name="declare_new" att_value="yes" ';
48
-		}else {
50
+		} else {
49 51
 			$chaine_shortcode .= 'cid="'.$wpshop_select_wpshop_categorie.'" type="'.$wpshop_select_wpshop_products_mode.'" ';
50 52
 		}
51 53
 		if($wpshop_select_wpshop_products_mode == 'list'){
52 54
 			$chaine_shortcode .= 'type="list" ';
53
-		}
54
-		elseif( $wpshop_select_wpshop_products_mode == 'grid' ) {
55
+		} elseif( $wpshop_select_wpshop_products_mode == 'grid' ) {
55 56
 			$chaine_shortcode .= 'type="grid" ';
56 57
 		}
57 58
 		if($wpshop_nb_par_ligne_wpshop_products){
Please login to merge, or discard this patch.
includes/librairies/documents/documents.class.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 class wpshop_documents
26 26
 {
27 27
 	/**
28
-	* This filter translates string before it is displayed
29
-	* specifically for the words 'Use as featured image' with 'Use as Product Thumbnail' when the user is selecting a Product Thumbnail
30
-	* using media gallery.
31
-	*
32
-	* @param $translation The current translation
33
-	* @param $text The text being translated
34
-	* @param $domain The domain for the translation
35
-	*
36
-	* @return string The translated / filtered text.
37
-	*/
28
+	 * This filter translates string before it is displayed
29
+	 * specifically for the words 'Use as featured image' with 'Use as Product Thumbnail' when the user is selecting a Product Thumbnail
30
+	 * using media gallery.
31
+	 *
32
+	 * @param $translation The current translation
33
+	 * @param $text The text being translated
34
+	 * @param $domain The domain for the translation
35
+	 *
36
+	 * @return string The translated / filtered text.
37
+	 */
38 38
 	public static function change_picture_translation($translation, $text, $domain = 'wpshop'){
39 39
 
40 40
 		if(($text == 'Use as featured image') && isset($_REQUEST['post_id'])){
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 
52 52
 	/**
53
-	*	
54
-	*/
53
+	 *	
54
+	 */
55 55
 	public static function attachment_fields($form_fields, $post){
56 56
 		/*	Get the current post informations	*/
57 57
 		if(isset($_GET["post_id"])){
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	/**
69
-	*
70
-	*/
69
+	 *
70
+	 */
71 71
 	public static function galery_manager_css(){
72 72
 		ob_start();
73 73
 		include(WPSHOP_CSS_DIR . 'pages/wpshop_galery.css');
Please login to merge, or discard this patch.
Braces   +10 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
 /*	Check if file is include. No direct access possible with file url	*/
4 6
 if ( !defined( 'WPSHOP_VERSION' ) ) {
@@ -40,9 +42,13 @@  discard block
 block discarded – undo
40 42
 		if(($text == 'Use as featured image') && isset($_REQUEST['post_id'])){
41 43
 
42 44
 			$post = get_post( $_REQUEST['post_id'] );
43
-			if (!empty($post->post_type) && $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT) return $translation;
45
+			if (!empty($post->post_type) && $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT) {
46
+				return $translation;
47
+			}
44 48
 			$translations = get_translations_for_domain($domain);
45
-			if ( empty($translations->entries['Use as product thumbnail']->translations[0]) ) return $translation;
49
+			if ( empty($translations->entries['Use as product thumbnail']->translations[0]) ) {
50
+				return $translation;
51
+			}
46 52
 			return $translations->entries['Use as product thumbnail']->translations[0];
47 53
 		}
48 54
 
@@ -56,8 +62,7 @@  discard block
 block discarded – undo
56 62
 		/*	Get the current post informations	*/
57 63
 		if(isset($_GET["post_id"])){
58 64
 			$parent_post = get_post( absint($_GET["post_id"]) );
59
-		}
60
-		else{
65
+		} else{
61 66
 			$parent_post = get_post( $post->post_parent );
62 67
 		}
63 68
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
 /**
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	*
36 36
 	* @return string The translated / filtered text.
37 37
 	*/
38
-	public static function change_picture_translation($translation, $text, $domain = 'wpshop'){
38
+	public static function change_picture_translation($translation, $text, $domain = 'wpshop') {
39 39
 
40
-		if(($text == 'Use as featured image') && isset($_REQUEST['post_id'])){
40
+		if (($text == 'Use as featured image') && isset($_REQUEST['post_id'])) {
41 41
 
42
-			$post = get_post( sanitize_key($_REQUEST['post_id']) );
42
+			$post = get_post(sanitize_key($_REQUEST['post_id']));
43 43
 			if (!empty($post->post_type) && $post->post_type != WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT) return $translation;
44 44
 			$translations = get_translations_for_domain($domain);
45
-			if ( empty($translations->entries['Use as product thumbnail']->translations[0]) ) return $translation;
45
+			if (empty($translations->entries['Use as product thumbnail']->translations[0])) return $translation;
46 46
 			return $translations->entries['Use as product thumbnail']->translations[0];
47 47
 		}
48 48
 
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	/**
53 53
 	*	
54 54
 	*/
55
-	public static function attachment_fields($form_fields, $post){
55
+	public static function attachment_fields($form_fields, $post) {
56 56
 		/*	Get the current post informations	*/
57
-		if(isset($_GET["post_id"])){
58
-			$parent_post = get_post( absint($_GET["post_id"]) );
57
+		if (isset($_GET["post_id"])) {
58
+			$parent_post = get_post(absint($_GET["post_id"]));
59 59
 		}
60
-		else{
61
-			$parent_post = get_post( $post->post_parent );
60
+		else {
61
+			$parent_post = get_post($post->post_parent);
62 62
 		}
63 63
 
64 64
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	/**
69 69
 	*
70 70
 	*/
71
-	public static function galery_manager_css(){
71
+	public static function galery_manager_css() {
72 72
 		ob_start();
73 73
 		include(WPSHOP_CSS_DIR . 'pages/wpshop_galery.css');
74 74
 		$wpshop_galery_css = ob_get_contents();
Please login to merge, or discard this patch.
includes/librairies/payments/paypal.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,8 +149,8 @@
 block discarded – undo
149 149
 	}
150 150
 
151 151
 	/**
152
-	* Display the paypal form in order to redirect correctly to paypal
153
-	*/
152
+	 * Display the paypal form in order to redirect correctly to paypal
153
+	 */
154 154
 	public static function display_form($oid) {
155 155
 		global $wpdb;
156 156
 		$order = get_post_meta($oid, '_order_postmeta', true);
Please login to merge, or discard this patch.
Braces   +13 added lines, -13 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
 /*	Check if file is include. No direct access possible with file url	*/
4 6
 if ( !defined( 'WPSHOP_VERSION' ) ) {
@@ -45,8 +47,7 @@  discard block
 block discarded – undo
45 47
 			if($paypalMode == 'sandbox') {
46 48
 				$fp = fsockopen ('ssl://sandbox.paypal.com', 443, $errno, $errstr, 30);
47 49
 				$host = "www.sandbox.paypal.com";
48
-			}
49
-			else {
50
+			} else {
50 51
 				$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
51 52
 				$host = "www.paypal.com";
52 53
 			}
@@ -84,8 +85,7 @@  discard block
 block discarded – undo
84 85
 
85 86
 			if (!$fp){
86 87
 				echo 'HTTP ERROR!';
87
-			}
88
-			else {
88
+			} else {
89 89
 				fputs ($fp, $header.$req);
90 90
 				while (!feof($fp)) {
91 91
 					$res = fgets ($fp, 1024);
@@ -113,13 +113,11 @@  discard block
 block discarded – undo
113 113
 								/*	Check if the paid amount is equal to the order amount	*/
114 114
 								if ( $amount_paid == $amount2pay ) {
115 115
 									$payment_status = 'completed';
116
-								}
117
-								else {
116
+								} else {
118 117
 									$payment_status = 'incorrect_amount';
119 118
 								}
120 119
 
121
-							}
122
-							else {
120
+							} else {
123 121
 								@mail($notify_email, 'VERIFIED DUPLICATED TRANSACTION', 'VERIFIED DUPLICATED TRANSACTION');
124 122
 								$payment_status = 'completed';
125 123
 							}
@@ -164,8 +162,11 @@  discard block
 block discarded – undo
164 162
 			if(!empty($paypalBusinessEmail)) {
165 163
 
166 164
 				$paypalMode = get_option('wpshop_paypalMode', null);
167
-				if($paypalMode == 'sandbox') $paypal = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
168
-				else $paypal = 'https://www.paypal.com/cgi-bin/webscr';
165
+				if($paypalMode == 'sandbox') {
166
+					$paypal = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
167
+				} else {
168
+					$paypal = 'https://www.paypal.com/cgi-bin/webscr';
169
+				}
169 170
 
170 171
 				$current_currency = get_option('wpshop_shop_default_currency');
171 172
 				$query = $wpdb->prepare('SELECT code_iso FROM ' .WPSHOP_DBT_ATTRIBUTE_UNIT. ' WHERE id =%d ', $current_currency );
@@ -202,8 +203,7 @@  discard block
 block discarded – undo
202 203
 									<input id="quantity_'.$i.'" name="quantity_'.$i.'" type="hidden" value="1" />
203 204
 									<input id="amount_'.$i.'" name="amount_'.$i.'" type="hidden" value="'.number_format($order['order_amount_to_pay_now'], 2, '.', '').'" />
204 205
 									';
205
-				}
206
-				else {
206
+				} else {
207 207
 
208 208
 					$output .=	'
209 209
 									<input id="item_number_'.$i.'" name="item_number_'.$i.'" type="hidden" value="' .$order['order_key']. '" />
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 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
 /**
@@ -18,38 +18,38 @@  discard block
 block discarded – undo
18 18
 class wpshop_paypal {
19 19
 
20 20
 	public function __construct() {
21
-		add_filter( 'wps_payment_mode_interface_paypal', array( &$this, 'display_admin_part') );
21
+		add_filter('wps_payment_mode_interface_paypal', array(&$this, 'display_admin_part'));
22 22
 
23 23
 		/** Check if SystemPay is registred in Payment Main Option **/
24
-		$payment_option = get_option( 'wps_payment_mode' );
25
-		if ( !empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('paypal', $payment_option['mode']) ) {
24
+		$payment_option = get_option('wps_payment_mode');
25
+		if (!empty($payment_option) && !empty($payment_option['mode']) && !array_key_exists('paypal', $payment_option['mode'])) {
26 26
 			$payment_option['mode']['paypal']['name'] = __('Paypal', 'wpshop');
27
-			$payment_option['mode']['paypal']['logo'] = WPSHOP_TEMPLATES_URL.'wpshop/medias/paypal.png';
27
+			$payment_option['mode']['paypal']['logo'] = WPSHOP_TEMPLATES_URL . 'wpshop/medias/paypal.png';
28 28
 			$payment_option['mode']['paypal']['description'] = __('<strong>Tips</strong> : If you have a Paypal account, by choosing this payment method, you will be redirected to the secure payment site Paypal to make your payment. Debit your PayPal account, immediate booking products.', 'wpshop');
29
-			update_option( 'wps_payment_mode', $payment_option );
29
+			update_option('wps_payment_mode', $payment_option);
30 30
 		}
31 31
 
32
-		$payment_listener = !empty( $_GET['paymentListener'] ) ? sanitize_text_field( $_GET['paymentListener'] ) : '';
32
+		$payment_listener = !empty($_GET['paymentListener']) ? sanitize_text_field($_GET['paymentListener']) : '';
33 33
 
34
-		if(!empty($payment_listener) && $payment_listener=='paypal') {
34
+		if (!empty($payment_listener) && $payment_listener == 'paypal') {
35 35
 			$payment_status = 'denied';
36 36
 			// read the post from PayPal system and add 'cmd'
37 37
 			$req = 'cmd=_notify-validate';
38 38
 			// @TODO : REQUEST
39
-			$post = !empty($_POST) ? (array) $_POST : array();
40
-			foreach ( $post as $key => $value) {
39
+			$post = !empty($_POST) ? (array)$_POST : array();
40
+			foreach ($post as $key => $value) {
41 41
 				$value = urlencode(stripslashes($value));
42 42
 				$req .= "&$key=$value";
43 43
 			}
44 44
 
45 45
 			// If testing on Sandbox use:
46 46
 			$paypalMode = get_option('wpshop_paypalMode', null);
47
-			if($paypalMode == 'sandbox') {
48
-				$fp = fsockopen ('ssl://sandbox.paypal.com', 443, $errno, $errstr, 30);
47
+			if ($paypalMode == 'sandbox') {
48
+				$fp = fsockopen('ssl://sandbox.paypal.com', 443, $errno, $errstr, 30);
49 49
 				$host = "www.sandbox.paypal.com";
50 50
 			}
51 51
 			else {
52
-				$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
52
+				$fp = fsockopen('ssl://www.paypal.com', 443, $errno, $errstr, 30);
53 53
 				$host = "www.paypal.com";
54 54
 			}
55 55
 
@@ -64,45 +64,45 @@  discard block
 block discarded – undo
64 64
 			$shipping = $_POST['mc_shipping']; // frais de livraison
65 65
 			$business = $_POST['business']; // compte pro
66 66
 			$order_id = (int)$_POST['invoice']; // num de facture
67
-			$receiver_email = sanitize_text_field( $_POST['receiver_email'] );
67
+			$receiver_email = sanitize_text_field($_POST['receiver_email']);
68 68
 			$amount_paid = $_POST['mc_gross']; // total (hors frais livraison)
69 69
 			$txn_id = $_POST['txn_id']; // num�ro de transaction
70 70
 			$payment_status = $_POST['payment_status']; // status du paiement
71 71
 			$payer_email = $_POST['payer_email']; // email du client
72
-			$txn_type = sanitize_text_field( $_POST['txn_type'] );
72
+			$txn_type = sanitize_text_field($_POST['txn_type']);
73 73
 
74 74
 			// @TODO : Request
75
-			$post = !empty($_POST) ? (array) $_POST : array();
76
-			if ( !empty($post) ) {
77
-				foreach ( $post as $key => $value) {
78
-					if ( substr($key, 0, 9) == 'item_name' ) {
75
+			$post = !empty($_POST) ? (array)$_POST : array();
76
+			if (!empty($post)) {
77
+				foreach ($post as $key => $value) {
78
+					if (substr($key, 0, 9) == 'item_name') {
79 79
 						$_POST[$key] = htmlentities($value);
80 80
 					}
81 81
 				}
82 82
 			}
83 83
 
84 84
 			/**	Save paypal return data automatically	*/
85
-			wpshop_payment::save_payment_return_data( $order_id );
85
+			wpshop_payment::save_payment_return_data($order_id);
86 86
 
87 87
 			$notify_email = get_option('wpshop_paypalEmail', null); // email address to which debug emails are sent to
88 88
 
89
-			if (!$fp){
89
+			if (!$fp) {
90 90
 				echo 'HTTP ERROR!';
91 91
 			}
92 92
 			else {
93
-				fputs ($fp, $header.$req);
93
+				fputs($fp, $header . $req);
94 94
 				while (!feof($fp)) {
95
-					$res = fgets ($fp, 1024);
96
-					if (strcmp ($res, "VERIFIED") == 0) {
95
+					$res = fgets($fp, 1024);
96
+					if (strcmp($res, "VERIFIED") == 0) {
97 97
 						$paypalBusinessEmail = get_option('wpshop_paypalEmail', null);
98 98
 
99 99
 						/**	Check if payment has been send to good paypal account	*/
100 100
 						if ($receiver_email == $paypalBusinessEmail) {
101 101
 							/**	Get the payment transaction identifier	*/
102
-							$paypal_txn_id = wpshop_payment::get_payment_transaction_number( $order_id,  wpshop_payment::get_order_waiting_payment_array_id( $order_id, 'paypal'));
102
+							$paypal_txn_id = wpshop_payment::get_payment_transaction_number($order_id, wpshop_payment::get_order_waiting_payment_array_id($order_id, 'paypal'));
103 103
 
104 104
 							/**	If no transaction reference has been saved for this order	*/
105
-							if ( empty($paypal_txn_id) ) {
105
+							if (empty($paypal_txn_id)) {
106 106
 								/**	Set the payment reference for the order	*/
107 107
 								wpshop_payment::set_payment_transaction_number($order_id, $txn_id);
108 108
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 								$amount_paid = number_format(floatval($amount_paid), 2, '.', '');
116 116
 
117 117
 								/*	Check if the paid amount is equal to the order amount	*/
118
-								if ( $amount_paid == $amount2pay ) {
118
+								if ($amount_paid == $amount2pay) {
119 119
 									$payment_status = 'completed';
120 120
 								}
121 121
 								else {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 						}
131 131
 					}
132 132
 					// if the IPN POST was 'INVALID'...do this
133
-					elseif (strcmp ($res, "INVALID") == 0) {
133
+					elseif (strcmp($res, "INVALID") == 0) {
134 134
 						@mail($notify_email, "INVALID IPN", "$res\n $req");
135 135
 						$payment_status = 'payment_refused';
136 136
 					}
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 				fclose($fp);
139 139
 			}
140 140
 
141
-			$mc_gross = !empty( $_POST['mc_gross'] ) ? (float)$_POST['mc_gross'] : 0;
141
+			$mc_gross = !empty($_POST['mc_gross']) ? (float)$_POST['mc_gross'] : 0;
142 142
 
143 143
 			$params_array = array('method' => 'paypal',
144 144
 					'waited_amount' => number_format((float)$order['order_amount_to_pay_now'], 2, '.', ''),
145
-					'status' => ( ( number_format((float)$order['order_amount_to_pay_now'], 2, '.', '') == number_format($mc_gross, 2, '.', '') ) ? 'payment_received' : 'incorrect_amount' ),
145
+					'status' => ((number_format((float)$order['order_amount_to_pay_now'], 2, '.', '') == number_format($mc_gross, 2, '.', '')) ? 'payment_received' : 'incorrect_amount'),
146 146
 					'author' => $order['customer_id'],
147 147
 					'payment_reference' => $txn_id,
148 148
 					'date' => current_time('mysql', 0),
149
-					'received_amount' => number_format($mc_gross, 2, '.', '') );
149
+					'received_amount' => number_format($mc_gross, 2, '.', ''));
150 150
 			wpshop_payment::check_order_payment_total_amount($order_id, $params_array, $payment_status);
151 151
 
152 152
 		}
@@ -162,25 +162,25 @@  discard block
 block discarded – undo
162 162
 		$order = get_post_meta($oid, '_order_postmeta', true);
163 163
 
164 164
 		// If the order exist
165
-		if(!empty($order)) {
165
+		if (!empty($order)) {
166 166
 
167 167
 			$paypalBusinessEmail = get_option('wpshop_paypalEmail', null);
168 168
 
169 169
 			// Si l'email Paypal n'est pas vide
170
-			if(!empty($paypalBusinessEmail)) {
170
+			if (!empty($paypalBusinessEmail)) {
171 171
 
172 172
 				$paypalMode = get_option('wpshop_paypalMode', null);
173
-				if($paypalMode == 'sandbox') $paypal = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
173
+				if ($paypalMode == 'sandbox') $paypal = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
174 174
 				else $paypal = 'https://www.paypal.com/cgi-bin/webscr';
175 175
 
176 176
 				$current_currency = get_option('wpshop_shop_default_currency');
177
-				$query = $wpdb->prepare('SELECT code_iso FROM ' .WPSHOP_DBT_ATTRIBUTE_UNIT. ' WHERE id =%d ', $current_currency );
177
+				$query = $wpdb->prepare('SELECT code_iso FROM ' . WPSHOP_DBT_ATTRIBUTE_UNIT . ' WHERE id =%d ', $current_currency);
178 178
 				$currency = $wpdb->get_var($query);
179 179
 
180 180
 				$output  = '<script type="text/javascript">jQuery(document).ready(function(){ jQuery("#paypalForm").submit(); });</script>';
181 181
 				$output .= '<div class="paypalPaymentLoading"><span>' . __('Redirecting to paypal. Please wait', 'wpshop') . '</span></div>';
182 182
 				$output .= '
183
-						<form action="'.$paypal.'" id="paypalForm" method="post">
183
+						<form action="'.$paypal . '" id="paypalForm" method="post">
184 184
 						<input id="cmd" name="cmd" type="hidden" value="_cart" />
185 185
 						<input id="upload" name="upload" type="hidden" value="1" />
186 186
 						<input id="charset" name="charset" type="hidden" value="utf-8" />
@@ -188,41 +188,41 @@  discard block
 block discarded – undo
188 188
 						<input id="no_note" name="no_note" type="hidden" value="0" />
189 189
 						<input id="rm" name="rm" type="hidden" value="0" />
190 190
 
191
-						<input id="custom" name="custom" type="hidden" value="'.$order['customer_id'].'" />
192
-						<input id="invoice" name="invoice" type="hidden" value="'.$oid.'" /> <!-- Invoice number -->
193
-						<input id="business" name="business" type="hidden" value="'.$paypalBusinessEmail.'" /> <!-- Paypal business account -->
191
+						<input id="custom" name="custom" type="hidden" value="'.$order['customer_id'] . '" />
192
+						<input id="invoice" name="invoice" type="hidden" value="'.$oid . '" /> <!-- Invoice number -->
193
+						<input id="business" name="business" type="hidden" value="'.$paypalBusinessEmail . '" /> <!-- Paypal business account -->
194 194
 						<input id="cbt" name="cbt" type="hidden" value="' . __('Back to shop', 'wpshop') . '" />
195 195
 						<input id="lc" name="lc" type="hidden" value="FR" />
196
-						<input id="currency_code" name="currency_code" type="hidden" value="'.$currency.'" />
196
+						<input id="currency_code" name="currency_code" type="hidden" value="'.$currency . '" />
197 197
 
198
-						<input id="return" name="return" type="hidden" value="'.wpshop_payment::get_success_payment_url().'" />
199
-						<input id="cancel_return" name="cancel_return" type="hidden" value="'.wpshop_payment::get_cancel_payment_url().'" />
200
-						<input id="notify_url" name="notify_url" type="hidden" value="'.wpshop_payment::construct_url_parameters(trailingslashit(home_url()), 'paymentListener', 'paypal').'" />
198
+						<input id="return" name="return" type="hidden" value="'.wpshop_payment::get_success_payment_url() . '" />
199
+						<input id="cancel_return" name="cancel_return" type="hidden" value="'.wpshop_payment::get_cancel_payment_url() . '" />
200
+						<input id="notify_url" name="notify_url" type="hidden" value="'.wpshop_payment::construct_url_parameters(trailingslashit(home_url()), 'paymentListener', 'paypal') . '" />
201 201
 				';
202 202
 
203
-				$i=1;
204
-				if ( !empty( $order['order_partial_payment']) && !empty($order['order_partial_payment']['amount_of_partial_payment']) ) {
205
-					$output .=	'
206
-									<input id="item_number_'.$i.'" name="item_number_'.$i.'" type="hidden" value="' .$oid. '_partial_payment" />
207
-									<input id="item_name_'.$i.'" name="item_name_'.$i.'" type="hidden" value="'.__('Partial payment', 'wpshop').' (' .__('Order number', 'wpshop'). ' : ' .$order['order_key']. ')" />
208
-									<input id="quantity_'.$i.'" name="quantity_'.$i.'" type="hidden" value="1" />
209
-									<input id="amount_'.$i.'" name="amount_'.$i.'" type="hidden" value="'.number_format($order['order_amount_to_pay_now'], 2, '.', '').'" />
203
+				$i = 1;
204
+				if (!empty($order['order_partial_payment']) && !empty($order['order_partial_payment']['amount_of_partial_payment'])) {
205
+					$output .= '
206
+									<input id="item_number_'.$i . '" name="item_number_' . $i . '" type="hidden" value="' . $oid . '_partial_payment" />
207
+									<input id="item_name_'.$i . '" name="item_name_' . $i . '" type="hidden" value="' . __('Partial payment', 'wpshop') . ' (' . __('Order number', 'wpshop') . ' : ' . $order['order_key'] . ')" />
208
+									<input id="quantity_'.$i . '" name="quantity_' . $i . '" type="hidden" value="1" />
209
+									<input id="amount_'.$i . '" name="amount_' . $i . '" type="hidden" value="' . number_format($order['order_amount_to_pay_now'], 2, '.', '') . '" />
210 210
 									';
211 211
 				}
212 212
 				else {
213 213
 
214
-					$output .=	'
215
-									<input id="item_number_'.$i.'" name="item_number_'.$i.'" type="hidden" value="' .$order['order_key']. '" />
216
-									<input id="item_name_'.$i.'" name="item_name_'.$i.'" type="hidden" value="' .__('Current order', 'wpshop'). ' : ' .$order['order_key']. '" />
217
-									<input id="quantity_'.$i.'" name="quantity_'.$i.'" type="hidden" value="1" />
218
-									<input id="amount_'.$i.'" name="amount_'.$i.'" type="hidden" value="'.number_format($order['order_amount_to_pay_now'], 2, '.', '').'" />
214
+					$output .= '
215
+									<input id="item_number_'.$i . '" name="item_number_' . $i . '" type="hidden" value="' . $order['order_key'] . '" />
216
+									<input id="item_name_'.$i . '" name="item_name_' . $i . '" type="hidden" value="' . __('Current order', 'wpshop') . ' : ' . $order['order_key'] . '" />
217
+									<input id="quantity_'.$i . '" name="quantity_' . $i . '" type="hidden" value="1" />
218
+									<input id="amount_'.$i . '" name="amount_' . $i . '" type="hidden" value="' . number_format($order['order_amount_to_pay_now'], 2, '.', '') . '" />
219 219
 									';
220 220
 
221 221
 				}
222 222
 
223 223
 
224 224
 
225
-				$output .=	'<noscript><input type="submit" value="' . __('Checkout', 'wpshop') . '" /></noscript></form>';
225
+				$output .= '<noscript><input type="submit" value="' . __('Checkout', 'wpshop') . '" /></noscript></form>';
226 226
 			}
227 227
 		}
228 228
 
@@ -232,16 +232,16 @@  discard block
 block discarded – undo
232 232
 
233 233
 	function display_admin_part() {
234 234
 		$paypalEmail = get_option('wpshop_paypalEmail');
235
-		$paypalMode = get_option('wpshop_paypalMode',0);
235
+		$paypalMode = get_option('wpshop_paypalMode', 0);
236 236
 		$output  = '<div class="wps-boxed">';
237
-		$output .= '<div class="wps-form-group"><label>'.__('Business email','wpshop').'</label><div class="wps-form"><input name="wpshop_paypalEmail" type="text" value="'.$paypalEmail.'" /></div></div>';
238
-		$output .= '<label class="simple_right">'.__('Mode','wpshop').'</label>';
237
+		$output .= '<div class="wps-form-group"><label>' . __('Business email', 'wpshop') . '</label><div class="wps-form"><input name="wpshop_paypalEmail" type="text" value="' . $paypalEmail . '" /></div></div>';
238
+		$output .= '<label class="simple_right">' . __('Mode', 'wpshop') . '</label>';
239 239
 		$output .= '<div class="wps-form"><select name="wpshop_paypalMode">';
240
-		$output .= '<option value="normal"'.(($paypalMode=='sandbox') ? null : ' selected="selected"').'>'.__('Production mode','wpshop').'</option>';
241
-		$output .= '<option value="sandbox"'.(($paypalMode=='sandbox') ? ' selected="selected"' : null).'>'.__('Sandbox mode','wpshop').'</option>';
240
+		$output .= '<option value="normal"' . (($paypalMode == 'sandbox') ? null : ' selected="selected"') . '>' . __('Production mode', 'wpshop') . '</option>';
241
+		$output .= '<option value="sandbox"' . (($paypalMode == 'sandbox') ? ' selected="selected"' : null) . '>' . __('Sandbox mode', 'wpshop') . '</option>';
242 242
 		$output .= '</select>';
243 243
 		$output .= '</div>';
244
-		$output .= '<a href="#" title="'.__('This checkbox allow to use Paypal in Sandbox mode (test) or production mode (real money)','wpshop').'" class="wpshop_infobulle_marker">?</a>';
244
+		$output .= '<a href="#" title="' . __('This checkbox allow to use Paypal in Sandbox mode (test) or production mode (real money)', 'wpshop') . '" class="wpshop_infobulle_marker">?</a>';
245 245
 		$output .= '</div>';
246 246
 		return $output;
247 247
 	}
Please login to merge, or discard this patch.
includes/librairies/db/db_structure_definition.php 2 patches
Spacing   +9 added lines, -9 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
 /**
@@ -525,11 +525,11 @@  discard block
 block discarded – undo
525 525
 	$wpshop_db_table_operation_list[$wpshop_db_version]['FIELD_ADD'][WPSHOP_DBT_ATTRIBUTE_GROUP] = array('backend_display_type');
526 526
 
527 527
 	$wpshop_db_table_list[$wpshop_db_version] = array(WPSHOP_DBT_ATTRIBUTE, WPSHOP_DBT_ATTRIBUTE_GROUP);
528
-	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE ".WPSHOP_DBT_ATTRIBUTE_VALUES_DATETIME." DROP INDEX entity_attribute_id";
529
-	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE ".WPSHOP_DBT_ATTRIBUTE_VALUES_DECIMAL." DROP INDEX entity_attribute_id";
530
-	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE ".WPSHOP_DBT_ATTRIBUTE_VALUES_TEXT." DROP INDEX entity_attribute_id";
531
-	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE ".WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER." DROP INDEX entity_attribute_id";
532
-	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE ".WPSHOP_DBT_ATTRIBUTE_VALUES_VARCHAR." DROP INDEX entity_attribute_id";
528
+	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE " . WPSHOP_DBT_ATTRIBUTE_VALUES_DATETIME . " DROP INDEX entity_attribute_id";
529
+	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE " . WPSHOP_DBT_ATTRIBUTE_VALUES_DECIMAL . " DROP INDEX entity_attribute_id";
530
+	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE " . WPSHOP_DBT_ATTRIBUTE_VALUES_TEXT . " DROP INDEX entity_attribute_id";
531
+	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE " . WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER . " DROP INDEX entity_attribute_id";
532
+	$wpshop_db_request[$wpshop_db_version][] = "ALTER TABLE " . WPSHOP_DBT_ATTRIBUTE_VALUES_VARCHAR . " DROP INDEX entity_attribute_id";
533 533
 }
534 534
 
535 535
 {/*	Version 17  - 1.3.1.3	*/
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 
562 562
 	$wpshop_db_table_list[$wpshop_db_version] = array(WPSHOP_DBT_ATTRIBUTE, WPSHOP_DBT_ATTRIBUTE_GROUP);
563 563
 
564
-	$wpshop_db_request[$wpshop_db_version][] = "UPDATE ".WPSHOP_DBT_ATTRIBUTE." SET backend_input=frontend_input WHERE frontend_input!='text'";
564
+	$wpshop_db_request[$wpshop_db_version][] = "UPDATE " . WPSHOP_DBT_ATTRIBUTE . " SET backend_input=frontend_input WHERE frontend_input!='text'";
565 565
 }
566 566
 
567 567
 {/*	Version 21  - 1.3.2.0	*/
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/librairies/db/db_data_definition.php 2 patches
Spacing   +11 added lines, -11 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
 /**
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $wpshop_db_content_update = array();
22 22
 $wpshop_db_options_add = array();
23 23
 $wpshop_db_options_update = array();
24
-$wpshop_db_delete= array();
24
+$wpshop_db_delete = array();
25 25
 $wpshop_db_version = 0;
26 26
 
27 27
 {/*	Version 0	*/
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 	$wpshop_eav_content[$wpshop_db_version]['attributes'][] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT;
77 77
 
78 78
 	/*	Default attribute group	*/
79
-	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'important_datas', 'name' => __('Product', 'wpshop'), 'details' => array( 'product_attribute_set_id', 'barcode', 'product_price', 'tx_tva', 'manage_stock', 'product_stock', 'product_weight'), 'backend_display_type' => 'movable-tab' );
79
+	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'important_datas', 'name' => __('Product', 'wpshop'), 'details' => array('product_attribute_set_id', 'barcode', 'product_price', 'tx_tva', 'manage_stock', 'product_stock', 'product_weight'), 'backend_display_type' => 'movable-tab');
80 80
 	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'general', 'name' => __('Main information', 'wpshop'), 'details' => array('product_reference', 'cost_of_postage',));
81 81
 	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'feature', 'name' => __('Feature', 'wpshop'), 'details' => array('product_height', 'product_width'));
82 82
 	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'additionnal_informations', 'name' => __('Additionnal informations', 'wpshop'), 'details' => array());
83 83
 
84
-	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array( 'name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array( 'price_ht', 'tva', ));
84
+	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'tva',));
85 85
 
86 86
 	/*	Update attribute with default unit	*/
87 87
 	$wpshop_db_content_update[$wpshop_db_version][WPSHOP_DBT_ATTRIBUTE][] = array('datas' => array('last_update_date' => current_time('mysql', 0), '_unit_group_id' => 1, '_default_unit' => 2), 'where' => array('code' => 'product_height'));
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
 	/*	Add shop type	*/
164 164
 	$current_db_version = get_option('wpshop_db_options', 0);
165
-	if(!empty($current_db_version) && $current_db_version['db_version'] >= $wpshop_db_version){
165
+	if (!empty($current_db_version) && $current_db_version['db_version'] >= $wpshop_db_version) {
166 166
 		$wpshop_db_options_add[$wpshop_db_version]['wpshop_shop_type'] = 'sale';
167 167
 		$wpshop_db_options_update[$wpshop_db_version]['wpshop_db_options']['installation_state'] = 'completed';
168 168
 	}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	$wpshop_db_content_update[$wpshop_db_version][WPSHOP_DBT_ATTRIBUTE_GROUP][] = array('datas' => array('last_update_date' => current_time('mysql', 0), 'used_in_shop_type' => 'sale'), 'where' => array('code' => 'shipping'));
183 183
 
184 184
 	/*	Delete useless option	*/
185
-	$wpshop_db_delete[$wpshop_db_version][] = $wpdb->prepare("DELETE FROM ".$wpdb->options." WHERE option_name=%s", 'wpshop_shop_currencies');
185
+	$wpshop_db_delete[$wpshop_db_version][] = $wpdb->prepare("DELETE FROM " . $wpdb->options . " WHERE option_name=%s", 'wpshop_shop_currencies');
186 186
 }
187 187
 
188 188
 {/*	Version 20 - Version 1.3.1.9	*/
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 
227 227
 	$wpshop_eav_content[$wpshop_db_version]['attributes'][] = WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS;
228 228
 
229
-	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Billing address', 'wpshop')][] = array('code' => 'billing_address', 'name' => __('Billing address', 'wpshop'), 'details' => array( 'address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'tva_intra', 'address_user_email', 'address', 'postcode', 'city', 'country', 'state', 'phone', 'longitude', 'latitude'));
229
+	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Billing address', 'wpshop')][] = array('code' => 'billing_address', 'name' => __('Billing address', 'wpshop'), 'details' => array('address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'tva_intra', 'address_user_email', 'address', 'postcode', 'city', 'country', 'state', 'phone', 'longitude', 'latitude'));
230 230
 	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Shipping address', 'wpshop')][] = array('code' => 'shipping_address', 'name' => __('Shipping address', 'wpshop'), 'details' => array('address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'address', 'postcode', 'city', 'country', 'state', 'longitude', 'latitude'));
231 231
 
232
-	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS][__('Account', 'wpshop')][] = array('code' => 'account', 'name' => __('Account', 'wpshop'), 'details' => array( 'user_login', 'user_pass', 'last_name', 'first_name', 'user_email' ));
232
+	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS][__('Account', 'wpshop')][] = array('code' => 'account', 'name' => __('Account', 'wpshop'), 'details' => array('user_login', 'user_pass', 'last_name', 'first_name', 'user_email'));
233 233
 }
234 234
 
235 235
 {/*	Version 40 - Version 1.3.5.4	*/
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 {/*	Version 60 - Version 1.3.9.8	*/
252 252
 	$wpshop_db_version = 60;
253 253
 
254
-	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array( 'name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'product_price', 'tx_tva', 'tva'));
254
+	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array('name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'product_price', 'tx_tva', 'tva'));
255 255
 	$wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array('code' => 'general', 'name' => __('Main information', 'wpshop'), 'details' => array('product_reference', 'barcode'));
256 256
 }
257 257
 
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/librairies/init.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -301,8 +301,8 @@
 block discarded – undo
301 301
 	}
302 302
 
303 303
 	/**
304
-	*	Admin javascript "header script" part definition
305
-	*/
304
+	 *	Admin javascript "header script" part definition
305
+	 */
306 306
 	function admin_css_head() {
307 307
 		ob_start();
308 308
 		include(WPSHOP_CSS_DIR . 'pages/wpshop_product.css');
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 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
 /*	Check if file is include. No direct access possible with file url	*/
4 6
 if ( !defined( 'WPSHOP_VERSION' ) ) {
@@ -519,7 +521,9 @@  discard block
 block discarded – undo
519 521
 		$to_exclude=unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE);
520 522
 		if(!empty($to_exclude)):
521 523
 			foreach($to_exclude as $excluded_type):
522
-				if(isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]);
524
+				if(isset($wp_types[$excluded_type])) {
525
+					unset($wp_types[$excluded_type]);
526
+				}
523 527
 			endforeach;
524 528
 		endif;
525 529
 		DEFINE('WPSHOP_INTERNAL_TYPES', serialize(array_merge($wp_types, array('users' => __('Users', 'wpshop')))));
Please login to merge, or discard this patch.
Spacing   +125 added lines, -125 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
 /**
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * @package wpshop
23 23
  * @subpackage librairies
24 24
  */
25
-class wpshop_init{
25
+class wpshop_init {
26 26
 
27 27
 	/**
28 28
 	 *	This is the function loaded when wordpress load the different plugin
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
 		/*	Include head js	*/
41 41
 		add_action('admin_print_scripts', array('wpshop_init', 'admin_print_js'));
42 42
 
43
-		$page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
44
-		$post_type = !empty( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : '';
45
-		$action = !empty( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : '';
46
-		$post = !empty( $_GET['post'] ) ? sanitize_text_field( $_GET['post'] ) : '';
47
-		$taxonomy = !empty( $_GET['taxonomy'] ) ? sanitize_text_field( $_GET['taxonomy'] ) : '';
48
-		if((isset($page) && substr($page, 0, 7) == 'wpshop_') || (isset($page) && $page == 'wps-installer' ) || (isset($post_type) && substr($post_type, 0, 7) == 'wpshop_') || !empty($post) || (isset($page) && $page==WPSHOP_NEWTYPE_IDENTIFIER_GROUP) || (isset($taxonomy) && ($taxonomy == WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES))){
43
+		$page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : '';
44
+		$post_type = !empty($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : '';
45
+		$action = !empty($_GET['action']) ? sanitize_text_field($_GET['action']) : '';
46
+		$post = !empty($_GET['post']) ? sanitize_text_field($_GET['post']) : '';
47
+		$taxonomy = !empty($_GET['taxonomy']) ? sanitize_text_field($_GET['taxonomy']) : '';
48
+		if ((isset($page) && substr($page, 0, 7) == 'wpshop_') || (isset($page) && $page == 'wps-installer') || (isset($post_type) && substr($post_type, 0, 7) == 'wpshop_') || !empty($post) || (isset($page) && $page == WPSHOP_NEWTYPE_IDENTIFIER_GROUP) || (isset($taxonomy) && ($taxonomy == WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES))) {
49 49
 			/*	Include the different javascript	*/
50 50
 // 			add_action('admin_init', array('wpshop_init', 'admin_js'));
51
-			add_action( 'admin_enqueue_scripts', array('wpshop_init', 'admin_js') );
51
+			add_action('admin_enqueue_scripts', array('wpshop_init', 'admin_js'));
52 52
 			add_action('admin_footer', array('wpshop_init', 'admin_js_footer'));
53 53
 
54 54
 			/*	Include the different css	*/
@@ -59,27 +59,27 @@  discard block
 block discarded – undo
59 59
 		add_action('admin_init', array('wpshop_init', 'wpshop_css'));
60 60
 
61 61
 		/*	Include the different css	*/
62
-		if ( !is_admin() ) {
62
+		if (!is_admin()) {
63 63
 			add_action('wp_print_styles', array('wpshop_init', 'frontend_css'));
64 64
 			add_action('wp_print_scripts', array('wpshop_init', 'frontend_js_instruction'));
65 65
 		}
66 66
 
67
-		if (isset($page,$action) && $page=='wpshop_doc' && $action=='edit') {
67
+		if (isset($page, $action) && $page == 'wpshop_doc' && $action == 'edit') {
68 68
 			add_action('admin_init', array('wpshop_doc', 'init_wysiwyg'));
69 69
 		}
70 70
 
71 71
 		// RICH TEXT EDIT INIT
72
-		add_action('init', array('wpshop_display','wpshop_rich_text_tags'), 9999);
73
-		add_action('init', array('wpshop_display','wps_hide_admin_bar_for_customers'), 9999 );
72
+		add_action('init', array('wpshop_display', 'wpshop_rich_text_tags'), 9999);
73
+		add_action('init', array('wpshop_display', 'wps_hide_admin_bar_for_customers'), 9999);
74 74
 
75 75
 		/**	Adda custom class to the admin body	*/
76
-		add_filter( 'admin_body_class', array( 'wpshop_init', 'admin_body_class' ) );
76
+		add_filter('admin_body_class', array('wpshop_init', 'admin_body_class'));
77 77
 	}
78 78
 
79 79
 	/**
80 80
 	 *	Admin menu creation
81 81
 	 */
82
-	public static function admin_menu(){
82
+	public static function admin_menu() {
83 83
 		global $menu;
84 84
 
85 85
 		/*	Get current plugin version	*/
@@ -87,17 +87,17 @@  discard block
 block discarded – undo
87 87
 
88 88
 		$wpshop_catalog_menu_order = 34;
89 89
 
90
-		$menu[ $wpshop_catalog_menu_order-1 ] = array( '', 'read', 'separator-wpshop_dashboard', '', 'wp-menu-separator wpshop_dashboard' );
90
+		$menu[$wpshop_catalog_menu_order - 1] = array('', 'read', 'separator-wpshop_dashboard', '', 'wp-menu-separator wpshop_dashboard');
91 91
 
92 92
 		/*	Main menu creation	*/
93 93
 		global $wps_dashboard_ctr;
94
-		add_menu_page(__( 'Dashboard', 'wpshop' ), __( 'Shop', 'wpshop' ), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array( $wps_dashboard_ctr, 'display_dashboard' ), 'dashicons-admin-home', $wpshop_catalog_menu_order);
95
-		add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __('Dashboard', 'wpshop' ), __('Dashboard', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array( $wps_dashboard_ctr, 'display_dashboard' ));
94
+		add_menu_page(__('Dashboard', 'wpshop'), __('Shop', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array($wps_dashboard_ctr, 'display_dashboard'), 'dashicons-admin-home', $wpshop_catalog_menu_order);
95
+		add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __('Dashboard', 'wpshop'), __('Dashboard', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array($wps_dashboard_ctr, 'display_dashboard'));
96 96
 
97 97
 		/*	Add eav model menus	*/
98
-		add_menu_page(__( 'Entities', 'wpshop' ), __( 'Entities', 'wpshop' ), 'wpshop_view_dashboard', WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, array('wpshop_display', 'display_page'), 'dashicons-universal-access-alt', $wpshop_catalog_menu_order + 1);
99
-		add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __( 'Attributes', 'wpshop' ), __('Attributes', 'wpshop'), 'wpshop_view_attributes', WPSHOP_URL_SLUG_ATTRIBUTE_LISTING, array('wpshop_display','display_page'));
100
-		add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __( 'Attributes groups', 'wpshop' ), __('Attributes groups', 'wpshop'), 'wpshop_view_attribute_set', WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING, array('wpshop_display','display_page'));
98
+		add_menu_page(__('Entities', 'wpshop'), __('Entities', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, array('wpshop_display', 'display_page'), 'dashicons-universal-access-alt', $wpshop_catalog_menu_order + 1);
99
+		add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __('Attributes', 'wpshop'), __('Attributes', 'wpshop'), 'wpshop_view_attributes', WPSHOP_URL_SLUG_ATTRIBUTE_LISTING, array('wpshop_display', 'display_page'));
100
+		add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __('Attributes groups', 'wpshop'), __('Attributes groups', 'wpshop'), 'wpshop_view_attribute_set', WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING, array('wpshop_display', 'display_page'));
101 101
 
102 102
 		/*	Add messages menus	*/
103 103
 		//add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __( 'Messages', 'wpshop' ), __( 'Messages', 'wpshop'), 'wpshop_view_messages', 'edit.php?post_type='.WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 		/*	Add a menu for plugin tools	*/
108 108
 // 		if (WPSHOP_DISPLAY_TOOLS_MENU) {
109
-			add_management_page( __('Wpshop - Tools', 'wpshop' ), __('Wpshop - Tools', 'wpshop' ), 'wpshop_view_tools_menu', WPSHOP_URL_SLUG_TOOLS , array('wpshop_tools', 'main_page'));
109
+			add_management_page(__('Wpshop - Tools', 'wpshop'), __('Wpshop - Tools', 'wpshop'), 'wpshop_view_tools_menu', WPSHOP_URL_SLUG_TOOLS, array('wpshop_tools', 'main_page'));
110 110
 // 		}
111 111
 
112 112
 		/*	Add the options menu	*/
@@ -120,29 +120,29 @@  discard block
 block discarded – undo
120 120
 		$wpshop_menu_order = array();
121 121
 
122 122
 		// Get the index of our custom separator
123
-		$separator = array_search( 'separator-wpshop_dashboard', $menu_order );
124
-		$product = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $menu_order );
125
-		$order = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $menu_order );
126
-		$customers = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, $menu_order );
123
+		$separator = array_search('separator-wpshop_dashboard', $menu_order);
124
+		$product = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $menu_order);
125
+		$order = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $menu_order);
126
+		$customers = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, $menu_order);
127 127
 		//$entities = array_search( 'admin.php?page=' . WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order );
128
-		$entities = array_search( WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order );
128
+		$entities = array_search(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order);
129 129
 
130
-		unset( $menu_order[$separator] );
131
-		unset( $menu_order[$product] );
132
-		unset( $menu_order[$order] );
133
-		unset( $menu_order[$customers] );
134
-		unset( $menu_order[$entities] );
130
+		unset($menu_order[$separator]);
131
+		unset($menu_order[$product]);
132
+		unset($menu_order[$order]);
133
+		unset($menu_order[$customers]);
134
+		unset($menu_order[$entities]);
135 135
 
136 136
 		// Loop through menu order and do some rearranging
137
-		foreach ( $menu_order as $index => $item ) :
138
-			if ( 'wpshop_dashboard' == $item ) :
137
+		foreach ($menu_order as $index => $item) :
138
+			if ('wpshop_dashboard' == $item) :
139 139
 				$wpshop_menu_order[] = 'separator-wpshop_dashboard';
140 140
 				$wpshop_menu_order[] = $item;
141 141
 				$wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT;
142 142
 				$wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER;
143 143
 				$wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS;
144 144
 				$wpshop_menu_order[] = WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES;
145
-			elseif ( !in_array( $item, array( 'separator-wpshop_dashboard' ) ) ) :
145
+			elseif (!in_array($item, array('separator-wpshop_dashboard'))) :
146 146
 				$wpshop_menu_order[] = $item;
147 147
 			endif;
148 148
 		endforeach;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	}
153 153
 
154 154
 	public static function admin_custom_menu_order() {
155
-		return current_user_can( 'manage_options' );
155
+		return current_user_can('manage_options');
156 156
 	}
157 157
 
158 158
 	/**
@@ -162,18 +162,18 @@  discard block
 block discarded – undo
162 162
 
163 163
 		/*	Désactivation de l'enregistrement automatique pour certains type de post	*/
164 164
 		global $post;
165
-		if ( $post && ( (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ORDER) ||  (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE)
166
-				|| (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_COUPON) ) ) {
165
+		if ($post && ((get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ORDER) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE)
166
+				|| (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_COUPON))) {
167 167
 			wp_dequeue_script('autosave');
168 168
 		}
169 169
 
170
-		$entity_to_search = !empty( $_GET['entity_to_search'] ) ? sanitize_text_field( $_GET['entity_to_search'] ) : '';
170
+		$entity_to_search = !empty($_GET['entity_to_search']) ? sanitize_text_field($_GET['entity_to_search']) : '';
171 171
 //	var WPSHOP_AJAX_FILE_URL = "'.WPSHOP_AJAX_FILE_URL.'";
172 172
 		echo '
173 173
 <script type="text/javascript">
174 174
 
175
-	var WPSHOP_MEDIAS_ICON_URL = "'.WPSHOP_MEDIAS_ICON_URL.'";
176
-	var WPSHOP_PRODUCT_PRICE_PILOT = "'.WPSHOP_PRODUCT_PRICE_PILOT.'";
175
+	var WPSHOP_MEDIAS_ICON_URL = "'.WPSHOP_MEDIAS_ICON_URL . '";
176
+	var WPSHOP_PRODUCT_PRICE_PILOT = "'.WPSHOP_PRODUCT_PRICE_PILOT . '";
177 177
 	var WPSHOP_PRODUCT_PRICE_HT = "' . WPSHOP_PRODUCT_PRICE_HT . '";
178 178
 	var WPSHOP_PRODUCT_PRICE_TAX = "' . WPSHOP_PRODUCT_PRICE_TAX . '";
179 179
 	var WPSHOP_PRODUCT_PRICE_TTC = "' . WPSHOP_PRODUCT_PRICE_TTC . '";
@@ -189,16 +189,16 @@  discard block
 block discarded – undo
189 189
 	var WPSHOP_JS_VAR_ADD_LOGO = "' . __('Upload your logo', 'wpshop') . '";
190 190
 	var WPSHOP_NEWOPTION_CREATION_NONCE = "' . wp_create_nonce("wpshop_new_option_for_attribute_creation") . '";
191 191
 
192
-	var WPSHOP_ADD_TEXT = "'.__('Add', 'wpshop').'";
193
-	var WPSHOP_CREATE_TEXT = "'.__('Create', 'wpshop').'";
194
-	var WPSHOP_SAVE_PRODUCT_OPTIONS_PARAMS = "'.__('Save parameters', 'wpshop').'";
192
+	var WPSHOP_ADD_TEXT = "'.__('Add', 'wpshop') . '";
193
+	var WPSHOP_CREATE_TEXT = "'.__('Create', 'wpshop') . '";
194
+	var WPSHOP_SAVE_PRODUCT_OPTIONS_PARAMS = "'.__('Save parameters', 'wpshop') . '";
195 195
 
196
-	var WPSHOP_NEW_OPTION_IN_LIST_EMPTY = "'.__('You don\'t specify all needed file', 'wpshop').'";
197
-	var WPSHOP_IS_NOT_ALLOWED_SHIPPING_COUNTRY = "'.__('Sorry ! You can\'t order on this shop, because we don\'t ship in your country.', 'wpshop').'";
198
-	var WPSHOP_CONFIRM_BEFORE_GENERATE_INVOICE = "'.__('If you generate the invoice, you will cannot modify this order later. Are you sure to do this action ?', 'wpshop').'";
199
-	var WPSHOP_NEW_OPTION_ALREADY_EXIST_IN_LIST = "'.__('The value you entered already exist in list', 'wpshop').'";
200
-	var WPSHOP_SURE_TO_DELETE_ATTR_OPTION_FROM_LIST = "'.__('Are you sure you want to delete this option from list?', 'wpshop').'";
201
-	var WPSHOP_DEFAULT_VALUE = "'.__('Set as default value', 'wpshop').'";
196
+	var WPSHOP_NEW_OPTION_IN_LIST_EMPTY = "'.__('You don\'t specify all needed file', 'wpshop') . '";
197
+	var WPSHOP_IS_NOT_ALLOWED_SHIPPING_COUNTRY = "'.__('Sorry ! You can\'t order on this shop, because we don\'t ship in your country.', 'wpshop') . '";
198
+	var WPSHOP_CONFIRM_BEFORE_GENERATE_INVOICE = "'.__('If you generate the invoice, you will cannot modify this order later. Are you sure to do this action ?', 'wpshop') . '";
199
+	var WPSHOP_NEW_OPTION_ALREADY_EXIST_IN_LIST = "'.__('The value you entered already exist in list', 'wpshop') . '";
200
+	var WPSHOP_SURE_TO_DELETE_ATTR_OPTION_FROM_LIST = "'.__('Are you sure you want to delete this option from list?', 'wpshop') . '";
201
+	var WPSHOP_DEFAULT_VALUE = "'.__('Set as default value', 'wpshop') . '";
202 202
 	var WPSHOP_MSG_INVOICE_QUOTATION = "' . __('Are you sure you want to charge this order? You\'ll be unable to modify the content after this operation', 'wpshop') . '";
203 203
 	var WPSHOP_MSG_IGNORE_CONFIGURATION = "' . __('If you continue without install the plugin. Your products won\'t be purchasable', 'wpshop') . '";
204 204
 	var WPSHOP_MSG_CONFIRM_THUMBNAIL_DELETION = "' . __('Are you sure you want to delete this thumbnail?', 'wpshop') . '";
@@ -207,55 +207,55 @@  discard block
 block discarded – undo
207 207
 	var WPSHOP_CHOSEN_SELECT_FROM_LIST = "' . __('Select an Option', 'wpshop') . '";
208 208
 	var WPSHOP_AJAX_CHOSEN_KEEP_TYPING = "' . __('Keep typing for search launching', 'wpshop') . '";
209 209
 	var WPSHOP_AJAX_CHOSEN_SEARCHING = "' . __('Searching in progress for', 'wpshop') . '";
210
-	var WPSHOP_MSG_CONFIRM_ADDON_DEACTIVATION = "'.__('Are you sure you want to deactivate this addon?', 'wpshop').'";
211
-	var WPS_DELETE_SHOP_LOGO_MSG = "'.__('Are you sure you want to delete this logo?', 'wpshop').'";
210
+	var WPSHOP_MSG_CONFIRM_ADDON_DEACTIVATION = "'.__('Are you sure you want to deactivate this addon?', 'wpshop') . '";
211
+	var WPS_DELETE_SHOP_LOGO_MSG = "'.__('Are you sure you want to delete this logo?', 'wpshop') . '";
212 212
 	var WPS_DEFAULT_LOGO = "'.WPSHOP_MEDIAS_IMAGES_URL . 'no_picture.png";
213 213
 
214
-	var WPSHOP_NO_ATTRIBUTES_SELECT_FOR_VARIATION = "'.__('You have to select at least one attribute for creating a new variation', 'wpshop').'";
214
+	var WPSHOP_NO_ATTRIBUTES_SELECT_FOR_VARIATION = "'.__('You have to select at least one attribute for creating a new variation', 'wpshop') . '";
215 215
 
216 216
 	var WPSHOP_CHOSEN_ATTRS = {disable_search_threshold: 5, no_results_text: WPSHOP_CHOSEN_NO_RESULT, placeholder_text_single : WPSHOP_CHOSEN_SELECT_FROM_LIST, placeholder_text_multiple : WPSHOP_CHOSEN_SELECT_FROM_MULTI_LIST};
217 217
 
218
-	var WPSHOP_TEMPLATES_URL = "'.WPSHOP_TEMPLATES_URL.'";
219
-	var WPSHOP_BUTTON_DESCRIPTION = "'.__('Insert shortcode into page content', 'wpshop').'";
220
-	var WPSHOP_WYSIWYG_MENU_TITLE_PRODUCT_LISTING = "'.__('Product listing', 'wpshop').'";
221
-	var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_PID_TITLE = "'.__('By product ID', 'wpshop').'";
222
-	var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_ATTRIBUTE_TITLE = "'.__('By attribute value', 'wpshop').'";
223
-	var WPSHOP_WYSIWYG_MENU_TITLE_CATEGORIES = "'.__('Wpshop categories', 'wpshop').'";
224
-	var WPSHOP_WYSIWYG_MENU_TITLE_ATTRIBUTE_VALUE = "'.__('Attribute value', 'wpshop').'";
225
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_TITLE = "'.__('Custom message content', 'wpshop').'";
226
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_FIRST_NAME = "'.__('Customer first name', 'wpshop').'";
227
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_LAST_NAME = "'.__('Customer last name', 'wpshop').'";
228
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_EMAIL = "'.__('Customer email', 'wpshop').'";
229
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ID = "'.__('Order identifer', 'wpshop').'";
230
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_PAYPAL_TRANSACTION_ID = "'.__('Paypal transaction ID', 'wpshop').'";
231
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CONTENT = "'.__('Order content', 'wpshop').'";
232
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CUSTOMER_PERSONNAL_INFORMATIONS = "'.__('Customer personnal informations', 'wpshop').'";
233
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ADDRESSES = "'.__('Order addresses', 'wpshop').'";
234
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_BILLING_ORDER_ADDRESS = "'.__('Billing order address', 'wpshop').'";
235
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_ORDER_ADDRESS = "'.__('Shipping order address', 'wpshop').'";
236
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_METHOD = "'.__('Shipping method', 'wpshop').'";
237
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_PAYMENT_METHOD = "'.__('order payment_method', 'wpshop').'";
238
-	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_COMMENT = "'.__('Order customer comment', 'wpshop').'";
239
-	var WPSHOP_CUSTOM_TAGS_TITLE = "'.__('Wpshop custom tags', 'wpshop').'";
240
-	var WPSHOP_CUSTOM_TAGS_CART = "'.__('Cart', 'wpshop').'";
241
-	var WPSHOP_CUSTOM_TAGS_CART_MINI = "'.__('Cart widget', 'wpshop').'";
242
-	var WPSHOP_CUSTOM_TAGS_CHECKOUT = "'.__('Checkout', 'wpshop').'";
243
-	var WPSHOP_CUSTOM_TAGS_ACCOUNT = "'.__('Customer account', 'wpshop').'";
244
-	var WPSHOP_CUSTOM_TAGS_SHOP = "'.__('Shop', 'wpshop').'";
245
-	var WPSHOP_CUSTOM_TAGS_ADVANCED_SEARCH = "'.__('Advanced search', 'wpshop').'";
246
-	var WPSHOP_CANCEL_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to cancel this order ?', 'wpshop').'";
247
-	var WPSHOP_REFUND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to refund this order ?', 'wpshop').'";
248
-	var WPSHOP_RESEND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to resend this order to customer ?', 'wpshop').'";
249
-	var WPSHOP_SEARCH_IN_ORDER_EXPLAIN_MESSAGE = "'.__('You want to search in orders', 'wpshop').'";
250
-	var WPSHOP_SEARCH_IN_ORDER_CHOICE_CUSTOMER = "'.__('a customer', 'wpshop').'";
251
-	var WPSHOP_SEARCH_IN_ORDER_CHOICE_PRODUCT = "'.__('a product', 'wpshop').'";
252
-	var WPSHOP_SEARCH_IN_ORDER_USER_CHOICE = "'.( (!empty($entity_to_search) ) ? $entity_to_search : 'customer' ).'";
253
-	var WPSHOP_DELETE_ADDRESS_CONFIRMATION = "'.__( 'Do you really want to delete this address', 'wpshop' ).'";
254
-
255
-	var wps_options_shipping_weight_for_custom_fees = "'.__( 'You must enter a weight', 'wpshop' ).'";
256
-	var wps_options_country_choose_for_custom_fees = "'.__( 'You must a country for custom fees saving', 'wpshop' ).'";
257
-	var wps_options_country_postcode_choose_for_custom_fees = "'.__( 'You must choose a country or write a postcode.', 'wpshop' ).'";
258
-	var wps_an_error_occured = "'.__( 'An error occured', 'wpshop' ).'";
218
+	var WPSHOP_TEMPLATES_URL = "'.WPSHOP_TEMPLATES_URL . '";
219
+	var WPSHOP_BUTTON_DESCRIPTION = "'.__('Insert shortcode into page content', 'wpshop') . '";
220
+	var WPSHOP_WYSIWYG_MENU_TITLE_PRODUCT_LISTING = "'.__('Product listing', 'wpshop') . '";
221
+	var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_PID_TITLE = "'.__('By product ID', 'wpshop') . '";
222
+	var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_ATTRIBUTE_TITLE = "'.__('By attribute value', 'wpshop') . '";
223
+	var WPSHOP_WYSIWYG_MENU_TITLE_CATEGORIES = "'.__('Wpshop categories', 'wpshop') . '";
224
+	var WPSHOP_WYSIWYG_MENU_TITLE_ATTRIBUTE_VALUE = "'.__('Attribute value', 'wpshop') . '";
225
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_TITLE = "'.__('Custom message content', 'wpshop') . '";
226
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_FIRST_NAME = "'.__('Customer first name', 'wpshop') . '";
227
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_LAST_NAME = "'.__('Customer last name', 'wpshop') . '";
228
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_EMAIL = "'.__('Customer email', 'wpshop') . '";
229
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ID = "'.__('Order identifer', 'wpshop') . '";
230
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_PAYPAL_TRANSACTION_ID = "'.__('Paypal transaction ID', 'wpshop') . '";
231
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CONTENT = "'.__('Order content', 'wpshop') . '";
232
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CUSTOMER_PERSONNAL_INFORMATIONS = "'.__('Customer personnal informations', 'wpshop') . '";
233
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ADDRESSES = "'.__('Order addresses', 'wpshop') . '";
234
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_BILLING_ORDER_ADDRESS = "'.__('Billing order address', 'wpshop') . '";
235
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_ORDER_ADDRESS = "'.__('Shipping order address', 'wpshop') . '";
236
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_METHOD = "'.__('Shipping method', 'wpshop') . '";
237
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_PAYMENT_METHOD = "'.__('order payment_method', 'wpshop') . '";
238
+	var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_COMMENT = "'.__('Order customer comment', 'wpshop') . '";
239
+	var WPSHOP_CUSTOM_TAGS_TITLE = "'.__('Wpshop custom tags', 'wpshop') . '";
240
+	var WPSHOP_CUSTOM_TAGS_CART = "'.__('Cart', 'wpshop') . '";
241
+	var WPSHOP_CUSTOM_TAGS_CART_MINI = "'.__('Cart widget', 'wpshop') . '";
242
+	var WPSHOP_CUSTOM_TAGS_CHECKOUT = "'.__('Checkout', 'wpshop') . '";
243
+	var WPSHOP_CUSTOM_TAGS_ACCOUNT = "'.__('Customer account', 'wpshop') . '";
244
+	var WPSHOP_CUSTOM_TAGS_SHOP = "'.__('Shop', 'wpshop') . '";
245
+	var WPSHOP_CUSTOM_TAGS_ADVANCED_SEARCH = "'.__('Advanced search', 'wpshop') . '";
246
+	var WPSHOP_CANCEL_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to cancel this order ?', 'wpshop') . '";
247
+	var WPSHOP_REFUND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to refund this order ?', 'wpshop') . '";
248
+	var WPSHOP_RESEND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to resend this order to customer ?', 'wpshop') . '";
249
+	var WPSHOP_SEARCH_IN_ORDER_EXPLAIN_MESSAGE = "'.__('You want to search in orders', 'wpshop') . '";
250
+	var WPSHOP_SEARCH_IN_ORDER_CHOICE_CUSTOMER = "'.__('a customer', 'wpshop') . '";
251
+	var WPSHOP_SEARCH_IN_ORDER_CHOICE_PRODUCT = "'.__('a product', 'wpshop') . '";
252
+	var WPSHOP_SEARCH_IN_ORDER_USER_CHOICE = "'.((!empty($entity_to_search)) ? $entity_to_search : 'customer') . '";
253
+	var WPSHOP_DELETE_ADDRESS_CONFIRMATION = "'.__('Do you really want to delete this address', 'wpshop') . '";
254
+
255
+	var wps_options_shipping_weight_for_custom_fees = "'.__('You must enter a weight', 'wpshop') . '";
256
+	var wps_options_country_choose_for_custom_fees = "'.__('You must a country for custom fees saving', 'wpshop') . '";
257
+	var wps_options_country_postcode_choose_for_custom_fees = "'.__('You must choose a country or write a postcode.', 'wpshop') . '";
258
+	var wps_an_error_occured = "'.__('An error occured', 'wpshop') . '";
259 259
 </script>';
260 260
 	}
261 261
 
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 		ob_end_clean();
271 271
 
272 272
 		echo '<script type="text/javascript">
273
-			var wp_version = "'.$wp_version.'";
274
-			'.$wpshop_product_js.'
273
+			var wp_version = "'.$wp_version . '";
274
+			'.$wpshop_product_js . '
275 275
 		</script>';
276 276
 	}
277 277
 
@@ -287,21 +287,21 @@  discard block
 block discarded – undo
287 287
 		wp_enqueue_script('jquery-ui-dialog');
288 288
 		wp_enqueue_script('jquery-form');
289 289
 		wp_enqueue_script('jquery-ui-slider');
290
-		wp_enqueue_script( 'jquery-ui-autocomplete' );
290
+		wp_enqueue_script('jquery-ui-autocomplete');
291 291
 		wp_enqueue_script('wpshop_main_function_js', WPSHOP_JS_URL . 'main_function.js', '', WPSHOP_VERSION);
292 292
 		wp_enqueue_script('wpshop_main_js', WPSHOP_JS_URL . 'main.js', '', WPSHOP_VERSION);
293 293
 		wp_enqueue_script('wpshop_jq_datatable', WPSHOP_JS_URL . 'jquery-libs/jquery.dataTables.min.js', '', WPSHOP_VERSION);
294
-		wp_enqueue_script('wpshop_jquery_chosen',  WPSHOP_JS_URL . 'jquery-libs/chosen.jquery.min.js', '', WPSHOP_VERSION);
294
+		wp_enqueue_script('wpshop_jquery_chosen', WPSHOP_JS_URL . 'jquery-libs/chosen.jquery.min.js', '', WPSHOP_VERSION);
295 295
 		wp_enqueue_script('jquery-effects-core');
296 296
 		wp_enqueue_script('jquery-effects-highlight');
297 297
 
298
-		$page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
298
+		$page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : '';
299 299
 
300 300
 		/*	Include specific js file for the current page if existing	*/
301
-		if(isset($page) && is_file(WPSHOP_JS_DIR . 'pages/' . $page . '.js')){
301
+		if (isset($page) && is_file(WPSHOP_JS_DIR . 'pages/' . $page . '.js')) {
302 302
 			wp_enqueue_script($page . '_js', WPSHOP_JS_URL . 'pages/' . $page . '.js', '', WPSHOP_VERSION);
303 303
 		}
304
-		if((isset($page) && ($page == 'wpshop_dashboard'))) {
304
+		if ((isset($page) && ($page == 'wpshop_dashboard'))) {
305 305
 			wp_enqueue_script($page . '_js', WPSHOP_JS_URL . 'pages/' . WPSHOP_URL_SLUG_OPTION . '.js', '', WPSHOP_VERSION);
306 306
 			wp_register_style($page . '_css', WPSHOP_CSS_URL . 'pages/' . WPSHOP_URL_SLUG_OPTION . '.css', '', WPSHOP_VERSION);
307 307
 			wp_enqueue_style($page . '_css');
@@ -328,12 +328,12 @@  discard block
 block discarded – undo
328 328
 	 * @param array $classes
329 329
 	 * @return string
330 330
 	 */
331
-	public static function admin_body_class( $classes ) {
331
+	public static function admin_body_class($classes) {
332 332
 		global $post;
333 333
 
334
-		if ( !empty($post->ID) ) {
335
-			$post_type = get_post_type( $post->ID );
336
-			if ( is_admin() && in_array( $post_type, array(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE, WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, WPSHOP_NEWTYPE_IDENTIFIER_COUPON, WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS) ) ) {
334
+		if (!empty($post->ID)) {
335
+			$post_type = get_post_type($post->ID);
336
+			if (is_admin() && in_array($post_type, array(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE, WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, WPSHOP_NEWTYPE_IDENTIFIER_COUPON, WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS))) {
337 337
 				$classes .= ' wpshop-admin-body wpshop-admin-post-type-' . $post_type;
338 338
 			}
339 339
 		}
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
 		wp_enqueue_style('wpshop_chosen_css');
362 362
 
363 363
 		/*	Include specific css file for the current page if existing	*/
364
-		$page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
365
-		if(isset($page) && is_file(WPSHOP_CSS_DIR . 'pages/' . $page . '.css')){
364
+		$page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : '';
365
+		if (isset($page) && is_file(WPSHOP_CSS_DIR . 'pages/' . $page . '.css')) {
366 366
 			wp_register_style($page . '_css', WPSHOP_CSS_URL . 'pages/' . $page . '.css', '', WPSHOP_VERSION);
367 367
 			wp_enqueue_style($page . '_css');
368 368
 		}
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 		wp_register_style('wpshop_default_wps_style_css', WPSHOP_TEMPLATES_URL . 'wpshop/css/wps_style.css', '', WPSHOP_VERSION);
405 405
 		wp_enqueue_style('wpshop_default_wps_style_css');
406 406
 
407
-		if( file_exists( get_stylesheet_directory().'/wpshop/css/wps_style.css' ) ) {
408
-			wp_deregister_style( 'wpshop_default_wps_style_css' );
407
+		if (file_exists(get_stylesheet_directory() . '/wpshop/css/wps_style.css')) {
408
+			wp_deregister_style('wpshop_default_wps_style_css');
409 409
 			wp_register_style('wps_style_css', wpshop_display::get_template_file('wps_style.css', WPSHOP_TEMPLATES_URL, 'wpshop/css', 'output', true), '', WPSHOP_VERSION);
410 410
 			wp_enqueue_style('wps_style_css', 11);
411 411
 		}
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 		wp_register_style('wps_owl_caroussel_transitions', wpshop_display::get_template_file('owl.transitions.css', WPSHOP_TEMPLATES_URL, 'wpshop/css', 'output'), '', WPSHOP_VERSION);
418 418
 		wp_enqueue_style('wps_owl_caroussel_transitions');
419 419
 
420
-			wp_enqueue_style( 'dashicons' );
420
+			wp_enqueue_style('dashicons');
421 421
 	}
422 422
 
423 423
 	/**
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		wp_enqueue_script('jquery-ui-slider');
436 436
 		wp_enqueue_script('wpshop_frontend_main_js', wpshop_display::get_template_file('frontend_main.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true);
437 437
 // 		wp_enqueue_script('wpshop_jquery_jqzoom_core_js', wpshop_display::get_template_file('jquery.jqzoom-core.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true);
438
-		wp_enqueue_script('fancyboxmousewheel',WPSHOP_JS_URL . 'fancybox/jquery.mousewheel-3.0.4.pack.js', '', WPSHOP_VERSION, true);
438
+		wp_enqueue_script('fancyboxmousewheel', WPSHOP_JS_URL . 'fancybox/jquery.mousewheel-3.0.4.pack.js', '', WPSHOP_VERSION, true);
439 439
 		wp_enqueue_script('fancybox', WPSHOP_JS_URL . 'fancybox/jquery.fancybox-1.3.4.pack.js', '', WPSHOP_VERSION, true);
440 440
 		wp_enqueue_script('jquery_address', WPSHOP_JS_URL . 'jquery-libs/jquery.address-1.5.min.js', '', WPSHOP_VERSION);
441 441
 		wp_enqueue_script('wps_api', wpshop_display::get_template_file('wps-api.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 	var WPSHOP_MUST_CHOOSE_SHIPPING_MODE = "<?php _e('You must to choose a shipping mode', 'wpshop'); ?>";
460 460
 	var WPSHOP_NO_SHIPPING_MODE_AVAILABLE = "<?php _e('You can\'t order because no shipping mode is available.', 'wpshop'); ?>";
461 461
 	var WPSHOP_LOADER_ICON_JQUERY_ADDRESS = "<img src=\"<?php echo WPSHOP_LOADING_ICON; ?>\" alt=\"Loading...\" />";
462
-	var WPSHOP_CONFIRM_DELETE_ADDRESS = "<?php _e( 'Do you really want to delete this address ?', 'wpshop' ); ?>";
462
+	var WPSHOP_CONFIRM_DELETE_ADDRESS = "<?php _e('Do you really want to delete this address ?', 'wpshop'); ?>";
463 463
 	var wps_speed_slideUpDown = 200;
464 464
 	var MODAL_URL = '<?php echo WPSHOP_TEMPLATES_URL; ?>wpshop/modal.php';
465 465
 </script>
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		$product_class = new wpshop_products();
497 497
 		add_action('save_post', array($product_class, 'save_product_custom_informations'));
498 498
 		/*	Modification des paramètres de variation quand ils ne sont pas configurés individuellement	*/
499
-		add_filter('pre_update_option_' . 'wpshop_catalog_product_option', array('wpshop_products', 'update_wpshop_catalog_product_option'), 10, 2 );
499
+		add_filter('pre_update_option_' . 'wpshop_catalog_product_option', array('wpshop_products', 'update_wpshop_catalog_product_option'), 10, 2);
500 500
 
501 501
 		/*	Add wpshop product category term	*/
502 502
 		wpshop_categories::create_product_categories();
@@ -504,14 +504,14 @@  discard block
 block discarded – undo
504 504
 		/*	Add wpshop message term	*/
505 505
 
506 506
 
507
-		if ( $wpshop_shop_type == 'sale' ) {
507
+		if ($wpshop_shop_type == 'sale') {
508 508
 			/*	Add wpshop orders term	*/
509 509
 			wpshop_orders::create_orders_type();
510 510
 			add_action('add_meta_boxes', array('wpshop_orders', 'add_meta_boxes'));
511
-			add_action('manage_'.WPSHOP_NEWTYPE_IDENTIFIER_ORDER.'_posts_custom_column',  array('wpshop_orders', 'orders_custom_columns'), 10, 2);
512
-			add_filter('manage_edit-'.WPSHOP_NEWTYPE_IDENTIFIER_ORDER.'_columns', array('wpshop_orders', 'orders_edit_columns'));
513
-			add_action('restrict_manage_posts', array('wpshop_orders', 'list_table_filters') );
514
-			add_filter('parse_query', array('wpshop_orders', 'list_table_filter_parse_query') );
511
+			add_action('manage_' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER . '_posts_custom_column', array('wpshop_orders', 'orders_custom_columns'), 10, 2);
512
+			add_filter('manage_edit-' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER . '_columns', array('wpshop_orders', 'orders_edit_columns'));
513
+			add_action('restrict_manage_posts', array('wpshop_orders', 'list_table_filters'));
514
+			add_filter('parse_query', array('wpshop_orders', 'list_table_filter_parse_query'));
515 515
 		}
516 516
 
517 517
 		$args = array(
@@ -521,14 +521,14 @@  discard block
 block discarded – undo
521 521
 		$output = 'objects'; // names or objects, note names is the default
522 522
 		$operator = 'or'; // 'and' or 'or'
523 523
 
524
-		$wp_types_original=get_post_types($args,$output,$operator);
524
+		$wp_types_original = get_post_types($args, $output, $operator);
525 525
 		foreach ($wp_types_original as $type => $type_definition):
526 526
 			$wp_types[$type] = $type_definition->labels->name;
527 527
 		endforeach;
528
-		$to_exclude=unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE);
529
-		if(!empty($to_exclude)):
530
-			foreach($to_exclude as $excluded_type):
531
-				if(isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]);
528
+		$to_exclude = unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE);
529
+		if (!empty($to_exclude)):
530
+			foreach ($to_exclude as $excluded_type):
531
+				if (isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]);
532 532
 			endforeach;
533 533
 		endif;
534 534
 		DEFINE('WPSHOP_INTERNAL_TYPES', serialize(array_merge($wp_types, array('users' => __('Users', 'wpshop')))));
Please login to merge, or discard this patch.
includes/librairies/HTML2PDF/_tcpdf_5.0.002/unicode_data.php 2 patches
Spacing   +14 added lines, -14 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
 // File name   : unicode_data.php
4 4
 // Begin       : 2008-01-01
@@ -17855,7 +17855,7 @@  discard block
 block discarded – undo
17855 17855
  * at http://www.unicode.org/unicode/reports/tr9/
17856 17856
  */
17857 17857
 global $unicode_mirror;
17858
-$unicode_mirror = array (
17858
+$unicode_mirror = array(
17859 17859
 0x0028=>0x0029,
17860 17860
 0x0029=>0x0028,
17861 17861
 0x003C=>0x003E,
@@ -18298,7 +18298,7 @@  discard block
 block discarded – undo
18298 18298
  * char code=>isolated, final, initial, medial
18299 18299
  */
18300 18300
 global $laa_array;
18301
-$laa_array = array (
18301
+$laa_array = array(
18302 18302
 1570 =>array(65269, 65270, 65269, 65270),
18303 18303
 1571 =>array(65271, 65272, 65271, 65272),
18304 18304
 1573 =>array(65273, 65274, 65273, 65274),
@@ -18312,7 +18312,7 @@  discard block
 block discarded – undo
18312 18312
  * second NSM char code=>substitution char
18313 18313
  */
18314 18314
 global $diacritics;
18315
-$diacritics = array (
18315
+$diacritics = array(
18316 18316
 1612=>64606, # Shadda + Dammatan
18317 18317
 1613=>64607, # Shadda + Kasratan
18318 18318
 1614=>64608, # Shadda + Fatha
@@ -18324,23 +18324,23 @@  discard block
 block discarded – undo
18324 18324
  * Array of character substitutions from UTF-8 unicode to latin1
18325 18325
  */
18326 18326
 global $utf8tolatin;
18327
-$utf8tolatin = array (
18327
+$utf8tolatin = array(
18328 18328
 8364=>128, # Euro1
18329
-338=>140,  # OE
18330
-352=>138,  # Scaron
18331
-376=>159,  # Ydieresis
18332
-381=>142,  # Zcaron2
18329
+338=>140, # OE
18330
+352=>138, # Scaron
18331
+376=>159, # Ydieresis
18332
+381=>142, # Zcaron2
18333 18333
 8226=>149, # bullet3
18334
-710=>136,  # circumflex
18334
+710=>136, # circumflex
18335 18335
 8224=>134, # dagger
18336 18336
 8225=>135, # daggerdbl
18337 18337
 8230=>133, # ellipsis
18338 18338
 8212=>151, # emdash
18339 18339
 8211=>150, # endash
18340
-402=>131,  # florin
18340
+402=>131, # florin
18341 18341
 8249=>139, # guilsinglleft
18342 18342
 8250=>155, # guilsinglright
18343
-339=>156,  # oe
18343
+339=>156, # oe
18344 18344
 8240=>137, # perthousand
18345 18345
 8222=>132, # quotedblbase
18346 18346
 8220=>147, # quotedblleft
@@ -18348,8 +18348,8 @@  discard block
 block discarded – undo
18348 18348
 8216=>145, # quoteleft
18349 18349
 8217=>146, # quoteright
18350 18350
 8218=>130, # quotesinglbase
18351
-353=>154,  # scaron
18352
-732=>152,  # tilde
18351
+353=>154, # scaron
18352
+732=>152, # tilde
18353 18353
 8482=>153, # trademark
18354 18354
 382=>158   # zcaron2
18355 18355
 );
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/librairies/HTML2PDF/_tcpdf_5.0.002/config/tcpdf_config.php 2 patches
Spacing   +38 added lines, -38 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
 // File name   : tcpdf_config.php
4 4
 // Begin       : 2004-06-11
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
 
36 36
 	// DOCUMENT_ROOT fix for IIS Webserver
37 37
 	if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
38
-		if(isset($_SERVER['SCRIPT_FILENAME'])) {
39
-			$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
40
-		} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
41
-			$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
42
-		}	else {
38
+		if (isset($_SERVER['SCRIPT_FILENAME'])) {
39
+			$_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF'])));
40
+		} elseif (isset($_SERVER['PATH_TRANSLATED'])) {
41
+			$_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF'])));
42
+		} else {
43 43
 			// define here your DOCUMENT_ROOT path if the previous fails
44 44
 			$_SERVER['DOCUMENT_ROOT'] = '/var/www';
45 45
 		}
46 46
 	}
47 47
 
48 48
 	// Automatic calculation for the following K_PATH_MAIN constant
49
-	$k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
49
+	$k_path_main = str_replace('\\', '/', realpath(substr(dirname(__FILE__), 0, 0 - strlen('config'))));
50 50
 	if (substr($k_path_main, -1) != '/') {
51 51
 		$k_path_main .= '/';
52 52
 	}
@@ -55,156 +55,156 @@  discard block
 block discarded – undo
55 55
 	 * Installation path (/var/www/tcpdf/).
56 56
 	 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
57 57
 	 */
58
-	define ('K_PATH_MAIN', $k_path_main);
58
+	define('K_PATH_MAIN', $k_path_main);
59 59
 
60 60
 	// Automatic calculation for the following K_PATH_URL constant
61 61
 	$k_path_url = $k_path_main; // default value for console mode
62 62
 	if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
63
-		if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
63
+		if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') {
64 64
 			$k_path_url = 'https://';
65 65
 		} else {
66 66
 			$k_path_url = 'http://';
67 67
 		}
68 68
 		$k_path_url .= $_SERVER['HTTP_HOST'];
69
-		$k_path_url .= str_replace( '\\', '/', substr($_SERVER['PHP_SELF'], 0, -24));
69
+		$k_path_url .= str_replace('\\', '/', substr($_SERVER['PHP_SELF'], 0, -24));
70 70
 	}
71 71
 
72 72
 	/**
73 73
 	 * URL path to tcpdf installation folder (http://localhost/tcpdf/).
74 74
 	 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
75 75
 	 */
76
-	define ('K_PATH_URL', $k_path_url);
76
+	define('K_PATH_URL', $k_path_url);
77 77
 
78 78
 	/**
79 79
 	 * path for PDF fonts
80 80
 	 * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
81 81
 	 */
82
-	define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
82
+	define('K_PATH_FONTS', K_PATH_MAIN . 'fonts/');
83 83
 
84 84
 	/**
85 85
 	 * cache directory for temporary files (full path)
86 86
 	 */
87
-	define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
87
+	define('K_PATH_CACHE', K_PATH_MAIN . 'cache/');
88 88
 
89 89
 	/**
90 90
 	 * cache directory for temporary files (url path)
91 91
 	 */
92
-	define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
92
+	define('K_PATH_URL_CACHE', K_PATH_URL . 'cache/');
93 93
 
94 94
 	/**
95 95
 	 *images directory
96 96
 	 */
97
-	define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
97
+	define('K_PATH_IMAGES', K_PATH_MAIN . 'images/');
98 98
 
99 99
 	/**
100 100
 	 * blank image
101 101
 	 */
102
-	define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
102
+	define('K_BLANK_IMAGE', K_PATH_IMAGES . '_blank.png');
103 103
 
104 104
 	/**
105 105
 	 * page format
106 106
 	 */
107
-	define ('PDF_PAGE_FORMAT', 'A4');
107
+	define('PDF_PAGE_FORMAT', 'A4');
108 108
 
109 109
 	/**
110 110
 	 * page orientation (P=portrait, L=landscape)
111 111
 	 */
112
-	define ('PDF_PAGE_ORIENTATION', 'P');
112
+	define('PDF_PAGE_ORIENTATION', 'P');
113 113
 
114 114
 	/**
115 115
 	 * document creator
116 116
 	 */
117
-	define ('PDF_CREATOR', 'TCPDF');
117
+	define('PDF_CREATOR', 'TCPDF');
118 118
 
119 119
 	/**
120 120
 	 * document author
121 121
 	 */
122
-	define ('PDF_AUTHOR', 'TCPDF');
122
+	define('PDF_AUTHOR', 'TCPDF');
123 123
 
124 124
 	/**
125 125
 	 * header title
126 126
 	 */
127
-	define ('PDF_HEADER_TITLE', 'TCPDF Example');
127
+	define('PDF_HEADER_TITLE', 'TCPDF Example');
128 128
 
129 129
 	/**
130 130
 	 * header description string
131 131
 	 */
132
-	define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
132
+	define('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
133 133
 
134 134
 	/**
135 135
 	 * image logo
136 136
 	 */
137
-	define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
137
+	define('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
138 138
 
139 139
 	/**
140 140
 	 * header logo image width [mm]
141 141
 	 */
142
-	define ('PDF_HEADER_LOGO_WIDTH', 30);
142
+	define('PDF_HEADER_LOGO_WIDTH', 30);
143 143
 
144 144
 	/**
145 145
 	 *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
146 146
 	 */
147
-	define ('PDF_UNIT', 'mm');
147
+	define('PDF_UNIT', 'mm');
148 148
 
149 149
 	/**
150 150
 	 * header margin
151 151
 	 */
152
-	define ('PDF_MARGIN_HEADER', 5);
152
+	define('PDF_MARGIN_HEADER', 5);
153 153
 
154 154
 	/**
155 155
 	 * footer margin
156 156
 	 */
157
-	define ('PDF_MARGIN_FOOTER', 10);
157
+	define('PDF_MARGIN_FOOTER', 10);
158 158
 
159 159
 	/**
160 160
 	 * top margin
161 161
 	 */
162
-	define ('PDF_MARGIN_TOP', 27);
162
+	define('PDF_MARGIN_TOP', 27);
163 163
 
164 164
 	/**
165 165
 	 * bottom margin
166 166
 	 */
167
-	define ('PDF_MARGIN_BOTTOM', 25);
167
+	define('PDF_MARGIN_BOTTOM', 25);
168 168
 
169 169
 	/**
170 170
 	 * left margin
171 171
 	 */
172
-	define ('PDF_MARGIN_LEFT', 15);
172
+	define('PDF_MARGIN_LEFT', 15);
173 173
 
174 174
 	/**
175 175
 	 * right margin
176 176
 	 */
177
-	define ('PDF_MARGIN_RIGHT', 15);
177
+	define('PDF_MARGIN_RIGHT', 15);
178 178
 
179 179
 	/**
180 180
 	 * default main font name
181 181
 	 */
182
-	define ('PDF_FONT_NAME_MAIN', 'helvetica');
182
+	define('PDF_FONT_NAME_MAIN', 'helvetica');
183 183
 
184 184
 	/**
185 185
 	 * default main font size
186 186
 	 */
187
-	define ('PDF_FONT_SIZE_MAIN', 10);
187
+	define('PDF_FONT_SIZE_MAIN', 10);
188 188
 
189 189
 	/**
190 190
 	 * default data font name
191 191
 	 */
192
-	define ('PDF_FONT_NAME_DATA', 'helvetica');
192
+	define('PDF_FONT_NAME_DATA', 'helvetica');
193 193
 
194 194
 	/**
195 195
 	 * default data font size
196 196
 	 */
197
-	define ('PDF_FONT_SIZE_DATA', 8);
197
+	define('PDF_FONT_SIZE_DATA', 8);
198 198
 
199 199
 	/**
200 200
 	 * default monospaced font name
201 201
 	 */
202
-	define ('PDF_FONT_MONOSPACED', 'courier');
202
+	define('PDF_FONT_MONOSPACED', 'courier');
203 203
 
204 204
 	/**
205 205
 	 * ratio used to adjust the conversion of pixels to user units
206 206
 	 */
207
-	define ('PDF_IMAGE_SCALE_RATIO', 1.25);
207
+	define('PDF_IMAGE_SCALE_RATIO', 1.25);
208 208
 
209 209
 	/**
210 210
 	 * magnification factor for titles
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	/**
225 225
 	 * reduction factor for small font
226 226
 	 */
227
-	define('K_SMALL_RATIO', 2/3);
227
+	define('K_SMALL_RATIO', 2 / 3);
228 228
 
229 229
 	/**
230 230
 	 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 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
 // File name   : tcpdf_config.php
4 6
 // Begin       : 2004-06-11
@@ -39,7 +41,7 @@  discard block
 block discarded – undo
39 41
 			$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
40 42
 		} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
41 43
 			$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
42
-		}	else {
44
+		} else {
43 45
 			// define here your DOCUMENT_ROOT path if the previous fails
44 46
 			$_SERVER['DOCUMENT_ROOT'] = '/var/www';
45 47
 		}
Please login to merge, or discard this patch.