Completed
Branch BETA-4.9-message-activity (e05538)
by
unknown
392:18 queued 376:05
created
caffeinated/admin/new/tickets/Tickets_List_Table.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				'TKT_taxable' => __('Taxable', 'event_espresso')
60 60
 			);
61 61
 
62
-        $this->_sortable_columns = array(
62
+		$this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64 64
 				'TKT_name' => array( 'TKT_name', TRUE ),
65 65
 				'TKT_description' => array( 'TKT_description', FALSE ),
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 				'TKT_min' => array( 'TKT_min', FALSE ),
69 69
 				'TKT_max' => array( 'TKT_max', FALSE ),
70 70
 				'TKT_price' => array( 'TKT_price', FALSE )
71
-	        	);
71
+				);
72 72
 
73
-        $this->_hidden_columns = array(
73
+		$this->_hidden_columns = array(
74 74
 			);
75 75
 
76 76
 	}
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 
32 32
 	protected function _setup_data() {
33 33
 		$trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE;
34
-		$this->_data = $this->_admin_page->get_default_tickets( $this->_per_page, FALSE, $trashed );
35
-		$this->_all_data_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, FALSE );
36
-		$this->_trashed_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, TRUE );
34
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, FALSE, $trashed);
35
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, FALSE);
36
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, TRUE);
37 37
 	}
38 38
 
39 39
 
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64
-				'TKT_name' => array( 'TKT_name', TRUE ),
65
-				'TKT_description' => array( 'TKT_description', FALSE ),
66
-				'TKT_qty' => array( 'TKT_qty', FALSE ),
67
-				'TKT_uses' => array( 'TKT_uses', FALSE ),
68
-				'TKT_min' => array( 'TKT_min', FALSE ),
69
-				'TKT_max' => array( 'TKT_max', FALSE ),
70
-				'TKT_price' => array( 'TKT_price', FALSE )
64
+				'TKT_name' => array('TKT_name', TRUE),
65
+				'TKT_description' => array('TKT_description', FALSE),
66
+				'TKT_qty' => array('TKT_qty', FALSE),
67
+				'TKT_uses' => array('TKT_uses', FALSE),
68
+				'TKT_min' => array('TKT_min', FALSE),
69
+				'TKT_max' => array('TKT_max', FALSE),
70
+				'TKT_price' => array('TKT_price', FALSE)
71 71
 	        	);
72 72
 
73 73
         $this->_hidden_columns = array(
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 88
 	protected function _add_view_counts() {
89 89
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
90
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket'))
91 91
 		$this->_views['trashed']['count'] = $this->_trashed_count;
92 92
 	}
93 93
 
94 94
 
95 95
 
96 96
 	function column_cb($item) {
97
-		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
97
+		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID());
98 98
 
99 99
 	}
100 100
 
@@ -105,21 +105,21 @@  discard block
 block discarded – undo
105 105
 		$actions = array();
106 106
 
107 107
 		//trash links
108
-		if ( $item->ID() !== 1 ) {
109
-			if ( $this->_view == 'all' ) {
110
-				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'trash_ticket', 'TKT_ID' => $item->ID() ), TICKETS_ADMIN_URL );
111
-				$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
108
+		if ($item->ID() !== 1) {
109
+			if ($this->_view == 'all') {
110
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
111
+				$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Ticket to trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
112 112
 			} else {
113 113
 				// restore price link
114
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
115
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Ticket', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
114
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
115
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Ticket', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
116 116
 				// delete price link
117
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
118
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Ticket Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
117
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
118
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
119 119
 			}
120 120
 		}
121 121
 
122
-		return $item->get('TKT_name') . $this->row_actions( $actions );
122
+		return $item->get('TKT_name').$this->row_actions($actions);
123 123
 	}
124 124
 
125 125
 
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 	function column_TKT_qty($item) {
135
-		return $item->get_pretty('TKT_qty','text');
135
+		return $item->get_pretty('TKT_qty', 'text');
136 136
 	}
137 137
 
138 138
 
139 139
 
140 140
 	function column_TKT_uses($item) {
141
-		return $item->get_pretty('TKT_uses','text');
141
+		return $item->get_pretty('TKT_uses', 'text');
142 142
 	}
143 143
 
144 144
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 
151 151
 	function column_TKT_max($item) {
152
-		return $item->get_pretty('TKT_max','text');
152
+		return $item->get_pretty('TKT_max', 'text');
153 153
 	}
154 154
 
