@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param EE_Messenger_Collection $messengers |
34 | 34 | */ |
35 | - public function __construct( EE_Messenger_Collection $messengers ) { |
|
36 | - $this->set_messenger_collection( $messengers ); |
|
35 | + public function __construct(EE_Messenger_Collection $messengers) { |
|
36 | + $this->set_messenger_collection($messengers); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @param mixed $messengers |
52 | 52 | */ |
53 | - public function set_messenger_collection( EE_Messenger_Collection $messengers ) { |
|
53 | + public function set_messenger_collection(EE_Messenger_Collection $messengers) { |
|
54 | 54 | $this->_messenger_collection = $messengers; |
55 | 55 | } |
56 | 56 | |
@@ -63,41 +63,41 @@ discard block |
||
63 | 63 | * @param string $folder |
64 | 64 | * @throws \EE_Error |
65 | 65 | */ |
66 | - public function load_messengers_from_folder( $folder = '' ) { |
|
66 | + public function load_messengers_from_folder($folder = '') { |
|
67 | 67 | //make sure autoloaders are set (fail-safe) |
68 | 68 | EED_Messages::set_autoloaders(); |
69 | - $folder = ! empty( $folder ) ? $folder : EE_LIBRARIES . 'messages' . DS . 'messenger'; |
|
70 | - $folder .= $folder[ strlen( $folder ) - 1 ] != DS ? DS : ''; |
|
69 | + $folder = ! empty($folder) ? $folder : EE_LIBRARIES.'messages'.DS.'messenger'; |
|
70 | + $folder .= $folder[strlen($folder) - 1] != DS ? DS : ''; |
|
71 | 71 | // get all the files in that folder that end in ".class.php |
72 | 72 | $filepaths = apply_filters( |
73 | 73 | 'FHEE__EE_messages__get_installed__messenger_files', |
74 | - glob( $folder . '*.class.php' ) |
|
74 | + glob($folder.'*.class.php') |
|
75 | 75 | ); |
76 | - if ( empty( $filepaths ) ) { |
|
76 | + if (empty($filepaths)) { |
|
77 | 77 | return; |
78 | 78 | } |
79 | - foreach ( (array) $filepaths as $file_path ) { |
|
79 | + foreach ((array) $filepaths as $file_path) { |
|
80 | 80 | // extract filename from path |
81 | - $file_path = basename( $file_path ); |
|
81 | + $file_path = basename($file_path); |
|
82 | 82 | // now remove any file extensions |
83 | - $messenger_class_name = substr( $file_path, 0, strpos( $file_path, '.' ) ); |
|
83 | + $messenger_class_name = substr($file_path, 0, strpos($file_path, '.')); |
|
84 | 84 | |
85 | 85 | //first check to see if the class name represents an actual messenger class. |
86 | - if ( strpos( strtolower( $messenger_class_name ), 'messenger' ) === false ) { |
|
86 | + if (strpos(strtolower($messenger_class_name), 'messenger') === false) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | |
90 | - if ( ! class_exists( $messenger_class_name ) ) { |
|
90 | + if ( ! class_exists($messenger_class_name)) { |
|
91 | 91 | throw new EE_Error( |
92 | 92 | sprintf( |
93 | - __( 'The "%1$s" messenger class can\'t be loaded from %2$s. Likely there is a typo in the class name or the file name.', 'event_espresso' ), |
|
93 | + __('The "%1$s" messenger class can\'t be loaded from %2$s. Likely there is a typo in the class name or the file name.', 'event_espresso'), |
|
94 | 94 | $messenger_class_name, |
95 | 95 | $file_path |
96 | 96 | ) |
97 | 97 | ); |
98 | 98 | } |
99 | 99 | |
100 | - $this->_load_messenger( new $messenger_class_name() ); |
|
100 | + $this->_load_messenger(new $messenger_class_name()); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | EED_Messages::set_autoloaders(); |
114 | 114 | $active_messengers = apply_filters( |
115 | 115 | 'FHEE__EEH_MSG_Template__get_active_messengers_in_db', |
116 | - get_option( 'ee_active_messengers', array() ) |
|
116 | + get_option('ee_active_messengers', array()) |
|
117 | 117 | ); |
118 | - foreach ( (array) $active_messengers as $active_messenger_classname => $active_messenger ) { |
|
119 | - $this->_load_messenger( $active_messenger ); |
|
118 | + foreach ((array) $active_messengers as $active_messenger_classname => $active_messenger) { |
|
119 | + $this->_load_messenger($active_messenger); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | * @param \EE_messenger $messenger |
129 | 129 | * @return bool |
130 | 130 | */ |
131 | - protected function _load_messenger( EE_messenger $messenger ) { |
|
132 | - if ( $this->messenger_collection()->has_by_name( $messenger->name ) ) { |
|
131 | + protected function _load_messenger(EE_messenger $messenger) { |
|
132 | + if ($this->messenger_collection()->has_by_name($messenger->name)) { |
|
133 | 133 | return true; |
134 | 134 | } |
135 | 135 | return $this->messenger_collection()->add( |
@@ -1,6 +1,6 @@ discard block |
||
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 | /** |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | * @param EE_Registration|array $data |
30 | 30 | * @throws \EE_Error |
31 | 31 | */ |
32 | - public function __construct( $data ) { |
|
32 | + public function __construct($data) { |
|
33 | 33 | $filtered_reg_status = null; |
34 | 34 | |
35 | - if ( ! is_array( $data ) && $data instanceof EE_Registration ) { |
|
35 | + if ( ! is_array($data) && $data instanceof EE_Registration) { |
|
36 | 36 | $this->reg_obj = $data; |
37 | 37 | } else { |
38 | - $this->reg_obj = is_array( $data ) && isset( $data[0] ) && $data[0] instanceof EE_Registration ? $data[0] : null; |
|
39 | - $filtered_reg_status = is_array( $data ) && ! empty( $data[1] ) ? $data[1] : null; |
|
38 | + $this->reg_obj = is_array($data) && isset($data[0]) && $data[0] instanceof EE_Registration ? $data[0] : null; |
|
39 | + $filtered_reg_status = is_array($data) && ! empty($data[1]) ? $data[1] : null; |
|
40 | 40 | } |
41 | 41 | |
42 | - if ( ! $this->reg_obj instanceof EE_Registration ) { |
|
42 | + if ( ! $this->reg_obj instanceof EE_Registration) { |
|
43 | 43 | throw new EE_Error( |
44 | 44 | sprintf( |
45 | - __( '%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'), |
|
45 | + __('%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'), |
|
46 | 46 | 'EE_Messages_REG_incoming_data', |
47 | 47 | 'EE_Registration' |
48 | 48 | ) |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array The prepped data for db |
66 | 66 | */ |
67 | - static public function convert_data_for_persistent_storage( $data ) { |
|
67 | + static public function convert_data_for_persistent_storage($data) { |
|
68 | 68 | $prepped_data = array(); |
69 | - if ( ! is_array( $data ) && $data instanceof EE_Registration ) { |
|
69 | + if ( ! is_array($data) && $data instanceof EE_Registration) { |
|
70 | 70 | $prepped_data['Registration'] = $data->ID(); |
71 | 71 | return $prepped_data; |
72 | - } elseif ( ! is_array( $data ) ) { |
|
72 | + } elseif ( ! is_array($data)) { |
|
73 | 73 | return array(); |
74 | 74 | } else { |
75 | - if ( $data[0] instanceof EE_Registration ) { |
|
75 | + if ($data[0] instanceof EE_Registration) { |
|
76 | 76 | $prepped_data['Registration'] = $data[0]; |
77 | 77 | } |
78 | - if ( ! empty( $data[1] ) ) { |
|
78 | + if ( ! empty($data[1])) { |
|
79 | 79 | $prepped_data['filter'] = $data[1]; |
80 | 80 | } |
81 | 81 | } |
@@ -91,17 +91,17 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return mixed |
93 | 93 | */ |
94 | - static public function convert_data_from_persistent_storage( $data ) { |
|
94 | + static public function convert_data_from_persistent_storage($data) { |
|
95 | 95 | $registration = null; |
96 | 96 | //$data['Registration'] could be either an ID (back compat) or a registration object (prepped using old system). |
97 | - if ( isset( $data[ 'Registration' ] ) ) { |
|
98 | - $registration = $data[ 'Registration' ] instanceof EE_Registration |
|
99 | - ? $data[ 'Registration' ] |
|
100 | - : EEM_Registration::instance()->get_one_by_ID( $data[ 'Registration' ] ); |
|
97 | + if (isset($data['Registration'])) { |
|
98 | + $registration = $data['Registration'] instanceof EE_Registration |
|
99 | + ? $data['Registration'] |
|
100 | + : EEM_Registration::instance()->get_one_by_ID($data['Registration']); |
|
101 | 101 | } |
102 | 102 | $prepped_data = array( |
103 | 103 | 0 => $registration, |
104 | - 1 => isset( $data['filter'] ) ? $data['filter'] : null |
|
104 | + 1 => isset($data['filter']) ? $data['filter'] : null |
|
105 | 105 | ); |
106 | 106 | return $prepped_data; |
107 | 107 | } |
@@ -119,18 +119,18 @@ discard block |
||
119 | 119 | $this->txn = $this->reg_obj->transaction(); |
120 | 120 | //possible session stuff? |
121 | 121 | $session = $this->txn->session_data(); |
122 | - $session_data = $session instanceof EE_Session ? $session->get_session_data() : array(); |
|
122 | + $session_data = $session instanceof EE_Session ? $session->get_session_data() : array(); |
|
123 | 123 | |
124 | 124 | //other data from the session (if possible) |
125 | - $this->user_id = isset( $session_data['user_id'] ) ? $session_data['user_id'] : ''; |
|
126 | - $this->ip_address = isset( $session_data['ip_address'] ) ? $session_data['ip_address'] : ''; |
|
127 | - $this->user_agent = isset( $session_data['user_agent'] ) ? $session_data['user_agent'] : ''; |
|
125 | + $this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : ''; |
|
126 | + $this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : ''; |
|
127 | + $this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : ''; |
|
128 | 128 | $this->init_access = $this->last_access = ''; |
129 | 129 | |
130 | 130 | $this->payment = $this->txn->get_first_related('Payment'); |
131 | 131 | // if there is no payments associated with the transaction |
132 | 132 | // then we just create a default payment object for potential parsing. |
133 | - $this->payment = empty( $this->payment ) |
|
133 | + $this->payment = empty($this->payment) |
|
134 | 134 | ? EE_Payment::new_instance( |
135 | 135 | array( |
136 | 136 | 'STS_ID' => EEM_Payment::status_id_pending, |
@@ -1,7 +1,8 @@ |
||
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_Messages_REG_incoming_data |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'NO direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | * about where to obtain the templates. |
110 | 110 | * |
111 | 111 | */ |
112 | - final private function _set_templates( $template_pack ) { |
|
112 | + final private function _set_templates($template_pack) { |
|
113 | 113 | |
114 | 114 | //get the corresponding template pack object (if present. If not then we just load the default and add a |
115 | 115 | //notice). The class name should be something like 'EE_Messages_Template_Pack_Default' where "default' would be |
116 | 116 | //the incoming template pack reference. |
117 | - $class_name = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $template_pack ) ) ); |
|
117 | + $class_name = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $template_pack))); |
|
118 | 118 | |
119 | - if ( ! class_exists( $class_name ) ) { |
|
119 | + if ( ! class_exists($class_name)) { |
|
120 | 120 | EE_Error::add_error( |
121 | 121 | sprintf( |
122 | 122 | __( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $template_pack = new $class_name; |
136 | 136 | |
137 | 137 | //get all the templates from the template pack. |
138 | - $this->_templates = $template_pack->get_templates( $this->_messenger, $this->_message_type ); |
|
138 | + $this->_templates = $template_pack->get_templates($this->_messenger, $this->_message_type); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -159,15 +159,15 @@ discard block |
||
159 | 159 | public function create_new_templates() { |
160 | 160 | $template_pack = 'default'; |
161 | 161 | //if we have the GRP_ID then let's use that to see if there is a set template pack and use that for the new templates. |
162 | - if ( ! empty( $this->_GRP_ID ) ) { |
|
163 | - $message_template_group = $this->_message_template_group_model->get_one_by_ID( $this->_GRP_ID ); |
|
162 | + if ( ! empty($this->_GRP_ID)) { |
|
163 | + $message_template_group = $this->_message_template_group_model->get_one_by_ID($this->_GRP_ID); |
|
164 | 164 | $template_pack = $message_template_group instanceof EE_Message_Template_Group |
165 | 165 | ? $message_template_group->get_template_pack_name() |
166 | 166 | : 'default'; |
167 | 167 | //we also need to reset the template variation to default |
168 | - $message_template_group->set_template_pack_variation( 'default' ); |
|
168 | + $message_template_group->set_template_pack_variation('default'); |
|
169 | 169 | } |
170 | - return $this->_create_new_templates( $template_pack ); |
|
170 | + return $this->_create_new_templates($template_pack); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | * which will contain information about where to obtain the templates. |
182 | 182 | * @return mixed (array|bool) success array or false. |
183 | 183 | */ |
184 | - protected function _create_new_templates( $template_pack ) { |
|
184 | + protected function _create_new_templates($template_pack) { |
|
185 | 185 | |
186 | - $this->_set_templates( $template_pack ); |
|
186 | + $this->_set_templates($template_pack); |
|
187 | 187 | |
188 | 188 | //necessary properties are set, let's save the default templates |
189 | - if ( empty( $this->_GRP_ID ) ) { |
|
189 | + if (empty($this->_GRP_ID)) { |
|
190 | 190 | $main_template_data = array( |
191 | 191 | 'MTP_messenger' => $this->_messenger->name, |
192 | 192 | 'MTP_message_type' => $this->_message_type->name, |
@@ -197,24 +197,24 @@ discard block |
||
197 | 197 | 'MTP_is_active' => 1, |
198 | 198 | ); |
199 | 199 | //let's insert the above and get our GRP_ID, then reset the template data array to just include the GRP_ID |
200 | - $grp_id = $this->_message_template_group_model->insert( $main_template_data ); |
|
201 | - if ( empty( $grp_id ) ) { |
|
200 | + $grp_id = $this->_message_template_group_model->insert($main_template_data); |
|
201 | + if (empty($grp_id)) { |
|
202 | 202 | return $grp_id; |
203 | 203 | } |
204 | 204 | $this->_GRP_ID = $grp_id; |
205 | 205 | } |
206 | 206 | |
207 | - $template_data = array( 'GRP_ID' => $this->_GRP_ID ); |
|
207 | + $template_data = array('GRP_ID' => $this->_GRP_ID); |
|
208 | 208 | |
209 | - foreach ( $this->_contexts as $context => $details ) { |
|
210 | - foreach ( $this->_fields as $field => $field_type ) { |
|
211 | - if ( $field != 'extra' ) { |
|
209 | + foreach ($this->_contexts as $context => $details) { |
|
210 | + foreach ($this->_fields as $field => $field_type) { |
|
211 | + if ($field != 'extra') { |
|
212 | 212 | $template_data['MTP_context'] = $context; |
213 | 213 | $template_data['MTP_template_field'] = $field; |
214 | - $template_data['MTP_content'] = $this->_templates[ $context ][ $field ]; |
|
214 | + $template_data['MTP_content'] = $this->_templates[$context][$field]; |
|
215 | 215 | |
216 | - $MTP = $this->_message_template_model->insert( $template_data ); |
|
217 | - if ( ! $MTP ) { |
|
216 | + $MTP = $this->_message_template_model->insert($template_data); |
|
217 | + if ( ! $MTP) { |
|
218 | 218 | EE_Error::add_error( |
219 | 219 | sprintf( |
220 | 220 | __( |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | return array( |
240 | 240 | 'GRP_ID' => $this->_GRP_ID, |
241 | - 'MTP_context' => key( $this->_contexts ) |
|
241 | + 'MTP_context' => key($this->_contexts) |
|
242 | 242 | ); |
243 | 243 | } |
244 | 244 |
@@ -32,73 +32,73 @@ |
||
32 | 32 | */ |
33 | 33 | class Socket |
34 | 34 | { |
35 | - private $handle = null; |
|
35 | + private $handle = null; |
|
36 | 36 | |
37 | - /** |
|
38 | - * fsockopen |
|
39 | - * |
|
40 | - * @see http://php.net/fsockopen |
|
41 | - * @param string $hostname |
|
42 | - * @param int $port |
|
43 | - * @param int $errno |
|
44 | - * @param string $errstr |
|
45 | - * @param float $timeout |
|
46 | - * @return resource |
|
47 | - */ |
|
48 | - public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null) |
|
49 | - { |
|
50 | - $this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout)); |
|
37 | + /** |
|
38 | + * fsockopen |
|
39 | + * |
|
40 | + * @see http://php.net/fsockopen |
|
41 | + * @param string $hostname |
|
42 | + * @param int $port |
|
43 | + * @param int $errno |
|
44 | + * @param string $errstr |
|
45 | + * @param float $timeout |
|
46 | + * @return resource |
|
47 | + */ |
|
48 | + public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null) |
|
49 | + { |
|
50 | + $this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout)); |
|
51 | 51 | |
52 | - if ($this->handle != false && $errno === 0 && $errstr === '') { |
|
53 | - return $this->handle; |
|
54 | - } else { |
|
55 | - return false; |
|
56 | - } |
|
57 | - } |
|
52 | + if ($this->handle != false && $errno === 0 && $errstr === '') { |
|
53 | + return $this->handle; |
|
54 | + } else { |
|
55 | + return false; |
|
56 | + } |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * fwrite |
|
61 | - * |
|
62 | - * @see http://php.net/fwrite |
|
63 | - * @param string $string |
|
64 | - * @param int $length |
|
65 | - * @return int | bool |
|
66 | - */ |
|
67 | - public function fwrite($string, $length = null) |
|
68 | - { |
|
69 | - return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length)); |
|
70 | - } |
|
59 | + /** |
|
60 | + * fwrite |
|
61 | + * |
|
62 | + * @see http://php.net/fwrite |
|
63 | + * @param string $string |
|
64 | + * @param int $length |
|
65 | + * @return int | bool |
|
66 | + */ |
|
67 | + public function fwrite($string, $length = null) |
|
68 | + { |
|
69 | + return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length)); |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * fgets |
|
74 | - * |
|
75 | - * @see http://php.net/fgets |
|
76 | - * @param int $length |
|
77 | - */ |
|
78 | - public function fgets($length = null) |
|
79 | - { |
|
80 | - return fgets($this->handle, $length); |
|
81 | - } |
|
72 | + /** |
|
73 | + * fgets |
|
74 | + * |
|
75 | + * @see http://php.net/fgets |
|
76 | + * @param int $length |
|
77 | + */ |
|
78 | + public function fgets($length = null) |
|
79 | + { |
|
80 | + return fgets($this->handle, $length); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * feof |
|
85 | - * |
|
86 | - * @see http://php.net/feof |
|
87 | - * @return bool |
|
88 | - */ |
|
89 | - public function feof() |
|
90 | - { |
|
91 | - return feof($this->handle); |
|
92 | - } |
|
83 | + /** |
|
84 | + * feof |
|
85 | + * |
|
86 | + * @see http://php.net/feof |
|
87 | + * @return bool |
|
88 | + */ |
|
89 | + public function feof() |
|
90 | + { |
|
91 | + return feof($this->handle); |
|
92 | + } |
|
93 | 93 | |
94 | - /** |
|
95 | - * fclose |
|
96 | - * |
|
97 | - * @see http://php.net/fclose |
|
98 | - * @return bool |
|
99 | - */ |
|
100 | - public function fclose() |
|
101 | - { |
|
102 | - return fclose($this->handle); |
|
103 | - } |
|
94 | + /** |
|
95 | + * fclose |
|
96 | + * |
|
97 | + * @see http://php.net/fclose |
|
98 | + * @return bool |
|
99 | + */ |
|
100 | + public function fclose() |
|
101 | + { |
|
102 | + return fclose($this->handle); |
|
103 | + } |
|
104 | 104 | } |
@@ -217,8 +217,7 @@ discard block |
||
217 | 217 | //ok so it wasn't a slug we were passed. try the usual then (ie, it's an object or an ID) |
218 | 218 | try { |
219 | 219 | return parent::ensure_is_obj( $base_class_obj_or_id, $ensure_is_in_db ); |
220 | - } |
|
221 | - catch ( EE_Error $e ) { |
|
220 | + } catch ( EE_Error $e ) { |
|
222 | 221 | //handle it outside the catch |
223 | 222 | } |
224 | 223 | throw new EE_Error( sprintf( __( "'%s' is neither a Payment Method ID, slug, nor object.", "event_espresso" ), $base_class_obj_or_id ) ); |
@@ -283,8 +282,7 @@ discard block |
||
283 | 282 | break; |
284 | 283 | } |
285 | 284 | } |
286 | - } |
|
287 | - catch ( EE_Error $e ) { |
|
285 | + } catch ( EE_Error $e ) { |
|
288 | 286 | $payment_method->set_active( FALSE ); |
289 | 287 | } |
290 | 288 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | /** |
202 | 202 | * Overrides parent ot also check by the slug |
203 | 203 | * @see EEM_Base::ensure_is_obj() |
204 | - * @param string|int|EE_Payment_Method $base_class_obj_or_id |
|
204 | + * @param EE_Payment_Method $base_class_obj_or_id |
|
205 | 205 | * @param boolean $ensure_is_in_db |
206 | 206 | * @return EE_Payment_Method |
207 | 207 | * @throws EE_Error |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | * Note: if an offline payment method was selected on the related transaction then this will have no payment methods returned. |
363 | 363 | * It will ONLY return a payment method for a PAYMENT recorded against the registration. |
364 | 364 | * |
365 | - * @param EE_Registration|int $registration_or_reg_id Either the EE_Registration object or the id for the registration. |
|
366 | - * @return EE_Payment|null |
|
365 | + * @param EE_Registration $registration_or_reg_id Either the EE_Registration object or the id for the registration. |
|
366 | + * @return null|EE_Base_Class |
|
367 | 367 | */ |
368 | 368 | public function get_last_used_for_registration( $registration_or_reg_id ) { |
369 | 369 | $registration_id = EEM_Registration::instance()->ensure_is_ID( $registration_or_reg_id ); |
@@ -294,15 +294,15 @@ discard block |
||
294 | 294 | |
295 | 295 | |
296 | 296 | |
297 | - /** |
|
298 | - * Overrides parent to not only turn wpdb results into EE_Payment_Method objects, |
|
299 | - * but also verifies the payment method type of each is a usable object. If not, |
|
300 | - * deactivate it, sets a notification, and deactivates it |
|
301 | - * |
|
302 | - * @param array $rows |
|
303 | - * @return EE_Payment_Method[] |
|
304 | - * @throws InvalidDataTypeException |
|
305 | - */ |
|
297 | + /** |
|
298 | + * Overrides parent to not only turn wpdb results into EE_Payment_Method objects, |
|
299 | + * but also verifies the payment method type of each is a usable object. If not, |
|
300 | + * deactivate it, sets a notification, and deactivates it |
|
301 | + * |
|
302 | + * @param array $rows |
|
303 | + * @return EE_Payment_Method[] |
|
304 | + * @throws InvalidDataTypeException |
|
305 | + */ |
|
306 | 306 | protected function _create_objects( $rows = array() ) { |
307 | 307 | EE_Registry::instance()->load_lib( 'Payment_Method_Manager' ); |
308 | 308 | $payment_methods = parent::_create_objects( $rows ); |
@@ -319,22 +319,22 @@ discard block |
||
319 | 319 | //only deactivate and notify the admin if the payment is active somewhere |
320 | 320 | $payment_method->deactivate(); |
321 | 321 | $payment_method->save(); |
322 | - do_action( |
|
323 | - 'AHEE__EEM_Payment_Method___create_objects_auto_deactivated_payment_method', |
|
324 | - $payment_method |
|
325 | - ); |
|
326 | - new PersistentAdminNotice( |
|
327 | - 'auto-deactivated-' . $payment_method->type(), |
|
328 | - sprintf( |
|
329 | - __('The payment method %1$s was automatically deactivated because it appears its associated Event Espresso Addon was recently deactivated.%2$sIt can be reactivated on the %3$sPlugins admin page%4$s, then you can reactivate the payment method.', |
|
330 | - 'event_espresso'), |
|
331 | - $payment_method->admin_name(), |
|
332 | - '<br />', |
|
333 | - '<a href="' . admin_url('plugins.php') . '">', |
|
334 | - '</a>' |
|
335 | - ), |
|
336 | - true |
|
337 | - ); |
|
322 | + do_action( |
|
323 | + 'AHEE__EEM_Payment_Method___create_objects_auto_deactivated_payment_method', |
|
324 | + $payment_method |
|
325 | + ); |
|
326 | + new PersistentAdminNotice( |
|
327 | + 'auto-deactivated-' . $payment_method->type(), |
|
328 | + sprintf( |
|
329 | + __('The payment method %1$s was automatically deactivated because it appears its associated Event Espresso Addon was recently deactivated.%2$sIt can be reactivated on the %3$sPlugins admin page%4$s, then you can reactivate the payment method.', |
|
330 | + 'event_espresso'), |
|
331 | + $payment_method->admin_name(), |
|
332 | + '<br />', |
|
333 | + '<a href="' . admin_url('plugins.php') . '">', |
|
334 | + '</a>' |
|
335 | + ), |
|
336 | + true |
|
337 | + ); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | return $usable_payment_methods; |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php use EventEspresso\core\domain\entities\notifications\PersistentAdminNotice; |
2 | 2 | use EventEspresso\core\exceptions\InvalidDataTypeException; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | /** |
8 | 8 | * |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | * @access protected |
41 | 41 | * @return EEM_Payment_Method |
42 | 42 | */ |
43 | - protected function __construct( $timezone = NULL ) { |
|
44 | - $this->singlular_item = __( 'Payment Method', 'event_espresso' ); |
|
45 | - $this->plural_item = __( 'Payment Methods', 'event_espresso' ); |
|
46 | - $this->_tables = array( 'Payment_Method' => new EE_Primary_Table( 'esp_payment_method', 'PMD_ID' ) ); |
|
43 | + protected function __construct($timezone = NULL) { |
|
44 | + $this->singlular_item = __('Payment Method', 'event_espresso'); |
|
45 | + $this->plural_item = __('Payment Methods', 'event_espresso'); |
|
46 | + $this->_tables = array('Payment_Method' => new EE_Primary_Table('esp_payment_method', 'PMD_ID')); |
|
47 | 47 | $this->_fields = array( |
48 | 48 | 'Payment_Method' => array( |
49 | - 'PMD_ID' => new EE_Primary_Key_Int_Field( 'PMD_ID', __( "ID", 'event_espresso' ) ), |
|
50 | - 'PMD_type' => new EE_Plain_Text_Field( 'PMD_type', __( "Payment Method Type", 'event_espresso' ), FALSE, 'Admin_Only' ), |
|
51 | - 'PMD_name' => new EE_Plain_Text_Field( 'PMD_name', __( "Name", 'event_espresso' ), FALSE ), |
|
52 | - 'PMD_desc' => new EE_Post_Content_Field( 'PMD_desc', __( "Description", 'event_espresso' ), FALSE, '' ), |
|
53 | - 'PMD_admin_name' => new EE_Plain_Text_Field( 'PMD_admin_name', __( "Admin-Only Name", 'event_espresso' ), TRUE ), |
|
54 | - 'PMD_admin_desc' => new EE_Post_Content_Field( 'PMD_admin_desc', __( "Admin-Only Description", 'event_espresso' ), TRUE ), |
|
55 | - 'PMD_slug' => new EE_Slug_Field( 'PMD_slug', __( "Slug", 'event_espresso' ), FALSE ), |
|
56 | - 'PMD_order' => new EE_Integer_Field( 'PMD_order', __( "Order", 'event_espresso' ), FALSE, 0 ), |
|
57 | - 'PMD_debug_mode' => new EE_Boolean_Field( 'PMD_debug_mode', __( "Debug Mode On?", 'event_espresso' ), FALSE, FALSE ), |
|
58 | - 'PMD_wp_user' => new EE_WP_User_Field( 'PMD_wp_user', __( "Payment Method Creator ID", 'event_espresso' ), FALSE ), |
|
59 | - 'PMD_open_by_default' => new EE_Boolean_Field( 'PMD_open_by_default', __( "Open by Default?", 'event_espresso' ), FALSE, FALSE ), 'PMD_button_url' => new EE_Plain_Text_Field( 'PMD_button_url', __( "Button URL", 'event_espresso' ), TRUE, '' ), |
|
60 | - 'PMD_scope' => new EE_Serialized_Text_Field( 'PMD_scope', __( "Usable From?", 'event_espresso' ), FALSE, array() ), //possible values currently are 'CART','ADMIN','API' |
|
49 | + 'PMD_ID' => new EE_Primary_Key_Int_Field('PMD_ID', __("ID", 'event_espresso')), |
|
50 | + 'PMD_type' => new EE_Plain_Text_Field('PMD_type', __("Payment Method Type", 'event_espresso'), FALSE, 'Admin_Only'), |
|
51 | + 'PMD_name' => new EE_Plain_Text_Field('PMD_name', __("Name", 'event_espresso'), FALSE), |
|
52 | + 'PMD_desc' => new EE_Post_Content_Field('PMD_desc', __("Description", 'event_espresso'), FALSE, ''), |
|
53 | + 'PMD_admin_name' => new EE_Plain_Text_Field('PMD_admin_name', __("Admin-Only Name", 'event_espresso'), TRUE), |
|
54 | + 'PMD_admin_desc' => new EE_Post_Content_Field('PMD_admin_desc', __("Admin-Only Description", 'event_espresso'), TRUE), |
|
55 | + 'PMD_slug' => new EE_Slug_Field('PMD_slug', __("Slug", 'event_espresso'), FALSE), |
|
56 | + 'PMD_order' => new EE_Integer_Field('PMD_order', __("Order", 'event_espresso'), FALSE, 0), |
|
57 | + 'PMD_debug_mode' => new EE_Boolean_Field('PMD_debug_mode', __("Debug Mode On?", 'event_espresso'), FALSE, FALSE), |
|
58 | + 'PMD_wp_user' => new EE_WP_User_Field('PMD_wp_user', __("Payment Method Creator ID", 'event_espresso'), FALSE), |
|
59 | + 'PMD_open_by_default' => new EE_Boolean_Field('PMD_open_by_default', __("Open by Default?", 'event_espresso'), FALSE, FALSE), 'PMD_button_url' => new EE_Plain_Text_Field('PMD_button_url', __("Button URL", 'event_espresso'), TRUE, ''), |
|
60 | + 'PMD_scope' => new EE_Serialized_Text_Field('PMD_scope', __("Usable From?", 'event_espresso'), FALSE, array()), //possible values currently are 'CART','ADMIN','API' |
|
61 | 61 | ) ); |
62 | 62 | $this->_model_relations = array( |
63 | 63 | // 'Event'=>new EE_HABTM_Relation('Event_Payment_Method'), |
64 | 64 | 'Payment' => new EE_Has_Many_Relation(), |
65 | - 'Currency' => new EE_HABTM_Relation( 'Currency_Payment_Method' ), |
|
65 | + 'Currency' => new EE_HABTM_Relation('Currency_Payment_Method'), |
|
66 | 66 | 'Transaction' => new EE_Has_Many_Relation(), |
67 | 67 | 'WP_User' => new EE_Belongs_To_Relation(), |
68 | 68 | ); |
69 | - parent::__construct( $timezone ); |
|
69 | + parent::__construct($timezone); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * @param string $slug |
77 | 77 | * @return EE_Payment_Method |
78 | 78 | */ |
79 | - public function get_one_by_slug( $slug ) { |
|
80 | - return $this->get_one( array( array( 'PMD_slug' => $slug ) ) ); |
|
79 | + public function get_one_by_slug($slug) { |
|
80 | + return $this->get_one(array(array('PMD_slug' => $slug))); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | return apply_filters( |
92 | 92 | 'FHEE__EEM_Payment_Method__scopes', |
93 | 93 | array( |
94 | - self::scope_cart => __( "Front-end Registration Page", 'event_espresso' ), |
|
95 | - self::scope_admin => __( "Admin Registration Page (no online processing)", 'event_espresso' ) |
|
94 | + self::scope_cart => __("Front-end Registration Page", 'event_espresso'), |
|
95 | + self::scope_admin => __("Admin Registration Page (no online processing)", 'event_espresso') |
|
96 | 96 | ) |
97 | 97 | ); |
98 | 98 | } |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | * @param string $scope like one of EEM_Payment_Method::instance()->scopes() |
105 | 105 | * @return boolean |
106 | 106 | */ |
107 | - public function is_valid_scope( $scope ) { |
|
107 | + public function is_valid_scope($scope) { |
|
108 | 108 | $scopes = $this->scopes(); |
109 | - if ( isset( $scopes[ $scope ] ) ) { |
|
109 | + if (isset($scopes[$scope])) { |
|
110 | 110 | return TRUE; |
111 | 111 | } else { |
112 | 112 | return FALSE; |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | * @throws EE_Error |
123 | 123 | * @return EE_Payment_Method[] |
124 | 124 | */ |
125 | - public function get_all_active( $scope = NULL, $query_params = array() ) { |
|
126 | - if( ! isset( $query_params[ 'order_by' ] ) && ! isset( $query_params[ 'order' ] ) ) { |
|
127 | - $query_params['order_by'] = array( 'PMD_order' => 'ASC', 'PMD_ID' => 'ASC' ); |
|
125 | + public function get_all_active($scope = NULL, $query_params = array()) { |
|
126 | + if ( ! isset($query_params['order_by']) && ! isset($query_params['order'])) { |
|
127 | + $query_params['order_by'] = array('PMD_order' => 'ASC', 'PMD_ID' => 'ASC'); |
|
128 | 128 | } |
129 | - return $this->get_all( $this->_get_query_params_for_all_active( $scope, $query_params ) ); |
|
129 | + return $this->get_all($this->_get_query_params_for_all_active($scope, $query_params)); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * @param array $query_params |
136 | 136 | * @return int |
137 | 137 | */ |
138 | - public function count_active( $scope = NULL, $query_params = array() ){ |
|
139 | - return $this->count( $this->_get_query_params_for_all_active( $scope, $query_params ) ); |
|
138 | + public function count_active($scope = NULL, $query_params = array()) { |
|
139 | + return $this->count($this->_get_query_params_for_all_active($scope, $query_params)); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -147,21 +147,21 @@ discard block |
||
147 | 147 | * @return array like param of EEM_Base::get_all() |
148 | 148 | * @throws EE_Error |
149 | 149 | */ |
150 | - protected function _get_query_params_for_all_active( $scope = NULL, $query_params = array() ){ |
|
151 | - if ( $scope ) { |
|
152 | - if ( $this->is_valid_scope( $scope ) ) { |
|
153 | - return array_replace_recursive( array( array( 'PMD_scope' => array( 'LIKE', "%$scope%" ) ) ), $query_params ); |
|
150 | + protected function _get_query_params_for_all_active($scope = NULL, $query_params = array()) { |
|
151 | + if ($scope) { |
|
152 | + if ($this->is_valid_scope($scope)) { |
|
153 | + return array_replace_recursive(array(array('PMD_scope' => array('LIKE', "%$scope%"))), $query_params); |
|
154 | 154 | } else { |
155 | - throw new EE_Error( sprintf( __( "'%s' is not a valid scope for a payment method", "event_espresso" ), $scope ) ); |
|
155 | + throw new EE_Error(sprintf(__("'%s' is not a valid scope for a payment method", "event_espresso"), $scope)); |
|
156 | 156 | } |
157 | 157 | } else { |
158 | 158 | $acceptable_scopes = array(); |
159 | 159 | $count = 0; |
160 | - foreach ( $this->scopes() as $scope_name => $desc ) { |
|
160 | + foreach ($this->scopes() as $scope_name => $desc) { |
|
161 | 161 | $count++; |
162 | - $acceptable_scopes[ 'PMD_scope*' . $count ] = array( 'LIKE', '%' . $scope_name . '%' ); |
|
162 | + $acceptable_scopes['PMD_scope*'.$count] = array('LIKE', '%'.$scope_name.'%'); |
|
163 | 163 | } |
164 | - return array_replace_recursive( array( array( 'OR*active_scope' => $acceptable_scopes ) ), $query_params ); |
|
164 | + return array_replace_recursive(array(array('OR*active_scope' => $acceptable_scopes)), $query_params); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | * @return array like param of EEM_Base::get_all() |
174 | 174 | * @throws EE_Error |
175 | 175 | */ |
176 | - public function get_query_params_for_all_active( $scope = NULL, $query_params = array() ) { |
|
177 | - return $this->_get_query_params_for_all_active( $scope, $query_params ); |
|
176 | + public function get_query_params_for_all_active($scope = NULL, $query_params = array()) { |
|
177 | + return $this->_get_query_params_for_all_active($scope, $query_params); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | * @param array $query_params |
185 | 185 | * @return EE_Payment_Method |
186 | 186 | */ |
187 | - public function get_one_active( $scope = NULL, $query_params = array() ) { |
|
188 | - return $this->get_one( $this->_get_query_params_for_all_active( $scope, $query_params ) ); |
|
187 | + public function get_one_active($scope = NULL, $query_params = array()) { |
|
188 | + return $this->get_one($this->_get_query_params_for_all_active($scope, $query_params)); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | * @param string $type |
196 | 196 | * @return EE_Payment_Method |
197 | 197 | */ |
198 | - public function get_one_of_type( $type ) { |
|
199 | - return $this->get_one( array( array( 'PMD_type' => $type ) ) ); |
|
198 | + public function get_one_of_type($type) { |
|
199 | + return $this->get_one(array(array('PMD_type' => $type))); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -209,22 +209,22 @@ discard block |
||
209 | 209 | * @return EE_Payment_Method |
210 | 210 | * @throws EE_Error |
211 | 211 | */ |
212 | - public function ensure_is_obj( $base_class_obj_or_id, $ensure_is_in_db = FALSE ) { |
|
212 | + public function ensure_is_obj($base_class_obj_or_id, $ensure_is_in_db = FALSE) { |
|
213 | 213 | //first: check if it's a slug |
214 | - if( is_string( $base_class_obj_or_id ) ) { |
|
215 | - $obj = $this->get_one_by_slug( $base_class_obj_or_id ); |
|
216 | - if( $obj ) { |
|
214 | + if (is_string($base_class_obj_or_id)) { |
|
215 | + $obj = $this->get_one_by_slug($base_class_obj_or_id); |
|
216 | + if ($obj) { |
|
217 | 217 | return $obj; |
218 | 218 | } |
219 | 219 | } |
220 | 220 | //ok so it wasn't a slug we were passed. try the usual then (ie, it's an object or an ID) |
221 | 221 | try { |
222 | - return parent::ensure_is_obj( $base_class_obj_or_id, $ensure_is_in_db ); |
|
222 | + return parent::ensure_is_obj($base_class_obj_or_id, $ensure_is_in_db); |
|
223 | 223 | } |
224 | - catch ( EE_Error $e ) { |
|
224 | + catch (EE_Error $e) { |
|
225 | 225 | //handle it outside the catch |
226 | 226 | } |
227 | - throw new EE_Error( sprintf( __( "'%s' is neither a Payment Method ID, slug, nor object.", "event_espresso" ), $base_class_obj_or_id ) ); |
|
227 | + throw new EE_Error(sprintf(__("'%s' is neither a Payment Method ID, slug, nor object.", "event_espresso"), $base_class_obj_or_id)); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | * @param mixed $base_obj_or_id_or_slug |
236 | 236 | * @return int |
237 | 237 | */ |
238 | - function ensure_is_ID( $base_obj_or_id_or_slug ) { |
|
239 | - if ( is_string( $base_obj_or_id_or_slug ) ) { |
|
238 | + function ensure_is_ID($base_obj_or_id_or_slug) { |
|
239 | + if (is_string($base_obj_or_id_or_slug)) { |
|
240 | 240 | //assume it's a slug |
241 | - $base_obj_or_id_or_slug = $this->get_one_by_slug( $base_obj_or_id_or_slug ); |
|
241 | + $base_obj_or_id_or_slug = $this->get_one_by_slug($base_obj_or_id_or_slug); |
|
242 | 242 | } |
243 | - return parent::ensure_is_ID( $base_obj_or_id_or_slug ); |
|
243 | + return parent::ensure_is_ID($base_obj_or_id_or_slug); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | |
@@ -249,36 +249,36 @@ discard block |
||
249 | 249 | * Verifies the button urls on all the passed payment methods have a valid button url. If not, resets them to their default. |
250 | 250 | * @param EE_Payment_Method[] $payment_methods. If NULL is provided defaults to all payment methods active in the cart |
251 | 251 | */ |
252 | - function verify_button_urls( $payment_methods = NULL ) { |
|
253 | - $payment_methods = is_array( $payment_methods ) ? $payment_methods : $this->get_all_active(EEM_Payment_Method::scope_cart); |
|
254 | - foreach ( $payment_methods as $payment_method ) { |
|
252 | + function verify_button_urls($payment_methods = NULL) { |
|
253 | + $payment_methods = is_array($payment_methods) ? $payment_methods : $this->get_all_active(EEM_Payment_Method::scope_cart); |
|
254 | + foreach ($payment_methods as $payment_method) { |
|
255 | 255 | try { |
256 | 256 | $current_button_url = $payment_method->button_url(); |
257 | - $buttons_urls_to_try = apply_filters( 'FHEE__EEM_Payment_Method__verify_button_urls__button_urls_to_try', array( |
|
258 | - 'current_ssl' => str_replace( "http://", "https://", $current_button_url ), |
|
259 | - 'current' => str_replace( "https://", "http://", $current_button_url ), |
|
260 | - 'default_ssl' => str_replace( "http://", "https://", $payment_method->type_obj()->default_button_url() ), |
|
261 | - 'default' => str_replace( "https://", "http://", $payment_method->type_obj()->default_button_url() ), |
|
262 | - ) ); |
|
263 | - foreach( $buttons_urls_to_try as $button_url_to_try ) { |
|
264 | - if( |
|
257 | + $buttons_urls_to_try = apply_filters('FHEE__EEM_Payment_Method__verify_button_urls__button_urls_to_try', array( |
|
258 | + 'current_ssl' => str_replace("http://", "https://", $current_button_url), |
|
259 | + 'current' => str_replace("https://", "http://", $current_button_url), |
|
260 | + 'default_ssl' => str_replace("http://", "https://", $payment_method->type_obj()->default_button_url()), |
|
261 | + 'default' => str_replace("https://", "http://", $payment_method->type_obj()->default_button_url()), |
|
262 | + )); |
|
263 | + foreach ($buttons_urls_to_try as $button_url_to_try) { |
|
264 | + if ( |
|
265 | 265 | (//this is the current url and it exists, regardless of SSL issues |
266 | 266 | $button_url_to_try == $current_button_url && |
267 | 267 | EEH_URL::remote_file_exists( |
268 | 268 | $button_url_to_try, |
269 | 269 | array( |
270 | 270 | 'sslverify' => false, |
271 | - 'limit_response_size' => 4095,//we don't really care for a full response, but we do want headers at least. Lets just ask for a one block |
|
271 | + 'limit_response_size' => 4095, //we don't really care for a full response, but we do want headers at least. Lets just ask for a one block |
|
272 | 272 | ) ) |
273 | 273 | ) |
274 | 274 | || |
275 | 275 | (//this is NOT the current url and it exists with a working SSL cert |
276 | 276 | $button_url_to_try != $current_button_url && |
277 | - EEH_URL::remote_file_exists( $button_url_to_try ) |
|
277 | + EEH_URL::remote_file_exists($button_url_to_try) |
|
278 | 278 | ) ) { |
279 | - if( $current_button_url != $button_url_to_try ){ |
|
280 | - $payment_method->save( array( 'PMD_button_url' => $button_url_to_try ) ); |
|
281 | - EE_Error::add_attention( sprintf( __( "Payment Method %s's button url was set to %s, because the old image either didnt exist or SSL was recently enabled.", "event_espresso" ), $payment_method->name(), $button_url_to_try ) ); |
|
279 | + if ($current_button_url != $button_url_to_try) { |
|
280 | + $payment_method->save(array('PMD_button_url' => $button_url_to_try)); |
|
281 | + EE_Error::add_attention(sprintf(__("Payment Method %s's button url was set to %s, because the old image either didnt exist or SSL was recently enabled.", "event_espresso"), $payment_method->name(), $button_url_to_try)); |
|
282 | 282 | } |
283 | 283 | //this image exists. So if wasn't set before, now it is; |
284 | 284 | //or if it was already set, we have nothing to do |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | } |
289 | - catch ( EE_Error $e ) { |
|
290 | - $payment_method->set_active( FALSE ); |
|
289 | + catch (EE_Error $e) { |
|
290 | + $payment_method->set_active(FALSE); |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | } |
@@ -303,19 +303,19 @@ discard block |
||
303 | 303 | * @return EE_Payment_Method[] |
304 | 304 | * @throws InvalidDataTypeException |
305 | 305 | */ |
306 | - protected function _create_objects( $rows = array() ) { |
|
307 | - EE_Registry::instance()->load_lib( 'Payment_Method_Manager' ); |
|
308 | - $payment_methods = parent::_create_objects( $rows ); |
|
306 | + protected function _create_objects($rows = array()) { |
|
307 | + EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
|
308 | + $payment_methods = parent::_create_objects($rows); |
|
309 | 309 | /* @var $payment_methods EE_Payment_Method[] */ |
310 | 310 | $usable_payment_methods = array(); |
311 | - foreach ( $payment_methods as $key => $payment_method ) { |
|
312 | - if ( EE_Payment_Method_Manager::instance()->payment_method_type_exists( $payment_method->type() ) ) { |
|
313 | - $usable_payment_methods[ $key ] = $payment_method; |
|
311 | + foreach ($payment_methods as $key => $payment_method) { |
|
312 | + if (EE_Payment_Method_Manager::instance()->payment_method_type_exists($payment_method->type())) { |
|
313 | + $usable_payment_methods[$key] = $payment_method; |
|
314 | 314 | //some payment methods enqueue their scripts in EE_PMT_*::__construct |
315 | 315 | //which is kinda a no-no (just because it's being constructed doesn't mean we need to enqueue |
316 | 316 | //its scripts). but for backwards-compat we should continue to do that |
317 | 317 | $payment_method->type_obj(); |
318 | - } elseif( $payment_method->active() ) { |
|
318 | + } elseif ($payment_method->active()) { |
|
319 | 319 | //only deactivate and notify the admin if the payment is active somewhere |
320 | 320 | $payment_method->deactivate(); |
321 | 321 | $payment_method->save(); |
@@ -324,13 +324,13 @@ discard block |
||
324 | 324 | $payment_method |
325 | 325 | ); |
326 | 326 | new PersistentAdminNotice( |
327 | - 'auto-deactivated-' . $payment_method->type(), |
|
327 | + 'auto-deactivated-'.$payment_method->type(), |
|
328 | 328 | sprintf( |
329 | 329 | __('The payment method %1$s was automatically deactivated because it appears its associated Event Espresso Addon was recently deactivated.%2$sIt can be reactivated on the %3$sPlugins admin page%4$s, then you can reactivate the payment method.', |
330 | 330 | 'event_espresso'), |
331 | 331 | $payment_method->admin_name(), |
332 | 332 | '<br />', |
333 | - '<a href="' . admin_url('plugins.php') . '">', |
|
333 | + '<a href="'.admin_url('plugins.php').'">', |
|
334 | 334 | '</a>' |
335 | 335 | ), |
336 | 336 | true |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | * @param string $scope @see EEM_Payment_Method::get_all_for_events |
351 | 351 | * @return EE_Payment_Method[] |
352 | 352 | */ |
353 | - public function get_all_for_transaction( $transaction, $scope ) { |
|
353 | + public function get_all_for_transaction($transaction, $scope) { |
|
354 | 354 | //give addons a chance to override what payment methods are chosen based on the transaction |
355 | 355 | return apply_filters( |
356 | 356 | 'FHEE__EEM_Payment_Method__get_all_for_transaction__payment_methods', |
357 | - $this->get_all_active( $scope, array( 'group_by' => 'PMD_type' ) ), |
|
357 | + $this->get_all_active($scope, array('group_by' => 'PMD_type')), |
|
358 | 358 | $transaction, |
359 | 359 | $scope |
360 | 360 | ); |
@@ -370,16 +370,16 @@ discard block |
||
370 | 370 | * @param EE_Registration|int $registration_or_reg_id Either the EE_Registration object or the id for the registration. |
371 | 371 | * @return EE_Payment|null |
372 | 372 | */ |
373 | - public function get_last_used_for_registration( $registration_or_reg_id ) { |
|
374 | - $registration_id = EEM_Registration::instance()->ensure_is_ID( $registration_or_reg_id ); |
|
373 | + public function get_last_used_for_registration($registration_or_reg_id) { |
|
374 | + $registration_id = EEM_Registration::instance()->ensure_is_ID($registration_or_reg_id); |
|
375 | 375 | |
376 | 376 | $query_params = array( |
377 | 377 | 0 => array( |
378 | 378 | 'Payment.Registration.REG_ID' => $registration_id, |
379 | 379 | ), |
380 | - 'order_by' => array( 'Payment.PAY_ID' => 'DESC' ) |
|
380 | + 'order_by' => array('Payment.PAY_ID' => 'DESC') |
|
381 | 381 | ); |
382 | - return $this->get_one( $query_params ); |
|
382 | + return $this->get_one($query_params); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param mixed $info |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | - public function add( $object, $info = null ) { |
|
43 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | - return parent::add( $object, $info ); |
|
42 | + public function add($object, $info = null) { |
|
43 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | + return parent::add($object, $info); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param mixed $info |
58 | 58 | * @return bool |
59 | 59 | */ |
60 | - public function set_info( $object, $info = null ) { |
|
61 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | - return parent::set_info( $object, $info ); |
|
60 | + public function set_info($object, $info = null) { |
|
61 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | + return parent::set_info($object, $info); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @param mixed |
75 | 75 | * @return null | object |
76 | 76 | */ |
77 | - public function get_by_info( $info ) { |
|
78 | - return parent::get_by_info( str_replace( ' ', '_', strtolower( $info ) ) ); |
|
77 | + public function get_by_info($info) { |
|
78 | + return parent::get_by_info(str_replace(' ', '_', strtolower($info))); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param object $object |
90 | 90 | * @return bool |
91 | 91 | */ |
92 | - public function has( $object ) { |
|
93 | - return parent::has( $object ); |
|
92 | + public function has($object) { |
|
93 | + return parent::has($object); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param string $message_type_name |
105 | 105 | * @return bool |
106 | 106 | */ |
107 | - public function has_by_name( $message_type_name ) { |
|
108 | - return $this->get_by_info( $message_type_name ) instanceof $this->interface ? true : false; |
|
107 | + public function has_by_name($message_type_name) { |
|
108 | + return $this->get_by_info($message_type_name) instanceof $this->interface ? true : false; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @param $object |
120 | 120 | * @return bool |
121 | 121 | */ |
122 | - public function remove( $object ) { |
|
123 | - return parent::remove( $object ); |
|
122 | + public function remove($object) { |
|
123 | + return parent::remove($object); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | * @param $object |
135 | 135 | * @return void |
136 | 136 | */ |
137 | - public function set_current( $object ) { |
|
138 | - parent::set_current( $object ); |
|
137 | + public function set_current($object) { |
|
138 | + parent::set_current($object); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | * @param $info |
150 | 150 | * @return void |
151 | 151 | */ |
152 | - public function set_current_by_info( $info ) { |
|
153 | - parent::set_current_by_info( $info ); |
|
152 | + public function set_current_by_info($info) { |
|
153 | + parent::set_current_by_info($info); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -164,10 +164,10 @@ discard block |
||
164 | 164 | * @return void |
165 | 165 | */ |
166 | 166 | public function show_collection_classes() { |
167 | - if ( WP_DEBUG ) { |
|
167 | + if (WP_DEBUG) { |
|
168 | 168 | $this->rewind(); |
169 | - while ( $this->valid() ) { |
|
170 | - echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : <span style="color:#E76700">' . $this->getInfo() . '</span></h5>'; |
|
169 | + while ($this->valid()) { |
|
170 | + echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : <span style="color:#E76700">'.$this->getInfo().'</span></h5>'; |
|
171 | 171 | $this->next(); |
172 | 172 | } |
173 | 173 | } |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * by calling EE_Object_Collection::set_info() |
36 | 36 | * |
37 | 37 | * @access public |
38 | - * @param object $object |
|
39 | - * @param mixed $info |
|
38 | + * @param EE_message_type $object |
|
39 | + * @param string $info |
|
40 | 40 | * @return bool |
41 | 41 | */ |
42 | 42 | public function add( $object, $info = null ) { |
@@ -72,6 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @access public |
74 | 74 | * @param mixed |
75 | + * @param string $info |
|
75 | 76 | * @return null | object |
76 | 77 | */ |
77 | 78 | public function get_by_info( $info ) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param mixed $info |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | - public function add( $object, $info = null ) { |
|
43 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | - return parent::add( $object, $info ); |
|
42 | + public function add($object, $info = null) { |
|
43 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | + return parent::add($object, $info); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param mixed $info |
58 | 58 | * @return bool |
59 | 59 | */ |
60 | - public function set_info( $object, $info = null ) { |
|
61 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | - return parent::set_info( $object, $info ); |
|
60 | + public function set_info($object, $info = null) { |
|
61 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | + return parent::set_info($object, $info); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @param mixed |
75 | 75 | * @return null | object |
76 | 76 | */ |
77 | - public function get_by_info( $info ) { |
|
78 | - return parent::get_by_info( str_replace( ' ', '_', strtolower( $info ) ) ); |
|
77 | + public function get_by_info($info) { |
|
78 | + return parent::get_by_info(str_replace(' ', '_', strtolower($info))); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param object $object |
90 | 90 | * @return bool |
91 | 91 | */ |
92 | - public function has( $object ) { |
|
93 | - return parent::has( $object ); |
|
92 | + public function has($object) { |
|
93 | + return parent::has($object); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param string $messenger_name |
105 | 105 | * @return bool |
106 | 106 | */ |
107 | - public function has_by_name( $messenger_name ) { |
|
108 | - return $this->get_by_info( $messenger_name ) instanceof $this->interface ? true : false; |
|
107 | + public function has_by_name($messenger_name) { |
|
108 | + return $this->get_by_info($messenger_name) instanceof $this->interface ? true : false; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @param $object |
120 | 120 | * @return bool |
121 | 121 | */ |
122 | - public function remove( $object ) { |
|
123 | - return parent::remove( $object ); |
|
122 | + public function remove($object) { |
|
123 | + return parent::remove($object); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | * @param $object |
149 | 149 | * @return void |
150 | 150 | */ |
151 | - public function set_current( $object ) { |
|
152 | - parent::set_current( $object ); |
|
151 | + public function set_current($object) { |
|
152 | + parent::set_current($object); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | * @param $info |
164 | 164 | * @return void |
165 | 165 | */ |
166 | - public function set_current_by_info( $info ) { |
|
167 | - parent::set_current_by_info( $info ); |
|
166 | + public function set_current_by_info($info) { |
|
167 | + parent::set_current_by_info($info); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | * @return void |
179 | 179 | */ |
180 | 180 | public function show_collection_classes() { |
181 | - if ( WP_DEBUG ) { |
|
181 | + if (WP_DEBUG) { |
|
182 | 182 | $this->rewind(); |
183 | - while ( $this->valid() ) { |
|
184 | - echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>'; |
|
183 | + while ($this->valid()) { |
|
184 | + echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : . <span style="color:#E76700">'.$this->getInfo().'</span></h5>'; |
|
185 | 185 | $this->next(); |
186 | 186 | } |
187 | 187 | } |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * by calling EE_Object_Collection::set_info() |
36 | 36 | * |
37 | 37 | * @access public |
38 | - * @param object $object |
|
39 | - * @param mixed $info |
|
38 | + * @param EE_messenger $object |
|
39 | + * @param string $info |
|
40 | 40 | * @return bool |
41 | 41 | */ |
42 | 42 | public function add( $object, $info = null ) { |
@@ -72,6 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @access public |
74 | 74 | * @param mixed |
75 | + * @param string $info |
|
75 | 76 | * @return null | object |
76 | 77 | */ |
77 | 78 | public function get_by_info( $info ) { |
@@ -40,8 +40,11 @@ discard block |
||
40 | 40 | <?php echo do_shortcode( $venue_description ); ?> |
41 | 41 | </p> |
42 | 42 | <?php endif; ?> |
43 | - <?php else : ?> |
|
44 | - <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?> |
|
43 | + <?php else { |
|
44 | + : ?> |
|
45 | + <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); |
|
46 | +} |
|
47 | +?> |
|
45 | 48 | <?php if ( $venue_excerpt ) : ?> |
46 | 49 | <p> |
47 | 50 | <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
@@ -53,12 +56,15 @@ discard block |
||
53 | 56 | <!-- .espresso-venue-dv --> |
54 | 57 | <?php |
55 | 58 | do_action( 'AHEE_event_details_after_venue_details', $post ); |
56 | -else : |
|
59 | +else { |
|
60 | + : |
|
57 | 61 | if ( espresso_venue_is_password_protected() ) : |
58 | 62 | ?> |
59 | 63 | <div class="espresso-venue-dv espresso-password-protected-venue-dv" > |
60 | 64 | <h3 class="event-venues-h3 ee-event-h3"> |
61 | - <?php _e( 'Location', 'event_espresso' );?> |
|
65 | + <?php _e( 'Location', 'event_espresso' ); |
|
66 | +} |
|
67 | +?> |
|
62 | 68 | </h3> |
63 | 69 | <?php echo espresso_password_protected_venue_form(); ?> |
64 | 70 | </div> |
@@ -1,66 +1,66 @@ |
||
1 | 1 | <?php |
2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
3 | 3 | if ( |
4 | - ( is_single() && espresso_display_venue_in_event_details() ) |
|
5 | - || ( is_archive() && espresso_display_venue_in_event_list() ) |
|
4 | + (is_single() && espresso_display_venue_in_event_details()) |
|
5 | + || (is_archive() && espresso_display_venue_in_event_list()) |
|
6 | 6 | ) : |
7 | 7 | global $post; |
8 | - do_action( 'AHEE_event_details_before_venue_details', $post ); |
|
9 | - $venue_name = espresso_venue_name( 0, 'details', FALSE ); |
|
10 | - if ( empty( $venue_name ) && espresso_is_venue_private() ) { |
|
11 | - do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
8 | + do_action('AHEE_event_details_before_venue_details', $post); |
|
9 | + $venue_name = espresso_venue_name(0, 'details', FALSE); |
|
10 | + if (empty($venue_name) && espresso_is_venue_private()) { |
|
11 | + do_action('AHEE_event_details_after_venue_details', $post); |
|
12 | 12 | return ''; |
13 | 13 | } |
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>"> |
17 | - <h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
17 | + <h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
18 | 18 | <p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p> |
19 | -<?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?> |
|
19 | +<?php if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?> |
|
20 | 20 | <p> |
21 | - <span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?> |
|
21 | + <span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?> |
|
22 | 22 | </p> |
23 | -<?php endif; ?> |
|
24 | -<?php if ( $venue_website = espresso_venue_website( $post->ID, FALSE )) : ?> |
|
23 | +<?php endif; ?> |
|
24 | +<?php if ($venue_website = espresso_venue_website($post->ID, FALSE)) : ?> |
|
25 | 25 | <p> |
26 | - <span class="small-text"><strong><?php _e( 'Venue Website:', 'event_espresso' ); ?></strong></span> <?php echo $venue_website; ?> |
|
26 | + <span class="small-text"><strong><?php _e('Venue Website:', 'event_espresso'); ?></strong></span> <?php echo $venue_website; ?> |
|
27 | 27 | </p> |
28 | 28 | <?php endif; ?> |
29 | -<?php if ( espresso_venue_has_address( $post->ID )) : ?> |
|
30 | - <strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong> |
|
31 | - <?php espresso_venue_address( 'inline' ); ?> |
|
32 | - <?php espresso_venue_gmap( $post->ID ); ?> |
|
29 | +<?php if (espresso_venue_has_address($post->ID)) : ?> |
|
30 | + <strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong> |
|
31 | + <?php espresso_venue_address('inline'); ?> |
|
32 | + <?php espresso_venue_gmap($post->ID); ?> |
|
33 | 33 | <div class="clear"><br/></div> |
34 | -<?php endif; ?> |
|
34 | +<?php endif; ?> |
|
35 | 35 | |
36 | - <?php $VNU_ID = espresso_venue_id( $post->ID ); ?> |
|
37 | - <?php if ( is_single() ) : ?> |
|
38 | - <?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?> |
|
39 | - <?php if ( $venue_description ) : ?> |
|
36 | + <?php $VNU_ID = espresso_venue_id($post->ID); ?> |
|
37 | + <?php if (is_single()) : ?> |
|
38 | + <?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?> |
|
39 | + <?php if ($venue_description) : ?> |
|
40 | 40 | <p> |
41 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
42 | - <?php echo do_shortcode( $venue_description ); ?> |
|
41 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
42 | + <?php echo do_shortcode($venue_description); ?> |
|
43 | 43 | </p> |
44 | - <?php endif; ?> |
|
44 | + <?php endif; ?> |
|
45 | 45 | <?php else : ?> |
46 | - <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?> |
|
47 | - <?php if ( $venue_excerpt ) : ?> |
|
46 | + <?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?> |
|
47 | + <?php if ($venue_excerpt) : ?> |
|
48 | 48 | <p> |
49 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
49 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
50 | 50 | <?php echo $venue_excerpt; ?> |
51 | 51 | </p> |
52 | - <?php endif; ?> |
|
53 | - <?php endif; ?> |
|
52 | + <?php endif; ?> |
|
53 | + <?php endif; ?> |
|
54 | 54 | </div> |
55 | 55 | <!-- .espresso-venue-dv --> |
56 | 56 | <?php |
57 | -do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
57 | +do_action('AHEE_event_details_after_venue_details', $post); |
|
58 | 58 | else : |
59 | - if ( espresso_venue_is_password_protected() ) : |
|
59 | + if (espresso_venue_is_password_protected()) : |
|
60 | 60 | ?> |
61 | 61 | <div class="espresso-venue-dv espresso-password-protected-venue-dv" > |
62 | 62 | <h3 class="event-venues-h3 ee-event-h3"> |
63 | - <?php _e( 'Location', 'event_espresso' );?> |
|
63 | + <?php _e('Location', 'event_espresso'); ?> |
|
64 | 64 | </h3> |
65 | 65 | <?php echo espresso_password_protected_venue_form(); ?> |
66 | 66 | </div> |
@@ -1,5 +1,5 @@ discard block |
||
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 | /** |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class EE_Year_Input extends EE_Select_Input{ |
|
27 | +class EE_Year_Input extends EE_Select_Input { |
|
28 | 28 | |
29 | - function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0 ){ |
|
30 | - if($four_digit_year){ |
|
29 | + function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0) { |
|
30 | + if ($four_digit_year) { |
|
31 | 31 | $current_year_int = intval(date('Y')); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | $current_year_int = intval(date('y')); |
34 | 34 | } |
35 | 35 | $answer_options = array(); |
36 | - for( $start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++){ |
|
36 | + for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
37 | 37 | $answer_options[$start] = $start; |
38 | 38 | } |
39 | - parent::__construct( $answer_options, $input_settings ); |
|
39 | + parent::__construct($answer_options, $input_settings); |
|
40 | 40 | } |
41 | 41 | } |
@@ -1,6 +1,7 @@ discard block |
||
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 |
@@ -29,7 +30,7 @@ discard block |
||
29 | 30 | function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0 ){ |
30 | 31 | if($four_digit_year){ |
31 | 32 | $current_year_int = intval(date('Y')); |
32 | - }else{ |
|
33 | + } else{ |
|
33 | 34 | $current_year_int = intval(date('y')); |
34 | 35 | } |
35 | 36 | $answer_options = array(); |