Completed
Branch FET-9998-unit-test-bootstrappi... (db3cac)
by
unknown
111:23 queued 102:09
created
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
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
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
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.
Indentation   +20 added lines, -20 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 ) {
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.
message_type/payment_cancelled/EE_Payment_Cancelled_message_type.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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 7
 /**
7 8
  * EE_Payment_Cancelled_message_type extends EE_message_type
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
Please login to merge, or discard this patch.
message_type/payment_failed/EE_Payment_Failed_message_type.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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 7
 /**
7 8
  * EE_Payment_Failed_message_type extends EE_message_type
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
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.
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.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  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
             $valid_shortcodes = array('recipient_details', 'organization');
37 37
             $template = $this->_data['template']['newsletter_content'];
38 38
             $data = $this->_data;
39
-            return $this->_shortcode_helper->parse_message_template( $template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message );
39
+            return $this->_shortcode_helper->parse_message_template($template, $data['data'], $valid_shortcodes, $this->_message_type, $this->_messenger, $this->_message);
40 40
         }
41 41
     }
42 42
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
      * @param  EE_messenger $messenger
53 53
      * @return  array                                             new validator config.
54 54
      */
55
-    public static function messenger_validator_config( $validator_config, EE_messenger $messenger ) {
56
-        if ( $messenger->name !== 'email' )
55
+    public static function messenger_validator_config($validator_config, EE_messenger $messenger) {
56
+        if ($messenger->name !== 'email')
57 57
             return $validator_config;
58 58
 
59 59
         $validator_config['content']['shortcodes'][] = 'newsletter';
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
      * @param  EE_messenger $messenger
81 81
      * @return  array                                           new/modified template fields array.
82 82
      */
83
-    public static function messenger_template_fields( $template_fields, EE_messenger $messenger ) {
84
-        if ( $messenger->name !== 'email' )
83
+    public static function messenger_template_fields($template_fields, EE_messenger $messenger) {
84
+        if ($messenger->name !== 'email')
85 85
             return $template_fields;
86 86
 
87 87
         $template_fields['extra']['content']['newsletter_content'] = array(
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
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
caffeinated/modules/mijireh_slurper/EED_Mijireh_Slurper.module.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 	}
111 111
 
112 112
 	/**
113
-	* Return true if the current page is the mijireh checkout page, otherwise return false.
114
-	*
115
-	* @return boolean
116
-	*/
113
+	 * Return true if the current page is the mijireh checkout page, otherwise return false.
114
+	 *
115
+	 * @return boolean
116
+	 */
117 117
 	public static function is_slurp_page() {
118 118
 		global $post;
119 119
 		$isSlurp = false;
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	}
131 131
 
132 132
 	/**
133
-	* adds the callback to adding the slurp page metabox, which shoudl only appear on a page with the {{mj-checkout-form}} "shortcode"
134
-	* @return void
135
-	*/
133
+	 * adds the callback to adding the slurp page metabox, which shoudl only appear on a page with the {{mj-checkout-form}} "shortcode"
134
+	 * @return void
135
+	 */
136 136
 	public static function add_slurp_page_metabox() {
137 137
 		if(self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Mijireh' ) ) ) ){
138 138
 			add_meta_box(
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 	}
148 148
 
149 149
 	/**
150
-	* outputs HTML for displaying the slurping metabox
151
-	* @param WP_Post $post
152
-	* @return void echoes out html
153
-	*/
150
+	 * outputs HTML for displaying the slurping metabox
151
+	 * @param WP_Post $post
152
+	 * @return void echoes out html
153
+	 */
154 154
 	public static function slurp_page_metabox($post) {
155 155
 	   global $wp;
156 156
 	   $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' );
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 	}
169 169
 
170 170
 	/**
171
-	* decides whether to slurp the post indicated by the $post global or not, based entirely
172
-	* on a special arg being in the querystring
173
-	* @return void
174
-	*/
171
+	 * decides whether to slurp the post indicated by the $post global or not, based entirely
172
+	 * on a special arg being in the querystring
173
+	 * @return void
174
+	 */
175 175
 	public static function slurp_or_not(){
176 176
 	  //check if this page has the right mijire 'shortcode' and if they've specified to slurp it
177 177
 	  if(isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()){
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 	}
181 181
 
182 182
 	/**
183
-	* Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the
184
-	* special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status
185
-	*/
183
+	 * Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the
184
+	 * special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status
185
+	 */
186 186
 	public static function slurp_now(){
187 187
 		global $post;
188 188
 		if ( $post->post_status != 'publish' ) {
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
 	 *  @return 	void
50 50
 	 */
51 51
 	public static function set_hooks_admin() {
52
-		define('EED_MIJIREH_SLURPER_PATH',EE_CAFF_PATH.'modules'.DS.'mijireh_slurper'.DS);
53
-		add_action('load-post.php',array('EED_Mijireh_Slurper','set_edit_post_page_hooks'));
54
-		add_action('load-admin.php',array('EED_Mijireh_Slurper','check_for_edit_slurp_page'));
55
-		add_action('AHEE__EE_Mijireh__settings_end',array('EED_Mijireh_Slurper','add_slurp_link_to_gateway'));
52
+		define('EED_MIJIREH_SLURPER_PATH', EE_CAFF_PATH.'modules'.DS.'mijireh_slurper'.DS);
53
+		add_action('load-post.php', array('EED_Mijireh_Slurper', 'set_edit_post_page_hooks'));
54
+		add_action('load-admin.php', array('EED_Mijireh_Slurper', 'check_for_edit_slurp_page'));
55
+		add_action('AHEE__EE_Mijireh__settings_end', array('EED_Mijireh_Slurper', 'add_slurp_link_to_gateway'));
56 56
 	}
57 57
 	/**
58 58
 	 * Merely used to avoid even bothering to add these hooks on pages besides admin's post.php
59 59
 	 */
60
-	public static function set_edit_post_page_hooks(){
61
-		add_action('add_meta_boxes',array('EED_Mijireh_Slurper','add_slurp_page_metabox'));
62
-		add_action('posts_selection',array('EED_Mijireh_Slurper','slurp_or_not'));
63
-		if(get_transient(EED_Mijireh_Slurper::slurp_started_transient_name)){
64
-			add_action( 'admin_notices', array('EED_Mijireh_Slurper', 'slurping_in_progress_notice') );
60
+	public static function set_edit_post_page_hooks() {
61
+		add_action('add_meta_boxes', array('EED_Mijireh_Slurper', 'add_slurp_page_metabox'));
62
+		add_action('posts_selection', array('EED_Mijireh_Slurper', 'slurp_or_not'));
63
+		if (get_transient(EED_Mijireh_Slurper::slurp_started_transient_name)) {
64
+			add_action('admin_notices', array('EED_Mijireh_Slurper', 'slurping_in_progress_notice'));
65 65
 			delete_transient(EED_Mijireh_Slurper::slurp_started_transient_name);
66 66
 		}
67 67
 	}
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	 * Adds the slurping content to the gateway's settings page, because I thought this was best suited to remain in the module's code (because
71 71
 	 * the gateway works fine independent of this module)
72 72
 	 */
73
-	public static function add_slurp_link_to_gateway($existing_content){
74
-		echo EEH_Template::display_template( EED_MIJIREH_SLURPER_PATH.'templates/additional_content_on_gateway.template.php', array(),true ) . $existing_content;
73
+	public static function add_slurp_link_to_gateway($existing_content) {
74
+		echo EEH_Template::display_template(EED_MIJIREH_SLURPER_PATH.'templates/additional_content_on_gateway.template.php', array(), true).$existing_content;
75 75
 	}
76
-	public static function slurping_in_progress_notice(){
77
-		EEH_Template::display_template( EED_MIJIREH_SLURPER_PATH.'templates/slurping_in_progress_notice.template.php', array() );
76
+	public static function slurping_in_progress_notice() {
77
+		EEH_Template::display_template(EED_MIJIREH_SLURPER_PATH.'templates/slurping_in_progress_notice.template.php', array());
78 78
 	}
79 79
 
80 80
 	/**
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	 * need to first make it). If the special arg is present, redirects the user to the slurp page's edit page
84 84
 	 * @return void
85 85
 	 */
86
-	public static function check_for_edit_slurp_page(){
87
-		if(isset($_GET['mijireh_edit_slurp_page']) && $_GET['mijireh_edit_slurp_page'] == 'true'){
86
+	public static function check_for_edit_slurp_page() {
87
+		if (isset($_GET['mijireh_edit_slurp_page']) && $_GET['mijireh_edit_slurp_page'] == 'true') {
88 88
 			//check if we already have a slurping page
89
-			if( ! $slurp_page_id = self::find_slurp_page() ){
89
+			if ( ! $slurp_page_id = self::find_slurp_page()) {
90 90
 				//if no slurp page yet, make one
91 91
 				$slurp_page_id = wp_insert_post(
92 92
 					array(
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 					)
97 97
 				);
98 98
 			}
99
-			wp_redirect(add_query_arg(array('post'=>$slurp_page_id,'action'=>'edit'),admin_url('post.php')));
99
+			wp_redirect(add_query_arg(array('post'=>$slurp_page_id, 'action'=>'edit'), admin_url('post.php')));
100 100
 		}
101 101
 	}
102 102
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 * Gets the post id which has the {{mj-checkout-form}} "shortcode" in it, otherwise null
105 105
 	 * @return int
106 106
 	 */
107
-	public static function find_slurp_page(){
107
+	public static function find_slurp_page() {
108 108
 		global $wpdb;
109 109
 		return $wpdb->get_var("SELECT id FROM {$wpdb->posts} WHERE post_content LIKE '%".EED_Mijireh_Slurper::mijireh_slurper_shortcode."%'");
110 110
 	}
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 	public static function is_slurp_page() {
118 118
 		global $post;
119 119
 		$isSlurp = false;
120
-		if(isset($post) && is_object($post)) {
120
+		if (isset($post) && is_object($post)) {
121 121
 			$content = $post->post_content;
122
-			if( strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode ) !== false ) {
122
+			if (strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode) !== false) {
123 123
 				$isSlurp = true;
124 124
 			}
125 125
 		}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	* @return void
135 135
 	*/
136 136
 	public static function add_slurp_page_metabox() {
137
-		if(self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Mijireh' ) ) ) ){
137
+		if (self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active(EEM_Payment_Method::scope_cart, array(array('PMD_type' => 'Mijireh')))) {
138 138
 			add_meta_box(
139 139
 				'slurp_meta_box', // $id
140 140
 				'Mijireh Page Slurp', // $title
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 	*/
154 154
 	public static function slurp_page_metabox($post) {
155 155
 	   global $wp;
156
-	   $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' );
157
-	   if( $mijireh_payment_method ){
158
-		$access_key = $mijireh_payment_method->get_extra_meta( 'access_key', TRUE );
156
+	   $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Mijireh');
157
+	   if ($mijireh_payment_method) {
158
+		$access_key = $mijireh_payment_method->get_extra_meta('access_key', TRUE);
159 159
 		EEH_Template::display_template(
160 160
 			EED_MIJIREH_SLURPER_PATH.'templates/mijireh_slurp_page_metabox.template.php',
161 161
 			 array(
162 162
 				 'mijireh_image_url'=> $mijireh_payment_method->button_url(),
163 163
 				 'access_key'=>$access_key,
164
-				 'slurp_action_link'=> esc_url_raw( add_query_arg('mijireh_slurp_now','true', add_query_arg( $wp->query_string, '',  '?'.$_SERVER['QUERY_STRING'] )))
164
+				 'slurp_action_link'=> esc_url_raw(add_query_arg('mijireh_slurp_now', 'true', add_query_arg($wp->query_string, '', '?'.$_SERVER['QUERY_STRING'])))
165 165
 			 )
166 166
 		 );
167 167
 	   }
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 	* on a special arg being in the querystring
173 173
 	* @return void
174 174
 	*/
175
-	public static function slurp_or_not(){
175
+	public static function slurp_or_not() {
176 176
 	  //check if this page has the right mijire 'shortcode' and if they've specified to slurp it
177
-	  if(isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()){
177
+	  if (isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()) {
178 178
 		  EED_Mijireh_Slurper::slurp_now();
179 179
 	  }
180 180
 	}
@@ -183,22 +183,22 @@  discard block
 block discarded – undo
183 183
 	* Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the
184 184
 	* special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status
185 185
 	*/
186
-	public static function slurp_now(){
186
+	public static function slurp_now() {
187 187
 		global $post;
188
-		if ( $post->post_status != 'publish' ) {
188
+		if ($post->post_status != 'publish') {
189 189
 			//make sure the post is published at least while slurping
190 190
 			$post->post_status = 'publish';
191 191
 			wp_update_post($post);
192 192
 		}
193
-		$mijireh_gateway = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' );
194
-		$access_key = $mijireh_gateway->get_extra_meta( 'access_key', TRUE );
193
+		$mijireh_gateway = EEM_Payment_Method::instance()->get_one_of_type('Mijireh');
194
+		$access_key = $mijireh_gateway->get_extra_meta('access_key', TRUE);
195 195
 		// 'slurp_url'=>get_permalink($post),
196 196
 		// 'page_id'=>$post->ID,
197 197
 		// 'return_url'=>$return_url
198 198
 		$url = 'https://secure.mijireh.com/api/1/slurps';
199 199
 		$args = array(
200 200
 		  	'headers' => array(
201
-				'Authorization' => 'Basic ' . base64_encode( $access_key . ':' ),
201
+				'Authorization' => 'Basic '.base64_encode($access_key.':'),
202 202
 				'Accept'=>'application/json'
203 203
 			),
204 204
 			'body'=>json_encode(
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 				)
210 210
 			)
211 211
 		);
212
-		$response = wp_remote_post($url,$args);
212
+		$response = wp_remote_post($url, $args);
213 213
 		//now redirect the user back to the same page
214 214
 		$redirect_args = $_GET;
215 215
 		unset($redirect_args['mijireh_slurp_now']);
216
-		$url = add_query_arg($redirect_args,admin_url('post.php'));
217
-		set_transient(EED_Mijireh_Slurper::slurp_started_transient_name,true);
216
+		$url = add_query_arg($redirect_args, admin_url('post.php'));
217
+		set_transient(EED_Mijireh_Slurper::slurp_started_transient_name, true);
218 218
 		// echo "redirect to $url";
219 219
 		wp_redirect($url);
220 220
 	}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 *  @access 	public
226 226
 	 *  @return 	void
227 227
 	 */
228
-	public function run( $WP ) {
228
+	public function run($WP) {
229 229
 	}
230 230
 
231 231
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('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
  *
@@ -122,8 +124,7 @@  discard block
 block discarded – undo
122 124
 			if( strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode ) !== false ) {
123 125
 				$isSlurp = true;
124 126
 			}
125
-		}
126
-		else {
127
+		} else {
127 128
 			// echo '[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Check Slurp Page Failed: " . print_r($post, 1);
128 129
 		}
129 130
 		return $isSlurp;
Please login to merge, or discard this patch.
mijireh_slurper/templates/additional_content_on_gateway.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <tr>
2
-	<th><?php _e("Mijireh Checkout Page Design", 'event_espresso');?><?php echo EEH_Template::get_help_tab_link( 'ee_mijireh_help_tab' ); ?></th>
2
+	<th><?php _e("Mijireh Checkout Page Design", 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link('ee_mijireh_help_tab'); ?></th>
3 3
 	<td>
4
-		<a href="?mijireh_edit_slurp_page=true"><?php _e("Edit Slurp Page", 'event_espresso');?></a>
4
+		<a href="?mijireh_edit_slurp_page=true"><?php _e("Edit Slurp Page", 'event_espresso'); ?></a>
5 5
 	</td>
6 6
 </tr>
7 7
\ No newline at end of file
Please login to merge, or discard this patch.