155 155
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('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
 /**
4 6
  * Event Espresso
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
 
88 90
 	protected function _add_view_counts() {
89 91
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
91
-		$this->_views['trashed']['count'] = $this->_trashed_count;
92
+		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) {
93
+				$this->_views['trashed']['count'] = $this->_trashed_count;
94
+		}
92 95
 	}
93 96
 
94 97
 
Please login to merge, or discard this patch.
libraries/messages/defaults/default/email_newsletter_content.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
                         <tbody>
34 34
                             <tr>
35 35
                                 <td>
36
-                                    <h2><?php printf( __('Hello, %s:', 'event_espresso'), '[RECIPIENT_FNAME]' ); ?></h2>
36
+                                    <h2><?php printf(__('Hello, %s:', 'event_espresso'), '[RECIPIENT_FNAME]'); ?></h2>
37 37
                                     <p class="lead"><?php _e("We've got a few things we want to share with you!", 'event_espresso'); ?></p>
38 38
                                     <div>
39 39
                                         [NEWSLETTER_CONTENT]
Please login to merge, or discard this patch.
libraries/messages/defaults/default/email_newsletter_subject.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php printf( __('Message from %s', 'event_espresso'), EE_Registry::instance()->CFG->organization->get_pretty( 'name' ) ); ?>
1
+<?php printf(__('Message from %s', 'event_espresso'), EE_Registry::instance()->CFG->organization->get_pretty('name')); ?>
Please login to merge, or discard this patch.
cancelled_registration/EE_Cancelled_Registration_message_type.class.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 		//remove unwanted transaction shortcode
81 81
 		foreach ( $this->_valid_shortcodes as $context => $shortcodes ) {
82 82
 			if( ($key = array_search('transaction', $shortcodes) ) !== false) {
83
-			    unset($this->_valid_shortcodes[$context][$key]);
83
+				unset($this->_valid_shortcodes[$context][$key]);
84 84
 			}
85 85
 		}
86 86
 	}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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
 /**
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 		parent::_set_valid_shortcodes();
79 79
 
80 80
 		//remove unwanted transaction shortcode
81
-		foreach ( $this->_valid_shortcodes as $context => $shortcodes ) {
82
-			if( ($key = array_search('transaction', $shortcodes) ) !== false) {
81
+		foreach ($this->_valid_shortcodes as $context => $shortcodes) {
82
+			if (($key = array_search('transaction', $shortcodes)) !== false) {
83 83
 			    unset($this->_valid_shortcodes[$context][$key]);
84 84
 			}
85 85
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
message_type/newsletter/EE_Messages_Contacts_incoming_data.class.php 3 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
  * @subpackage helpers
6 6
  * @since           4.3.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * This prepares data for message types that send messages for multiple contacts and handles
@@ -30,8 +32,9 @@  discard block
 block discarded – undo
30 32
 
31 33
         //validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
32 34
         $ctc_chk = reset( $data );
33
-        if ( ! $ctc_chk instanceof EE_Attendee )
34
-            throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso') );
35
+        if ( ! $ctc_chk instanceof EE_Attendee ) {
36
+                    throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso') );
37
+        }
35 38
 
36 39
         parent::__construct( $data );
37 40
     }
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -19,101 +19,101 @@
 block discarded – undo
19 19
 class EE_Messages_Contacts_incoming_data extends EE_Messages_incoming_data {
20 20
 
21 21
 
22
-    /**
23
-     * Constructor.
24
-     *
25
-     * @since    4.3.0
26
-     * @param  EE_Attendee[]     $data expecting an array of EE_Attendee objects.
27
-     * @throws EE_Error
28
-     * @access protected
29
-     */
30
-    public function __construct( $data = array() ) {
31
-
32
-        //validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
33
-        $ctc_chk = reset( $data );
34
-        if ( ! $ctc_chk instanceof EE_Attendee )
35
-            throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso') );
36
-
37
-        parent::__construct( $data );
38
-    }
39
-
40
-
41
-    /**
42
-     * @see parent class for phpdocs.
43
-     * @param array $attendees
44
-     * @return array
45
-     */
46
-    public static function convert_data_for_persistent_storage( $attendees ) {
47
-        $attendee_ids = array_filter ( array_map(
48
-            function( $attendee ) {
49
-                if ( $attendee instanceof EE_Attendee ) {
50
-                    return $attendee->ID();
51
-                }
52
-            },
53
-            $attendees
54
-            ) );
55
-        return $attendee_ids;
56
-    }
57
-
58
-
59
-
60
-
61
-    /**
62
-     * @see parent class for phpdocs
63
-     * @param array $attendee_ids
64
-     * @return EE_Attendee[]
65
-     */
66
-    public static function convert_data_from_persistent_storage( $attendee_ids ) {
67
-        $attendee_ids = (array) $attendee_ids;
68
-        $attendees = EEM_Attendee::instance()->get_all(
69
-          array(
70
-              array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
71
-          )
72
-        );
73
-        return $attendees;
74
-    }
75
-
76
-
77
-
78
-
79
-    /**
80
-     * setup the data.
81
-     *
82
-     * Sets up the expected data object for the messages prep using incoming registration objects.
83
-     *
84
-     * @since   4.3.0
85
-     *
86
-     * @return void
87
-     * @access protected
88
-     */
89
-    protected function _setup_data() {
90
-
91
-        //we'll loop through each contact and setup the data needed.  Note that many properties will just be set as empty because the contacts data handler is for a very specific set of data (i.e. just what's related to the contact).
92
-        $this->txn = NULL;
93
-        $this->taxes = NULL;
94
-        $this->grand_total_price_object = '';
95
-        $this->user_id = $this->ip_address = $this->user_agent = $this->init_access = '';
96
-        $this->payment = NULL;
97
-        $this->billing = array();
98
-        $this->reg_objs = array();
99
-        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
100
-        $this->total_ticket_count = 0;
101
-        $this->primary_attendee_data = array(
102
-            'registration_id' => 0,
103
-            'att_obj' => NULL,
104
-            'reg_obj' => NULL,
105
-            'primary_att_obj' => NULL,
106
-            'primary_reg_obj' => NULL
107
-            );
108
-
109
-        foreach ( $this->_data as $contact ) {
110
-            $id = $contact->ID();
111
-            $reg = $contact->get_first_related('Registration');
112
-            $this->attendees[$id]['att_obj'] = $contact;
113
-            $this->attendees[$id]['reg_objs'][$reg->ID()] = $reg;
114
-            $this->attendees[$id]['attendee_email'] = $contact->email();
115
-            $this->attendees[$id]['tkt_objs'] = array();
116
-            $this->attendees[$id]['evt_objs'] = array();
117
-        }
118
-    }
22
+	/**
23
+	 * Constructor.
24
+	 *
25
+	 * @since    4.3.0
26
+	 * @param  EE_Attendee[]     $data expecting an array of EE_Attendee objects.
27
+	 * @throws EE_Error
28
+	 * @access protected
29
+	 */
30
+	public function __construct( $data = array() ) {
31
+
32
+		//validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
33
+		$ctc_chk = reset( $data );
34
+		if ( ! $ctc_chk instanceof EE_Attendee )
35
+			throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso') );
36
+
37
+		parent::__construct( $data );
38
+	}
39
+
40
+
41
+	/**
42
+	 * @see parent class for phpdocs.
43
+	 * @param array $attendees
44
+	 * @return array
45
+	 */
46
+	public static function convert_data_for_persistent_storage( $attendees ) {
47
+		$attendee_ids = array_filter ( array_map(
48
+			function( $attendee ) {
49
+				if ( $attendee instanceof EE_Attendee ) {
50
+					return $attendee->ID();
51
+				}
52
+			},
53
+			$attendees
54
+			) );
55
+		return $attendee_ids;
56
+	}
57
+
58
+
59
+
60
+
61
+	/**
62
+	 * @see parent class for phpdocs
63
+	 * @param array $attendee_ids
64
+	 * @return EE_Attendee[]
65
+	 */
66
+	public static function convert_data_from_persistent_storage( $attendee_ids ) {
67
+		$attendee_ids = (array) $attendee_ids;
68
+		$attendees = EEM_Attendee::instance()->get_all(
69
+		  array(
70
+			  array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
71
+		  )
72
+		);
73
+		return $attendees;
74
+	}
75
+
76
+
77
+
78
+
79
+	/**
80
+	 * setup the data.
81
+	 *
82
+	 * Sets up the expected data object for the messages prep using incoming registration objects.
83
+	 *
84
+	 * @since   4.3.0
85
+	 *
86
+	 * @return void
87
+	 * @access protected
88
+	 */
89
+	protected function _setup_data() {
90
+
91
+		//we'll loop through each contact and setup the data needed.  Note that many properties will just be set as empty because the contacts data handler is for a very specific set of data (i.e. just what's related to the contact).
92
+		$this->txn = NULL;
93
+		$this->taxes = NULL;
94
+		$this->grand_total_price_object = '';
95
+		$this->user_id = $this->ip_address = $this->user_agent = $this->init_access = '';
96
+		$this->payment = NULL;
97
+		$this->billing = array();
98
+		$this->reg_objs = array();
99
+		$this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
100
+		$this->total_ticket_count = 0;
101
+		$this->primary_attendee_data = array(
102
+			'registration_id' => 0,
103
+			'att_obj' => NULL,
104
+			'reg_obj' => NULL,
105
+			'primary_att_obj' => NULL,
106
+			'primary_reg_obj' => NULL
107
+			);
108
+
109
+		foreach ( $this->_data as $contact ) {
110
+			$id = $contact->ID();
111
+			$reg = $contact->get_first_related('Registration');
112
+			$this->attendees[$id]['att_obj'] = $contact;
113
+			$this->attendees[$id]['reg_objs'][$reg->ID()] = $reg;
114
+			$this->attendees[$id]['attendee_email'] = $contact->email();
115
+			$this->attendees[$id]['tkt_objs'] = array();
116
+			$this->attendees[$id]['evt_objs'] = array();
117
+		}
118
+	}
119 119
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
      * @throws EE_Error
28 28
      * @access protected
29 29
      */
30
-    public function __construct( $data = array() ) {
30
+    public function __construct($data = array()) {
31 31
 
32 32
         //validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
33
-        $ctc_chk = reset( $data );
34
-        if ( ! $ctc_chk instanceof EE_Attendee )
35
-            throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso') );
33
+        $ctc_chk = reset($data);
34
+        if ( ! $ctc_chk instanceof EE_Attendee)
35
+            throw new EE_Error(__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso'));
36 36
 
37
-        parent::__construct( $data );
37
+        parent::__construct($data);
38 38
     }
39 39
 
40 40
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
      * @param array $attendees
44 44
      * @return array
45 45
      */
46
-    public static function convert_data_for_persistent_storage( $attendees ) {
47
-        $attendee_ids = array_filter ( array_map(
48
-            function( $attendee ) {
49
-                if ( $attendee instanceof EE_Attendee ) {
46
+    public static function convert_data_for_persistent_storage($attendees) {
47
+        $attendee_ids = array_filter(array_map(
48
+            function($attendee) {
49
+                if ($attendee instanceof EE_Attendee) {
50 50
                     return $attendee->ID();
51 51
                 }
52 52
             },
53 53
             $attendees
54
-            ) );
54
+            ));
55 55
         return $attendee_ids;
56 56
     }
57 57
 
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
      * @param array $attendee_ids
64 64
      * @return EE_Attendee[]
65 65
      */
66
-    public static function convert_data_from_persistent_storage( $attendee_ids ) {
66
+    public static function convert_data_from_persistent_storage($attendee_ids) {
67 67
         $attendee_ids = (array) $attendee_ids;
68 68
         $attendees = EEM_Attendee::instance()->get_all(
69 69
           array(
70
-              array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
70
+              array('ATT_ID' => array('IN', $attendee_ids))
71 71
           )
72 72
         );
73 73
         return $attendees;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->payment = NULL;
97 97
         $this->billing = array();
98 98
         $this->reg_objs = array();
99
-        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
99
+        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer = $this->registrations = array();
100 100
         $this->total_ticket_count = 0;
101 101
         $this->primary_attendee_data = array(
102 102
             'registration_id' => 0,
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             'primary_reg_obj' => NULL
107 107
             );
108 108
 
109
-        foreach ( $this->_data as $contact ) {
109
+        foreach ($this->_data as $contact) {
110 110
             $id = $contact->ID();
111 111
             $reg = $contact->get_first_related('Registration');
112 112
             $this->attendees[$id]['att_obj'] = $contact;
Please login to merge, or discard this patch.
message_type/newsletter/EE_Messages_Email_Newsletter_Validator.class.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file contains the EE_Messages_Email_Newsletter_Validator class.
4
- * @package      Event Espresso
5
- * @subpackage helpers
6
- * @since           4.3.0
7
- */
3
+	 * This file contains the EE_Messages_Email_Newsletter_Validator class.
4
+	 * @package      Event Espresso
5
+	 * @subpackage helpers
6
+	 * @since           4.3.0
7
+	 */
8 8
 if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
9 9
 
10 10
 /**
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
  * @author          Darren Ethier
19 19
  */
20 20
 class EE_Messages_Email_Newsletter_Validator extends EE_Messages_Validator {
21
-    public function __construct( $fields, $context ) {
22
-        $this->_m_name = 'email';
23
-        $this->_mt_name = 'newsletter';
21
+	public function __construct( $fields, $context ) {
22
+		$this->_m_name = 'email';
23
+		$this->_mt_name = 'newsletter';
24 24
 
25
-        parent::__construct( $fields, $context );
26
-    }
25
+		parent::__construct( $fields, $context );
26
+	}
27 27
 
28
-    /**
29
-     * custom validator (restricting what was originally set by the messenger)
30
-     */
31
-    protected function _modify_validator() {
32
-        if ( $this->_context == 'attendee' )
33
-            $this->_valid_shortcodes_modifier[$this->_context]['from'] = array('recipient_details', 'email', 'organization');
28
+	/**
29
+	 * custom validator (restricting what was originally set by the messenger)
30
+	 */
31
+	protected function _modify_validator() {
32
+		if ( $this->_context == 'attendee' )
33
+			$this->_valid_shortcodes_modifier[$this->_context]['from'] = array('recipient_details', 'email', 'organization');
34 34
 
35
-        //excluded shortcodes
36
-        $fields = array('to','from','subject','content','newsletter_content');
37
-        foreach ( $fields as $field ) {
38
-            $this->_specific_shortcode_excludes[$field] = array('[RECIPIENT_REGISTRATION_CODE]', '[RECIPIENT_EDIT_REGISTRATION_LINK]', '[EVENT_AUTHOR_FORMATTED_EMAIL]', '[EVENT_AUTHOR_EMAIL]');
39
-        }
40
-        $add_excludes = array( '[RECIPIENT_FNAME]', '[RECIPIENT_LNAME]', '[RECIPIENT_EMAIL]', '[COMPANY]', '[CO_ADD1]','[CO_ADD2]', '[CO_CITY]', '[CO_STATE]','[CO_ZIP]','[CO_LOGO]','[CO_PHONE]','[CO_LOGO_URL]','[CO_FACEBOOK_URL]','[CO_TWITTER_URL]','[CO_PINTEREST_URL]','[CO_GOOGLE_URL]','[CO_LINKEDIN_URL]','[CO_INSTAGRAM_URL]');
41
-        $this->_specific_shortcode_excludes['from'] = array_merge($this->_specific_shortcode_excludes['from'], $add_excludes);
42
-        $this->_specific_shortcode_excludes['content'] = array_merge( $this->_specific_shortcode_excludes['content'], array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]') );
43
-    }
35
+		//excluded shortcodes
36
+		$fields = array('to','from','subject','content','newsletter_content');
37
+		foreach ( $fields as $field ) {
38
+			$this->_specific_shortcode_excludes[$field] = array('[RECIPIENT_REGISTRATION_CODE]', '[RECIPIENT_EDIT_REGISTRATION_LINK]', '[EVENT_AUTHOR_FORMATTED_EMAIL]', '[EVENT_AUTHOR_EMAIL]');
39
+		}
40
+		$add_excludes = array( '[RECIPIENT_FNAME]', '[RECIPIENT_LNAME]', '[RECIPIENT_EMAIL]', '[COMPANY]', '[CO_ADD1]','[CO_ADD2]', '[CO_CITY]', '[CO_STATE]','[CO_ZIP]','[CO_LOGO]','[CO_PHONE]','[CO_LOGO_URL]','[CO_FACEBOOK_URL]','[CO_TWITTER_URL]','[CO_PINTEREST_URL]','[CO_GOOGLE_URL]','[CO_LINKEDIN_URL]','[CO_INSTAGRAM_URL]');
41
+		$this->_specific_shortcode_excludes['from'] = array_merge($this->_specific_shortcode_excludes['from'], $add_excludes);
42
+		$this->_specific_shortcode_excludes['content'] = array_merge( $this->_specific_shortcode_excludes['content'], array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]') );
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@
 block discarded – undo
18 18
  * @author          Darren Ethier
19 19
  */
20 20
 class EE_Messages_Email_Newsletter_Validator extends EE_Messages_Validator {
21
-    public function __construct( $fields, $context ) {
21
+    public function __construct($fields, $context) {
22 22
         $this->_m_name = 'email';
23 23
         $this->_mt_name = 'newsletter';
24 24
 
25
-        parent::__construct( $fields, $context );
25
+        parent::__construct($fields, $context);
26 26
     }
27 27
 
28 28
     /**
29 29
      * custom validator (restricting what was originally set by the messenger)
30 30
      */
31 31
     protected function _modify_validator() {
32
-        if ( $this->_context == 'attendee' )
32
+        if ($this->_context == 'attendee')
33 33
             $this->_valid_shortcodes_modifier[$this->_context]['from'] = array('recipient_details', 'email', 'organization');
34 34
 
35 35
         //excluded shortcodes
36
-        $fields = array('to','from','subject','content','newsletter_content');
37
-        foreach ( $fields as $field ) {
36
+        $fields = array('to', 'from', 'subject', 'content', 'newsletter_content');
37
+        foreach ($fields as $field) {
38 38
             $this->_specific_shortcode_excludes[$field] = array('[RECIPIENT_REGISTRATION_CODE]', '[RECIPIENT_EDIT_REGISTRATION_LINK]', '[EVENT_AUTHOR_FORMATTED_EMAIL]', '[EVENT_AUTHOR_EMAIL]');
39 39
         }
40
-        $add_excludes = array( '[RECIPIENT_FNAME]', '[RECIPIENT_LNAME]', '[RECIPIENT_EMAIL]', '[COMPANY]', '[CO_ADD1]','[CO_ADD2]', '[CO_CITY]', '[CO_STATE]','[CO_ZIP]','[CO_LOGO]','[CO_PHONE]','[CO_LOGO_URL]','[CO_FACEBOOK_URL]','[CO_TWITTER_URL]','[CO_PINTEREST_URL]','[CO_GOOGLE_URL]','[CO_LINKEDIN_URL]','[CO_INSTAGRAM_URL]');
40
+        $add_excludes = array('[RECIPIENT_FNAME]', '[RECIPIENT_LNAME]', '[RECIPIENT_EMAIL]', '[COMPANY]', '[CO_ADD1]', '[CO_ADD2]', '[CO_CITY]', '[CO_STATE]', '[CO_ZIP]', '[CO_LOGO]', '[CO_PHONE]', '[CO_LOGO_URL]', '[CO_FACEBOOK_URL]', '[CO_TWITTER_URL]', '[CO_PINTEREST_URL]', '[CO_GOOGLE_URL]', '[CO_LINKEDIN_URL]', '[CO_INSTAGRAM_URL]');
41 41
         $this->_specific_shortcode_excludes['from'] = array_merge($this->_specific_shortcode_excludes['from'], $add_excludes);
42
-        $this->_specific_shortcode_excludes['content'] = array_merge( $this->_specific_shortcode_excludes['content'], array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]') );
42
+        $this->_specific_shortcode_excludes['content'] = array_merge($this->_specific_shortcode_excludes['content'], array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'));
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
  * @subpackage helpers
6 6
  * @since           4.3.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * Holds any special validation rules for template fields with Email messenger and Newsletter
@@ -29,8 +31,9 @@  discard block
 block discarded – undo
29 31
      * custom validator (restricting what was originally set by the messenger)
30 32
      */
31 33
     protected function _modify_validator() {
32
-        if ( $this->_context == 'attendee' )
33
-            $this->_valid_shortcodes_modifier[$this->_context]['from'] = array('recipient_details', 'email', 'organization');
34
+        if ( $this->_context == 'attendee' ) {
35
+                    $this->_valid_shortcodes_modifier[$this->_context]['from'] = array('recipient_details', 'email', 'organization');
36
+        }
34 37
 
35 38
         //excluded shortcodes
36 39
         $fields = array('to','from','subject','content','newsletter_content');
Please login to merge, or discard this patch.
caffeinated/core/libraries/shortcodes/EE_Newsletter_Shortcodes.lib.php 3 patches
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
  * @subpackage helpers
6 6
  * @since           4.3.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * This is the library class for the "newsletter" group shortcodes.
@@ -54,8 +56,9 @@  discard block
 block discarded – undo
54 56
      * @return  array                                             new validator config.
55 57
      */
56 58
     public static function messenger_validator_config( $validator_config, EE_messenger $messenger ) {
57
-        if ( $messenger->name !== 'email' )
58
-            return $validator_config;
59
+        if ( $messenger->name !== 'email' ) {
60
+                    return $validator_config;
61
+        }
59 62
 
60 63
         $validator_config['content']['shortcodes'][] = 'newsletter';
61 64
         $validator_config['newsletter_content'] = array(
@@ -82,8 +85,9 @@  discard block
 block discarded – undo
82 85
      * @return  array                                           new/modified template fields array.
83 86
      */
84 87
     public static function messenger_template_fields( $template_fields, EE_messenger $messenger ) {
85
-        if ( $messenger->name !== 'email' )
86
-            return $template_fields;
88
+        if ( $messenger->name !== 'email' ) {
89
+                    return $template_fields;
90
+        }
87 91
 
88 92
         $template_fields['extra']['content']['newsletter_content'] = array(
89 93
             'input' => 'wp_editor',
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 
31 31
 
32 32
 
33
-    protected function _parser( $shortcode ) {
34
-        if ( $shortcode == '[NEWSLETTER_CONTENT]' ) {
33
+    protected function _parser($shortcode) {
34
+        if ($shortcode == '[NEWSLETTER_CONTENT]') {
35 35
             $this->_validate_list_requirements();
36 36
             $this->_set_shortcode_helper();
37 37
             $valid_shortcodes = array('recipient_details', 'organization');
38 38
             $template = $this->_data['template']['newsletter_content'];
39 39
             $data = $this->_data;
40
-            return $this->_shortcode_helper->parse_message_template( $template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message );
40
+            return $this->_shortcode_helper->parse_message_template($template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message);
41 41
         }
42 42
     }
43 43
 
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
      * @param  EE_messenger  $messenger
54 54
      * @return  array                                             new validator config.
55 55
      */
56
-    public static function messenger_validator_config( $validator_config, EE_messenger $messenger ) {
57
-        if ( $messenger->name !== 'email' )
56
+    public static function messenger_validator_config($validator_config, EE_messenger $messenger) {
57
+        if ($messenger->name !== 'email')
58 58
             return $validator_config;
59 59
 
60 60
         $validator_config['content']['shortcodes'][] = 'newsletter';
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
      * @param  EE_messenger  $messenger
82 82
      * @return  array                                           new/modified template fields array.
83 83
      */
84
-    public static function messenger_template_fields( $template_fields, EE_messenger $messenger ) {
85
-        if ( $messenger->name !== 'email' )
84
+    public static function messenger_template_fields($template_fields, EE_messenger $messenger) {
85
+        if ($messenger->name !== 'email')
86 86
             return $template_fields;
87 87
 
88 88
         $template_fields['extra']['content']['newsletter_content'] = array(
Please login to merge, or discard this patch.
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -20,81 +20,81 @@
 block discarded – undo
20 20
  */
21 21
 class EE_Newsletter_Shortcodes extends EE_Shortcodes {
22 22
 
23
-    protected function _init_props() {
24
-        $this->label = __("Newsletter Shortcodes", 'event_espresso');
25
-        $this->description = __('All shortcodes used for the newsletter message type', 'event_espresso');
26
-        $this->_shortcodes = array(
27
-            '[NEWSLETTER_CONTENT]' => __('This will parse to whatever is found in the related [newsletter_content] field.  Note that when triggering a newsletter message, whatever is added for the custom message will be inserted where this shortcode is placed', 'event_espresso')
28
-            );
29
-    }
23
+	protected function _init_props() {
24
+		$this->label = __("Newsletter Shortcodes", 'event_espresso');
25
+		$this->description = __('All shortcodes used for the newsletter message type', 'event_espresso');
26
+		$this->_shortcodes = array(
27
+			'[NEWSLETTER_CONTENT]' => __('This will parse to whatever is found in the related [newsletter_content] field.  Note that when triggering a newsletter message, whatever is added for the custom message will be inserted where this shortcode is placed', 'event_espresso')
28
+			);
29
+	}
30 30
 
31 31
 
32 32
 
33
-    protected function _parser( $shortcode ) {
34
-        if ( $shortcode == '[NEWSLETTER_CONTENT]' ) {
35
-            $this->_validate_list_requirements();
36
-            $valid_shortcodes = array('recipient_details', 'organization');
37
-            $template = $this->_data['template']['newsletter_content'];
38
-            $data = $this->_data;
39
-            return $this->_shortcode_helper->parse_message_template( $template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message );
40
-        }
41
-    }
33
+	protected function _parser( $shortcode ) {
34
+		if ( $shortcode == '[NEWSLETTER_CONTENT]' ) {
35
+			$this->_validate_list_requirements();
36
+			$valid_shortcodes = array('recipient_details', 'organization');
37
+			$template = $this->_data['template']['newsletter_content'];
38
+			$data = $this->_data;
39
+			return $this->_shortcode_helper->parse_message_template( $template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message );
40
+		}
41
+	}
42 42
 
43 43
 
44
-    /**
45
-     * Callback set in args for EE_Register_Messages_Shortcode_Library::register for 'msgr_validator_callback'.
46
-     *
47
-     * EE_Register_Messages_Shortcode_Library::register registers this callback with the
48
-     * 'FHEE__EE_messenger__get_validator_config' filter.
49
-     *
50
-     * @since    4.3.0
51
-     * @param  array        $validator_config  current validator configuration array
52
-     * @param  EE_messenger $messenger
53
-     * @return  array                                             new validator config.
54
-     */
55
-    public static function messenger_validator_config( $validator_config, EE_messenger $messenger ) {
56
-        if ( $messenger->name !== 'email' )
57
-            return $validator_config;
44
+	/**
45
+	 * Callback set in args for EE_Register_Messages_Shortcode_Library::register for 'msgr_validator_callback'.
46
+	 *
47
+	 * EE_Register_Messages_Shortcode_Library::register registers this callback with the
48
+	 * 'FHEE__EE_messenger__get_validator_config' filter.
49
+	 *
50
+	 * @since    4.3.0
51
+	 * @param  array        $validator_config  current validator configuration array
52
+	 * @param  EE_messenger $messenger
53
+	 * @return  array                                             new validator config.
54
+	 */
55
+	public static function messenger_validator_config( $validator_config, EE_messenger $messenger ) {
56
+		if ( $messenger->name !== 'email' )
57
+			return $validator_config;
58 58
 
59
-        $validator_config['content']['shortcodes'][] = 'newsletter';
60
-        $validator_config['newsletter_content'] = array(
61
-            'shortcodes' => array('recipient_details', 'organization'),
62
-            'required' => array('[NEWSLETTER_CONTENT]')
63
-            );
64
-        return $validator_config;
65
-    }
59
+		$validator_config['content']['shortcodes'][] = 'newsletter';
60
+		$validator_config['newsletter_content'] = array(
61
+			'shortcodes' => array('recipient_details', 'organization'),
62
+			'required' => array('[NEWSLETTER_CONTENT]')
63
+			);
64
+		return $validator_config;
65
+	}
66 66
 
67 67
 
68 68
 
69 69
 
70
-    /**
71
-     * Callback set in args for EE_Register_Messages_Shortcode_Library::register for
72
-     * 'msgr_template_fields_callback'.
73
-     *
74
-     * EE_Register_Messages_Shortcode_Library::register registers this callback with the
75
-     * FHEE__EE_messenger__get_template_fields filter.
76
-     *
77
-     * @since    4.3.0
78
-     *
79
-     * @param  array        $template_fields current template fields setup array.
80
-     * @param  EE_messenger $messenger
81
-     * @return  array                                           new/modified template fields array.
82
-     */
83
-    public static function messenger_template_fields( $template_fields, EE_messenger $messenger ) {
84
-        if ( $messenger->name !== 'email' )
85
-            return $template_fields;
70
+	/**
71
+	 * Callback set in args for EE_Register_Messages_Shortcode_Library::register for
72
+	 * 'msgr_template_fields_callback'.
73
+	 *
74
+	 * EE_Register_Messages_Shortcode_Library::register registers this callback with the
75
+	 * FHEE__EE_messenger__get_template_fields filter.
76
+	 *
77
+	 * @since    4.3.0
78
+	 *
79
+	 * @param  array        $template_fields current template fields setup array.
80
+	 * @param  EE_messenger $messenger
81
+	 * @return  array                                           new/modified template fields array.
82
+	 */
83
+	public static function messenger_template_fields( $template_fields, EE_messenger $messenger ) {
84
+		if ( $messenger->name !== 'email' )
85
+			return $template_fields;
86 86
 
87
-        $template_fields['extra']['content']['newsletter_content'] = array(
88
-            'input' => 'wp_editor',
89
-            'label' => '[NEWSLETTER_CONTENT]',
90
-            'type' => 'string',
91
-            'required' => TRUE,
92
-            'validation' => TRUE,
93
-            'format' => '%s',
94
-            'rows' => '15',
95
-            'shortcodes_required' => array('[NEWSLETTER_CONTENT]')
96
-            );
97
-        return $template_fields;
98
-    }
87
+		$template_fields['extra']['content']['newsletter_content'] = array(
88
+			'input' => 'wp_editor',
89
+			'label' => '[NEWSLETTER_CONTENT]',
90
+			'type' => 'string',
91
+			'required' => TRUE,
92
+			'validation' => TRUE,
93
+			'format' => '%s',
94
+			'rows' => '15',
95
+			'shortcodes_required' => array('[NEWSLETTER_CONTENT]')
96
+			);
97
+		return $template_fields;
98
+	}
99 99
 
100 100
 } //end class EE_Newsletter_Shortcodes
Please login to merge, or discard this patch.
caffeinated/core/libraries/shortcodes/EE_Question_Shortcodes.lib.php 2 patches
Spacing   +12 added lines, -12 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
 /**
@@ -57,39 +57,39 @@  discard block
 block discarded – undo
57 57
 	 * @param string $shortcode the shortcode to be parsed.
58 58
 	 * @return string parsed shortcode
59 59
 	 */
60
-	protected function _parser( $shortcode ) {
60
+	protected function _parser($shortcode) {
61 61
 
62
-		if ( ! $this->_data instanceof EE_Answer || ! isset( $this->_extra_data['data'] ) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
62
+		if ( ! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
63 63
 			return '';
64 64
 		}
65 65
 
66
-		switch ( $shortcode ) {
66
+		switch ($shortcode) {
67 67
 
68 68
 			case '[QUESTION]' :
69
-				$question = isset( $this->_extra_data['data']->questions[$this->_data->ID()] ) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
70
-				if ( ! $question instanceof EE_Question ) {
69
+				$question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
70
+				if ( ! $question instanceof EE_Question) {
71 71
 					return ''; //get out because we can't figure out what the question is.
72 72
 				}
73
-				return $question->get_pretty( 'QST_display_text', 'no_wpautop' );
73
+				return $question->get_pretty('QST_display_text', 'no_wpautop');
74 74
 				break;
75 75
 
76 76
 			case '[ANSWER]' :
77 77
 				//need to get the question to determine the type of question (some questions require translation of the answer).
78
-				$question = isset( $this->_extra_data['data']->questions[$this->_data->ID()] ) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
79
-				if ( ! $question instanceof EE_Question ) {
78
+				$question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
79
+				if ( ! $question instanceof EE_Question) {
80 80
 					return ''; //get out cause we can't figure out what the question type is!
81 81
 				}
82 82
 
83 83
 				//what we show for the answer depends on the question type!
84
-				switch ( $question->get( 'QST_type' ) ) {
84
+				switch ($question->get('QST_type')) {
85 85
 
86 86
 					case 'STATE' :
87
-						$state = EEM_State::instance()->get_one_by_ID( $this->_data->get('ANS_value') );
87
+						$state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value'));
88 88
 						$answer = $state instanceof EE_State ? $state->name() : '';
89 89
 						break;
90 90
 
91 91
 					case 'COUNTRY' :
92
-						$country = EEM_Country::instance()->get_one_by_ID( $this->_data->get( 'ANS_value') );
92
+						$country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value'));
93 93
 						$answer = $country instanceof EE_Country ? $country->name() : '';
94 94
 						break;
95 95
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
caffeinated/modules/events_archive_caff/EED_Events_Archive_Caff.module.php 4 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author			Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
- * @ link					http://www.eventespresso.com
12
- * @ version		 	4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EED_Events_Archive_Caff
17
- *
18
- * @package		Event Espresso
19
- * @subpackage	/modules/events_archive_caff/
20
- * @author		Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author			Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
+	 * @ link					http://www.eventespresso.com
12
+	 * @ version		 	4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EED_Events_Archive_Caff
17
+	 *
18
+	 * @package		Event Espresso
19
+	 * @subpackage	/modules/events_archive_caff/
20
+	 * @author		Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class EED_Events_Archive_Caff  extends EED_Events_Archive {
25 25
 
26 26
 
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.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 	 *  @access 	public
124 124
 	 *  @param    EE_Template_Config $CFG
125 125
 	 *  @param 	array $REQ
126
-	 *  @return    EE_Events_Archive_Config
126
+	 *  @return    EE_Template_Config
127 127
 	 */
128 128
 	public static function update_template_settings( $CFG, $REQ ) {
129 129
 		$config = new EE_Events_Archive_Config();
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @return EED_Events_Archive_Caff
29 29
 	 */
30 30
 	public static function instance() {
31
-		return parent::get_instance( __CLASS__ );
31
+		return parent::get_instance(__CLASS__);
32 32
 	}
33 33
 
34 34
 
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	 *  @return 	void
50 50
 	 */
51 51
 	public static function set_hooks_admin() {
52
-		define( 'EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
53
-		define( 'EVENT_ARCHIVE_CAFF_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
54
-		add_action( 'AHEE__template_settings__template__before_settings_form', array( 'EED_Events_Archive_Caff', 'template_settings_form' ), 10 );
55
-		add_filter( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', array( 'EED_Events_Archive_Caff', 'update_template_settings' ), 10, 2 );
52
+		define('EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
53
+		define('EVENT_ARCHIVE_CAFF_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
54
+		add_action('AHEE__template_settings__template__before_settings_form', array('EED_Events_Archive_Caff', 'template_settings_form'), 10);
55
+		add_filter('FHEE__General_Settings_Admin_Page__update_template_settings__data', array('EED_Events_Archive_Caff', 'update_template_settings'), 10, 2);
56 56
 		// AJAX
57
-		add_action( 'wp_ajax_espresso_update_event_archive_order', array( 'EED_Events_Archive_Caff', 'update_event_archive_order' ) );
58
-		add_action( 'wp_ajax_nopriv_espresso_update_event_archive_order', array( 'EED_Events_Archive_Caff', 'update_event_archive_order' ) );
57
+		add_action('wp_ajax_espresso_update_event_archive_order', array('EED_Events_Archive_Caff', 'update_event_archive_order'));
58
+		add_action('wp_ajax_nopriv_espresso_update_event_archive_order', array('EED_Events_Archive_Caff', 'update_event_archive_order'));
59 59
 	}
60 60
 
61 61
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param    WP $WP
69 69
 	 * @return    void
70 70
 	 */
71
-	public function run( $WP ) {
71
+	public function run($WP) {
72 72
 	}
73 73
 
74 74
 
@@ -83,33 +83,33 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public static function template_settings_form() {
85 85
 		// grab general settings admin page and remove the existing hook callback
86
-		$gen_set_admin = EE_Registry::instance()->LIB->EE_Admin_Page_Loader->get_admin_page_object( 'general_settings' );
87
-		if ( $gen_set_admin instanceof General_Settings_Admin_Page ) {
88
-			remove_action( 'AHEE__template_settings__template__before_settings_form', array( $gen_set_admin, 'template_settings_caff_features' ), 100 );
86
+		$gen_set_admin = EE_Registry::instance()->LIB->EE_Admin_Page_Loader->get_admin_page_object('general_settings');
87
+		if ($gen_set_admin instanceof General_Settings_Admin_Page) {
88
+			remove_action('AHEE__template_settings__template__before_settings_form', array($gen_set_admin, 'template_settings_caff_features'), 100);
89 89
 		}
90 90
 		// first just grab the template settings
91 91
 		$config = EE_Registry::instance()->CFG->template_settings;
92 92
 		// then if the Event Archive config is valid, use that, else create a new one
93
-		$config = isset( $config->EED_Events_Archive ) && $config->EED_Events_Archive instanceof EE_Events_Archive_Config ? $config->EED_Events_Archive : new EE_Events_Archive_Config();
94
-		$config = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $config );
95
-		$config->display_status_banner = isset( $config->display_status_banner ) ? $config->display_status_banner : 0;
96
-		$config->display_description = isset( $config->display_description ) ? $config->display_description : 1;
97
-		$config->display_ticket_selector = isset( $config->display_ticket_selector ) ? $config->display_ticket_selector : 0;
98
-		$config->display_datetimes = isset( $config->display_datetimes ) ? $config->display_datetimes : 1;
99
-		$config->display_venue = isset( $config->display_venue ) ? $config->display_venue : 0;
100
-		$config->display_expired_events = isset( $config->display_expired_events ) ? $config->display_expired_events : 0;
93
+		$config = isset($config->EED_Events_Archive) && $config->EED_Events_Archive instanceof EE_Events_Archive_Config ? $config->EED_Events_Archive : new EE_Events_Archive_Config();
94
+		$config = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $config);
95
+		$config->display_status_banner = isset($config->display_status_banner) ? $config->display_status_banner : 0;
96
+		$config->display_description = isset($config->display_description) ? $config->display_description : 1;
97
+		$config->display_ticket_selector = isset($config->display_ticket_selector) ? $config->display_ticket_selector : 0;
98
+		$config->display_datetimes = isset($config->display_datetimes) ? $config->display_datetimes : 1;
99
+		$config->display_venue = isset($config->display_venue) ? $config->display_venue : 0;
100
+		$config->display_expired_events = isset($config->display_expired_events) ? $config->display_expired_events : 0;
101 101
 		// display order options
102
-		$config->use_sortable_display_order = isset( $config->use_sortable_display_order  )? $config->use_sortable_display_order : false;
103
-		$config->display_order_tickets = isset( $config->display_order_tickets  )? $config->display_order_tickets : 100;
104
-		$config->display_order_datetimes = isset( $config->display_order_datetimes  )? $config->display_order_datetimes : 110;
105
-		$config->display_order_event = isset( $config->display_order_event  )? $config->display_order_event : 120;
106
-		$config->display_order_venue = isset( $config->display_order_venue  )? $config->display_order_venue : 130;
102
+		$config->use_sortable_display_order = isset($config->use_sortable_display_order) ? $config->use_sortable_display_order : false;
103
+		$config->display_order_tickets = isset($config->display_order_tickets) ? $config->display_order_tickets : 100;
104
+		$config->display_order_datetimes = isset($config->display_order_datetimes) ? $config->display_order_datetimes : 110;
105
+		$config->display_order_event = isset($config->display_order_event) ? $config->display_order_event : 120;
106
+		$config->display_order_venue = isset($config->display_order_venue) ? $config->display_order_venue : 130;
107 107
 		// get template parts
108
-		$template_parts = EED_Events_Archive::instance()->initialize_template_parts( $config );
108
+		$template_parts = EED_Events_Archive::instance()->initialize_template_parts($config);
109 109
 		// convert to array so that we can add more properties
110
-		$config = get_object_vars( $config );
111
-		$config[ 'event_archive_display_order' ] = $template_parts->generate_sortable_list_of_template_parts( 'event-archive-sortable-js', '', 'archive-sortable-li archive-sortable-js' );
112
-		EEH_Template::display_template( EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $config );
110
+		$config = get_object_vars($config);
111
+		$config['event_archive_display_order'] = $template_parts->generate_sortable_list_of_template_parts('event-archive-sortable-js', '', 'archive-sortable-li archive-sortable-js');
112
+		EEH_Template::display_template(EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH.'admin-event-list-settings.template.php', $config);
113 113
 	}
114 114
 
115 115
 
@@ -125,24 +125,24 @@  discard block
 block discarded – undo
125 125
 	 *  @param 	array $REQ
126 126
 	 *  @return    EE_Events_Archive_Config
127 127
 	 */
128
-	public static function update_template_settings( $CFG, $REQ ) {
128
+	public static function update_template_settings($CFG, $REQ) {
129 129
 		$config = new EE_Events_Archive_Config();
130 130
 		// unless we are resetting the config...
131
-		if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) {
132
-			$config->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0;
133
-			$config->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1;
134
-			$config->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0;
135
-			$config->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1;
136
-			$config->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0;
137
-			$config->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0;
138
-			$config->use_sortable_display_order = isset( $REQ['EED_Events_Archive_use_sortable_display_order'] ) ? absint( $REQ['EED_Events_Archive_use_sortable_display_order'] ) : 0;
139
-			$config->display_order_tickets = isset( $CFG->EED_Events_Archive->display_order_tickets ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_tickets : 100;
140
-			$config->display_order_datetimes = isset( $CFG->EED_Events_Archive->display_order_datetimes ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_datetimes : 110;
141
-			$config->display_order_event = isset( $CFG->EED_Events_Archive->display_order_event ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_event : 120;
142
-			$config->display_order_venue = isset( $CFG->EED_Events_Archive->display_order_venue ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_venue : 130;
131
+		if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) {
132
+			$config->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0;
133
+			$config->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1;
134
+			$config->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0;
135
+			$config->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1;
136
+			$config->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0;
137
+			$config->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0;
138
+			$config->use_sortable_display_order = isset($REQ['EED_Events_Archive_use_sortable_display_order']) ? absint($REQ['EED_Events_Archive_use_sortable_display_order']) : 0;
139
+			$config->display_order_tickets = isset($CFG->EED_Events_Archive->display_order_tickets) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_tickets : 100;
140
+			$config->display_order_datetimes = isset($CFG->EED_Events_Archive->display_order_datetimes) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_datetimes : 110;
141
+			$config->display_order_event = isset($CFG->EED_Events_Archive->display_order_event) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_event : 120;
142
+			$config->display_order_venue = isset($CFG->EED_Events_Archive->display_order_venue) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_venue : 130;
143 143
 		}
144 144
 		$CFG->EED_Events_Archive = $config;
145
-		do_action( 'AHEE__EED_Events_Archive__update_template_settings__after_update', $CFG, $REQ );
145
+		do_action('AHEE__EED_Events_Archive__update_template_settings__after_update', $CFG, $REQ);
146 146
 		return $CFG;
147 147
 	}
148 148
 
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public static function update_event_archive_order() {
158 158
 		$config_saved = false;
159
-		$template_parts = sanitize_text_field( $_POST[ 'elements' ] );
160
-		if ( ! empty( $template_parts ) ) {
161
-			$template_parts = explode( ',', trim( $template_parts, ',' ) );
162
-			foreach ( $template_parts as $key => $template_part ) {
159
+		$template_parts = sanitize_text_field($_POST['elements']);
160
+		if ( ! empty($template_parts)) {
161
+			$template_parts = explode(',', trim($template_parts, ','));
162
+			foreach ($template_parts as $key => $template_part) {
163 163
 				$template_part = "display_order_$template_part";
164
-				$priority = ( $key * 10 ) + 100;
164
+				$priority = ($key * 10) + 100;
165 165
 				if (
166 166
 					property_exists(
167 167
 						EE_Registry::instance()->CFG->template_settings->EED_Events_Archive,
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 				) {
171 171
 					EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->$template_part = $priority;
172 172
 				}
173
-				do_action( "AHEE__EED_Events_Archive__update_event_archive_order__$template_part", $priority );
173
+				do_action("AHEE__EED_Events_Archive__update_event_archive_order__$template_part", $priority);
174 174
 			}
175
-			$config_saved = EE_Registry::instance()->CFG->update_espresso_config( false, false );
175
+			$config_saved = EE_Registry::instance()->CFG->update_espresso_config(false, false);
176 176
 		}
177
-		if ( $config_saved ) {
178
-			EE_Error::add_success( __( 'Display Order has been successfully updated.', 'event_espresso' ) );
177
+		if ($config_saved) {
178
+			EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso'));
179 179
 		} else {
180
-			EE_Error::add_error( __( 'Display Order was not updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
180
+			EE_Error::add_error(__('Display Order was not updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
181 181
 		}
182
-		echo wp_json_encode( EE_Error::get_notices( false ) );
182
+		echo wp_json_encode(EE_Error::get_notices(false));
183 183
 		exit();
184 184
 	}
185 185
 
Please login to merge, or discard this patch.