@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base{ |
|
2 | +class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base { |
|
3 | 3 | |
4 | 4 | |
5 | 5 | |
@@ -7,32 +7,32 @@ discard block |
||
7 | 7 | * |
8 | 8 | * @return string of html to display the field |
9 | 9 | */ |
10 | - function display(){ |
|
10 | + function display() { |
|
11 | 11 | $input = $this->_input; |
12 | 12 | $raw_value = maybe_serialize($input->raw_value()); |
13 | - if( $input instanceof EE_Text_Area_Input ) { |
|
13 | + if ($input instanceof EE_Text_Area_Input) { |
|
14 | 14 | $rows = $input->get_rows(); |
15 | 15 | $cols = $input->get_cols(); |
16 | - }else{ |
|
16 | + } else { |
|
17 | 17 | $rows = 4; |
18 | 18 | $cols = 20; |
19 | 19 | } |
20 | 20 | $html = '<textarea'; |
21 | - $html .= ' id="' . $input->html_id() . '"'; |
|
22 | - $html .= ' name="' . $input->html_name() . '"'; |
|
23 | - $html .= ' class="' . $input->html_class() . '"' ; |
|
24 | - $html .= ' style="' . $input->html_style() . '"'; |
|
21 | + $html .= ' id="'.$input->html_id().'"'; |
|
22 | + $html .= ' name="'.$input->html_name().'"'; |
|
23 | + $html .= ' class="'.$input->html_class().'"'; |
|
24 | + $html .= ' style="'.$input->html_style().'"'; |
|
25 | 25 | $html .= $input->other_html_attributes(); |
26 | - $html .= ' rows= "' . $rows . '" cols="' . $cols . '">'; |
|
26 | + $html .= ' rows= "'.$rows.'" cols="'.$cols.'">'; |
|
27 | 27 | $html .= $raw_value; |
28 | 28 | $html .= '</textarea>'; |
29 | - foreach ( $this->_input->get_validation_strategies() as $validation_strategy ) { |
|
29 | + foreach ($this->_input->get_validation_strategies() as $validation_strategy) { |
|
30 | 30 | if ( |
31 | 31 | $validation_strategy instanceof EE_Simple_HTML_Validation_Strategy |
32 | 32 | || $validation_strategy instanceof EE_Full_HTML_Validation_Strategy |
33 | 33 | ) { |
34 | 34 | $html .= sprintf( |
35 | - __( '%1$s(allowed tags: %2$s)%3$s', 'event_espresso' ), |
|
35 | + __('%1$s(allowed tags: %2$s)%3$s', 'event_espresso'), |
|
36 | 36 | '<p class="ee-question-desc">', |
37 | 37 | $validation_strategy->get_list_of_allowed_tags(), |
38 | 38 | '</p>' |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * Class EE_Radio_Button_Display_Strategy |
4 | 4 | * displays a set of radio buttons |
@@ -15,34 +15,34 @@ discard block |
||
15 | 15 | * @throws EE_Error |
16 | 16 | * @return string of html to display the field |
17 | 17 | */ |
18 | - public function display(){ |
|
18 | + public function display() { |
|
19 | 19 | $input = $this->get_input(); |
20 | 20 | $input->set_label_sizes(); |
21 | 21 | $label_size_class = $input->get_label_size_class(); |
22 | 22 | $html = ''; |
23 | - foreach( $input->options() as $value => $display_text ){ |
|
24 | - $value = $input->get_normalization_strategy()->unnormalize( $value ); |
|
23 | + foreach ($input->options() as $value => $display_text) { |
|
24 | + $value = $input->get_normalization_strategy()->unnormalize($value); |
|
25 | 25 | |
26 | - $html_id = $this->get_sub_input_id( $value ); |
|
27 | - $html .= EEH_HTML::nl( 0, 'radio' ); |
|
28 | - $html .= '<label for="' . $html_id . '"'; |
|
29 | - $html .= ' id="' . $html_id . '-lbl"'; |
|
30 | - $html .= ' class="ee-radio-label-after' . $label_size_class . '">'; |
|
31 | - $html .= EEH_HTML::nl( 1, 'radio' ); |
|
32 | - $html .= '<input id="' . $html_id . '"'; |
|
33 | - $html .= ' name="' . $input->html_name() . '"'; |
|
34 | - $html .= ' class="' . $input->html_class() . '"'; |
|
35 | - $html .= ' style="' . $input->html_style() . '"'; |
|
26 | + $html_id = $this->get_sub_input_id($value); |
|
27 | + $html .= EEH_HTML::nl(0, 'radio'); |
|
28 | + $html .= '<label for="'.$html_id.'"'; |
|
29 | + $html .= ' id="'.$html_id.'-lbl"'; |
|
30 | + $html .= ' class="ee-radio-label-after'.$label_size_class.'">'; |
|
31 | + $html .= EEH_HTML::nl(1, 'radio'); |
|
32 | + $html .= '<input id="'.$html_id.'"'; |
|
33 | + $html .= ' name="'.$input->html_name().'"'; |
|
34 | + $html .= ' class="'.$input->html_class().'"'; |
|
35 | + $html .= ' style="'.$input->html_style().'"'; |
|
36 | 36 | $html .= ' type="radio"'; |
37 | - $html .= ' value="' . esc_attr( $value ) . '"'; |
|
37 | + $html .= ' value="'.esc_attr($value).'"'; |
|
38 | 38 | $html .= $input->raw_value() === $value ? ' checked="checked"' : ''; |
39 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
39 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
40 | 40 | $html .= '> '; |
41 | 41 | $html .= $display_text; |
42 | - $html .= EEH_HTML::nl( -1, 'radio' ) . '</label>'; |
|
42 | + $html .= EEH_HTML::nl( -1, 'radio' ).'</label>'; |
|
43 | 43 | |
44 | 44 | } |
45 | - $html .= EEH_HTML::div( '', '', 'clear-float' ); |
|
45 | + $html .= EEH_HTML::div('', '', 'clear-float'); |
|
46 | 46 | $html .= EEH_HTML::divx(); |
47 | 47 | return $html; |
48 | 48 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base{ |
|
11 | +class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * return EE_Admin_File_Uploader_Display_Strategy |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * Besides that, no special consideration should be required to make the media uploader appear, besides having |
30 | 30 | * this input displayed. |
31 | 31 | */ |
32 | - static function enqueue_scripts(){ |
|
32 | + static function enqueue_scripts() { |
|
33 | 33 | wp_enqueue_media(); |
34 | 34 | wp_enqueue_script('media-upload'); |
35 | - wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
35 | + wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -42,19 +42,19 @@ discard block |
||
42 | 42 | * @return string of html to display the field |
43 | 43 | */ |
44 | 44 | |
45 | - function display(){ |
|
45 | + function display() { |
|
46 | 46 | // the actual input |
47 | 47 | $input = '<input type="text" size="34" '; |
48 | - $input .= 'name="' . $this->_input->html_name() . '" '; |
|
49 | - $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" '; |
|
50 | - $input .= 'value="' . $this->_input->raw_value_in_form() . '" '; |
|
51 | - $input .= $this->_input->other_html_attributes() . '>'; |
|
48 | + $input .= 'name="'.$this->_input->html_name().'" '; |
|
49 | + $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" '; |
|
50 | + $input .= 'value="'.$this->_input->raw_value_in_form().'" '; |
|
51 | + $input .= $this->_input->other_html_attributes().'>'; |
|
52 | 52 | // image uploader |
53 | - $uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' ); |
|
53 | + $uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload'); |
|
54 | 54 | //only attempt to show the image if it at least exists |
55 | - $image = $this->src_exists( $this->_input->raw_value() ) ? EEH_HTML::br(2) . EEH_HTML::img( $this->_input->raw_value(), __( 'logo', 'event_espresso' ), '', 'ee_media_image' ) : ''; |
|
55 | + $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : ''; |
|
56 | 56 | // html string |
57 | - return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' ); |
|
57 | + return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | * @param string $src |
66 | 66 | * @return boolean |
67 | 67 | */ |
68 | - protected function src_exists( $src ){ |
|
69 | - $results = wp_remote_head( $src ); |
|
70 | - if( is_array( $results) && ! $results instanceof WP_Error){ |
|
71 | - return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
|
72 | - }else{ |
|
68 | + protected function src_exists($src) { |
|
69 | + $results = wp_remote_head($src); |
|
70 | + if (is_array($results) && ! $results instanceof WP_Error) { |
|
71 | + return strpos($results['headers']['content-type'], "image") !== FALSE; |
|
72 | + } else { |
|
73 | 73 | return FALSE; |
74 | 74 | } |
75 | 75 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param WP $WP |
20 | 20 | * @return void |
21 | 21 | */ |
22 | - public function run( WP $WP ) {} |
|
22 | + public function run(WP $WP) {} |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $attributes |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function process_shortcode( $attributes = array() ) { |
|
72 | + public function process_shortcode($attributes = array()) { |
|
73 | 73 | |
74 | 74 | //set default attributes |
75 | 75 | $default_shortcode_attributes = array( |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $default_shortcode_attributes |
87 | 87 | ); |
88 | 88 | // grab attributes and merge with defaults, then extract |
89 | - $attributes = array_merge( (array) $default_shortcode_attributes, (array) $attributes ); |
|
89 | + $attributes = array_merge((array) $default_shortcode_attributes, (array) $attributes); |
|
90 | 90 | |
91 | 91 | $template_args = array( |
92 | 92 | 'contacts' => array(), |
@@ -102,31 +102,31 @@ discard block |
||
102 | 102 | $error = false; |
103 | 103 | |
104 | 104 | //what event? |
105 | - if ( empty( $attributes['event_id'] ) && empty( $attributes['datetime_id'] ) && empty( $attributes['ticket_id'] ) ) { |
|
105 | + if (empty($attributes['event_id']) && empty($attributes['datetime_id']) && empty($attributes['ticket_id'])) { |
|
106 | 106 | //seems like is_espresso_event_single() isn't working as expected. So using alternate method. |
107 | - if ( is_single() && is_espresso_event() ) { |
|
107 | + if (is_single() && is_espresso_event()) { |
|
108 | 108 | $event = EEH_Event_View::get_event(); |
109 | - if ( $event instanceof EE_Event ) { |
|
109 | + if ($event instanceof EE_Event) { |
|
110 | 110 | $template_args['event'] = $event; |
111 | 111 | $query[0]['Registration.EVT_ID'] = $event->ID(); |
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | //try getting the earliest active event if none then get the |
115 | - $events = EEM_Event::instance()->get_active_events( array( 'limit' => 1, |
|
116 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
117 | - ) ); |
|
118 | - $events = empty( $events ) ? EEM_Event::instance()->get_upcoming_events( array( 'limit' => 1, |
|
119 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
120 | - ) ) : $events; |
|
121 | - $event = reset( $events ); |
|
122 | - if ( $event instanceof EE_Event ) { |
|
115 | + $events = EEM_Event::instance()->get_active_events(array('limit' => 1, |
|
116 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
117 | + )); |
|
118 | + $events = empty($events) ? EEM_Event::instance()->get_upcoming_events(array('limit' => 1, |
|
119 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
120 | + )) : $events; |
|
121 | + $event = reset($events); |
|
122 | + if ($event instanceof EE_Event) { |
|
123 | 123 | $query[0]['Registration.EVT_ID'] = $event->ID(); |
124 | 124 | $template_args['event'] = $event; |
125 | 125 | } |
126 | 126 | } |
127 | - } elseif ( ! empty( $attributes['event_id'] ) ) { |
|
128 | - $event = EEM_Event::instance()->get_one_by_ID( $attributes['event_id'] ); |
|
129 | - if ( $event instanceof EE_Event ) { |
|
127 | + } elseif ( ! empty($attributes['event_id'])) { |
|
128 | + $event = EEM_Event::instance()->get_one_by_ID($attributes['event_id']); |
|
129 | + if ($event instanceof EE_Event) { |
|
130 | 130 | $query[0]['Registration.EVT_ID'] = $attributes['event_id']; |
131 | 131 | $template_args['event'] = $event; |
132 | 132 | } else { |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | //datetime? |
138 | - if ( ! empty( $attributes['datetime_id'] ) && empty( $attributes['event_id'] ) ) { |
|
139 | - $datetime = EEM_Datetime::instance()->get_one_by_ID( $attributes['datetime_id'] ); |
|
140 | - if ( $datetime instanceof EE_Datetime ) { |
|
138 | + if ( ! empty($attributes['datetime_id']) && empty($attributes['event_id'])) { |
|
139 | + $datetime = EEM_Datetime::instance()->get_one_by_ID($attributes['datetime_id']); |
|
140 | + if ($datetime instanceof EE_Datetime) { |
|
141 | 141 | $query[0]['Registration.Ticket.Datetime.DTT_ID'] = $attributes['datetime_id']; |
142 | 142 | $query['default_where_conditions'] = 'this_model_only'; |
143 | 143 | $template_args['datetime'] = $datetime; |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | //ticket?just |
151 | - if ( ! empty( $attributes['ticket_id'] ) && empty( $attributes['event_id'] ) && empty( $attributes['datetime_id'] ) ) { |
|
152 | - $ticket = EEM_Ticket::instance()->get_one_by_ID( $attributes['ticket_id'] ); |
|
153 | - if ( $ticket instanceof EE_Ticket ) { |
|
151 | + if ( ! empty($attributes['ticket_id']) && empty($attributes['event_id']) && empty($attributes['datetime_id'])) { |
|
152 | + $ticket = EEM_Ticket::instance()->get_one_by_ID($attributes['ticket_id']); |
|
153 | + if ($ticket instanceof EE_Ticket) { |
|
154 | 154 | $query[0]['Registration.TKT_ID'] = $attributes['ticket_id']; |
155 | 155 | $template_args['ticket'] = $ticket; |
156 | 156 | $template_args['event'] = $ticket->first_datetime() instanceof EE_Datetime ? $ticket->first_datetime()->event() : null; |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | |
162 | 162 | //status |
163 | 163 | $reg_status_array = EEM_Registration::reg_status_array(); |
164 | - if ( $attributes['status'] != 'all' && isset( $reg_status_array[$attributes['status']] ) ) { |
|
164 | + if ($attributes['status'] != 'all' && isset($reg_status_array[$attributes['status']])) { |
|
165 | 165 | $query[0]['Registration.STS_ID'] = $attributes['status']; |
166 | 166 | } |
167 | - $query['group_by'] = array( 'ATT_ID' ); |
|
168 | - $query['order_by'] = apply_filters( 'FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', array( 'ATT_lname' => 'ASC', 'ATT_fname' => 'ASC' ) ); |
|
167 | + $query['group_by'] = array('ATT_ID'); |
|
168 | + $query['order_by'] = apply_filters('FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', array('ATT_lname' => 'ASC', 'ATT_fname' => 'ASC')); |
|
169 | 169 | |
170 | 170 | //if we have NO query where conditions, then there was an invalid parameter or the shortcode was used incorrectly |
171 | 171 | //so when WP_DEBUG is set and true, we'll show a message, otherwise we'll just return an empty string. |
172 | - if ( ( ! isset( $query[0] ) || ! is_array( $query[0] ) ) || $error ) { |
|
173 | - if ( WP_DEBUG ) { |
|
174 | - return '<div class="important-notice ee-attention">' . __( 'The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', 'event_espresso' ) . '</div>'; |
|
172 | + if (( ! isset($query[0]) || ! is_array($query[0])) || $error) { |
|
173 | + if (WP_DEBUG) { |
|
174 | + return '<div class="important-notice ee-attention">'.__('The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', 'event_espresso').'</div>'; |
|
175 | 175 | } else { |
176 | 176 | return ''; |
177 | 177 | } |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | |
180 | 180 | |
181 | 181 | //get contacts! |
182 | - $template_args['contacts'] = EEM_Attendee::instance()->get_all( $query ); |
|
182 | + $template_args['contacts'] = EEM_Attendee::instance()->get_all($query); |
|
183 | 183 | |
184 | 184 | |
185 | 185 | //all set let's load up the template and return. |
186 | - return EEH_Template::locate_template( 'loop-espresso_event_attendees.php', $template_args, true, true ); |
|
186 | + return EEH_Template::locate_template('loop-espresso_event_attendees.php', $template_args, true, true); |
|
187 | 187 | |
188 | 188 | } |
189 | 189 |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | * @param WP $WP |
51 | 51 | * @return void |
52 | 52 | */ |
53 | - public function run( WP $WP ) { |
|
54 | - if ( did_action( 'pre_get_posts' ) && did_action( 'send_headers' ) ) { |
|
53 | + public function run(WP $WP) { |
|
54 | + if (did_action('pre_get_posts') && did_action('send_headers')) { |
|
55 | 55 | EED_Events_Archive::instance()->event_list(); |
56 | 56 | } else { |
57 | 57 | // this will trigger the EED_Events_Archive module's event_list() method during the pre_get_posts hook point, |
58 | 58 | // this allows us to initialize things, enqueue assets, etc, |
59 | 59 | // as well, this saves an instantiation of the module in an array using 'espresso_events' as the key, so that we can retrieve it |
60 | - add_action( 'pre_get_posts', array( EED_Events_Archive::instance(), 'event_list' ) ); |
|
60 | + add_action('pre_get_posts', array(EED_Events_Archive::instance(), 'event_list')); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | * @param array $attributes |
80 | 80 | * @return string |
81 | 81 | */ |
82 | - public function process_shortcode( $attributes = array() ) { |
|
82 | + public function process_shortcode($attributes = array()) { |
|
83 | 83 | // make sure EED_Events_Archive is setup properly |
84 | - if ( apply_filters( 'FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE )) { |
|
84 | + if (apply_filters('FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE)) { |
|
85 | 85 | EED_Events_Archive::instance()->event_list(); |
86 | 86 | } |
87 | 87 | //set default attributes |
@@ -102,24 +102,24 @@ discard block |
||
102 | 102 | $default_espresso_events_shortcode_atts |
103 | 103 | ); |
104 | 104 | // grab attributes and merge with defaults, then extract |
105 | - $attributes = array_merge( (array) $default_espresso_events_shortcode_atts, (array) $attributes ); |
|
105 | + $attributes = array_merge((array) $default_espresso_events_shortcode_atts, (array) $attributes); |
|
106 | 106 | // make sure we use the_excerpt() |
107 | - add_filter( 'FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true' ); |
|
107 | + add_filter('FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true'); |
|
108 | 108 | // apply query filters |
109 | - add_filter( 'FHEE__EEH_Event_Query__apply_query_filters', '__return_true' ); |
|
109 | + add_filter('FHEE__EEH_Event_Query__apply_query_filters', '__return_true'); |
|
110 | 110 | // run the query |
111 | 111 | global $wp_query; |
112 | - $wp_query = new EE_Event_List_Query( $attributes ); |
|
112 | + $wp_query = new EE_Event_List_Query($attributes); |
|
113 | 113 | // check what template is loaded and load filters accordingly |
114 | - EED_Events_Archive::instance()->template_include( 'loop-espresso_events.php' ); |
|
114 | + EED_Events_Archive::instance()->template_include('loop-espresso_events.php'); |
|
115 | 115 | // load our template |
116 | - $event_list = EEH_Template::locate_template( 'loop-espresso_events.php', array(), TRUE, TRUE ); |
|
116 | + $event_list = EEH_Template::locate_template('loop-espresso_events.php', array(), TRUE, TRUE); |
|
117 | 117 | // now reset the query and postdata |
118 | 118 | wp_reset_query(); |
119 | 119 | wp_reset_postdata(); |
120 | 120 | EED_Events_Archive::remove_all_events_archive_filters(); |
121 | 121 | // remove query filters |
122 | - remove_filter( 'FHEE__EEH_Event_Query__apply_query_filters', '__return_true' ); |
|
122 | + remove_filter('FHEE__EEH_Event_Query__apply_query_filters', '__return_true'); |
|
123 | 123 | // pull our content from the output buffer and return it |
124 | 124 | return $event_list; |
125 | 125 | } |
@@ -164,44 +164,44 @@ discard block |
||
164 | 164 | * @param array $args |
165 | 165 | * @return \EE_Event_List_Query |
166 | 166 | */ |
167 | - function __construct( $args = array() ) { |
|
167 | + function __construct($args = array()) { |
|
168 | 168 | // EEH_Debug_Tools::printr( $args, '$args <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
169 | 169 | // incoming args could be a mix of WP query args + EE shortcode args |
170 | - foreach ( $args as $key =>$value ) { |
|
171 | - $property = '_' . $key; |
|
170 | + foreach ($args as $key =>$value) { |
|
171 | + $property = '_'.$key; |
|
172 | 172 | // if the arg is a property of this class, then it's an EE shortcode arg |
173 | - if ( property_exists( $this, $property )) { |
|
173 | + if (property_exists($this, $property)) { |
|
174 | 174 | // set the property value |
175 | 175 | $this->{$property} = $value; |
176 | 176 | // then remove it from the array of args that will later be passed to WP_Query() |
177 | - unset( $args[ $key ] ); |
|
177 | + unset($args[$key]); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | //add query filters |
181 | 181 | EEH_Event_Query::add_query_filters(); |
182 | 182 | // set params that will get used by the filters |
183 | - EEH_Event_Query::set_query_params( $this->_month, $this->_category_slug, $this->_show_expired, $this->_order_by, $this->_sort ); |
|
183 | + EEH_Event_Query::set_query_params($this->_month, $this->_category_slug, $this->_show_expired, $this->_order_by, $this->_sort); |
|
184 | 184 | // first off, let's remove any filters from previous queries |
185 | - remove_filter( 'FHEE__archive_espresso_events_template__upcoming_events_h1', array( $this, 'event_list_title' )); |
|
186 | - remove_all_filters( 'FHEE__content_espresso_events__event_class' ); |
|
185 | + remove_filter('FHEE__archive_espresso_events_template__upcoming_events_h1', array($this, 'event_list_title')); |
|
186 | + remove_all_filters('FHEE__content_espresso_events__event_class'); |
|
187 | 187 | // Event List Title ? |
188 | - add_filter( 'FHEE__archive_espresso_events_template__upcoming_events_h1', array( $this, 'event_list_title' ), 10, 1 ); |
|
188 | + add_filter('FHEE__archive_espresso_events_template__upcoming_events_h1', array($this, 'event_list_title'), 10, 1); |
|
189 | 189 | // add the css class |
190 | - add_filter( 'FHEE__content_espresso_events__event_class', array( $this, 'event_list_css' ), 10, 1 ); |
|
190 | + add_filter('FHEE__content_espresso_events__event_class', array($this, 'event_list_css'), 10, 1); |
|
191 | 191 | // the current "page" we are viewing |
192 | - $paged = max( 1, get_query_var( 'paged' )); |
|
192 | + $paged = max(1, get_query_var('paged')); |
|
193 | 193 | // Force these args |
194 | - $args = array_merge( $args, array( |
|
194 | + $args = array_merge($args, array( |
|
195 | 195 | 'post_type' => 'espresso_events', |
196 | 196 | 'posts_per_page' => $this->_limit, |
197 | 197 | 'update_post_term_cache' => FALSE, |
198 | 198 | 'update_post_meta_cache' => FALSE, |
199 | 199 | 'paged' => $paged, |
200 | - 'offset' => ( $paged - 1 ) * $this->_limit |
|
200 | + 'offset' => ($paged - 1) * $this->_limit |
|
201 | 201 | )); |
202 | 202 | |
203 | 203 | // run the query |
204 | - parent::__construct( $args ); |
|
204 | + parent::__construct($args); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | * @param string $event_list_title |
215 | 215 | * @return string |
216 | 216 | */ |
217 | - public function event_list_title( $event_list_title = '' ) { |
|
218 | - if ( ! empty( $this->_title )) { |
|
217 | + public function event_list_title($event_list_title = '') { |
|
218 | + if ( ! empty($this->_title)) { |
|
219 | 219 | return $this->_title; |
220 | 220 | } |
221 | 221 | return $event_list_title; |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | * @param string $event_list_css |
231 | 231 | * @return array |
232 | 232 | */ |
233 | - public function event_list_css( $event_list_css = '' ) { |
|
234 | - $event_list_css .= ! empty( $event_list_css ) ? ' ' : ''; |
|
235 | - $event_list_css .= ! empty( $this->_css_class ) ? $this->_css_class : ''; |
|
236 | - $event_list_css .= ! empty( $event_list_css ) ? ' ' : ''; |
|
237 | - $event_list_css .= ! empty( $this->_category_slug ) ? $this->_category_slug : ''; |
|
233 | + public function event_list_css($event_list_css = '') { |
|
234 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
235 | + $event_list_css .= ! empty($this->_css_class) ? $this->_css_class : ''; |
|
236 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
237 | + $event_list_css .= ! empty($this->_category_slug) ? $this->_category_slug : ''; |
|
238 | 238 | return $event_list_css; |
239 | 239 | } |
240 | 240 |
@@ -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 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @author Mike Nelson |
20 | 20 | * |
21 | 21 | */ |
22 | -class EED_Mijireh_Payment_Checker extends EED_Module{ |
|
22 | +class EED_Mijireh_Payment_Checker extends EED_Module { |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * set_hooks - for hooking into EE Core, other modules, etc |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | * @return void |
41 | 41 | */ |
42 | 42 | public static function set_hooks_admin() { |
43 | - add_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', array( 'EED_Mijireh_Payment_Checker', 'check_for_payment_update_on_transaction' ), 10, 1 ); |
|
43 | + add_action('AHEE__Transactions_Admin_Page__transaction_details__start', array('EED_Mijireh_Payment_Checker', 'check_for_payment_update_on_transaction'), 10, 1); |
|
44 | 44 | } |
45 | 45 | |
46 | - public static function check_for_payment_update_on_transaction( $transaction ) { |
|
47 | - if( $transaction instanceof EE_Transaction ) { |
|
46 | + public static function check_for_payment_update_on_transaction($transaction) { |
|
47 | + if ($transaction instanceof EE_Transaction) { |
|
48 | 48 | $last_payment = $transaction->last_payment(); |
49 | 49 | //if this payment is from Mijireh and so far unapproved |
50 | - if( |
|
50 | + if ( |
|
51 | 51 | $last_payment instanceof EE_Payment && |
52 | 52 | $last_payment->payment_method() instanceof EE_Payment_Method && |
53 | 53 | $last_payment->payment_method()->type_obj() instanceof EE_PMT_Mijireh && |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | ) { |
56 | 56 | add_action( |
57 | 57 | 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', |
58 | - array( 'EED_Mijireh_Payment_Checker', 'send_notifications_after_mijireh_ipn' ), |
|
58 | + array('EED_Mijireh_Payment_Checker', 'send_notifications_after_mijireh_ipn'), |
|
59 | 59 | 5, 2 |
60 | 60 | ); |
61 | - EE_Payment_Processor::instance()->process_ipn( array(), $transaction, $last_payment->payment_method() ); |
|
61 | + EE_Payment_Processor::instance()->process_ipn(array(), $transaction, $last_payment->payment_method()); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * @param EE_Registration $registration |
75 | 75 | * @param array $additional_details |
76 | 76 | */ |
77 | - public static function send_notifications_after_mijireh_ipn( $registration, $additional_details ) { |
|
78 | - $last_payment = isset( $additional_details[ 'last_payment' ] ) ? $additional_details[ 'last_payment' ] : null; |
|
79 | - if ( ! $last_payment instanceof EE_Payment || $last_payment->status() != EEM_Payment::status_id_approved ) { |
|
80 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 ); |
|
77 | + public static function send_notifications_after_mijireh_ipn($registration, $additional_details) { |
|
78 | + $last_payment = isset($additional_details['last_payment']) ? $additional_details['last_payment'] : null; |
|
79 | + if ( ! $last_payment instanceof EE_Payment || $last_payment->status() != EEM_Payment::status_id_approved) { |
|
80 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @access public |
90 | 90 | * @param WP_Query $WP_Query |
91 | 91 | */ |
92 | - public function run( $WP_Query = null ) { |
|
92 | + public function run($WP_Query = null) { |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 |
@@ -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 | * Event Espresso |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <li><?php printf( |
40 | 40 | __('To find the sandbox account\'s credit card, go to %1$s, then "Dashboard", then under Sandbox click "Accounts", then click your account and click "Profile", then in the popup that appears click on the "Funding" tab. Your testing card is listed there.', 'event_espresso'), |
41 | 41 | '<a href="http://developer.paypal.com">developer.paypal.com</a>'); ?></li> |
42 | - <li><?php printf(__('CVV2 should be 115 (see %s PayPal\'s documentation for other special codes %s)', 'event_espresso'),'<a href="https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions#id108HH0RJ0TS" target="_blank">','</a>'); ?></li> |
|
42 | + <li><?php printf(__('CVV2 should be 115 (see %s PayPal\'s documentation for other special codes %s)', 'event_espresso'), '<a href="https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions#id108HH0RJ0TS" target="_blank">', '</a>'); ?></li> |
|
43 | 43 | </ul> |
44 | 44 | |
45 | 45 | <p class="test-credit-cards-info-pg"> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | <p class="test-credit-cards-info-pg"> |
68 | 68 | <strong><?php _e('Testing Result Code Responses', 'event_espresso'); ?></strong><br/> |
69 | - <span class="small-text"><?php printf(__('You can use the amount of the transaction to generate a particular result code (see %s PayPal\'s documentation%s). The table below lists the general guidelines for specifying amounts. IMPORTANT: before you attempt any of these, ensure your sandbox PayPal account has %s "Negative Testing" set to on%s. Also be aware that you can generate AVS errors by using certain strings in your address field, and CVV errors using certain CVV values. See %s this PayPal doc %s', 'event_espresso'),"<a href='https://developer.paypal.com/docs/classic/api/errorcodes/#id09C3GA00GR1' target='_blank'>","</a>", "<a href='https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMNXNkZ2s5VUlHTUk/edit?usp=drivesdk' target='_blank'>","</a>","<a href='https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions' target='_blank'>","</a>"); ?></span> |
|
69 | + <span class="small-text"><?php printf(__('You can use the amount of the transaction to generate a particular result code (see %s PayPal\'s documentation%s). The table below lists the general guidelines for specifying amounts. IMPORTANT: before you attempt any of these, ensure your sandbox PayPal account has %s "Negative Testing" set to on%s. Also be aware that you can generate AVS errors by using certain strings in your address field, and CVV errors using certain CVV values. See %s this PayPal doc %s', 'event_espresso'), "<a href='https://developer.paypal.com/docs/classic/api/errorcodes/#id09C3GA00GR1' target='_blank'>", "</a>", "<a href='https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMNXNkZ2s5VUlHTUk/edit?usp=drivesdk' target='_blank'>", "</a>", "<a href='https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions' target='_blank'>", "</a>"); ?></span> |
|
70 | 70 | </p> |
71 | 71 | |
72 | 72 | <div class="tbl-wrap"> |
@@ -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 | /** |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | $this->description = __('All shortcodes related to emails', 'event_espresso'); |
44 | 44 | $this->_shortcodes = array( |
45 | 45 | '[SITE_ADMIN_EMAIL]' => __('Will be replaced with the admin email for the site that Event Espresso is installed on', 'event_espresso'), |
46 | - '[EVENT_AUTHOR_FORMATTED_EMAIL]' => __('This will be replaced with a properly formatted list of Event Creator emails for the events in a registration. %1$sNOTE:%2$s If the event author has not filled out their WordPress user profile then the organization name will be used as the "From" name.', 'event_espresso'),'<strong>','</strong>', |
|
46 | + '[EVENT_AUTHOR_FORMATTED_EMAIL]' => __('This will be replaced with a properly formatted list of Event Creator emails for the events in a registration. %1$sNOTE:%2$s If the event author has not filled out their WordPress user profile then the organization name will be used as the "From" name.', 'event_espresso'), '<strong>', '</strong>', |
|
47 | 47 | '[EVENT_AUTHOR_EMAIL]' => __('This is the same as %1$s shortcode except it is just a list of emails (not fancy headers).', 'event_espresso'), '[EVENT_AUTHOR_FORMATTED_EMAIL]', |
48 | - '[CO_FORMATTED_EMAIL]' => __('This parses to the formatted email address of the organization name set in Your Organization Settings. "My Organization <[email protected]>"', 'event_espresso' ), |
|
48 | + '[CO_FORMATTED_EMAIL]' => __('This parses to the formatted email address of the organization name set in Your Organization Settings. "My Organization <[email protected]>"', 'event_espresso'), |
|
49 | 49 | '[CO_EMAIL]' => __('This will parse to the email address only for the organization set in Your Organization Settings.', 'event_espresso'), |
50 | - '[ESPRESSO_ADMIN_FORMATTED_EMAIL]' => __('This parses to the formatted email address of the organization name set in Your Organization Settings. "My Organization <[email protected]>"', 'event_espresso' ), |
|
50 | + '[ESPRESSO_ADMIN_FORMATTED_EMAIL]' => __('This parses to the formatted email address of the organization name set in Your Organization Settings. "My Organization <[email protected]>"', 'event_espresso'), |
|
51 | 51 | '[ESPRESSO_ADMIN_EMAIL]' => __('This parses to the email address only for the organization set in Your Organization Settings page.', 'event_espresso') |
52 | 52 | ); |
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | - protected function _parser( $shortcode ) { |
|
56 | + protected function _parser($shortcode) { |
|
57 | 57 | |
58 | - switch ( $shortcode ) { |
|
58 | + switch ($shortcode) { |
|
59 | 59 | |
60 | 60 | case '[SITE_ADMIN_EMAIL]' : |
61 | 61 | return $this->_get_site_admin_email(); |
@@ -66,17 +66,17 @@ discard block |
||
66 | 66 | break; |
67 | 67 | |
68 | 68 | case '[EVENT_AUTHOR_EMAIL]' : |
69 | - return $this->_get_event_admin_emails( FALSE ); |
|
69 | + return $this->_get_event_admin_emails(FALSE); |
|
70 | 70 | break; |
71 | 71 | |
72 | 72 | case '[CO_FORMATTED_EMAIL]' : |
73 | 73 | case '[ESPRESSO_ADMIN_FORMATTED_EMAIL]' : |
74 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ) . ' <' . EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) . '>'; |
|
74 | + return EE_Registry::instance()->CFG->organization->get_pretty('name').' <'.EE_Registry::instance()->CFG->organization->get_pretty('email').'>'; |
|
75 | 75 | break; |
76 | 76 | |
77 | 77 | case '[CO_EMAIL]' : |
78 | 78 | case '[ESPRESSO_ADMIN_EMAIL]' : |
79 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
79 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
80 | 80 | break; |
81 | 81 | |
82 | 82 | default : |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | |
101 | - private function _get_event_admin_emails( $fancy_headers = TRUE ) { |
|
101 | + private function _get_event_admin_emails($fancy_headers = TRUE) { |
|
102 | 102 | |
103 | - if ( !empty( $this->_data->admin_email ) ) { |
|
104 | - if ( ! $fancy_headers ) |
|
103 | + if ( ! empty($this->_data->admin_email)) { |
|
104 | + if ( ! $fancy_headers) |
|
105 | 105 | return $this->_data->admin_email; |
106 | - return !empty( $this->_data->fname ) ? $this->_data->fname . ' ' . $this->_data->lname . ' <' . $this->_data->admin_email . '>' : EE_Registry::instance()->CFG->organization->get_pretty( 'name' ) . ' <' . $this->_data->admin_email . '>'; |
|
106 | + return ! empty($this->_data->fname) ? $this->_data->fname.' '.$this->_data->lname.' <'.$this->_data->admin_email.'>' : EE_Registry::instance()->CFG->organization->get_pretty('name').' <'.$this->_data->admin_email.'>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | //k this shortcode has been used else where. Since we don't know what particular event this is for, let's loop through the events and get an array of event admins for the events. We'll return the formatted list of admin emails and let the messenger make sure we only pick one if this is for a field that can only have ONE!. |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | $admin_email = array(); |
112 | 112 | |
113 | 113 | //loop through events and set the list of event_ids to retrieve so we can do ONE query. |
114 | - foreach ( $this->_data->events as $event ) { |
|
114 | + foreach ($this->_data->events as $event) { |
|
115 | 115 | $ids[] = $event['ID']; |
116 | 116 | } |
117 | 117 | |
118 | 118 | //get all the events |
119 | - $events = EE_Registry::instance()->load_model('Event')->get_all( array(array('EVT_ID' => array('IN', $ids ) ) ) ); |
|
119 | + $events = EE_Registry::instance()->load_model('Event')->get_all(array(array('EVT_ID' => array('IN', $ids)))); |
|
120 | 120 | |
121 | 121 | //now loop through each event and setup the details |
122 | 122 | $admin_details = array(); |
123 | 123 | $cnt = 0; |
124 | - foreach ( $events as $event ) { |
|
125 | - $user = get_userdata($event->get('EVT_wp_user') ); |
|
124 | + foreach ($events as $event) { |
|
125 | + $user = get_userdata($event->get('EVT_wp_user')); |
|
126 | 126 | $admin_details[$cnt] = new stdClass(); |
127 | 127 | $admin_details[$cnt]->email = $user->user_email; |
128 | 128 | $admin_details[$cnt]->first_name = $user->user_firstname; |
@@ -131,28 +131,28 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | //results? |
134 | - if ( empty($admin_details) || !is_array($admin_details) ) { |
|
134 | + if (empty($admin_details) || ! is_array($admin_details)) { |
|
135 | 135 | $msg[] = __('The admin details could not be retrieved from the database.', 'event_espresso'); |
136 | - $msg[] = sprintf( __('Query: %s', 'event_espresso'), $sql ); |
|
137 | - $msg[] = sprintf( __('Events Data: %s', 'event_espresso'), var_export($this->_data->events, TRUE) ); |
|
138 | - $msg[] = sprintf( __('Event IDS: %s', 'event_espresso'), var_export($ids, TRUE) ); |
|
139 | - $msg[] = sprintf( __('Query Results: %s', 'event_espresso'), var_export($admin_details) ); |
|
140 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, implode( PHP_EOL, $msg ), 'shortcode_parser' ); |
|
136 | + $msg[] = sprintf(__('Query: %s', 'event_espresso'), $sql); |
|
137 | + $msg[] = sprintf(__('Events Data: %s', 'event_espresso'), var_export($this->_data->events, TRUE)); |
|
138 | + $msg[] = sprintf(__('Event IDS: %s', 'event_espresso'), var_export($ids, TRUE)); |
|
139 | + $msg[] = sprintf(__('Query Results: %s', 'event_espresso'), var_export($admin_details)); |
|
140 | + do_action('AHEE_log', __FILE__, __FUNCTION__, implode(PHP_EOL, $msg), 'shortcode_parser'); |
|
141 | 141 | } |
142 | 142 | |
143 | - foreach ( $admin_details as $admin ) { |
|
143 | + foreach ($admin_details as $admin) { |
|
144 | 144 | //only add an admin email if it is present. |
145 | - if ( empty( $admin->email ) || $admin->email == '' ) continue; |
|
145 | + if (empty($admin->email) || $admin->email == '') continue; |
|
146 | 146 | |
147 | - if ( ! $fancy_headers ) { |
|
147 | + if ( ! $fancy_headers) { |
|
148 | 148 | $admin_email[] = $admin->email; |
149 | 149 | continue; |
150 | 150 | } |
151 | 151 | |
152 | - $admin_email[] = !empty( $admin->first_name ) ? $admin->first_name . ' ' . $admin->last_name . ' <' . $admin->email . '>' : EE_Registry::instance()->CFG->organization->get_pretty( 'name' ) . ' <' . $admin->email . '>'; |
|
152 | + $admin_email[] = ! empty($admin->first_name) ? $admin->first_name.' '.$admin->last_name.' <'.$admin->email.'>' : EE_Registry::instance()->CFG->organization->get_pretty('name').' <'.$admin->email.'>'; |
|
153 | 153 | } |
154 | 154 | |
155 | - $admin_email = implode( ',', $admin_email ); |
|
155 | + $admin_email = implode(',', $admin_email); |
|
156 | 156 | return $admin_email; |
157 | 157 | } |
158 | 158 |
@@ -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 | /** |
@@ -58,96 +58,96 @@ discard block |
||
58 | 58 | '[CO_GOOGLE_URL]' => __('Link to organization Google page', 'event_espresso'), |
59 | 59 | '[CO_LINKEDIN_URL]' => __('Link to organization LinkedIn page', 'event_espresso'), |
60 | 60 | '[CO_INSTAGRAM_URL]' => __('Link to organization Instagram page', 'event_espresso'), |
61 | - '[CO_TAX_NUMBER_*]' => __('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso','<strong>','</strong>') |
|
61 | + '[CO_TAX_NUMBER_*]' => __('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso', '<strong>', '</strong>') |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | - protected function _parser( $shortcode ) { |
|
66 | + protected function _parser($shortcode) { |
|
67 | 67 | |
68 | - switch ( $shortcode ) { |
|
68 | + switch ($shortcode) { |
|
69 | 69 | |
70 | 70 | case '[COMPANY]' : |
71 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
71 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
72 | 72 | break; |
73 | 73 | |
74 | 74 | case '[CO_ADD1]' : |
75 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_1' ); |
|
75 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_1'); |
|
76 | 76 | break; |
77 | 77 | |
78 | 78 | case '[CO_ADD2]' : |
79 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_2' ); |
|
79 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_2'); |
|
80 | 80 | break; |
81 | 81 | |
82 | 82 | case '[CO_CITY]' : |
83 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'city' ); |
|
83 | + return EE_Registry::instance()->CFG->organization->get_pretty('city'); |
|
84 | 84 | break; |
85 | 85 | |
86 | 86 | case '[CO_STATE]' : |
87 | - $state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( EE_Registry::instance()->CFG->organization->STA_ID ); |
|
87 | + $state = EE_Registry::instance()->load_model('State')->get_one_by_ID(EE_Registry::instance()->CFG->organization->STA_ID); |
|
88 | 88 | return $state->name(); |
89 | 89 | break; |
90 | 90 | |
91 | 91 | case '[CO_ZIP]' : |
92 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'zip' ); |
|
92 | + return EE_Registry::instance()->CFG->organization->get_pretty('zip'); |
|
93 | 93 | break; |
94 | 94 | |
95 | 95 | case '[CO_EMAIL]' : |
96 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
96 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
97 | 97 | break; |
98 | 98 | |
99 | 99 | case '[CO_PHONE]' : |
100 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'phone' ); |
|
100 | + return EE_Registry::instance()->CFG->organization->get_pretty('phone'); |
|
101 | 101 | break; |
102 | 102 | |
103 | 103 | case '[CO_LOGO]' : |
104 | - return '<img src="' . EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ) . '" id="headerImage" />'; |
|
104 | + return '<img src="'.EE_Registry::instance()->CFG->organization->get_pretty('logo_url').'" id="headerImage" />'; |
|
105 | 105 | break; |
106 | 106 | |
107 | 107 | case '[CO_LOGO_URL]' : |
108 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
108 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
109 | 109 | break; |
110 | 110 | |
111 | 111 | case '[CO_FACEBOOK_URL]' : |
112 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
112 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
113 | 113 | break; |
114 | 114 | |
115 | 115 | case '[CO_TWITTER_URL]' : |
116 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
116 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
117 | 117 | break; |
118 | 118 | |
119 | 119 | case '[CO_PINTEREST_URL]' : |
120 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
120 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
121 | 121 | break; |
122 | 122 | |
123 | 123 | case '[CO_LINKEDIN_URL]' : |
124 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
124 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
125 | 125 | break; |
126 | 126 | |
127 | 127 | case '[CO_GOOGLE_URL]' : |
128 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
128 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
129 | 129 | break; |
130 | 130 | |
131 | 131 | case '[CO_INSTAGRAM_URL]' : |
132 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
132 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
133 | 133 | break; |
134 | 134 | |
135 | 135 | } |
136 | 136 | |
137 | 137 | //also allow for parameter shortcode |
138 | - if ( strpos( $shortcode, '[CO_TAX_NUMBER_*' ) !== FALSE ) { |
|
138 | + if (strpos($shortcode, '[CO_TAX_NUMBER_*') !== FALSE) { |
|
139 | 139 | //first see if there is any company tax number set and bail early if not |
140 | 140 | $tax_number = EE_Registry::instance()->CFG->organization->vat; |
141 | - if ( empty( $tax_number ) ) { |
|
141 | + if (empty($tax_number)) { |
|
142 | 142 | return ''; |
143 | 143 | } |
144 | 144 | |
145 | 145 | //see if there are any attributes. |
146 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
146 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
147 | 147 | |
148 | 148 | //set custom attrs if present (or default) |
149 | - $prefix = isset( $attrs['prefix'] ) ? $attrs['prefix'] : __('VAT/Tax Number: ', 'event_espresso'); |
|
150 | - return $prefix . $tax_number; |
|
149 | + $prefix = isset($attrs['prefix']) ? $attrs['prefix'] : __('VAT/Tax Number: ', 'event_espresso'); |
|
150 | + return $prefix.$tax_number; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return ''; |