@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | -class EE_Template_Layout extends EE_Div_Per_Section_Layout{ |
|
24 | +class EE_Template_Layout extends EE_Div_Per_Section_Layout { |
|
25 | 25 | |
26 | 26 | protected $_layout_template_file = NULL; |
27 | 27 | protected $_layout_begin_template_file = NULL; |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | * @type array $_template_args |
43 | 43 | * } |
44 | 44 | */ |
45 | - public function __construct( $template_options = array() ) { |
|
45 | + public function __construct($template_options = array()) { |
|
46 | 46 | // loop thru incoming options |
47 | - foreach( $template_options as $key => $value ) { |
|
47 | + foreach ($template_options as $key => $value) { |
|
48 | 48 | // add underscore to $key to match property names |
49 | - $_key = '_' . $key; |
|
50 | - if ( property_exists( $this, $_key )) { |
|
49 | + $_key = '_'.$key; |
|
50 | + if (property_exists($this, $_key)) { |
|
51 | 51 | $this->{$_key} = $value; |
52 | 52 | } |
53 | 53 | } |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | * @return string |
66 | 66 | */ |
67 | 67 | public function layout_form() { |
68 | - if ( $this->_layout_template_file ) { |
|
69 | - return EEH_Template::locate_template( $this->_layout_template_file, $this->template_args(), TRUE, TRUE ); |
|
68 | + if ($this->_layout_template_file) { |
|
69 | + return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), TRUE, TRUE); |
|
70 | 70 | } else { |
71 | 71 | return parent::layout_form(); |
72 | 72 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | * @return string |
80 | 80 | */ |
81 | 81 | public function layout_form_begin() { |
82 | - if($this->_layout_begin_template_file){ |
|
83 | - return EEH_Template::locate_template( $this->_layout_begin_template_file, $this->template_args(), TRUE, TRUE ); |
|
84 | - }else{ |
|
82 | + if ($this->_layout_begin_template_file) { |
|
83 | + return EEH_Template::locate_template($this->_layout_begin_template_file, $this->template_args(), TRUE, TRUE); |
|
84 | + } else { |
|
85 | 85 | return parent::layout_form_begin(); |
86 | 86 | } |
87 | 87 | } |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @param EE_Form_Input_Base $input |
95 | 95 | * @return string |
96 | 96 | */ |
97 | - public function layout_input( $input ) { |
|
98 | - if($this->_input_template_file){ |
|
99 | - return EEH_Template::locate_template( $this->_input_template_file, array( 'input' => $input ), TRUE, TRUE ); |
|
97 | + public function layout_input($input) { |
|
98 | + if ($this->_input_template_file) { |
|
99 | + return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), TRUE, TRUE); |
|
100 | 100 | } |
101 | 101 | return parent::layout_input($input); |
102 | 102 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @param EE_Form_Section_Proper $form_section |
110 | 110 | * @return string |
111 | 111 | */ |
112 | - public function layout_subsection( $form_section ) { |
|
113 | - if($this->_subsection_template_file){ |
|
114 | - return EEH_Template::locate_template( $this->_subsection_template_file, $this->template_args(), TRUE, TRUE ); |
|
112 | + public function layout_subsection($form_section) { |
|
113 | + if ($this->_subsection_template_file) { |
|
114 | + return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), TRUE, TRUE); |
|
115 | 115 | } |
116 | - return parent::layout_subsection( $form_section ); |
|
116 | + return parent::layout_subsection($form_section); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | * @return string |
124 | 124 | */ |
125 | 125 | public function layout_form_end() { |
126 | - if($this->_layout_end_template_file){ |
|
127 | - return EEH_Template::locate_template( $this->_layout_end_template_file, $this->template_args(), TRUE, TRUE); |
|
128 | - }else{ |
|
126 | + if ($this->_layout_end_template_file) { |
|
127 | + return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), TRUE, TRUE); |
|
128 | + } else { |
|
129 | 129 | return parent::layout_form_end(); |
130 | 130 | } |
131 | 131 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * @param array $template_args |
137 | 137 | */ |
138 | - public function set_template_args( $template_args = array() ) { |
|
138 | + public function set_template_args($template_args = array()) { |
|
139 | 139 | $this->_template_args = $template_args; |
140 | 140 | } |
141 | 141 | |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | /** |
145 | 145 | * @param array $template_args |
146 | 146 | */ |
147 | - public function add_template_args( $template_args = array() ) { |
|
148 | - $this->_template_args = array_merge_recursive( $this->_template_args, $template_args ); |
|
147 | + public function add_template_args($template_args = array()) { |
|
148 | + $this->_template_args = array_merge_recursive($this->_template_args, $template_args); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | * @return array |
155 | 155 | */ |
156 | 156 | public function template_args() { |
157 | - foreach ( $this->form_section()->subsections() as $subsection_name => $subsection ) { |
|
158 | - $subsection_name = self::prep_form_subsection_key_name( $subsection_name ); |
|
159 | - if ( strpos( $subsection_name, '[' ) !== FALSE ) { |
|
160 | - $sub_name = explode( '[', $subsection_name ); |
|
161 | - $this->_template_args[ $sub_name[0] ][ rtrim( $sub_name[1], ']' ) ] = $this->layout_subsection( $subsection ); |
|
157 | + foreach ($this->form_section()->subsections() as $subsection_name => $subsection) { |
|
158 | + $subsection_name = self::prep_form_subsection_key_name($subsection_name); |
|
159 | + if (strpos($subsection_name, '[') !== FALSE) { |
|
160 | + $sub_name = explode('[', $subsection_name); |
|
161 | + $this->_template_args[$sub_name[0]][rtrim($sub_name[1], ']')] = $this->layout_subsection($subsection); |
|
162 | 162 | } else { |
163 | - $this->_template_args[ $subsection_name ] = $this->layout_subsection( $subsection ); |
|
163 | + $this->_template_args[$subsection_name] = $this->layout_subsection($subsection); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | // d( $this->_template_args ); |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | * @param string $subsection_name |
177 | 177 | * @return string |
178 | 178 | */ |
179 | - public static function prep_form_subsection_key_name( $subsection_name = '' ) { |
|
180 | - $subsection_name = str_replace( array( '-', ' ' ), array( '', '_' ), $subsection_name ); |
|
181 | - return is_numeric( substr( $subsection_name, 0, 1 )) ? 'form_' . $subsection_name : $subsection_name; |
|
179 | + public static function prep_form_subsection_key_name($subsection_name = '') { |
|
180 | + $subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name); |
|
181 | + return is_numeric(substr($subsection_name, 0, 1)) ? 'form_'.$subsection_name : $subsection_name; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | * @param string $subsection_name |
191 | 191 | * @return string |
192 | 192 | */ |
193 | - public static function get_subform_name( $subsection_name = '' ) { |
|
194 | - return EE_Template_Layout::prep_form_subsection_key_name( $subsection_name ); |
|
193 | + public static function get_subform_name($subsection_name = '') { |
|
194 | + return EE_Template_Layout::prep_form_subsection_key_name($subsection_name); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 |
@@ -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,18 +42,18 @@ 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() . '">'; |
|
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 | 51 | // image uploader |
52 | - $uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' ); |
|
52 | + $uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload'); |
|
53 | 53 | //only attempt to show the image if it at least exists |
54 | - $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' ) : ''; |
|
54 | + $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 | 55 | // html string |
56 | - return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' ); |
|
56 | + return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | * @param string $src |
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | - protected function src_exists( $src ){ |
|
68 | - $results = wp_remote_head( $src ); |
|
69 | - if( is_array( $results) && ! $results instanceof WP_Error){ |
|
70 | - return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
|
71 | - }else{ |
|
67 | + protected function src_exists($src) { |
|
68 | + $results = wp_remote_head($src); |
|
69 | + if (is_array($results) && ! $results instanceof WP_Error) { |
|
70 | + return strpos($results['headers']['content-type'], "image") !== FALSE; |
|
71 | + } else { |
|
72 | 72 | return FALSE; |
73 | 73 | } |
74 | 74 | } |
@@ -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 | /** |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML{ |
|
29 | - public function __construct($template_file,$args = array(), $options_array = array()) { |
|
30 | - $html = EEH_Template::locate_template( $template_file, $args ); |
|
28 | +class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML { |
|
29 | + public function __construct($template_file, $args = array(), $options_array = array()) { |
|
30 | + $html = EEH_Template::locate_template($template_file, $args); |
|
31 | 31 | |
32 | 32 | // echo " filepath:$template_file html $html"; |
33 | 33 | parent::__construct($html, $options_array); |
@@ -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 | * |
4 | 4 | * EE_Billing_Info_Form |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @author Mike Nelson |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Billing_Info_Form extends EE_Form_Section_Proper{ |
|
14 | +class EE_Billing_Info_Form extends EE_Form_Section_Proper { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * The payment method this billing form is for |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @param EE_Payment_Method $payment_method |
27 | 27 | * @param array $options_array @see EE_Form_Section_Proper::__construct() |
28 | 28 | */ |
29 | - public function __construct( EE_Payment_Method $payment_method, $options_array= array()){ |
|
29 | + public function __construct(EE_Payment_Method $payment_method, $options_array = array()) { |
|
30 | 30 | $this->_pm_instance = $payment_method; |
31 | 31 | $this->_layout_strategy = new EE_Div_Per_Section_Layout(); |
32 | - parent::__construct( $options_array ); |
|
32 | + parent::__construct($options_array); |
|
33 | 33 | |
34 | 34 | } |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param EE_Payment_Method $payment_method |
41 | 41 | * @return void |
42 | 42 | */ |
43 | - public function set_payment_method( EE_Payment_Method $payment_method ){ |
|
43 | + public function set_payment_method(EE_Payment_Method $payment_method) { |
|
44 | 44 | $this->_pm_instance = $payment_method; |
45 | 45 | } |
46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * Returns the instance of the payment method this billing form is for |
51 | 51 | * @return EE_Payment_Method |
52 | 52 | */ |
53 | - public function payment_method(){ |
|
53 | + public function payment_method() { |
|
54 | 54 | return $this->_pm_instance; |
55 | 55 | } |
56 | 56 | |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | * payment_fields_autofilled_notice_html |
61 | 61 | * @return string |
62 | 62 | */ |
63 | - public function payment_fields_autofilled_notice_html(){ |
|
63 | + public function payment_fields_autofilled_notice_html() { |
|
64 | 64 | return new EE_Form_Section_HTML( |
65 | 65 | EEH_HTML::p( |
66 | - apply_filters( 'FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __( 'Payment fields have been autofilled because you are in debug mode', 'event_espresso' )), |
|
66 | + apply_filters('FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __('Payment fields have been autofilled because you are in debug mode', 'event_espresso')), |
|
67 | 67 | '', |
68 | 68 | 'important-notice' |
69 | 69 | ) |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * @return string |
77 | 77 | */ |
78 | - public function html_class(){ |
|
79 | - return ! empty( $this->_html_class ) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
78 | + public function html_class() { |
|
79 | + return ! empty($this->_html_class) ? $this->_html_class.' ee-billing-form' : 'ee-billing-form'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @subpackage messages |
21 | 21 | * @author Darren Ethier |
22 | 22 | */ |
23 | -class EE_Pdf_messenger extends EE_messenger { |
|
23 | +class EE_Pdf_messenger extends EE_messenger { |
|
24 | 24 | |
25 | 25 | |
26 | 26 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @see abstract declaration in EE_messenger for details. |
66 | 66 | */ |
67 | 67 | protected function _set_admin_pages() { |
68 | - $this->admin_registered_pages = array( 'events_edit' => false ); |
|
68 | + $this->admin_registered_pages = array('events_edit' => false); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | protected function _set_validator_config() { |
86 | 86 | $this->_validator_config = array( |
87 | 87 | 'subject' => array( |
88 | - 'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime') |
|
88 | + 'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime') |
|
89 | 89 | ), |
90 | 90 | 'content' => array( |
91 | - 'shortcodes' => array( 'recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime') |
|
91 | + 'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime') |
|
92 | 92 | ), |
93 | 93 | 'attendee_list' => array( |
94 | 94 | 'shortcodes' => array('attendee', 'event_list', 'ticket_list'), |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'required' => array('[EVENT_LIST]') |
100 | 100 | ), |
101 | 101 | 'ticket_list' => array( |
102 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'), |
|
102 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'), |
|
103 | 103 | 'required' => array('[TICKET_LIST]') |
104 | 104 | ), |
105 | 105 | 'datetime_list' => array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function enqueue_scripts_styles() { |
121 | 121 | parent::enqueue_scripts_styles(); |
122 | - do_action( 'AHEE__EE_Pdf_messenger__enqueue_scripts_styles'); |
|
122 | + do_action('AHEE__EE_Pdf_messenger__enqueue_scripts_styles'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -245,18 +245,18 @@ discard block |
||
245 | 245 | */ |
246 | 246 | protected function _send_message() { |
247 | 247 | $this->_template_args = array( |
248 | - 'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"), |
|
249 | - 'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ), |
|
250 | - 'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ), |
|
251 | - 'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ), |
|
252 | - 'extra_css' => EE_LIBRARIES_URL . 'messages/defaults/default/variations/pdf_base_default.css', |
|
253 | - 'main_body' => apply_filters( 'FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )), $this->_content ) |
|
248 | + 'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"), |
|
249 | + 'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation), |
|
250 | + 'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation), |
|
251 | + 'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation), |
|
252 | + 'extra_css' => EE_LIBRARIES_URL.'messages/defaults/default/variations/pdf_base_default.css', |
|
253 | + 'main_body' => apply_filters('FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content) |
|
254 | 254 | ); |
255 | 255 | $this->_deregister_wp_hooks(); |
256 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); |
|
256 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles')); |
|
257 | 257 | $content = $this->_get_main_template(); |
258 | 258 | // die( $content ); |
259 | - $this->_do_pdf( $content ); |
|
259 | + $this->_do_pdf($content); |
|
260 | 260 | exit(0); |
261 | 261 | } |
262 | 262 | |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | |
281 | 281 | //just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load. |
282 | 282 | add_action('wp_head', 'wp_enqueue_scripts'); |
283 | - add_action( 'wp_footer', 'wp_print_footer_scripts' ); |
|
284 | - add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); |
|
283 | + add_action('wp_footer', 'wp_print_footer_scripts'); |
|
284 | + add_action('wp_print_footer_scripts', '_wp_footer_scripts'); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | |
@@ -294,11 +294,11 @@ discard block |
||
294 | 294 | * @param bool $preview |
295 | 295 | * @return string |
296 | 296 | */ |
297 | - protected function _get_main_template( $preview = FALSE ) { |
|
298 | - $wrapper_template = $this->_tmp_pack->get_wrapper( 'html', 'main' ); |
|
297 | + protected function _get_main_template($preview = FALSE) { |
|
298 | + $wrapper_template = $this->_tmp_pack->get_wrapper('html', 'main'); |
|
299 | 299 | //add message type to template_args |
300 | 300 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
301 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
301 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -311,21 +311,21 @@ discard block |
||
311 | 311 | * |
312 | 312 | * @return void |
313 | 313 | */ |
314 | - protected function _do_pdf( $content = '' ) { |
|
315 | - $invoice_name = html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8"); |
|
314 | + protected function _do_pdf($content = '') { |
|
315 | + $invoice_name = html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8"); |
|
316 | 316 | |
317 | 317 | //only load dompdf if nobody else has yet... |
318 | - if( ! defined('DOMPDF_DIR')){ |
|
318 | + if ( ! defined('DOMPDF_DIR')) { |
|
319 | 319 | define('DOMPDF_ENABLE_REMOTE', TRUE); |
320 | 320 | define('DOMPDF_ENABLE_JAVASCRIPT', FALSE); |
321 | 321 | define('DOMPDF_ENABLE_CSS_FLOAT', TRUE); |
322 | - require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php'); |
|
322 | + require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php'); |
|
323 | 323 | } |
324 | 324 | $dompdf = new DOMPDF(); |
325 | 325 | $dompdf->load_html($content); |
326 | 326 | $dompdf->render(); |
327 | 327 | //forcing the browser to open a download dialog. |
328 | - $dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => TRUE )); |
|
328 | + $dompdf->stream($invoice_name.".pdf", array('Attachment' => TRUE)); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @subpackage messages |
20 | 20 | * @author Darren Ethier |
21 | 21 | */ |
22 | -class EE_Html_messenger extends EE_messenger { |
|
22 | +class EE_Html_messenger extends EE_messenger { |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @see abstract declaration in EE_messenger for details. |
63 | 63 | */ |
64 | 64 | protected function _set_admin_pages() { |
65 | - $this->admin_registered_pages = array( 'events_edit' => true ); |
|
65 | + $this->admin_registered_pages = array('events_edit' => true); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -82,29 +82,29 @@ discard block |
||
82 | 82 | protected function _set_validator_config() { |
83 | 83 | $this->_validator_config = array( |
84 | 84 | 'subject' => array( |
85 | - 'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction' ) |
|
85 | + 'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction') |
|
86 | 86 | ), |
87 | 87 | 'content' => array( |
88 | - 'shortcodes' => array( 'organization', 'primary_registration_list', 'primary_registration_details', 'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list') |
|
88 | + 'shortcodes' => array('organization', 'primary_registration_list', 'primary_registration_details', 'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list') |
|
89 | 89 | ), |
90 | 90 | 'event_list' => array( |
91 | - 'shortcodes' => array( 'event', 'ticket_list', 'venue', 'primary_registration_details', 'primary_registration_list', 'event_author' ), |
|
91 | + 'shortcodes' => array('event', 'ticket_list', 'venue', 'primary_registration_details', 'primary_registration_list', 'event_author'), |
|
92 | 92 | 'required' => array('[EVENT_LIST]') |
93 | 93 | ), |
94 | 94 | 'ticket_list' => array( |
95 | - 'shortcodes' => array( 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'line_item_list', 'venue'), |
|
95 | + 'shortcodes' => array('attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'line_item_list', 'venue'), |
|
96 | 96 | 'required' => array('[TICKET_LIST]') |
97 | 97 | ), |
98 | 98 | 'ticket_line_item_no_pms' => array( |
99 | - 'shortcodes' => array( 'line_item', 'ticket' ), |
|
99 | + 'shortcodes' => array('line_item', 'ticket'), |
|
100 | 100 | 'required' => array('[TICKET_LINE_ITEM_LIST]') |
101 | 101 | ), |
102 | 102 | 'ticket_line_item_pms' => array( |
103 | - 'shortcodes' => array( 'line_item', 'ticket', 'line_item_list' ), |
|
103 | + 'shortcodes' => array('line_item', 'ticket', 'line_item_list'), |
|
104 | 104 | 'required' => array('[TICKET_LINE_ITEM_LIST]'), |
105 | 105 | ), |
106 | 106 | 'price_modifier_line_item_list' => array( |
107 | - 'shortcodes' => array( 'line_item' ), |
|
107 | + 'shortcodes' => array('line_item'), |
|
108 | 108 | 'required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]') |
109 | 109 | ), |
110 | 110 | 'datetime_list' => array( |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | |
133 | 133 | |
134 | 134 | |
135 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
136 | - if ( $sending_messenger_name = 'pdf' ) { |
|
137 | - add_filter( 'EE_messenger__get_variation__variation', array( $this, 'add_html_css' ), 10, 8 ); |
|
135 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
136 | + if ($sending_messenger_name = 'pdf') { |
|
137 | + add_filter('EE_messenger__get_variation__variation', array($this, 'add_html_css'), 10, 8); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | |
143 | - public function add_html_css( $variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters ) { |
|
144 | - $variation = $template_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ); |
|
143 | + public function add_html_css($variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters) { |
|
144 | + $variation = $template_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters); |
|
145 | 145 | return $variation; |
146 | 146 | } |
147 | 147 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function enqueue_scripts_styles() { |
156 | 156 | parent::enqueue_scripts_styles(); |
157 | - do_action( 'AHEE__EE_Html_messenger__enqueue_scripts_styles'); |
|
157 | + do_action('AHEE__EE_Html_messenger__enqueue_scripts_styles'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | ), |
215 | 215 | 'ticket_line_item_no_pms' => array( |
216 | 216 | 'input' => 'textarea', |
217 | - 'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with no Price Modifiers', 'event_espresso'), |
|
217 | + 'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with no Price Modifiers', 'event_espresso'), |
|
218 | 218 | 'type' => 'string', |
219 | 219 | 'required' => FALSE, |
220 | 220 | 'validation' => TRUE, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ), |
226 | 226 | 'ticket_line_item_pms' => array( |
227 | 227 | 'input' => 'textarea', |
228 | - 'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with Price Modifiers', 'event_espresso'), |
|
228 | + 'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with Price Modifiers', 'event_espresso'), |
|
229 | 229 | 'type' => 'string', |
230 | 230 | 'required' => FALSE, |
231 | 231 | 'validation' => TRUE, |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * |
319 | 319 | */ |
320 | 320 | protected function _set_default_message_types() { |
321 | - $this->_default_message_types = array( 'receipt', 'invoice' ); |
|
321 | + $this->_default_message_types = array('receipt', 'invoice'); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @since 4.5.0 |
330 | 330 | */ |
331 | 331 | protected function _set_valid_message_types() { |
332 | - $this->_valid_message_types = array( 'receipt', 'invoice' ); |
|
332 | + $this->_valid_message_types = array('receipt', 'invoice'); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -344,15 +344,15 @@ discard block |
||
344 | 344 | */ |
345 | 345 | protected function _send_message() { |
346 | 346 | $this->_template_args = array( |
347 | - 'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"), |
|
348 | - 'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ), |
|
349 | - 'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ), |
|
350 | - 'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ), |
|
351 | - 'main_body' => apply_filters( 'FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )), $this->_content ) |
|
347 | + 'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"), |
|
348 | + 'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation), |
|
349 | + 'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation), |
|
350 | + 'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation), |
|
351 | + 'main_body' => apply_filters('FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content) |
|
352 | 352 | ); |
353 | 353 | |
354 | 354 | $this->_deregister_wp_hooks(); |
355 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); |
|
355 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles')); |
|
356 | 356 | echo $this->_get_main_template(); |
357 | 357 | exit(); |
358 | 358 | } |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | $wp_scripts = $wp_styles = array(); |
377 | 377 | |
378 | 378 | //just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load. |
379 | - add_action( 'wp_footer', 'wp_print_footer_scripts' ); |
|
380 | - add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); |
|
379 | + add_action('wp_footer', 'wp_print_footer_scripts'); |
|
380 | + add_action('wp_print_footer_scripts', '_wp_footer_scripts'); |
|
381 | 381 | add_action('wp_head', 'wp_enqueue_scripts'); |
382 | 382 | } |
383 | 383 | |
@@ -391,13 +391,13 @@ discard block |
||
391 | 391 | * |
392 | 392 | * @return string |
393 | 393 | */ |
394 | - protected function _get_main_template( $preview = FALSE ) { |
|
395 | - $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, 'main' ); |
|
394 | + protected function _get_main_template($preview = FALSE) { |
|
395 | + $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, 'main'); |
|
396 | 396 | |
397 | 397 | //include message type as a template arg |
398 | 398 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
399 | 399 | |
400 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
400 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 |
@@ -167,44 +167,44 @@ discard block |
||
167 | 167 | public function __construct() { |
168 | 168 | $this->_set_props(); |
169 | 169 | //make sure classname is correct |
170 | - $classname = get_class( $this ); |
|
170 | + $classname = get_class($this); |
|
171 | 171 | //make sure required props have been set |
172 | 172 | |
173 | 173 | //if label is empty then throw an error because we should have it defined by now. |
174 | - if ( ! isset( $this->label ) ) { |
|
175 | - throw new EE_Error( sprintf( __('The label property is not set for %s. Please ensure that is set for the class.', 'event_espresso' ), $classname ) ); |
|
174 | + if ( ! isset($this->label)) { |
|
175 | + throw new EE_Error(sprintf(__('The label property is not set for %s. Please ensure that is set for the class.', 'event_espresso'), $classname)); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
179 | 179 | //the reference for this template pack |
180 | - if ( ! isset( $this->dbref ) ) { |
|
181 | - throw new EE_Error( sprintf( __('The dbref property is not set for %s. Please ensure that is set for the class.', 'event_espresso' ), $classname ) ); |
|
180 | + if ( ! isset($this->dbref)) { |
|
181 | + throw new EE_Error(sprintf(__('The dbref property is not set for %s. Please ensure that is set for the class.', 'event_espresso'), $classname)); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | //make sure dbref is safe |
185 | - $this->dbref = str_replace( '-', '_', sanitize_key( $this->dbref ) ); |
|
185 | + $this->dbref = str_replace('-', '_', sanitize_key($this->dbref)); |
|
186 | 186 | |
187 | - $should_be = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $this->dbref ) ) ); |
|
187 | + $should_be = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $this->dbref))); |
|
188 | 188 | |
189 | - if ( $should_be !== $classname ) { |
|
190 | - throw new EE_Error( sprintf( __('The name of the template pack instantiated class is "%s". It should be "%s". Make sure that the name of the template pack class matches is prepended with "EE_Messages_Template_Pack_" and appended with a sentence case iteration of the value for your template pack\'s dbref property.', 'event_espresso' ), $classname, $should_be ) ); |
|
189 | + if ($should_be !== $classname) { |
|
190 | + throw new EE_Error(sprintf(__('The name of the template pack instantiated class is "%s". It should be "%s". Make sure that the name of the template pack class matches is prepended with "EE_Messages_Template_Pack_" and appended with a sentence case iteration of the value for your template pack\'s dbref property.', 'event_espresso'), $classname, $should_be)); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | //if _base_path is not set then throw an error because a base path string is needed. |
194 | - if ( empty( $this->_base_path ) ) { |
|
195 | - throw new EE_Error( sprintf( __('The _base_path property is not set for %s. Please ensure that is set for the class.', 'event_espresso' ), $classname ) ); |
|
194 | + if (empty($this->_base_path)) { |
|
195 | + throw new EE_Error(sprintf(__('The _base_path property is not set for %s. Please ensure that is set for the class.', 'event_espresso'), $classname)); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
199 | 199 | //if _base_url is not set then throw an error because a string is needed for variations. |
200 | - if ( empty( $this->_base_url ) ) { |
|
201 | - throw new EE_Error( sprintf( __('The _base_url property is not set for %s. Please ensure that is set for the class.', 'event_espresso' ), $classname ) ); |
|
200 | + if (empty($this->_base_url)) { |
|
201 | + throw new EE_Error(sprintf(__('The _base_url property is not set for %s. Please ensure that is set for the class.', 'event_espresso'), $classname)); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | 205 | //if $supports is not set then throw an error because that effectively means this template_pack does not have any templates! |
206 | - if ( empty( $this->_supports ) ) { |
|
207 | - throw new EE_Error( sprintf( __('The supports property is not set for %s. Please ensure that is set for the class.', 'event_espresso' ), $classname ) ); |
|
206 | + if (empty($this->_supports)) { |
|
207 | + throw new EE_Error(sprintf(__('The supports property is not set for %s. Please ensure that is set for the class.', 'event_espresso'), $classname)); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | * |
242 | 242 | * @return array |
243 | 243 | */ |
244 | - public function get_templates( EE_messenger $messenger, EE_message_type $message_type ) { |
|
245 | - return isset( $this->_templates[$messenger->name][$message_type->name] ) ? $this->_templates[$messenger->name][$message_type->name] : $this->_get_templates( $messenger, $message_type ); |
|
244 | + public function get_templates(EE_messenger $messenger, EE_message_type $message_type) { |
|
245 | + return isset($this->_templates[$messenger->name][$message_type->name]) ? $this->_templates[$messenger->name][$message_type->name] : $this->_get_templates($messenger, $message_type); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @return array Returns an multi-level associative array indexed by template context and field in the format: |
260 | 260 | * array( 'context' => array( 'field' => 'value', 'another-field', 'value' ) ); |
261 | 261 | */ |
262 | - protected function _get_templates( EE_messenger $messenger, EE_message_type $message_type ) { |
|
262 | + protected function _get_templates(EE_messenger $messenger, EE_message_type $message_type) { |
|
263 | 263 | $templates = array(); |
264 | 264 | |
265 | 265 | /** |
@@ -278,28 +278,28 @@ discard block |
||
278 | 278 | $contexts = $message_type->get_contexts(); |
279 | 279 | |
280 | 280 | |
281 | - foreach ( $contexts as $context => $details ) { |
|
282 | - foreach ( $fields as $field => $field_details ) { |
|
283 | - if ( empty( $field_details ) ) |
|
281 | + foreach ($contexts as $context => $details) { |
|
282 | + foreach ($fields as $field => $field_details) { |
|
283 | + if (empty($field_details)) |
|
284 | 284 | continue; |
285 | 285 | /** |
286 | 286 | * is this a field array (linked to a main field)? |
287 | 287 | */ |
288 | - if ( $field == 'extra' ) { |
|
289 | - foreach ( $field_details as $main_field => $sub_fields ) { |
|
290 | - foreach ( $sub_fields as $sub_field => $sub_field_details ) { |
|
288 | + if ($field == 'extra') { |
|
289 | + foreach ($field_details as $main_field => $sub_fields) { |
|
290 | + foreach ($sub_fields as $sub_field => $sub_field_details) { |
|
291 | 291 | //make sure that the template_field_ref matches what the main template field is for this template group. |
292 | 292 | $template_field_ref = $sub_field == 'main' ? $main_field : $sub_field; |
293 | - $templates[ $context ][ $main_field ][ $sub_field ] = $this->_get_specific_template( $default_pack, $messenger, $message_type, $template_field_ref, $context ); |
|
293 | + $templates[$context][$main_field][$sub_field] = $this->_get_specific_template($default_pack, $messenger, $message_type, $template_field_ref, $context); |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | } else { |
297 | - $templates[ $context ][ $field ] = $this->_get_specific_template( $default_pack, $messenger, $message_type, $field, $context ); |
|
297 | + $templates[$context][$field] = $this->_get_specific_template($default_pack, $messenger, $message_type, $field, $context); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | } |
301 | 301 | |
302 | - $templates = apply_filters( 'FHEE__EE_Template_Pack___get_templates__templates', $templates, $messenger, $message_type, $this ); |
|
302 | + $templates = apply_filters('FHEE__EE_Template_Pack___get_templates__templates', $templates, $messenger, $message_type, $this); |
|
303 | 303 | |
304 | 304 | $this->_templates[$messenger->name][$message_type->name] = $templates; |
305 | 305 | return $templates; |
@@ -317,22 +317,22 @@ discard block |
||
317 | 317 | * |
318 | 318 | * @return string The template contents. |
319 | 319 | */ |
320 | - protected function _get_specific_template( $default_pack, EE_messenger $messenger, EE_message_type $message_type, $field, $context ) { |
|
320 | + protected function _get_specific_template($default_pack, EE_messenger $messenger, EE_message_type $message_type, $field, $context) { |
|
321 | 321 | |
322 | 322 | //default templates |
323 | - $default_templates = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_templates( $messenger, $message_type ) : array(); |
|
323 | + $default_templates = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_templates($messenger, $message_type) : array(); |
|
324 | 324 | |
325 | 325 | //first we allow for the $_base_path to be filtered. However, we assign this to a new variable so that we have the original base_path as a fallback. |
326 | - $filtered_base_path = apply_filters( 'FHEE__EE_Template_Pack___get_specific_template__filtered_base_path', $this->_base_path, $messenger, $message_type, $field, $context, $this ); |
|
326 | + $filtered_base_path = apply_filters('FHEE__EE_Template_Pack___get_specific_template__filtered_base_path', $this->_base_path, $messenger, $message_type, $field, $context, $this); |
|
327 | 327 | |
328 | 328 | $master_templates = $message_type->get_master_templates(); |
329 | - $master_templates_mt = isset( $master_templates[$messenger->name] ) ? $master_templates[$messenger->name] : $message_type->name; |
|
330 | - $full_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '_' . $context . '.template.php'; |
|
331 | - $fallback_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '.template.php'; |
|
332 | - $mt_defined_full_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php'; |
|
333 | - $mt_defined_fallback_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php'; |
|
334 | - $base_defined_full_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php'; |
|
335 | - $base_defined_fallback_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php'; |
|
329 | + $master_templates_mt = isset($master_templates[$messenger->name]) ? $master_templates[$messenger->name] : $message_type->name; |
|
330 | + $full_path = $filtered_base_path.$messenger->name.'_'.$message_type->name.'_'.$field.'_'.$context.'.template.php'; |
|
331 | + $fallback_path = $filtered_base_path.$messenger->name.'_'.$message_type->name.'_'.$field.'.template.php'; |
|
332 | + $mt_defined_full_path = $filtered_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'_'.$context.'.template.php'; |
|
333 | + $mt_defined_fallback_path = $filtered_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'.template.php'; |
|
334 | + $base_defined_full_path = $this->_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'_'.$context.'.template.php'; |
|
335 | + $base_defined_fallback_path = $this->_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'.template.php'; |
|
336 | 336 | |
337 | 337 | /** |
338 | 338 | * Template checks are done hierarchically in the following order: |
@@ -346,28 +346,28 @@ discard block |
||
346 | 346 | */ |
347 | 347 | |
348 | 348 | |
349 | - if ( is_readable( $full_path ) ) { |
|
349 | + if (is_readable($full_path)) { |
|
350 | 350 | $actual_path = $full_path; |
351 | - } elseif ( is_readable( $fallback_path ) ) { |
|
351 | + } elseif (is_readable($fallback_path)) { |
|
352 | 352 | $actual_path = $fallback_path; |
353 | - } elseif ( is_readable( $mt_defined_full_path ) ) { |
|
353 | + } elseif (is_readable($mt_defined_full_path)) { |
|
354 | 354 | $actual_path = $mt_defined_full_path; |
355 | - } elseif ( is_readable( $mt_defined_fallback_path ) ) { |
|
355 | + } elseif (is_readable($mt_defined_fallback_path)) { |
|
356 | 356 | $actual_path = $mt_defined_fallback_path; |
357 | - } elseif ( is_readable( $base_defined_full_path ) ) { |
|
357 | + } elseif (is_readable($base_defined_full_path)) { |
|
358 | 358 | $actual_path = $base_defined_full_path; |
359 | - } elseif ( is_readable( $base_defined_fallback_path ) ) { |
|
359 | + } elseif (is_readable($base_defined_fallback_path)) { |
|
360 | 360 | $actual_path = $base_defined_fallback_path; |
361 | - } else { |
|
361 | + } else { |
|
362 | 362 | $actual_path = ''; |
363 | 363 | } |
364 | - if ( empty( $actual_path ) ) { |
|
365 | - $contents = isset( $default_templates[$context][$field] ) ? $default_templates[$context][$field] : ''; |
|
364 | + if (empty($actual_path)) { |
|
365 | + $contents = isset($default_templates[$context][$field]) ? $default_templates[$context][$field] : ''; |
|
366 | 366 | } else { |
367 | - $contents = EEH_Template::display_template( $actual_path, array(), TRUE ); |
|
367 | + $contents = EEH_Template::display_template($actual_path, array(), TRUE); |
|
368 | 368 | } |
369 | 369 | |
370 | - return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', $contents, $actual_path, $messenger, $message_type, $field, $context, $this ); |
|
370 | + return apply_filters('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', $contents, $actual_path, $messenger, $message_type, $field, $context, $this); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -382,8 +382,8 @@ discard block |
||
382 | 382 | * @return array |
383 | 383 | */ |
384 | 384 | public function get_supports() { |
385 | - $supports = apply_filters( 'FHEE__' . get_class( $this ) . '__get_supports', $this->_supports ); |
|
386 | - return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_supports', $supports, $this ); |
|
385 | + $supports = apply_filters('FHEE__'.get_class($this).'__get_supports', $this->_supports); |
|
386 | + return apply_filters('FHEE__EE_Messages_Template_Pack__get_supports', $supports, $this); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | |
@@ -398,11 +398,11 @@ discard block |
||
398 | 398 | * |
399 | 399 | * @return array|string |
400 | 400 | */ |
401 | - public function get_default_variation_labels( $messenger = '' ) { |
|
402 | - $label = empty( $messenger ) ? $this->_default_variation_labels : array(); |
|
403 | - $label = empty( $label ) && ! empty( $this->_default_variation_labels[$messenger] ) ? $this->_default_variation_labels[$messenger] : __('Default', 'event_espresso'); |
|
401 | + public function get_default_variation_labels($messenger = '') { |
|
402 | + $label = empty($messenger) ? $this->_default_variation_labels : array(); |
|
403 | + $label = empty($label) && ! empty($this->_default_variation_labels[$messenger]) ? $this->_default_variation_labels[$messenger] : __('Default', 'event_espresso'); |
|
404 | 404 | |
405 | - return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_default_variation_labels', $label, $this->_default_variation_labels, $messenger ); |
|
405 | + return apply_filters('FHEE__EE_Messages_Template_Pack__get_default_variation_labels', $label, $this->_default_variation_labels, $messenger); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | |
@@ -418,25 +418,25 @@ discard block |
||
418 | 418 | * @param string $message_type if included then css variations matching the message_type are returned (must have $messenger set). Otherwise the array of variations per message type are returned. If message_type is provided but NOT the messenger, then just all variations for all messengers are returned. |
419 | 419 | * @return array |
420 | 420 | */ |
421 | - public function get_variations( $messenger = '', $message_type = '' ) { |
|
422 | - $messenger_variations = ! empty( $messenger ) && isset( $this->_variations[$messenger] ) ? $this->_variations[$messenger] : array(); |
|
421 | + public function get_variations($messenger = '', $message_type = '') { |
|
422 | + $messenger_variations = ! empty($messenger) && isset($this->_variations[$messenger]) ? $this->_variations[$messenger] : array(); |
|
423 | 423 | |
424 | 424 | //message_type provided? IF so, then we've requested a specific set of variations, so we need to make sure we set it as empty if that's not present. |
425 | - $variations = !empty( $messenger ) && !empty( $message_type ) && isset( $messenger_variations[$message_type] ) ? $messenger_variations[$message_type] : array(); |
|
425 | + $variations = ! empty($messenger) && ! empty($message_type) && isset($messenger_variations[$message_type]) ? $messenger_variations[$message_type] : array(); |
|
426 | 426 | |
427 | 427 | //now let's account for the possibility we just want all the variations for a messenger (which is indicated by providing the messenger but not the message type). |
428 | - $variations = empty( $variations ) && !empty( $messenger ) && empty( $message_type ) ? $messenger_variations : $variations; |
|
428 | + $variations = empty($variations) && ! empty($messenger) && empty($message_type) ? $messenger_variations : $variations; |
|
429 | 429 | |
430 | 430 | //filter per template pack and globally. |
431 | - $variations = apply_filters( 'FHEE__' . get_class( $this ) . '__get_variations', $variations, $messenger, $message_type ); |
|
432 | - $variations = apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variations', $variations, $messenger, $message_type, $this ); |
|
431 | + $variations = apply_filters('FHEE__'.get_class($this).'__get_variations', $variations, $messenger, $message_type); |
|
432 | + $variations = apply_filters('FHEE__EE_Messages_Template_Pack__get_variations', $variations, $messenger, $message_type, $this); |
|
433 | 433 | |
434 | 434 | //prepend the _default_variation, but ONLY if we're returning the fully validated array. |
435 | - if ( !empty( $messenger ) && !empty( $message_type ) && ! empty( $variations ) ) { |
|
436 | - $variations = array( 'default' => $this->get_default_variation_labels( $messenger ) ) + $variations; |
|
435 | + if ( ! empty($messenger) && ! empty($message_type) && ! empty($variations)) { |
|
436 | + $variations = array('default' => $this->get_default_variation_labels($messenger)) + $variations; |
|
437 | 437 | } |
438 | 438 | |
439 | - return empty( $variations ) ? array( 'default' => $this->get_default_variation_labels('dft') ): $variations; |
|
439 | + return empty($variations) ? array('default' => $this->get_default_variation_labels('dft')) : $variations; |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | |
@@ -457,39 +457,39 @@ discard block |
||
457 | 457 | * |
458 | 458 | * @return string The variation path or url (typically css reference) |
459 | 459 | */ |
460 | - public function get_variation( $messenger, $message_type, $type, $variation, $url = true, $file_extension = '.css', $skip_filters = FALSE ) { |
|
460 | + public function get_variation($messenger, $message_type, $type, $variation, $url = true, $file_extension = '.css', $skip_filters = FALSE) { |
|
461 | 461 | |
462 | 462 | $base = $url ? $this->_base_url : $this->_base_path; |
463 | 463 | $base_path = $this->_base_path; |
464 | 464 | |
465 | - if ( ! $skip_filters ) { |
|
466 | - $base = apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation__base_path_or_url', $base, $messenger, $message_type, $type, $variation, $url, $file_extension, $this ); |
|
467 | - $base_path = apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation__base_path', $base_path, $messenger, $message_type, $type, $variation, FALSE, $file_extension, $this ); |
|
465 | + if ( ! $skip_filters) { |
|
466 | + $base = apply_filters('FHEE__EE_Messages_Template_Pack__get_variation__base_path_or_url', $base, $messenger, $message_type, $type, $variation, $url, $file_extension, $this); |
|
467 | + $base_path = apply_filters('FHEE__EE_Messages_Template_Pack__get_variation__base_path', $base_path, $messenger, $message_type, $type, $variation, FALSE, $file_extension, $this); |
|
468 | 468 | } |
469 | 469 | |
470 | - $default_pack = get_class( $this ) != 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : $this; |
|
470 | + $default_pack = get_class($this) != 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : $this; |
|
471 | 471 | |
472 | 472 | //possible variation paths considering whether message type is present or not in the file name. |
473 | - $path_string = 'variations/' . $messenger . '_' . $message_type . '_' . $type . '_' . $variation . $file_extension; |
|
474 | - $default_path_string = 'variations/' . $messenger . '_' . $type . '_' . $variation . $file_extension; |
|
473 | + $path_string = 'variations/'.$messenger.'_'.$message_type.'_'.$type.'_'.$variation.$file_extension; |
|
474 | + $default_path_string = 'variations/'.$messenger.'_'.$type.'_'.$variation.$file_extension; |
|
475 | 475 | |
476 | 476 | //first see if fully validated file exists. |
477 | - if ( is_readable( $base_path . $path_string ) ) { |
|
478 | - $variation_path = $base . $path_string; |
|
477 | + if (is_readable($base_path.$path_string)) { |
|
478 | + $variation_path = $base.$path_string; |
|
479 | 479 | //otherwise see if default exists. |
480 | - } elseif ( is_readable( $base_path . $default_path_string ) ) { |
|
481 | - $variation_path = $base . $default_path_string; |
|
480 | + } elseif (is_readable($base_path.$default_path_string)) { |
|
481 | + $variation_path = $base.$default_path_string; |
|
482 | 482 | } else { |
483 | - $variation_path = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_default_variation( $messenger, $message_type, $type, $url, $file_extension ) : ''; |
|
483 | + $variation_path = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_default_variation($messenger, $message_type, $type, $url, $file_extension) : ''; |
|
484 | 484 | } |
485 | 485 | |
486 | - if ( $skip_filters ) { |
|
486 | + if ($skip_filters) { |
|
487 | 487 | return $variation_path; |
488 | 488 | } |
489 | 489 | |
490 | 490 | //filter result |
491 | - $variation_path = apply_filters( 'FHEE__' . get_class( $this ) . '__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url ); |
|
492 | - return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, $this ); |
|
491 | + $variation_path = apply_filters('FHEE__'.get_class($this).'__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url); |
|
492 | + return apply_filters('FHEE__EE_Messages_Template_Pack__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, $this); |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | |
@@ -504,19 +504,19 @@ discard block |
||
504 | 504 | * |
505 | 505 | * @return string returns the path for the requested wrapper template. |
506 | 506 | */ |
507 | - public function get_wrapper( $messenger, $type = 'main' ) { |
|
508 | - $default_pack = get_class( $this ) !== 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : NULL; |
|
507 | + public function get_wrapper($messenger, $type = 'main') { |
|
508 | + $default_pack = get_class($this) !== 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : NULL; |
|
509 | 509 | |
510 | - $path_string = $this->_base_path . $messenger . '_' . $type . '_wrapper.template.php'; |
|
510 | + $path_string = $this->_base_path.$messenger.'_'.$type.'_wrapper.template.php'; |
|
511 | 511 | |
512 | - if ( is_readable( $path_string ) ) { |
|
512 | + if (is_readable($path_string)) { |
|
513 | 513 | $template = $path_string; |
514 | 514 | } else { |
515 | - $template = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_wrapper( $messenger, $type ) : ''; |
|
515 | + $template = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_wrapper($messenger, $type) : ''; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | //filter |
519 | - $template = apply_filters( 'FHEE__' . get_class( $this ) . '__get_wrapper', $template, $messenger, $type ); |
|
520 | - return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_wrapper', $template, $messenger, $type, $this ); |
|
519 | + $template = apply_filters('FHEE__'.get_class($this).'__get_wrapper', $template, $messenger, $type); |
|
520 | + return apply_filters('FHEE__EE_Messages_Template_Pack__get_wrapper', $template, $messenger, $type, $this); |
|
521 | 521 | } |
522 | 522 | } |
@@ -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 | /** |
@@ -55,33 +55,33 @@ discard block |
||
55 | 55 | '[EVENT_NAME]' => __("This also can be used for the name of the event", 'event_espresso'), |
56 | 56 | '[EVENT_PHONE]' => __('The phone number for the event (usually an info number)', 'event_espresso'), |
57 | 57 | '[EVENT_DESCRIPTION]' => __('The description of the event', 'event_espresso'), |
58 | - '[EVENT_EXCERPT]' => __( 'This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso' ), |
|
58 | + '[EVENT_EXCERPT]' => __('This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso'), |
|
59 | 59 | '[EVENT_LINK]' => __('A link associated with the event', 'event_espresso'), |
60 | 60 | '[EVENT_URL]' => __('A link to the event set up on the host site.', 'event_espresso'), |
61 | 61 | '[VIRTUAL_URL]' => __('What was used for the "URL of Event" field in the Venue settings', 'event_espresso'), |
62 | 62 | '[VIRTUAL_PHONE]' => __('An alternate phone number for the event. Typically used as a "call-in" number', 'event_espresso'), |
63 | 63 | '[EVENT_IMAGE]' => __('This will parse to the Feature image for the event.', 'event_espresso'), |
64 | 64 | '[EVENT_TOTAL_AVAILABLE_SPACES_*]' => sprintf( |
65 | - __( 'This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event. There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode). %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso' ), |
|
65 | + __('This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event. There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode). %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso'), |
|
66 | 66 | '<code>', |
67 | 67 | '</code>' |
68 | 68 | ), |
69 | - '[EVENT_TOTAL_SPOTS_TAKEN]' => __( 'This shortcode will parse to the output the total approved registrations for this event', 'event_espresso' ), |
|
69 | + '[EVENT_TOTAL_SPOTS_TAKEN]' => __('This shortcode will parse to the output the total approved registrations for this event', 'event_espresso'), |
|
70 | 70 | '[EVENT_FACEBOOK_URL]' => __('This will return the Facebook URL for the event if you have it set via custom field in your event, otherwise it will use the Facebook URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_facebook</code> and the value as your facebook url.', 'event_espresso'), |
71 | 71 | '[EVENT_TWITTER_URL]' => __('This will return the Twitter URL for the event if you have it set via custom field in your event, otherwise it will use the Twitter URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_twitter</code> and the value as your facebook url', 'event_espresso'), |
72 | 72 | '[EVENT_META_*]' => __('This is a special dynamic shortcode. After the "*", add the exact name for your custom field, if there is a value set for that custom field within the event then it will be output in place of this shortcode.', 'event_espresso'), |
73 | - '[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __( 'This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso' ), |
|
73 | + '[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __('This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso'), |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | - protected function _parser( $shortcode ) { |
|
78 | + protected function _parser($shortcode) { |
|
79 | 79 | |
80 | 80 | |
81 | 81 | $this->_event = $this->_data instanceof EE_Event ? $this->_data : null; |
82 | 82 | |
83 | 83 | //if no event, then let's see if there is a reg_obj. If there IS, then we'll try and grab the event from the reg_obj instead. |
84 | - if ( empty( $this->_event ) ) { |
|
84 | + if (empty($this->_event)) { |
|
85 | 85 | $aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL; |
86 | 86 | $aee = $this->_extra_data instanceof EE_Messages_Addressee ? $this->_extra_data : $aee; |
87 | 87 | |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | |
91 | 91 | |
92 | 92 | //If there is no event objecdt by now then get out. |
93 | - if ( ! $this->_event instanceof EE_Event ) |
|
93 | + if ( ! $this->_event instanceof EE_Event) |
|
94 | 94 | return ''; |
95 | 95 | |
96 | - switch ( $shortcode ) { |
|
96 | + switch ($shortcode) { |
|
97 | 97 | |
98 | 98 | case '[EVENT_ID]' : |
99 | 99 | return $this->_event->ID(); |
@@ -126,41 +126,41 @@ discard block |
||
126 | 126 | |
127 | 127 | case '[VIRTUAL_URL]' : |
128 | 128 | $venue = $this->_event->get_first_related('Venue'); |
129 | - if ( empty( $venue ) ) |
|
129 | + if (empty($venue)) |
|
130 | 130 | return ''; |
131 | 131 | return $venue->get('VNU_virtual_url'); |
132 | 132 | |
133 | 133 | case '[VIRTUAL_PHONE]' : |
134 | 134 | $venue = $this->_event->get_first_related('Venue'); |
135 | - if ( empty( $venue ) ) |
|
135 | + if (empty($venue)) |
|
136 | 136 | return ''; |
137 | 137 | return $venue->get('VNU_virtual_phone'); |
138 | 138 | break; |
139 | 139 | |
140 | 140 | case '[EVENT_IMAGE]' : |
141 | - $image = $this->_event->feature_image_url(array(600,300) ); |
|
141 | + $image = $this->_event->feature_image_url(array(600, 300)); |
|
142 | 142 | // @todo: eventually we should make this an attribute shortcode so that em can send along what size they want returned. |
143 | - return !empty( $image ) ? '<img src="' . $image . '" alt="' . sprintf( esc_attr__( '%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name') ) . '" />' : ''; |
|
143 | + return ! empty($image) ? '<img src="'.$image.'" alt="'.sprintf(esc_attr__('%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name')).'" />' : ''; |
|
144 | 144 | break; |
145 | 145 | |
146 | 146 | case '[EVENT_FACEBOOK_URL]' : |
147 | - $facebook_url = $this->_event->get_post_meta('event_facebook', true ); |
|
148 | - return empty( $facebook_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ) : $facebook_url; |
|
147 | + $facebook_url = $this->_event->get_post_meta('event_facebook', true); |
|
148 | + return empty($facebook_url) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : $facebook_url; |
|
149 | 149 | break; |
150 | 150 | |
151 | 151 | case '[EVENT_TWITTER_URL]' : |
152 | 152 | $twitter_url = $this->_event->get_post_meta('event_twitter', true); |
153 | - return empty( $twitter_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ) : $twitter_url; |
|
153 | + return empty($twitter_url) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : $twitter_url; |
|
154 | 154 | break; |
155 | 155 | |
156 | 156 | case '[EVENT_AUTHOR_EMAIL]' : |
157 | 157 | $author_id = $this->_event->get('EVT_wp_user'); |
158 | - $user_data = get_userdata( (int) $author_id ); |
|
158 | + $user_data = get_userdata((int) $author_id); |
|
159 | 159 | return $user_data->user_email; |
160 | 160 | break; |
161 | 161 | |
162 | 162 | case '[EVENT_TOTAL_SPOTS_TAKEN]' : |
163 | - return EEM_Registration::instance()->count( array( array( 'EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved ) ), 'REG_ID', true ); |
|
163 | + return EEM_Registration::instance()->count(array(array('EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved)), 'REG_ID', true); |
|
164 | 164 | break; |
165 | 165 | |
166 | 166 | case '[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' : |
@@ -170,26 +170,26 @@ discard block |
||
170 | 170 | 'page' => 'espresso_registrations', |
171 | 171 | 'action' => 'default' |
172 | 172 | ), |
173 | - admin_url( 'admin.php' ), |
|
173 | + admin_url('admin.php'), |
|
174 | 174 | true |
175 | 175 | ); |
176 | 176 | break; |
177 | 177 | } |
178 | 178 | |
179 | - if ( strpos( $shortcode, '[EVENT_META_*' ) !== false ) { |
|
180 | - $shortcode = str_replace( '[EVENT_META_*', '', $shortcode ); |
|
181 | - $shortcode = trim( str_replace( ']', '', $shortcode ) ); |
|
179 | + if (strpos($shortcode, '[EVENT_META_*') !== false) { |
|
180 | + $shortcode = str_replace('[EVENT_META_*', '', $shortcode); |
|
181 | + $shortcode = trim(str_replace(']', '', $shortcode)); |
|
182 | 182 | |
183 | 183 | //pull the meta value from the event post |
184 | - $event_meta = $this->_event->get_post_meta( $shortcode, true ); |
|
184 | + $event_meta = $this->_event->get_post_meta($shortcode, true); |
|
185 | 185 | |
186 | - return !empty( $event_meta ) ? $this->_event->get_post_meta( $shortcode, true ) : ''; |
|
186 | + return ! empty($event_meta) ? $this->_event->get_post_meta($shortcode, true) : ''; |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | |
190 | - if ( strpos( $shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*' ) !== false ) { |
|
191 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
192 | - $method = empty( $attrs['method'] ) ? 'current' : $attrs['method']; |
|
190 | + if (strpos($shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*') !== false) { |
|
191 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
192 | + $method = empty($attrs['method']) ? 'current' : $attrs['method']; |
|
193 | 193 | $method = $method === 'current'; |
194 | 194 | $available = $this->_event->total_available_spaces($method); |
195 | 195 | return $available === EE_INF ? '∞' : $available; |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | * @param boolean $full_link if TRUE (default) we return the html for the name of the event linked to the event. Otherwise we just return the url of the event. |
206 | 206 | * @return string |
207 | 207 | */ |
208 | - private function _get_event_link( $event, $full_link = TRUE ) { |
|
208 | + private function _get_event_link($event, $full_link = TRUE) { |
|
209 | 209 | $url = get_permalink($event->ID()); |
210 | 210 | |
211 | - return $full_link ? '<a href="' . $url . '">' . $event->get('EVT_name') . '</a>' : $url; |
|
211 | + return $full_link ? '<a href="'.$url.'">'.$event->get('EVT_name').'</a>' : $url; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 |
@@ -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 | /** |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | - protected function _parser( $shortcode ) { |
|
65 | + protected function _parser($shortcode) { |
|
66 | 66 | |
67 | - switch ( $shortcode ) { |
|
67 | + switch ($shortcode) { |
|
68 | 68 | |
69 | 69 | case '[VENUE_TITLE]' : |
70 | 70 | return $this->_venue('title'); |
@@ -132,38 +132,38 @@ discard block |
||
132 | 132 | * @param string $what What to retrieve from database |
133 | 133 | * @return string What was retrieved! |
134 | 134 | */ |
135 | - private function _venue( $db_ref ) { |
|
135 | + private function _venue($db_ref) { |
|
136 | 136 | |
137 | 137 | //we need the EE_Event object to get the venue. |
138 | 138 | |
139 | 139 | $this->_event = $this->_data instanceof EE_Event ? $this->_data : null; |
140 | 140 | |
141 | 141 | //if no event, then let's see if there is a reg_obj. If there IS, then we'll try and grab the event from the reg_obj instead. |
142 | - if ( empty( $this->_event ) ) { |
|
142 | + if (empty($this->_event)) { |
|
143 | 143 | $aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL; |
144 | 144 | $aee = $this->_extra_data instanceof EE_Messages_Addressee ? $this->_extra_data : $aee; |
145 | 145 | |
146 | 146 | $this->_event = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->event() : NULL; |
147 | 147 | |
148 | 148 | //if still empty do we have a ticket data item? |
149 | - $this->_event = empty( $this->_event ) && $this->_data instanceof EE_Ticket && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data']->tickets[$this->_data->ID()]['EE_Event'] : $this->_event; |
|
149 | + $this->_event = empty($this->_event) && $this->_data instanceof EE_Ticket && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data']->tickets[$this->_data->ID()]['EE_Event'] : $this->_event; |
|
150 | 150 | |
151 | 151 | //if STILL empty event, let's try to get the first event in the list of events via EE_Messages_Addressee and use that. |
152 | - $event = $aee instanceof EE_Messages_Addressee ? reset( $aee->events ) : array(); |
|
153 | - $this->_event = empty( $this->_event ) && !empty( $events ) ? $event : $this->_event; |
|
152 | + $event = $aee instanceof EE_Messages_Addressee ? reset($aee->events) : array(); |
|
153 | + $this->_event = empty($this->_event) && ! empty($events) ? $event : $this->_event; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
157 | 157 | //If there is no event objecdt by now then get out. |
158 | - if ( ! $this->_event instanceof EE_Event ) |
|
158 | + if ( ! $this->_event instanceof EE_Event) |
|
159 | 159 | return ''; |
160 | 160 | |
161 | 161 | $venue = $this->_event->get_first_related('Venue'); |
162 | 162 | |
163 | - if ( empty( $venue ) ) |
|
163 | + if (empty($venue)) |
|
164 | 164 | return ''; //no venue so get out. |
165 | 165 | |
166 | - switch ( $db_ref ) { |
|
166 | + switch ($db_ref) { |
|
167 | 167 | case 'title': |
168 | 168 | return $venue->get('VNU_name'); |
169 | 169 | break; |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | |
175 | 175 | case 'url': |
176 | 176 | $url = $venue->get('VNU_url'); |
177 | - return empty( $url ) ? $venue->get_permalink() : $url; |
|
177 | + return empty($url) ? $venue->get_permalink() : $url; |
|
178 | 178 | break; |
179 | 179 | |
180 | 180 | case 'image': |
181 | - return '<img src="' . $venue->feature_image_url(array(200,200) ) . '" alt="' . sprintf( esc_attr__( '%s Feature Image', 'event_espresso'), $venue->get('VNU_name') ) . '" />'; |
|
181 | + return '<img src="'.$venue->feature_image_url(array(200, 200)).'" alt="'.sprintf(esc_attr__('%s Feature Image', 'event_espresso'), $venue->get('VNU_name')).'" />'; |
|
182 | 182 | break; |
183 | 183 | |
184 | 184 | case 'phone': |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | break; |
213 | 213 | |
214 | 214 | case 'formatted_address' : |
215 | - return EEH_Address::format( $venue ); |
|
215 | + return EEH_Address::format($venue); |
|
216 | 216 | break; |
217 | 217 | |
218 | 218 | case 'gmap_link': |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | 'id' => $venue->ID(), |
224 | 224 | 'address' => $venue->get('VNU_address'), |
225 | 225 | 'city' => $venue->get('VNU_city'), |
226 | - 'state' => is_object( $state ) ? $state->get('STA_name') : '', |
|
226 | + 'state' => is_object($state) ? $state->get('STA_name') : '', |
|
227 | 227 | 'zip' => $venue->get('VNU_zip'), |
228 | - 'country' => is_object( $country ) ? $country->get('CNT_name'): '', |
|
228 | + 'country' => is_object($country) ? $country->get('CNT_name') : '', |
|
229 | 229 | 'type' => $db_ref == 'gmap_link' ? 'url' : 'map', |
230 | 230 | 'map_w' => 200, |
231 | 231 | 'map_h' => 200 |