Completed
Push — master ( e21aca...50b935 )
by
unknown
13:22
created
modules/wps_product_quick_add/templates/backend/attribute-list.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 	<div id="wps-product-quick-creation-form-attributes" class="wps-bloc-loader" >
4
-		<?php $attribute_list = wpshop_attributes_set::getAttributeSetDetails( $chosen_set ); ?>
5
-		<?php if ( !empty( $attribute_list ) ) : ?>
6
-			<?php foreach( $attribute_list as $attribute_set ) : ?>
4
+		<?php $attribute_list = wpshop_attributes_set::getAttributeSetDetails($chosen_set); ?>
5
+		<?php if (!empty($attribute_list)) : ?>
6
+			<?php foreach ($attribute_list as $attribute_set) : ?>
7 7
 			<?php
8 8
 				$attributes = '';
9
-				foreach($attribute_set['attribut'] as $attribute_key => $attribute) {
10
-					if( !empty( $attribute_key ) && ( $attribute->status == 'valid' ) && ( 'yes' == $attribute->is_used_in_quick_add_form ) ) {
11
-						$output = wpshop_attributes::display_attribute( $attribute->code );
9
+				foreach ($attribute_set['attribut'] as $attribute_key => $attribute) {
10
+					if (!empty($attribute_key) && ($attribute->status == 'valid') && ('yes' == $attribute->is_used_in_quick_add_form)) {
11
+						$output = wpshop_attributes::display_attribute($attribute->code);
12 12
 						$attributes .= $output['field'];
13 13
 					}
14 14
 				}
15 15
 			?>
16
-			<?php if ( !empty( $attributes ) ) : ?>
16
+			<?php if (!empty($attributes)) : ?>
17 17
 	<div class="wps-boxed">
18 18
 		<span class="wps-h5"><?php echo $attribute_set['name']; ?></span>
19 19
 		<?php echo $attributes; ?>
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
 	<div id="wps-product-quick-creation-form-attributes" class="wps-bloc-loader" >
4 6
 		<?php $attribute_list = wpshop_attributes_set::getAttributeSetDetails( $chosen_set ); ?>
Please login to merge, or discard this patch.
wps-pos-addon/modules/wps_product_quick_add/wps_product_quick_add.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3
-DEFINE( 'WPSPOSPDTQUICK_VERSION', 1.0 );
4
-DEFINE( 'WPSPOSPDTQUICK_DIR', basename( dirname( __FILE__ ) ) );
5
-DEFINE( 'WPSPOSPDTQUICK_PATH', str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) );
6
-DEFINE( 'WPSPOSPDTQUICK_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPSPOSPDTQUICK_PATH ) );
3
+DEFINE('WPSPOSPDTQUICK_VERSION', 1.0);
4
+DEFINE('WPSPOSPDTQUICK_DIR', basename(dirname(__FILE__)));
5
+DEFINE('WPSPOSPDTQUICK_PATH', str_replace("\\", "/", plugin_dir_path(__FILE__)));
6
+DEFINE('WPSPOSPDTQUICK_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPSPOSPDTQUICK_PATH));
7 7
 
8 8
 /**	Définition du chemin absolu vers les templates / Define the templates absolute directories	*/
9
-DEFINE( 'WPSPOSPDTQUICK_TEMPLATES_MAIN_DIR', WPSPOSPDTQUICK_PATH . '/templates/');
9
+DEFINE('WPSPOSPDTQUICK_TEMPLATES_MAIN_DIR', WPSPOSPDTQUICK_PATH . '/templates/');
10 10
 
11 11
 
12 12
 /** Inclusion des différents composants / Include plugin components */
13
-require_once( WPSPOSPDTQUICK_PATH . 'controller/wps_product_quick_add.ctr.php' );
13
+require_once(WPSPOSPDTQUICK_PATH . 'controller/wps_product_quick_add.ctr.php');
14 14
 /**	Instanciation du controlleur principal / Main controller instanciation	*/
15 15
 $wpspos_product_quick_add = new wpspos_product_quick_add();
16 16
 
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
 DEFINE( 'WPSPOSPDTQUICK_VERSION', 1.0 );
4 6
 DEFINE( 'WPSPOSPDTQUICK_DIR', basename( dirname( __FILE__ ) ) );
Please login to merge, or discard this patch.
includes/modules/wps_highlighting/config/config.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
-DEFINE( 'WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING', 'wps_highlighting');
3 1
\ No newline at end of file
2
+<?php if (!defined('ABSPATH')) exit;
3
+DEFINE('WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING', 'wps_highlighting');
4 4
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,4 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 DEFINE( 'WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING', 'wps_highlighting');
3 5
\ No newline at end of file
Please login to merge, or discard this patch.
includes/modules/wps_highlighting/controller/wps_highlighting_ctr.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 class wps_highlighting_ctr {
3 5
 
4 6
 	/** Define the main directory containing the template for the current plugin
@@ -80,8 +82,7 @@  discard block
 block discarded – undo
80 82
 				$wps_pos_menu_ordered[] = 'edit.php?post_type=wps_highlighting';
81 83
 
82 84
 				unset( $current_menu_order[ array_search( 'edit.php?post_type=wps_highlighting', $current_menu_order ) ] );
83
-			}
84
-			else if ( 'edit.php?post_type=wps_highlighting' != $menu_item ) {
85
+			} else if ( 'edit.php?post_type=wps_highlighting' != $menu_item ) {
85 86
 				$wps_pos_menu_ordered[] = $menu_item;
86 87
 			}
87 88
 		}
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 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
 class wps_highlighting_ctr {
3 3
 
4 4
 	/** Define the main directory containing the template for the current plugin
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 
14 14
 	function __construct() {
15 15
 		$this->template_dir = WPS_HIGHLIGHTING_PATH . WPS_HIGHLIGHTING_DIR . "/templates/";
16
-		add_action( 'init', array($this, 'register_post_type') );
17
-		add_action( 'add_meta_boxes', array($this, 'add_meta_boxes') );
18
-		add_action( 'save_post', array($this, 'save_post_action') );
16
+		add_action('init', array($this, 'register_post_type'));
17
+		add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
18
+		add_action('save_post', array($this, 'save_post_action'));
19 19
 
20 20
 		/**	Red�finition de l'ordre des menus / Arrangements for displaying menu under wpshop menu	*/
21
-		add_action( 'menu_order', array( $this, 'admin_menu_order' ), 11 );
21
+		add_action('menu_order', array($this, 'admin_menu_order'), 11);
22 22
 
23
-		add_shortcode( 'wps_highlighting', array( $this, 'display_highlightings' ) );
23
+		add_shortcode('wps_highlighting', array($this, 'display_highlightings'));
24 24
 	}
25 25
 
26 26
 	/**
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	function register_post_type() {
30 30
 		$labels = array(
31
-				'name'               => __( 'Highlighting', 'wps_highlighting' ),
32
-				'singular_name'      => __( 'Highlighting', 'wps_highlighting' ),
33
-				'menu_name'          => __( 'Highlightings', 'wps_highlighting' ),
34
-				'add_new'            => __( 'Add new highlighting', 'wps_highlighting' ),
35
-				'add_new_item'       => __( 'Add new highlighting', 'wps_highlighting' ),
36
-				'new_item'           => __( 'New Highlighting', 'wps_highlighting' ),
37
-				'edit_item'          => __( 'Edit Highlighting', 'wps_highlighting' ),
38
-				'view_item'          => __( 'View Highlighting', 'wps_highlighting' ),
39
-				'all_items'          => __( 'All Highlightings', 'wps_highlighting' ),
40
-				'search_items'       => __( 'Search Highlighting', 'wps_highlighting' ),
41
-				'parent_item_colon'  => __( 'Parent Highlighting :', 'wps_highlighting' ),
42
-				'not_found'          => __( 'No Highlighting found.', 'wps_highlighting' ),
43
-				'not_found_in_trash' => __( 'No Highlightings found in Trash.', 'wps_highlighting' ),
31
+				'name'               => __('Highlighting', 'wps_highlighting'),
32
+				'singular_name'      => __('Highlighting', 'wps_highlighting'),
33
+				'menu_name'          => __('Highlightings', 'wps_highlighting'),
34
+				'add_new'            => __('Add new highlighting', 'wps_highlighting'),
35
+				'add_new_item'       => __('Add new highlighting', 'wps_highlighting'),
36
+				'new_item'           => __('New Highlighting', 'wps_highlighting'),
37
+				'edit_item'          => __('Edit Highlighting', 'wps_highlighting'),
38
+				'view_item'          => __('View Highlighting', 'wps_highlighting'),
39
+				'all_items'          => __('All Highlightings', 'wps_highlighting'),
40
+				'search_items'       => __('Search Highlighting', 'wps_highlighting'),
41
+				'parent_item_colon'  => __('Parent Highlighting :', 'wps_highlighting'),
42
+				'not_found'          => __('No Highlighting found.', 'wps_highlighting'),
43
+				'not_found_in_trash' => __('No Highlightings found in Trash.', 'wps_highlighting'),
44 44
 		);
45 45
 
46 46
 		$args = array(
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
 				'show_in_menu'       => false,
52 52
 				'menu_icon'			 => 'dashicons-star-filled',
53 53
 				'query_var'          => true,
54
-				'rewrite'            => array( 'slug' => WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING ),
54
+				'rewrite'            => array('slug' => WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING),
55 55
 				'capability_type'    => 'post',
56 56
 				'has_archive'        => false,
57 57
 				'hierarchical'       => true,
58 58
 				'menu_position'      => null,
59
-				'supports'           => array( 'title', 'editor', 'thumbnail' )
59
+				'supports'           => array('title', 'editor', 'thumbnail')
60 60
 		);
61 61
 
62
-		register_post_type( WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, $args );
62
+		register_post_type(WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, $args);
63 63
 	}
64 64
 
65 65
 	/**
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @return array The new admin menu order with the POS addon placed
71 71
 	 */
72
-	function admin_menu_order( $current_menu_order ) {
72
+	function admin_menu_order($current_menu_order) {
73 73
 		/**	Create a new menu order	*/
74 74
 		$wps_pos_menu_ordered = array();
75 75
 
76 76
 		/**	Read the current existing menu order for rearrange it	*/
77
-		foreach ( $current_menu_order as $menu_item ) {
78
-			if ( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS == $menu_item ) {
77
+		foreach ($current_menu_order as $menu_item) {
78
+			if ('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS == $menu_item) {
79 79
 				$wps_pos_menu_ordered[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS;
80 80
 				$wps_pos_menu_ordered[] = 'edit.php?post_type=wps_highlighting';
81 81
 
82
-				unset( $current_menu_order[ array_search( 'edit.php?post_type=wps_highlighting', $current_menu_order ) ] );
82
+				unset($current_menu_order[array_search('edit.php?post_type=wps_highlighting', $current_menu_order)]);
83 83
 			}
84
-			else if ( 'edit.php?post_type=wps_highlighting' != $menu_item ) {
84
+			else if ('edit.php?post_type=wps_highlighting' != $menu_item) {
85 85
 				$wps_pos_menu_ordered[] = $menu_item;
86 86
 			}
87 87
 		}
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 	 * Add Meta Box
94 94
 	 */
95 95
 	function add_meta_boxes() {
96
-		add_meta_box( 'wps_highlighting_meta_box', __( 'Select the hook', 'wps_highlighting'), array( $this, 'meta_box_content' ), WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, 'side', 'default');
97
-		add_meta_box( 'wps_highlighting_meta_box_link', __( 'Link of Highlighting', 'wps_highlighting'), array( $this, 'meta_box_content_link' ), WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, 'side', 'default');
96
+		add_meta_box('wps_highlighting_meta_box', __('Select the hook', 'wps_highlighting'), array($this, 'meta_box_content'), WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, 'side', 'default');
97
+		add_meta_box('wps_highlighting_meta_box_link', __('Link of Highlighting', 'wps_highlighting'), array($this, 'meta_box_content_link'), WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING, 'side', 'default');
98 98
 	}
99 99
 
100 100
 	/**
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
 	function meta_box_content() {
104 104
 		global $post;
105 105
 
106
-		$hook = get_post_meta( $post->ID, '_wps_highlighting_hook', true );
106
+		$hook = get_post_meta($post->ID, '_wps_highlighting_hook', true);
107 107
 		$output  = '<select name="wps_highlighting_hook">';
108
-		$output .= '<option value="sidebar" ' .( ( !empty($hook) && $hook == 'sidebar' ) ? 'selected="selected"' : '' ). '>' .__( 'Sidebar', 'wps_highlighting' ). '</option>';
109
-		$output .= '<option value="home" ' .( ( !empty($hook) && $hook == 'home' ) ? 'selected="selected"' : '' ). '>' .__( 'HomePage Content', 'wps_highlighting' ). '</option>';
108
+		$output .= '<option value="sidebar" ' . ((!empty($hook) && $hook == 'sidebar') ? 'selected="selected"' : '') . '>' . __('Sidebar', 'wps_highlighting') . '</option>';
109
+		$output .= '<option value="home" ' . ((!empty($hook) && $hook == 'home') ? 'selected="selected"' : '') . '>' . __('HomePage Content', 'wps_highlighting') . '</option>';
110 110
 		$output .= '</select>';
111 111
 		$output .= '<hr/>';
112
-		$output .= '<div style="padding : 5px; background #CCC;"><u><strong>' .__( 'shortcode for display Highlightings', 'wpshop'). '</strong></u><ul><li><u>Home page content :</u> [wps_highlighting hook_name="home"]</li><li><u>Sidebar :</u> [wps_highlighting hook_name="sidebar"]</li><ul></div>';
112
+		$output .= '<div style="padding : 5px; background #CCC;"><u><strong>' . __('shortcode for display Highlightings', 'wpshop') . '</strong></u><ul><li><u>Home page content :</u> [wps_highlighting hook_name="home"]</li><li><u>Sidebar :</u> [wps_highlighting hook_name="sidebar"]</li><ul></div>';
113 113
 		echo $output;
114 114
 	}
115 115
 
116 116
 	function meta_box_content_link() {
117 117
 		global $post;
118
-		$link = get_post_meta( $post->ID, '_wps_highlighting_link', true );
119
-		$output  = '<label for="wps_highlighting_link">' .__( 'Link of Highlighting', 'wps_highlighting' ). '</label><br/>';
120
-		$output .= '<input type="text" id="wps_highlighting_link" name="wps_highlighting_link" value="' .$link. '" />';
118
+		$link = get_post_meta($post->ID, '_wps_highlighting_link', true);
119
+		$output  = '<label for="wps_highlighting_link">' . __('Link of Highlighting', 'wps_highlighting') . '</label><br/>';
120
+		$output .= '<input type="text" id="wps_highlighting_link" name="wps_highlighting_link" value="' . $link . '" />';
121 121
 		echo $output;
122 122
 	}
123 123
 
@@ -125,26 +125,26 @@  discard block
 block discarded – undo
125 125
 	 * Save action
126 126
 	 */
127 127
 	function save_post_action() {
128
-		$post_type = !empty( $_POST['post_type'] ) ? sanitize_text_field( $_POST['post_type'] ) : '';
129
-		if( !empty($post_type) && !empty($post_type) && $post_type == WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING ) {
130
-			$wps_highlighting_hook = !empty( $_POST['wps_highlighting_hook'] ) ? sanitize_text_field( $_POST['wps_highlighting_hook'] ) : '';
131
-			$wps_highlighting_link = !empty( $_POST['wps_highlighting_link'] ) ? sanitize_text_field( $_POST['wps_highlighting_link'] ) : '';
132
-			$post_ID = !empty( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
133
-			if( !empty($wps_highlighting_hook) ) {
134
-				update_post_meta( $post_ID, '_wps_highlighting_hook', $wps_highlighting_hook );
128
+		$post_type = !empty($_POST['post_type']) ? sanitize_text_field($_POST['post_type']) : '';
129
+		if (!empty($post_type) && !empty($post_type) && $post_type == WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING) {
130
+			$wps_highlighting_hook = !empty($_POST['wps_highlighting_hook']) ? sanitize_text_field($_POST['wps_highlighting_hook']) : '';
131
+			$wps_highlighting_link = !empty($_POST['wps_highlighting_link']) ? sanitize_text_field($_POST['wps_highlighting_link']) : '';
132
+			$post_ID = !empty($_POST['post_ID']) ? (int)$_POST['post_ID'] : 0;
133
+			if (!empty($wps_highlighting_hook)) {
134
+				update_post_meta($post_ID, '_wps_highlighting_hook', $wps_highlighting_hook);
135 135
 			}
136
-			update_post_meta( $post_ID, '_wps_highlighting_link', $wps_highlighting_link );
136
+			update_post_meta($post_ID, '_wps_highlighting_link', $wps_highlighting_link);
137 137
 		}
138 138
 	}
139 139
 
140
-	function get_data_for_hook( $hook ) {
140
+	function get_data_for_hook($hook) {
141 141
 		$highlightings_datas = array();
142
-		if( !empty($hook) ) {
142
+		if (!empty($hook)) {
143 143
 			$wps_highlighting_mdl = new wps_highlighting_model();
144
-			$highlightings = $wps_highlighting_mdl->get_highlighting( $hook );
145
-			if( !empty($highlightings) ) {
146
-				foreach( $highlightings as $highlighting ) {
147
-					$wps_highlighting = new wps_highlighting_model( $highlighting['post_data']->ID, $highlighting['post_data']->post_title, $highlighting['post_meta']['hook'], $highlighting['post_meta']['link'] );
144
+			$highlightings = $wps_highlighting_mdl->get_highlighting($hook);
145
+			if (!empty($highlightings)) {
146
+				foreach ($highlightings as $highlighting) {
147
+					$wps_highlighting = new wps_highlighting_model($highlighting['post_data']->ID, $highlighting['post_data']->post_title, $highlighting['post_meta']['hook'], $highlighting['post_meta']['link']);
148 148
 					$wps_highlighting->post_content = $highlighting['post_data']->post_content;
149 149
 					$highlightings_datas[] = $wps_highlighting;
150 150
 				}
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 		return $highlightings_datas;
154 154
 	}
155 155
 
156
-	function display_highlightings( $args ) {
156
+	function display_highlightings($args) {
157 157
 		$output = $highlightings = '';
158
-		if( !empty($args) && !empty($args['hook_name']) ) {
159
-			$datas = $this->get_data_for_hook( $args['hook_name'] );
158
+		if (!empty($args) && !empty($args['hook_name'])) {
159
+			$datas = $this->get_data_for_hook($args['hook_name']);
160 160
 			//Display in Template
161
-			if( !empty($datas) ) {
162
-				foreach( $datas as $data ) {
161
+			if (!empty($datas)) {
162
+				foreach ($datas as $data) {
163 163
 					ob_start();
164
-					require( wpshop_tools::get_template_part( WPS_HIGHLIGHTING_DIR, $this->template_dir,"frontend", "highlighting") );
164
+					require(wpshop_tools::get_template_part(WPS_HIGHLIGHTING_DIR, $this->template_dir, "frontend", "highlighting"));
165 165
 					$highlightings .= ob_get_contents();
166 166
 					ob_end_clean();
167 167
 				}
Please login to merge, or discard this patch.
includes/modules/wps_highlighting/templates/frontend/highlighting.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div>
4
-	<a href="<?php echo ( ( !empty($data->link) ) ? $data->link : '#' ); ?>" title="<?php echo ( ($data->title) ? $data->title : '' ); ?>">
5
-		<?php if( !empty($data->id) ) : ?>
6
-		<?php echo get_the_post_thumbnail( $data->id, 'medium' ); ?>
4
+	<a href="<?php echo ((!empty($data->link)) ? $data->link : '#'); ?>" title="<?php echo (($data->title) ? $data->title : ''); ?>">
5
+		<?php if (!empty($data->id)) : ?>
6
+		<?php echo get_the_post_thumbnail($data->id, 'medium'); ?>
7 7
 		<?php echo $data->post_content; ?>
8 8
 		<?php endif; ?>
9 9
 	</a>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <div>
4 6
 	<a href="<?php echo ( ( !empty($data->link) ) ? $data->link : '#' ); ?>" title="<?php echo ( ($data->title) ? $data->title : '' ); ?>">
Please login to merge, or discard this patch.
includes/modules/wps_highlighting/model/wps_highlighting_model.php 2 patches
Spacing   +16 added lines, -16 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
 class wps_highlighting_model {
3 3
 	
4 4
 	var $id;
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 	var $hook;
7 7
 	var $link;
8 8
 	
9
-	function __construct( $id = '',  $title = '', $hook = '', $link = '') {
10
-		if( !empty($id) ) {
9
+	function __construct($id = '', $title = '', $hook = '', $link = '') {
10
+		if (!empty($id)) {
11 11
 			$this->id = $id;
12 12
 			$this->title = $title;
13 13
 			$this->hook = $hook;
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 		}
16 16
 	}
17 17
 	
18
-	function Create( $title, $hook, $link ) {
19
-		if( empty($this->id) ) {
20
-			if( !empty($title) && !empty($hook) && !empty($link) ) {
18
+	function Create($title, $hook, $link) {
19
+		if (empty($this->id)) {
20
+			if (!empty($title) && !empty($hook) && !empty($link)) {
21 21
 				$this->title = $title;
22 22
 				$this->hook = $hook;
23 23
 				$this->link = $link;
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 	}
27 27
 	
28
-	function get_highlighting( $hook = '', $id = '' ) {
28
+	function get_highlighting($hook = '', $id = '') {
29 29
 		global $wpdb;
30 30
 		$data = array();
31
-		if( !empty($id) ) {
32
-			$highlighting  = get_post( $id );
33
-			$hook_metadata = get_post_meta( $id, '_wps_highlighting_hook', true );
34
-			$link_metadata = get_post_meta( $id, '_wps_highlighting_link', true );
31
+		if (!empty($id)) {
32
+			$highlighting  = get_post($id);
33
+			$hook_metadata = get_post_meta($id, '_wps_highlighting_hook', true);
34
+			$link_metadata = get_post_meta($id, '_wps_highlighting_link', true);
35 35
 			// Fill Data
36 36
 			$data[0]['post_data'] = $highlighting;
37 37
 			$data[0]['post_meta']['hook'] = $hook_metadata;
38 38
 			$data[0]['post_meta']['link'] = $link_metadata;
39 39
 		}
40 40
 		else {
41
-			$highlightings = get_posts( array( 'posts_per_page' => -1, 'post_type' => WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING ) );
42
-			foreach( $highlightings as $highlighting ) {
43
-				$hook_metadata = get_post_meta( $highlighting->ID, '_wps_highlighting_hook', true );
44
-				$link_metadata = get_post_meta( $highlighting->ID, '_wps_highlighting_link', true );
41
+			$highlightings = get_posts(array('posts_per_page' => -1, 'post_type' => WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING));
42
+			foreach ($highlightings as $highlighting) {
43
+				$hook_metadata = get_post_meta($highlighting->ID, '_wps_highlighting_hook', true);
44
+				$link_metadata = get_post_meta($highlighting->ID, '_wps_highlighting_link', true);
45 45
 				// Fill Data
46
-				if( empty($hook) || ( !empty($hook) && $hook == $hook_metadata ) ) {
46
+				if (empty($hook) || (!empty($hook) && $hook == $hook_metadata)) {
47 47
 					$data[$highlighting->ID]['post_data'] = $highlighting;
48 48
 					$data[$highlighting->ID]['post_meta']['hook'] = $hook_metadata;
49 49
 					$data[$highlighting->ID]['post_meta']['link'] = $link_metadata;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 class wps_highlighting_model {
3 5
 	
4 6
 	var $id;
@@ -36,8 +38,7 @@  discard block
 block discarded – undo
36 38
 			$data[0]['post_data'] = $highlighting;
37 39
 			$data[0]['post_meta']['hook'] = $hook_metadata;
38 40
 			$data[0]['post_meta']['link'] = $link_metadata;
39
-		}
40
-		else {
41
+		} else {
41 42
 			$highlightings = get_posts( array( 'posts_per_page' => -1, 'post_type' => WPS_NEWTYPE_IDENTIFIER_HIGHLIGHTING ) );
42 43
 			foreach( $highlightings as $highlighting ) {
43 44
 				$hook_metadata = get_post_meta( $highlighting->ID, '_wps_highlighting_hook', true );
Please login to merge, or discard this patch.
includes/modules/wps_highlighting/wps_highlighting.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 
3 3
 /**
4 4
  * Bootstrap file
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
  * @version 1.0
7 7
  */
8 8
 
9
-DEFINE('WPS_HIGHLIGHTING_DIR', basename(dirname(__FILE__)) );
10
-DEFINE('WPS_HIGHLIGHTING_PATH', str_replace( "\\", "/", str_replace( WPS_HIGHLIGHTING_DIR, "", dirname( __FILE__ ) ) ) );
11
-DEFINE('WPS_HIGHLIGHTING_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_HIGHLIGHTING_PATH ) );
9
+DEFINE('WPS_HIGHLIGHTING_DIR', basename(dirname(__FILE__)));
10
+DEFINE('WPS_HIGHLIGHTING_PATH', str_replace("\\", "/", str_replace(WPS_HIGHLIGHTING_DIR, "", dirname(__FILE__))));
11
+DEFINE('WPS_HIGHLIGHTING_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_HIGHLIGHTING_PATH));
12 12
 
13
-load_plugin_textdomain( 'wps_highlighting', false, dirname(plugin_basename( __FILE__ )).'/languages/' );
13
+load_plugin_textdomain('wps_highlighting', false, dirname(plugin_basename(__FILE__)) . '/languages/');
14 14
 
15
-include( plugin_dir_path( __FILE__ ).'/config/config.php' );
16
-include( plugin_dir_path( __FILE__ ).'/controller/wps_highlighting_ctr.php' );
17
-include( plugin_dir_path( __FILE__ ).'/model/wps_highlighting_model.php' );
15
+include(plugin_dir_path(__FILE__) . '/config/config.php');
16
+include(plugin_dir_path(__FILE__) . '/controller/wps_highlighting_ctr.php');
17
+include(plugin_dir_path(__FILE__) . '/model/wps_highlighting_model.php');
18 18
 
19 19
 $wps_highlight = new wps_highlighting_ctr();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 
3 5
 /**
4 6
  * Bootstrap file
Please login to merge, or discard this patch.
includes/modules/wps_message/wps_message.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 /**
3 3
  * @author ALLEGRE Jérôme - Eoxia dev team <[email protected]>
4 4
  * @version 0.1
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 /** Template Global vars **/
10 10
 DEFINE('WPS_MESSAGE_VERSION', '0.1');
11 11
 DEFINE('WPS_MESSAGE_DIR', basename(dirname(__FILE__)));
12
-DEFINE('WPS_MESSAGE_PATH', str_replace( "\\", "/", str_replace( WPS_MESSAGE_DIR, "", dirname( __FILE__ ) ) ) );
13
-DEFINE('WPS_MESSAGE_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_MESSAGE_PATH ) );
12
+DEFINE('WPS_MESSAGE_PATH', str_replace("\\", "/", str_replace(WPS_MESSAGE_DIR, "", dirname(__FILE__))));
13
+DEFINE('WPS_MESSAGE_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_MESSAGE_PATH));
14 14
 
15 15
 /** Require */
16
-require_once( plugin_dir_path( __FILE__ ).'/controller/wps_message_ctr.php' );
17
-require_once( plugin_dir_path( __FILE__ ).'/model/wps_message_mdl.php' );
16
+require_once(plugin_dir_path(__FILE__) . '/controller/wps_message_ctr.php');
17
+require_once(plugin_dir_path(__FILE__) . '/model/wps_message_mdl.php');
18 18
 
19 19
 $wps_message = new wps_message_ctr();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 /**
3 5
  * @author ALLEGRE Jérôme - Eoxia dev team <[email protected]>
4 6
  * @version 0.1
Please login to merge, or discard this patch.
includes/modules/wps_message/templates/frontend/messages.php 2 patches
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
 <div class="wps-table wps-my-message">
4 6
 	<div class="wps-table-header wps-table-row">
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,39 +1,39 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wps-table wps-my-message">
4 4
 	<div class="wps-table-header wps-table-row">
5
-		<div class="wps-table-cell"><?php _e( 'Message title', 'wpshop' ); ?></div>
6
-		<div class="wps-table-cell"><?php _e( 'Send date', 'wpshop' ); ?></div>
5
+		<div class="wps-table-cell"><?php _e('Message title', 'wpshop'); ?></div>
6
+		<div class="wps-table-cell"><?php _e('Send date', 'wpshop'); ?></div>
7 7
 	</div>
8
-	<?php if( !empty($messages_data) && is_array($messages_data) ) :?>
9
-	<?php foreach( $messages_data as $meta_id => $message ) : ?>
8
+	<?php if (!empty($messages_data) && is_array($messages_data)) :?>
9
+	<?php foreach ($messages_data as $meta_id => $message) : ?>
10 10
 
11
-	<div class="wps-table-content wps-table-row" data-nonce="<?php echo wp_create_nonce( 'get_content_message' ); ?>" data-id="<?php echo $meta_id; ?>" data-date="<?php echo substr($message[0]['mess_dispatch_date'][0], 0, 7); ?>">
11
+	<div class="wps-table-content wps-table-row" data-nonce="<?php echo wp_create_nonce('get_content_message'); ?>" data-id="<?php echo $meta_id; ?>" data-date="<?php echo substr($message[0]['mess_dispatch_date'][0], 0, 7); ?>">
12 12
 		<div class="wps-table-cell">
13 13
 			<span class="wps-message-title"><?php echo $message[0]['mess_title']; ?></span>
14
-			<?php if( !empty($message[0]['mess_object_id']) ) {
15
-				$order_meta = get_post_meta( $message[0]['mess_object_id'], '_order_postmeta', true );
16
-				$comments = get_post_meta( $message[0]['mess_object_id'], '_order_private_comments', true);
17
-				if(!empty($comments)) {
18
-					foreach ( $comments as $comment ) {
19
-						$user_data = get_userdata( $comment['author'] );
14
+			<?php if (!empty($message[0]['mess_object_id'])) {
15
+				$order_meta = get_post_meta($message[0]['mess_object_id'], '_order_postmeta', true);
16
+				$comments = get_post_meta($message[0]['mess_object_id'], '_order_private_comments', true);
17
+				if (!empty($comments)) {
18
+					foreach ($comments as $comment) {
19
+						$user_data = get_userdata($comment['author']);
20 20
 						echo '<br><b>' . $order_meta['order_key'] . '</b> <i>';
21
-						printf( __( '%s says on', 'wpshop'), $user_data->user_login );
22
-						echo ' ' . mysql2date( get_option('links_updated_date_format'), $comment['comment_date'], true ) . '</i> : <br>' . $comment['comment'];
21
+						printf(__('%s says on', 'wpshop'), $user_data->user_login);
22
+						echo ' ' . mysql2date(get_option('links_updated_date_format'), $comment['comment_date'], true) . '</i> : <br>' . $comment['comment'];
23 23
 					}
24 24
 				}
25 25
 			} ?>
26 26
 		</div>
27 27
 		<div class="wps-table-cell">
28
-		<?php if( !empty($message[0]['mess_dispatch_date']) ) : ?>
28
+		<?php if (!empty($message[0]['mess_dispatch_date'])) : ?>
29 29
 			<ul>
30
-			<?php foreach( $message[0]['mess_dispatch_date'] as $date ) : ?>
31
-				<li><?php echo mysql2date( get_option('date_format') . ' ' . get_option('time_format') , $date, true ); ?></li>
30
+			<?php foreach ($message[0]['mess_dispatch_date'] as $date) : ?>
31
+				<li><?php echo mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $date, true); ?></li>
32 32
 			<?php endforeach; ?>
33 33
 			</ul>
34 34
 		<?php endif; ?>
35 35
 		</div>
36 36
 	</div>
37 37
 	<?php endforeach; ?>
38
-	<?php endif;?>
38
+	<?php endif; ?>
39 39
 </div>
Please login to merge, or discard this patch.