Completed
Branch FET/11104/replace-deprecated-b... (15008a)
by
unknown
13:29 queued 25s
created
registrations/templates/attendee_registrations_main_meta_box.template.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -5,42 +5,42 @@
 block discarded – undo
5 5
 		<table class="admin-primary-mbox-tbl">
6 6
 			<thead>
7 7
 				<tr>
8
-					<th class="jst-left"><?php esc_html_e( 'Event Name', 'event_espresso' );?></th>
9
-					<th class="jst-left"><?php esc_html_e( 'REG ID', 'event_espresso' );?></th>
10
-					<th class="jst-left"><?php esc_html_e( 'TXN ID', 'event_espresso' );?></th>
11
-					<th class="jst-left"><?php esc_html_e( 'Reg Code', 'event_espresso' );?></th>
12
-					<th class="jst-rght"><?php esc_html_e( 'Ticket Price', 'event_espresso' );?></th>
8
+					<th class="jst-left"><?php esc_html_e('Event Name', 'event_espresso'); ?></th>
9
+					<th class="jst-left"><?php esc_html_e('REG ID', 'event_espresso'); ?></th>
10
+					<th class="jst-left"><?php esc_html_e('TXN ID', 'event_espresso'); ?></th>
11
+					<th class="jst-left"><?php esc_html_e('Reg Code', 'event_espresso'); ?></th>
12
+					<th class="jst-rght"><?php esc_html_e('Ticket Price', 'event_espresso'); ?></th>
13 13
 				</tr>
14 14
 			</thead>
15 15
 			<tbody>
16
-			<?php foreach( $registrations as $registration ) : ?>
16
+			<?php foreach ($registrations as $registration) : ?>
17 17
 				<tr>
18 18
 					<td class="jst-left">
19 19
 					<?php
20
-						$event_url = add_query_arg( array( 'action' => 'edit', 'post' => $registration->event_ID() ), admin_url( 'admin.php?page=espresso_events' ));
21
-						echo EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $registration->event_ID() ) ?  '<a href="'. $event_url .'"  title="'. esc_attr__( 'Edit Event', 'event_espresso' ) .'">' . $registration->event_name() . '</a>' : $registration->event_name();
20
+						$event_url = add_query_arg(array('action' => 'edit', 'post' => $registration->event_ID()), admin_url('admin.php?page=espresso_events'));
21
+						echo EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $registration->event_ID()) ? '<a href="'.$event_url.'"  title="'.esc_attr__('Edit Event', 'event_espresso').'">'.$registration->event_name().'</a>' : $registration->event_name();
22 22
 					?>
23 23
 					</td>
24 24
 					<td class="jst-left">
25 25
 					<?php
26
-							$reg_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL );
27
-							echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $registration->ID() ) ? '
28
-							<a href="'.$reg_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . 
29
-								esc_html__( 'View Registration', 'event_espresso' ) .
26
+							$reg_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration->ID()), REG_ADMIN_URL);
27
+							echo EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? '
28
+							<a href="'.$reg_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'. 
29
+								esc_html__('View Registration', 'event_espresso').
30 30
 							'</a>' : $registration->ID();
31 31
 					?>
32 32
 					</td>
33 33
 					<td class="jst-left">
34 34
 					<?php
35
-						$txn_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID() ), TXN_ADMIN_URL );
36
-						echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ? '
37
-						<a href="'.$txn_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '">' .
38
-							sprintf( esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID() ) .
35
+						$txn_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID()), TXN_ADMIN_URL);
36
+						echo EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '
37
+						<a href="'.$txn_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'">'.
38
+							sprintf(esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID()).
39 39
 						'</a>' : $registration->transaction_ID();
40 40
 					?>
41 41
 					</td>
42
-					<td class="jst-left"><?php echo $registration->reg_code();?></td>
43
-					<td class="jst-rght"><?php echo EEH_Template::format_currency( $registration->final_price() );?></td>
42
+					<td class="jst-left"><?php echo $registration->reg_code(); ?></td>
43
+					<td class="jst-rght"><?php echo EEH_Template::format_currency($registration->final_price()); ?></td>
44 44
 				</tr>
45 45
 			<?php endforeach; ?>
46 46
 			</tbody>
Please login to merge, or discard this patch.
strategies/validation/EE_Max_Length_Validation_Strategy.strategy.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,36 +8,36 @@
 block discarded – undo
8 8
  * @subpackage	Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php.
9 9
  * @author				Mike Nelson
10 10
  */
11
-class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	protected $_max_length;
14 14
 
15
-	public function __construct( $validation_error_message = NULL, $max_length = EE_INF ) {
15
+	public function __construct($validation_error_message = NULL, $max_length = EE_INF) {
16 16
 		$this->_max_length = $max_length;
17
-		if( $validation_error_message === null ) {
18
-			$validation_error_message = sprintf( __( 'Input is too long. Maximum number of characters is %1$s', 'event_espresso' ), $max_length );
17
+		if ($validation_error_message === null) {
18
+			$validation_error_message = sprintf(__('Input is too long. Maximum number of characters is %1$s', 'event_espresso'), $max_length);
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 	/**
24 24
 	 * @param $normalized_value
25 25
 	 */
26 26
 	public function validate($normalized_value) {
27
-		if( $this->_max_length !== EE_INF &&
27
+		if ($this->_max_length !== EE_INF &&
28 28
 				$normalized_value &&
29
-				is_string( $normalized_value ) &&
30
-				 strlen( $normalized_value ) > $this->_max_length){
31
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'maxlength' );
29
+				is_string($normalized_value) &&
30
+				 strlen($normalized_value) > $this->_max_length) {
31
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'maxlength');
32 32
 		}
33 33
 	}
34 34
 
35 35
 	/**
36 36
 	 * @return array
37 37
 	 */
38
-	function get_jquery_validation_rule_array(){
39
-		if( $this->_max_length !== EE_INF ) {
40
-			return array( 'maxlength'=> $this->_max_length, 'messages' => array( 'maxlength' => $this->get_validation_error_message() ) );
38
+	function get_jquery_validation_rule_array() {
39
+		if ($this->_max_length !== EE_INF) {
40
+			return array('maxlength'=> $this->_max_length, 'messages' => array('maxlength' => $this->get_validation_error_message()));
41 41
 		} else {
42 42
 			return array();
43 43
 		}
Please login to merge, or discard this patch.
4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION')) {
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5 5
 }
6 6
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author				Brent Christensen
15 15
  *
16 16
  */
17
-class EE_DMS_4_9_0_Answers_With_No_Registration extends EE_Data_Migration_Script_Stage{
17
+class EE_DMS_4_9_0_Answers_With_No_Registration extends EE_Data_Migration_Script_Stage {
18 18
 
19 19
 
20 20
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @return EE_DMS_4_9_0_Answers_With_No_Registration
25 25
 	 */
26 26
 	public function __construct() {
27
-		$this->_pretty_name = __( 'Answer Cleanup', 'event_espresso' );
27
+		$this->_pretty_name = __('Answer Cleanup', 'event_espresso');
28 28
 		parent::__construct();
29 29
 	}
30 30
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	protected function _migration_step($num_items_to_migrate = 50) {
49 49
 		global $wpdb;
50 50
 		$wpdb->delete(
51
-			$wpdb->prefix . 'esp_answer',
52
-			array( 'REG_ID' => 0 ),
53
-			array( '%d' )
51
+			$wpdb->prefix.'esp_answer',
52
+			array('REG_ID' => 0),
53
+			array('%d')
54 54
 		);
55 55
 		$this->set_completed();
56 56
 		return 1;
Please login to merge, or discard this patch.
core/db_models/EEM_Extra_Meta.model.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * ------------------------------------------------------------------------
28 28
  */
29
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
29
+require_once (EE_MODELS.'EEM_Base.model.php');
30 30
 
31 31
 class EEM_Extra_Meta extends EEM_Base {
32 32
 
33 33
   	// private instance of the Attendee object
34 34
 	protected static $_instance = NULL;
35 35
 
36
-	protected function __construct( $timezone = NULL ) {
37
-		$this->singular_item = __('Extra Meta','event_espresso');
38
-		$this->plural_item = __('Extra Metas','event_espresso');
36
+	protected function __construct($timezone = NULL) {
37
+		$this->singular_item = __('Extra Meta', 'event_espresso');
38
+		$this->plural_item = __('Extra Metas', 'event_espresso');
39 39
 		$this->_tables = array(
40 40
 			'Extra_Meta'=> new EE_Primary_Table('esp_extra_meta', 'EXM_ID')
41 41
 		);
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 
51 51
 			));
52 52
 		$this->_model_relations = array();
53
-		foreach($models_this_can_attach_to as $model){
53
+		foreach ($models_this_can_attach_to as $model) {
54 54
 			$this->_model_relations[$model] = new EE_Belongs_To_Any_Relation();
55 55
 		}
56
-		foreach( $this->cap_contexts_to_cap_action_map() as $cap_context => $action ) {
57
-			$this->_cap_restriction_generators[ $cap_context ] = new EE_Restriction_Generator_Meta( 'EXM_key', 'EXM_value' );
56
+		foreach ($this->cap_contexts_to_cap_action_map() as $cap_context => $action) {
57
+			$this->_cap_restriction_generators[$cap_context] = new EE_Restriction_Generator_Meta('EXM_key', 'EXM_value');
58 58
 		}
59
-		parent::__construct( $timezone );
59
+		parent::__construct($timezone);
60 60
 	}
61 61
 
62 62
 
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('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Restriction_Generator_Meta.strategy.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author				Mike Nelson
15 15
  *
16 16
  */
17
-class EE_Restriction_Generator_Meta extends EE_Restriction_Generator_Base{
17
+class EE_Restriction_Generator_Meta extends EE_Restriction_Generator_Base {
18 18
 
19 19
 	/**
20 20
 	 *
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param string $key_field_name
34 34
 	 * @param string $value_field_name
35 35
 	 */
36
-	public function __construct( $key_field_name, $value_field_name ) {
36
+	public function __construct($key_field_name, $value_field_name) {
37 37
 		$this->_key_field_name = $key_field_name;
38 38
 		$this->_value_field_name = $value_field_name;
39 39
 	}
@@ -45,21 +45,21 @@  discard block
 block discarded – undo
45 45
 	 * @throws EE_Error
46 46
 	 */
47 47
 	protected function _generate_restrictions() {
48
-		$whitelisted_meta_keys = apply_filters( 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', array() );
49
-		$blacklisted_meta_keys = apply_filters( 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', array() );
48
+		$whitelisted_meta_keys = apply_filters('FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', array());
49
+		$blacklisted_meta_keys = apply_filters('FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', array());
50 50
 		$conditions = array(
51
-			$this->_key_field_name => array( 'NOT_LIKE', "\\\\_%" ),//each slash is escaped because we are using double quotes, and 
51
+			$this->_key_field_name => array('NOT_LIKE', "\\\\_%"), //each slash is escaped because we are using double quotes, and 
52 52
 			//stripslashes will be called on this because the models assume this is from user input
53
-			$this->_value_field_name => array( 'NOT_REGEXP', '^[aOs]:[\d]:.*$')					
53
+			$this->_value_field_name => array('NOT_REGEXP', '^[aOs]:[\d]:.*$')					
54 54
 		);
55
-		if( ! empty( $blacklisted_meta_keys ) ) {
56
-			$conditions[ $this->_key_field_name . '*blacklisted' ] = array( 'NOT_IN', $blacklisted_meta_keys );
55
+		if ( ! empty($blacklisted_meta_keys)) {
56
+			$conditions[$this->_key_field_name.'*blacklisted'] = array('NOT_IN', $blacklisted_meta_keys);
57 57
 		}
58
-		if( ! empty( $whitelisted_meta_keys ) ) {
58
+		if ( ! empty($whitelisted_meta_keys)) {
59 59
 			$conditions = array(
60 60
 				'OR*whitelisted-or-normal' => array(
61 61
 					'AND' => $conditions,
62
-					$this->_key_field_name . '*whitelisted' => array( 'IN', $whitelisted_meta_keys ) 
62
+					$this->_key_field_name.'*whitelisted' => array('IN', $whitelisted_meta_keys) 
63 63
 				)
64 64
 			);
65 65
 		}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			//only allow access to non-protected metas if they're an admin
68 68
 			EE_Restriction_Generator_Base::get_default_restrictions_cap() => new EE_Return_None_Where_Conditions(),
69 69
 			//don't allow access to protected metas to anyone. If they want that, don't apply caps to the query
70
-			'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions( $conditions ),
70
+			'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions($conditions),
71 71
 		);
72 72
 	}
73 73
 }
Please login to merge, or discard this patch.
core/db_models/strategies/EE_CPT_Minimum_Where_Conditions.strategy.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,6 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 	protected $_post_type;
9 9
 	protected $_meta_field;
10
+
11
+	/**
12
+	 * @param string $post_type
13
+	 */
10 14
 	function __construct($post_type, $meta_field_to_chk = ''){
11 15
 		$this->_post_type = $post_type;
12 16
 		$this->_meta_field = $meta_field_to_chk;
@@ -27,7 +31,6 @@  discard block
 block discarded – undo
27 31
 	}
28 32
 	/**
29 33
 	 * Gets the where default where conditions for a custom post type model
30
-	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
31 34
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
32 35
 	 */
33 36
 	protected function _get_default_where_conditions() {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  *
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
  * @since		 	   4.8.29.rc.010
16 16
  *
17 17
  */
18
-class EE_CPT_Minimum_Where_Conditions extends EE_Default_Where_Conditions{
18
+class EE_CPT_Minimum_Where_Conditions extends EE_Default_Where_Conditions {
19 19
 
20 20
 	protected $_post_type;
21 21
 	protected $_meta_field;
22
-	function __construct($post_type, $meta_field_to_chk = ''){
22
+	function __construct($post_type, $meta_field_to_chk = '') {
23 23
 		$this->_post_type = $post_type;
24 24
 		$this->_meta_field = $meta_field_to_chk;
25 25
 	}
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 * @param string $column column name
30 30
 	 * @return EE_Model_Field_Base
31 31
 	 */
32
-	protected function _get_field_on_column($column){
32
+	protected function _get_field_on_column($column) {
33 33
 		$all_fields = $this->_model->field_settings(true);
34
-		foreach($all_fields as $field_name => $field_obj){
35
-			if($column == $field_obj->get_table_column()){
34
+		foreach ($all_fields as $field_name => $field_obj) {
35
+			if ($column == $field_obj->get_table_column()) {
36 36
 				return $field_obj;
37 37
 			}
38 38
 		}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 /**
6 6
  *
7 7
  * Class EE_CPT_Minimum_Where_Conditions
8
-  * 
8
+ * 
9 9
  * Strategy specifically for adding where conditions specific to CPT models.
10 10
  * But only sets the minimum, so any row of the right type will get used
11 11
  *
Please login to merge, or discard this patch.
core/db_models/strategies/EE_CPT_Where_Conditions.strategy.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions{
18 18
 	/**
19 19
 	 * Gets the where default where conditions for a custom post type model
20
-	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
21 20
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
22 21
 	 */
23 22
 	protected function _get_default_where_conditions() {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  *
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * * @since		 	   4.6.0
15 15
  *
16 16
  */
17
-class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions{
17
+class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions {
18 18
 	/**
19 19
 	 * Gets the where default where conditions for a custom post type model
20 20
 	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		return array_merge( 
26 26
 			parent::_get_default_where_conditions(),
27 27
 			array( 
28
-				$status_field->get_name() => array('NOT IN',array('auto-draft','trash') )
28
+				$status_field->get_name() => array('NOT IN', array('auto-draft', 'trash'))
29 29
 			)
30 30
 		);
31 31
 	}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 /**
6 6
  *
7 7
  * Class EE_Default_Where_Conditions
8
-  * 
8
+ * 
9 9
  * Strategy specifically for adding where conditions specific to CPT models.
10 10
  *
11 11
  * @package         Event Espresso
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha/ReCaptcha/RequestMethod.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
 interface RequestMethod
33 33
 {
34 34
 
35
-    /**
36
-     * Submit the request with the specified parameters.
37
-     *
38
-     * @param RequestParameters $params Request parameters
39
-     * @return string Body of the reCAPTCHA response
40
-     */
41
-    public function submit(RequestParameters $params);
35
+	/**
36
+	 * Submit the request with the specified parameters.
37
+	 *
38
+	 * @param RequestParameters $params Request parameters
39
+	 * @return string Body of the reCAPTCHA response
40
+	 */
41
+	public function submit(RequestParameters $params);
42 42
 }
Please login to merge, or discard this patch.
core/db_models/EEM_Message_Template_Group.model.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @param        $messenger
85 85
 	 * @param string $orderby
86 86
 	 * @param string $order
87
-	 * @return array all (including trashed or inactive) message template group objects for the given messenger
87
+	 * @return EE_Base_Class[] all (including trashed or inactive) message template group objects for the given messenger
88 88
 	 */
89 89
 	public function get_all_message_templates_by_messenger($messenger, $orderby = 'GRP_ID', $order = 'ASC' ) {
90 90
 		return $this->get_all_deleted_and_undeleted(
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 	/**
344 344
 	 * This sends things to the validator for the given messenger and message type.
345 345
 	 *
346
-	 * @param  array $fields the incoming fields to check.
346
+	 * @param  string $fields the incoming fields to check.
347 347
 	 *                       Note this array is in the formatted fields from the form fields setup.
348 348
 	 *                       So we need to reformat this into an array of expected field refs by the validator.
349 349
 	 *                       Note also that this is not only the fields for the Message Template Group
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php if (!defined('EVENT_ESPRESSO_VERSION') )
2 2
 	exit('NO direct script access allowed');
3 3
 /**
4
- * EEM_Message_Template_Group
5
- *
6
- * @package		Event Espresso
7
- * @subpackage	includes/models/EEM_Message_Template_Group.model.php
8
- * @author		Darren Ethier
9
- *
10
- *
11
- */
4
+	 * EEM_Message_Template_Group
5
+	 *
6
+	 * @package		Event Espresso
7
+	 * @subpackage	includes/models/EEM_Message_Template_Group.model.php
8
+	 * @author		Darren Ethier
9
+	 *
10
+	 *
11
+	 */
12 12
 require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
13 13
 class EEM_Message_Template_Group extends EEM_Soft_Delete_Base {
14 14
 
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION') )
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION'))
2 2
 	exit('NO direct script access allowed');
3 3
 /**
4 4
  * EEM_Message_Template_Group
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *
10 10
  *
11 11
  */
12
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
12
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
13 13
 class EEM_Message_Template_Group extends EEM_Soft_Delete_Base {
14 14
 
15 15
 	// private instance of the EEM_Message_Template_Group object
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 
19 19
 
20
-	protected function __construct( $timezone = NULL ) {
20
+	protected function __construct($timezone = NULL) {
21 21
 		$this->singular_item = __('Message Template Group', 'event_espresso');
22 22
 		$this->plural_item = __('Message Template Groups', 'event_espresso');
23 23
 		$this->_tables = array(
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 		$this->_fields = array(
27 27
 			'Message_Template_Group' => array(
28 28
 				'GRP_ID' => new EE_Primary_Key_Int_Field('GRP_ID', __('Message Template Group ID', 'event_espresso')),
29
-				'MTP_name' => new EE_Plain_Text_Field( 'MTP_name', __('The name of the template group', 'event_espresso'), FALSE, '' ),
30
-				'MTP_description' => new EE_Simple_HTML_Field( 'MTP_description', __('A brief description about this template.', 'event_espresso' ), FALSE, '' ),
31
-				'MTP_user_id'=> new EE_WP_User_Field('MTP_user_id', __('Template Creator ID', 'event_espresso'), FALSE, get_current_user_id() ),
32
-				'MTP_messenger'=>new EE_Plain_Text_Field('MTP_messenger', __('Messenger Used for Template', 'event_espresso'), FALSE, 'email' ),
33
-				'MTP_message_type'=>new EE_Plain_Text_Field('MTP_message_type', __('Message Type', 'event_espresso'),false,'registration'),
29
+				'MTP_name' => new EE_Plain_Text_Field('MTP_name', __('The name of the template group', 'event_espresso'), FALSE, ''),
30
+				'MTP_description' => new EE_Simple_HTML_Field('MTP_description', __('A brief description about this template.', 'event_espresso'), FALSE, ''),
31
+				'MTP_user_id'=> new EE_WP_User_Field('MTP_user_id', __('Template Creator ID', 'event_espresso'), FALSE, get_current_user_id()),
32
+				'MTP_messenger'=>new EE_Plain_Text_Field('MTP_messenger', __('Messenger Used for Template', 'event_espresso'), FALSE, 'email'),
33
+				'MTP_message_type'=>new EE_Plain_Text_Field('MTP_message_type', __('Message Type', 'event_espresso'), false, 'registration'),
34 34
 				'MTP_is_global'=>new EE_Boolean_Field('MTP_is_global', __('Flag indicating if Template Group is Global', 'event_espresso'), false, true),
35 35
 				'MTP_is_override'=>new EE_Boolean_Field('MTP_is_override', __('Flag indicating if Template Group overrides any other Templates for the messenger/messagetype combination', 'event_espresso'), false, false),
36 36
 				'MTP_deleted'=>new EE_Trashed_Flag_Field('MTP_deleted', __('Flag indicating whether this has been trashed', 'event_espresso'), false, false),
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 			'Event' => new EE_HABTM_Relation('Event_Message_Template'),
44 44
 			'WP_User' => new EE_Belongs_To_Relation()
45 45
 		);
46
-		foreach( $this->_cap_contexts_to_cap_action_map as $context => $action ){
47
-			$this->_cap_restriction_generators[ $context ] = new EE_Restriction_Generator_Global( 'MTP_is_global');
46
+		foreach ($this->_cap_contexts_to_cap_action_map as $context => $action) {
47
+			$this->_cap_restriction_generators[$context] = new EE_Restriction_Generator_Global('MTP_is_global');
48 48
 		}
49 49
 		$this->_caps_slug = 'messages';
50 50
 
51
-		parent::__construct( $timezone );
51
+		parent::__construct($timezone);
52 52
 	}
53 53
 
54 54
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 		$limit = null,
72 72
 		$count = false
73 73
 	) {
74
-		$query_params = array( array('Event.EVT_ID' => $EVT_ID), 'order_by' => array($orderby => $order), 'limit' => $limit );
75
-		return $count ? $this->count_deleted( $query_params, 'GRP_ID', TRUE ) : $this->get_all_deleted( $query_params );
74
+		$query_params = array(array('Event.EVT_ID' => $EVT_ID), 'order_by' => array($orderby => $order), 'limit' => $limit);
75
+		return $count ? $this->count_deleted($query_params, 'GRP_ID', TRUE) : $this->get_all_deleted($query_params);
76 76
 	}
77 77
 
78 78
 
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 	 * @param string $order
87 87
 	 * @return array all (including trashed or inactive) message template group objects for the given messenger
88 88
 	 */
89
-	public function get_all_message_templates_by_messenger($messenger, $orderby = 'GRP_ID', $order = 'ASC' ) {
89
+	public function get_all_message_templates_by_messenger($messenger, $orderby = 'GRP_ID', $order = 'ASC') {
90 90
 		return $this->get_all_deleted_and_undeleted(
91
-			array( array( 'MTP_messenger' => $messenger ), 'order_by' => array( $orderby => $order ) )
91
+			array(array('MTP_messenger' => $messenger), 'order_by' => array($orderby => $order))
92 92
 		);
93 93
 	}
94 94
 
@@ -99,18 +99,18 @@  discard block
 block discarded – undo
99 99
 	 * @param  array  $_where any existing where conditions to append these to.
100 100
 	 * @return array          original where conditions or original with additional filters.
101 101
 	 */
102
-	protected function _maybe_mtp_filters( $_where = array() ) {
102
+	protected function _maybe_mtp_filters($_where = array()) {
103 103
 		//account for messenger or message type filters
104 104
 		if (
105
-			isset( $_REQUEST[ 'ee_messenger_filter_by' ] )
106
-			&& $_REQUEST[ 'ee_messenger_filter_by' ] != 'none_selected'
107
-			&& $_REQUEST[ 'ee_messenger_filter_by' ] != 'all'
105
+			isset($_REQUEST['ee_messenger_filter_by'])
106
+			&& $_REQUEST['ee_messenger_filter_by'] != 'none_selected'
107
+			&& $_REQUEST['ee_messenger_filter_by'] != 'all'
108 108
 		) {
109
-			$_where['MTP_messenger'] =  $_REQUEST['ee_messenger_filter_by'] ;
109
+			$_where['MTP_messenger'] = $_REQUEST['ee_messenger_filter_by'];
110 110
 		}
111 111
 
112 112
 		if (
113
-			isset( $_REQUEST['ee_message_type_filter_by'])
113
+			isset($_REQUEST['ee_message_type_filter_by'])
114 114
 			&& $_REQUEST['ee_message_type_filter_by'] != 'none_selected'
115 115
 		) {
116 116
 			$_where['MTP_message_type'] = $_REQUEST['ee_message_type_filter_by'];
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		$global = true,
142 142
 		$user_check = false
143 143
 	) {
144
-		$_where = $global ? array('MTP_is_global' => TRUE ) : array('MTP_is_global' => FALSE );
144
+		$_where = $global ? array('MTP_is_global' => TRUE) : array('MTP_is_global' => FALSE);
145 145
 		$_where['MTP_is_active'] = TRUE;
146 146
 		$_where = $this->_maybe_mtp_filters($_where);
147 147
 
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 			$_where['MTP_user_id'] = get_current_user_id();
157 157
 		}
158 158
 
159
-		$query_params = array( $_where, 'order_by' => array($orderby => $order), 'limit' => $limit );
159
+		$query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
160 160
 
161
-		return $count ? $this->count($query_params, 'GRP_ID', TRUE ) : $this->get_all($query_params);
161
+		return $count ? $this->count($query_params, 'GRP_ID', TRUE) : $this->get_all($query_params);
162 162
 	}
163 163
 
164 164
 
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
 	 * @param bool   $count
174 174
 	 * @return mixed array on success, FALSE on fail
175 175
 	 */
176
-	public function get_all_message_templates( $orderby = 'GRP_ID', $order = 'ASC', $limit = null, $count = false ) {
176
+	public function get_all_message_templates($orderby = 'GRP_ID', $order = 'ASC', $limit = null, $count = false) {
177 177
 		$_where = $this->_maybe_mtp_filters();
178 178
 
179
-		$query_params = array( $_where, 'order_by' => array($orderby => $order), 'limit' => $limit );
179
+		$query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
180 180
 
181 181
 		$r_templates = $count
182
-			? $this->count_deleted_and_undeleted($query_params, 'GRP_ID', TRUE )
183
-			: $this->get_all_deleted_and_undeleted( $query_params );
182
+			? $this->count_deleted_and_undeleted($query_params, 'GRP_ID', TRUE)
183
+			: $this->get_all_deleted_and_undeleted($query_params);
184 184
 
185 185
 		return $r_templates;
186 186
 	}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 	 * @param  array  $query_params same as EEM_Base::get_all()
195 195
 	 * @return  EE_Message_Template_Group[]
196 196
 	 */
197
-	public function get_all_custom_templates_by_event( $EVT_ID, $query_params = array() ) {
198
-		$where = array_merge( $query_params, array( 'Event.EVT_ID' => $EVT_ID ) );
197
+	public function get_all_custom_templates_by_event($EVT_ID, $query_params = array()) {
198
+		$where = array_merge($query_params, array('Event.EVT_ID' => $EVT_ID));
199 199
 		return $this->get_all(
200
-			array( $where )
200
+			array($where)
201 201
 		);
202 202
 	}
203 203
 
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
 		$count = false,
223 223
 		$global = true
224 224
 	) {
225
-		$_where = $global ? array('MTP_is_global' => TRUE ) : array('MTP_is_global' => FALSE );
225
+		$_where = $global ? array('MTP_is_global' => TRUE) : array('MTP_is_global' => FALSE);
226 226
 		$_where['MTP_is_active'] = TRUE;
227 227
 		$_where = $this->_maybe_mtp_filters($_where);
228 228
 
229
-		$query_params = array( $_where, 'order_by' => array($orderby => $order), 'limit' => $limit );
229
+		$query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
230 230
 
231
-		return $count ? $this->count_deleted($query_params, 'GRP_ID', TRUE ) : $this->get_all_deleted( $query_params );
231
+		return $count ? $this->count_deleted($query_params, 'GRP_ID', TRUE) : $this->get_all_deleted($query_params);
232 232
 	}
233 233
 
234 234
 
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
 			'MTP_is_active' => $active
265 265
 		);
266 266
 
267
-		$query_params = array( $_where, 'order_by' => array($orderby=>$order), 'limit' => $limit );
267
+		$query_params = array($_where, 'order_by' => array($orderby=>$order), 'limit' => $limit);
268 268
 
269
-		return $count ? $this->count($query_params, 'GRP_ID', TRUE ) : $this->get_all( $query_params );
269
+		return $count ? $this->count($query_params, 'GRP_ID', TRUE) : $this->get_all($query_params);
270 270
 	}
271 271
 
272 272
 
@@ -300,13 +300,13 @@  discard block
 block discarded – undo
300 300
 			'MTP_is_global' => TRUE,
301 301
 		);
302 302
 
303
-		if ( $active != 'all' ) {
303
+		if ($active != 'all') {
304 304
 			$_where['MTP_is_active'] = $active;
305 305
 		}
306 306
 
307
-		$query_params = array( $_where, 'order_by' => array( $orderby => $order ), 'limit' => $limit );
307
+		$query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
308 308
 
309
-		return $count ? $this->count( $query_params, 'GRP_ID', TRUE ) : $this->get_all( $query_params );
309
+		return $count ? $this->count($query_params, 'GRP_ID', TRUE) : $this->get_all($query_params);
310 310
 	}
311 311
 
312 312
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @param  array  $query_params same as EEM_Base->get_all()
320 320
 	 * @return EE_Message_Template_Group[]
321 321
 	 */
322
-	public function get_custom_message_template_by_m_and_mt( $messenger, $message_type, $query_params = array() ) {
322
+	public function get_custom_message_template_by_m_and_mt($messenger, $message_type, $query_params = array()) {
323 323
 		return $this->get_all(
324 324
 			array_merge(
325 325
 				$query_params,
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 		$assembled_fields = array();
357 357
 
358 358
 		//let's loop through all the fields and set them up in the right format
359
-		foreach ( $fields as $index => $value ) {
359
+		foreach ($fields as $index => $value) {
360 360
 			// first let's figure out if the value['content'] in the current index is an array.
361 361
 			//  If it is then this is special fields that are used in parsing special shortcodes (i.e. 'attendee_list').
362
-			if ( is_array($value['content']) ) {
362
+			if (is_array($value['content'])) {
363 363
 				$assembled_fields[$value['name']] = $value['content']['main'];
364 364
 				//loop through the content and get the other fields.
365
-				foreach ( $value['content'] as $name => $val ) {
366
-					if ( $name == 'main' ) continue;
365
+				foreach ($value['content'] as $name => $val) {
366
+					if ($name == 'main') continue;
367 367
 					$assembled_fields[$name] = $val;
368 368
 				}
369 369
 				continue;
@@ -375,15 +375,15 @@  discard block
 block discarded – undo
375 375
 
376 376
 		// now we've got the assembled_fields.
377 377
 		// We need to setup the string for the appropriate validator class and call that.
378
-		$m_ref = ucwords( str_replace('_',' ', $messenger ) );
379
-		$m_ref = str_replace( ' ', '_', $m_ref );
380
-		$mt_ref = ucwords( str_replace('_', ' ', $message_type ) );
381
-		$mt_ref = str_replace( ' ', '_', $mt_ref );
378
+		$m_ref = ucwords(str_replace('_', ' ', $messenger));
379
+		$m_ref = str_replace(' ', '_', $m_ref);
380
+		$mt_ref = ucwords(str_replace('_', ' ', $message_type));
381
+		$mt_ref = str_replace(' ', '_', $mt_ref);
382 382
 
383
-		$classname = 'EE_Messages_' . $m_ref . '_' . $mt_ref . '_Validator';
383
+		$classname = 'EE_Messages_'.$m_ref.'_'.$mt_ref.'_Validator';
384 384
 
385
-		if ( !class_exists( $classname ) ) {
386
-			$msg[] = __( 'The Validator class was unable to load', 'event_espresso');
385
+		if ( ! class_exists($classname)) {
386
+			$msg[] = __('The Validator class was unable to load', 'event_espresso');
387 387
 			$msg[] = sprintf(
388 388
 				__(
389 389
 					'The class name compiled was %s. Please check and make sure the spelling and case is correct for the class name and that there is an autoloader in place for this class',
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
 				),
392 392
 				$classname
393 393
 			);
394
-			throw new EE_Error( implode( '||', $msg ) );
394
+			throw new EE_Error(implode('||', $msg));
395 395
 		}
396 396
 
397
-		$a = new ReflectionClass( $classname );
398
-		$_VLD = $a->newInstance( $assembled_fields, $context );
397
+		$a = new ReflectionClass($classname);
398
+		$_VLD = $a->newInstance($assembled_fields, $context);
399 399
 		$result = $_VLD->validate();
400 400
 		return $result;
401 401
 	}
@@ -414,18 +414,18 @@  discard block
 block discarded – undo
414 414
 	 *
415 415
 	 * @return int  count of updated records.
416 416
 	 */
417
-	public function deactivate_message_template_groups_for( $messenger_names = array(), $message_type_names = array() ) {
417
+	public function deactivate_message_template_groups_for($messenger_names = array(), $message_type_names = array()) {
418 418
 		$query_args = array();
419
-		if ( empty( $messenger_names ) && empty( $message_type_names ) ) {
419
+		if (empty($messenger_names) && empty($message_type_names)) {
420 420
 			return 0;
421 421
 		}
422
-		if ( ! empty( $messenger_names ) ) {
423
-			$query_args[ 0 ][ 'MTP_messenger' ] = array( 'IN', (array) $messenger_names );
422
+		if ( ! empty($messenger_names)) {
423
+			$query_args[0]['MTP_messenger'] = array('IN', (array) $messenger_names);
424 424
 		}
425
-		if ( ! empty( $message_type_names ) ) {
426
-			$query_args[ 0 ][ 'MTP_message_type' ] = array( 'IN', (array) $message_type_names );
425
+		if ( ! empty($message_type_names)) {
426
+			$query_args[0]['MTP_message_type'] = array('IN', (array) $message_type_names);
427 427
 		}
428
-		return $this->update( array( 'MTP_is_active' => false ), $query_args );
428
+		return $this->update(array('MTP_is_active' => false), $query_args);
429 429
 	}
430 430
 
431 431
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,6 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION') )
1
+<?php if (!defined('EVENT_ESPRESSO_VERSION') ) {
2 2
 	exit('NO direct script access allowed');
3
+}
3 4
 /**
4 5
  * EEM_Message_Template_Group
5 6
  *
@@ -363,7 +364,9 @@  discard block
 block discarded – undo
363 364
 				$assembled_fields[$value['name']] = $value['content']['main'];
364 365
 				//loop through the content and get the other fields.
365 366
 				foreach ( $value['content'] as $name => $val ) {
366
-					if ( $name == 'main' ) continue;
367
+					if ( $name == 'main' ) {
368
+						continue;
369
+					}
367 370
 					$assembled_fields[$name] = $val;
368 371
 				}
369 372
 				continue;
Please login to merge, or discard this patch.