@@ -7,13 +7,13 @@ |
||
7 | 7 | <!-- Facebook sharing information tags --> |
8 | 8 | <meta property="og:title" content="<?php echo $subject; ?>" /> |
9 | 9 | <title><?php echo $subject; ?></title> |
10 | - <?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_head', $message_type, $subject, $from, $main_body ); ?> |
|
10 | + <?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_head', $message_type, $subject, $from, $main_body); ?> |
|
11 | 11 | </head> |
12 | -<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_header', $message_type, $subject, $from, $main_body ); ?> |
|
12 | +<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_header', $message_type, $subject, $from, $main_body); ?> |
|
13 | 13 | <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> |
14 | -<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_before_main_body', $message_type, $subject, $from, $main_body ); ?> |
|
14 | +<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_before_main_body', $message_type, $subject, $from, $main_body); ?> |
|
15 | 15 | <?php echo $main_body; ?> |
16 | -<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_after_main_body', $message_type, $subject, $from, $main_body ); ?> |
|
16 | +<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_after_main_body', $message_type, $subject, $from, $main_body); ?> |
|
17 | 17 | </body> |
18 | -<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_footer', $message_type, $subject, $from, $main_body ); ?> |
|
18 | +<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_footer', $message_type, $subject, $from, $main_body); ?> |
|
19 | 19 | </html> |
20 | 20 | \ No newline at end of file |
@@ -27,21 +27,21 @@ |
||
27 | 27 | <!-- Primary Style Sheet --> |
28 | 28 | <link rel="stylesheet" type="text/css" href="<?php echo $main_css; ?>" /> |
29 | 29 | <!-- Make sure the buttons don't print --> |
30 | - <?php if ( isset( $extra_css )) : ?> |
|
30 | + <?php if (isset($extra_css)) : ?> |
|
31 | 31 | <!-- Additional Style Sheet --> |
32 | 32 | <link rel="stylesheet" type="text/css" href="<?php echo $extra_css; ?>" /> |
33 | 33 | <?php endif; ?> |
34 | 34 | <style type="text/css"> |
35 | 35 | @media print{ .noPrint{ display:none !important;height:0!important; width:0!important; margin:0!important; padding:0!important; }} |
36 | 36 | </style> |
37 | - <?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_head', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
37 | + <?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_head', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
38 | 38 | </head> |
39 | - <?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_header', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
39 | + <?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_header', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
40 | 40 | <body> |
41 | - <?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_before_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
41 | + <?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_before_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
42 | 42 | <?php echo $main_body; ?> |
43 | - <?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_after_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
43 | + <?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_after_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
44 | 44 | </body> |
45 | - <?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_footer', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
45 | + <?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_footer', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?> |
|
46 | 46 | <?php wp_footer(); ?> |
47 | 47 | </html> |
48 | 48 | \ No newline at end of file |
@@ -116,7 +116,7 @@ |
||
116 | 116 | * @access public |
117 | 117 | * @param EE_Template_Config $CFG |
118 | 118 | * @param array $REQ |
119 | - * @return EE_Event_Single_Config |
|
119 | + * @return EE_Template_Config |
|
120 | 120 | */ |
121 | 121 | public static function update_template_settings( $CFG, $REQ ) { |
122 | 122 | $display_order_tickets = isset( $CFG->EED_Event_Single->display_order_tickets ) ? $CFG->EED_Event_Single->display_order_tickets : 100; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return EED_Event_Single_Caff |
30 | 30 | */ |
31 | 31 | public static function instance() { |
32 | - return parent::get_instance( __CLASS__ ); |
|
32 | + return parent::get_instance(__CLASS__); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -50,34 +50,34 @@ discard block |
||
50 | 50 | * @return void |
51 | 51 | */ |
52 | 52 | public static function set_hooks_admin() { |
53 | - define( 'EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
54 | - define( 'EVENT_SINGLE_CAFF_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
53 | + define('EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
54 | + define('EVENT_SINGLE_CAFF_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
55 | 55 | add_action( |
56 | 56 | 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__template_settings', |
57 | - array( 'EED_Event_Single_Caff', 'load_scripts_styles' ), |
|
57 | + array('EED_Event_Single_Caff', 'load_scripts_styles'), |
|
58 | 58 | 10 |
59 | 59 | ); |
60 | - add_action( 'AHEE__template_settings__template__before_settings_form', array( 'EED_Event_Single_Caff', 'template_settings_form' ), 10 ); |
|
61 | - add_filter( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', array( 'EED_Event_Single_Caff', 'update_template_settings' ), 10, 2 ); |
|
60 | + add_action('AHEE__template_settings__template__before_settings_form', array('EED_Event_Single_Caff', 'template_settings_form'), 10); |
|
61 | + add_filter('FHEE__General_Settings_Admin_Page__update_template_settings__data', array('EED_Event_Single_Caff', 'update_template_settings'), 10, 2); |
|
62 | 62 | // AJAX |
63 | - add_action( 'wp_ajax_espresso_update_event_single_order', array( 'EED_Event_Single_Caff', 'update_event_single_order' ) ); |
|
64 | - add_action( 'wp_ajax_nopriv_espresso_update_event_single_order', array( 'EED_Event_Single_Caff', 'update_event_single_order' ) ); |
|
63 | + add_action('wp_ajax_espresso_update_event_single_order', array('EED_Event_Single_Caff', 'update_event_single_order')); |
|
64 | + add_action('wp_ajax_nopriv_espresso_update_event_single_order', array('EED_Event_Single_Caff', 'update_event_single_order')); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | 70 | public static function load_scripts_styles() { |
71 | - add_action( 'admin_enqueue_scripts', array( 'EED_Event_Single_Caff', 'enqueue_scripts_styles' ), 10 ); |
|
71 | + add_action('admin_enqueue_scripts', array('EED_Event_Single_Caff', 'enqueue_scripts_styles'), 10); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | 76 | public static function enqueue_scripts_styles() { |
77 | - wp_register_style( 'eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL . 'eed_event_single_sortable.css', array(), EVENT_ESPRESSO_VERSION ); |
|
78 | - wp_enqueue_style( 'eed-event-single-sortable' ); |
|
79 | - wp_register_script( 'eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL . 'eed_event_single_sortable.js', array( 'jquery-ui-sortable' ), EVENT_ESPRESSO_VERSION, true ); |
|
80 | - wp_enqueue_script( 'eed-event-single-sortable' ); |
|
77 | + wp_register_style('eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL.'eed_event_single_sortable.css', array(), EVENT_ESPRESSO_VERSION); |
|
78 | + wp_enqueue_style('eed-event-single-sortable'); |
|
79 | + wp_register_script('eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL.'eed_event_single_sortable.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true); |
|
80 | + wp_enqueue_script('eed-event-single-sortable'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -91,21 +91,21 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function template_settings_form() { |
93 | 93 | $config = EE_Registry::instance()->CFG->template_settings; |
94 | - $config = isset( $config->EED_Event_Single ) && $config->EED_Event_Single instanceof EE_Event_Single_Config ? $config->EED_Event_Single : new EE_Event_Single_Config(); |
|
95 | - $config->use_sortable_display_order = isset( $config->use_sortable_display_order ) ? $config->use_sortable_display_order : false; |
|
96 | - $config = apply_filters( 'FHEE__EED_Event_Single__template_settings_form__event_list_config', $config ); |
|
94 | + $config = isset($config->EED_Event_Single) && $config->EED_Event_Single instanceof EE_Event_Single_Config ? $config->EED_Event_Single : new EE_Event_Single_Config(); |
|
95 | + $config->use_sortable_display_order = isset($config->use_sortable_display_order) ? $config->use_sortable_display_order : false; |
|
96 | + $config = apply_filters('FHEE__EED_Event_Single__template_settings_form__event_list_config', $config); |
|
97 | 97 | |
98 | 98 | $event_single_order_array = array(); |
99 | - $event_single_order_array[ $config->display_order_tickets ] = 'tickets'; |
|
100 | - $event_single_order_array[ $config->display_order_datetimes ] = 'datetimes'; |
|
101 | - $event_single_order_array[ $config->display_order_event ] = 'event'; |
|
102 | - $event_single_order_array[ $config->display_order_venue ] = 'venue'; |
|
99 | + $event_single_order_array[$config->display_order_tickets] = 'tickets'; |
|
100 | + $event_single_order_array[$config->display_order_datetimes] = 'datetimes'; |
|
101 | + $event_single_order_array[$config->display_order_event] = 'event'; |
|
102 | + $event_single_order_array[$config->display_order_venue] = 'venue'; |
|
103 | 103 | // get template parts |
104 | - $template_parts = EED_Event_Single::instance()->initialize_template_parts( $config ); |
|
104 | + $template_parts = EED_Event_Single::instance()->initialize_template_parts($config); |
|
105 | 105 | // convert to array so that we can add more properties |
106 | - $config = get_object_vars( $config ); |
|
107 | - $config[ 'event_single_display_order' ] = $template_parts->generate_sortable_list_of_template_parts( 'event-single-sortable-js', '', 'single-sortable-li single-sortable-js' ); |
|
108 | - EEH_Template::display_template( EVENT_SINGLE_CAFF_TEMPLATES_PATH . 'admin-event-single-settings.template.php', $config ); |
|
106 | + $config = get_object_vars($config); |
|
107 | + $config['event_single_display_order'] = $template_parts->generate_sortable_list_of_template_parts('event-single-sortable-js', '', 'single-sortable-li single-sortable-js'); |
|
108 | + EEH_Template::display_template(EVENT_SINGLE_CAFF_TEMPLATES_PATH.'admin-event-single-settings.template.php', $config); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -118,20 +118,20 @@ discard block |
||
118 | 118 | * @param array $REQ |
119 | 119 | * @return EE_Event_Single_Config |
120 | 120 | */ |
121 | - public static function update_template_settings( $CFG, $REQ ) { |
|
122 | - $display_order_tickets = isset( $CFG->EED_Event_Single->display_order_tickets ) ? $CFG->EED_Event_Single->display_order_tickets : 100; |
|
123 | - $display_order_datetimes = isset( $CFG->EED_Event_Single->display_order_datetimes ) ? $CFG->EED_Event_Single->display_order_datetimes : 110; |
|
124 | - $display_order_event = isset( $CFG->EED_Event_Single->display_order_event ) ? $CFG->EED_Event_Single->display_order_event : 120; |
|
125 | - $display_order_venue = isset( $CFG->EED_Event_Single->display_order_venue ) ? $CFG->EED_Event_Single->display_order_venue : 130; |
|
121 | + public static function update_template_settings($CFG, $REQ) { |
|
122 | + $display_order_tickets = isset($CFG->EED_Event_Single->display_order_tickets) ? $CFG->EED_Event_Single->display_order_tickets : 100; |
|
123 | + $display_order_datetimes = isset($CFG->EED_Event_Single->display_order_datetimes) ? $CFG->EED_Event_Single->display_order_datetimes : 110; |
|
124 | + $display_order_event = isset($CFG->EED_Event_Single->display_order_event) ? $CFG->EED_Event_Single->display_order_event : 120; |
|
125 | + $display_order_venue = isset($CFG->EED_Event_Single->display_order_venue) ? $CFG->EED_Event_Single->display_order_venue : 130; |
|
126 | 126 | $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
127 | - $CFG->EED_Event_Single->display_status_banner_single = !empty( $REQ['display_status_banner_single'] ) && $REQ['display_status_banner_single'] ? TRUE : FALSE; |
|
128 | - $CFG->EED_Event_Single->display_venue = ! empty( $REQ['display_venue'] ) && $REQ['display_venue'] ? TRUE : FALSE; |
|
129 | - $CFG->EED_Event_Single->use_sortable_display_order = ! empty( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) ? absint( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) : 0; |
|
127 | + $CFG->EED_Event_Single->display_status_banner_single = ! empty($REQ['display_status_banner_single']) && $REQ['display_status_banner_single'] ? TRUE : FALSE; |
|
128 | + $CFG->EED_Event_Single->display_venue = ! empty($REQ['display_venue']) && $REQ['display_venue'] ? TRUE : FALSE; |
|
129 | + $CFG->EED_Event_Single->use_sortable_display_order = ! empty($REQ['EED_Events_Single_use_sortable_display_order']) ? absint($REQ['EED_Events_Single_use_sortable_display_order']) : 0; |
|
130 | 130 | $CFG->EED_Event_Single->display_order_tickets = $CFG->EED_Event_Single->use_sortable_display_order ? $display_order_tickets : 100; |
131 | 131 | $CFG->EED_Event_Single->display_order_datetimes = $CFG->EED_Event_Single->use_sortable_display_order ? $display_order_datetimes : 110; |
132 | 132 | $CFG->EED_Event_Single->display_order_event = $CFG->EED_Event_Single->use_sortable_display_order ? $display_order_event : 120; |
133 | 133 | $CFG->EED_Event_Single->display_order_venue = $CFG->EED_Event_Single->use_sortable_display_order ? $display_order_venue : 130; |
134 | - do_action( 'AHEE__EED_Event_Single__update_template_settings__after_update', $CFG, $REQ ); |
|
134 | + do_action('AHEE__EED_Event_Single__update_template_settings__after_update', $CFG, $REQ); |
|
135 | 135 | return $CFG; |
136 | 136 | } |
137 | 137 | |
@@ -145,23 +145,23 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public static function update_event_single_order() { |
147 | 147 | $config_saved = false; |
148 | - $template_parts = sanitize_text_field( $_POST[ 'elements' ] ); |
|
149 | - if ( ! empty( $template_parts ) ) { |
|
150 | - $template_parts = explode( ',', trim( $template_parts, ',' ) ); |
|
151 | - foreach ( $template_parts as $key => $template_part ) { |
|
148 | + $template_parts = sanitize_text_field($_POST['elements']); |
|
149 | + if ( ! empty($template_parts)) { |
|
150 | + $template_parts = explode(',', trim($template_parts, ',')); |
|
151 | + foreach ($template_parts as $key => $template_part) { |
|
152 | 152 | $template_part = "display_order_$template_part"; |
153 | - $priority = ( $key * 10 ) + 100; |
|
153 | + $priority = ($key * 10) + 100; |
|
154 | 154 | EE_Registry::instance()->CFG->template_settings->EED_Event_Single->{$template_part} = $priority; |
155 | - do_action( "AHEE__EED_Event_Single__update_event_single_order__$template_part", $priority ); |
|
155 | + do_action("AHEE__EED_Event_Single__update_event_single_order__$template_part", $priority); |
|
156 | 156 | } |
157 | - $config_saved = EE_Registry::instance()->CFG->update_espresso_config( false, false ); |
|
157 | + $config_saved = EE_Registry::instance()->CFG->update_espresso_config(false, false); |
|
158 | 158 | } |
159 | - if ( $config_saved ) { |
|
160 | - EE_Error::add_success( __( 'Display Order has been successfully updated.', 'event_espresso' ) ); |
|
159 | + if ($config_saved) { |
|
160 | + EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso')); |
|
161 | 161 | } else { |
162 | - EE_Error::add_error( __( 'Display Order was not updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
162 | + EE_Error::add_error(__('Display Order was not updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
163 | 163 | } |
164 | - echo wp_json_encode( EE_Error::get_notices( false )); |
|
164 | + echo wp_json_encode(EE_Error::get_notices(false)); |
|
165 | 165 | exit(); |
166 | 166 | } |
167 | 167 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param WP $WP |
175 | 175 | * @return void |
176 | 176 | */ |
177 | - public function run( $WP ) { |
|
177 | + public function run($WP) { |
|
178 | 178 | } |
179 | 179 | |
180 | 180 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -123,7 +123,7 @@ |
||
123 | 123 | * @access public |
124 | 124 | * @param EE_Template_Config $CFG |
125 | 125 | * @param array $REQ |
126 | - * @return EE_Events_Archive_Config |
|
126 | + * @return EE_Template_Config |
|
127 | 127 | */ |
128 | 128 | public static function update_template_settings( $CFG, $REQ ) { |
129 | 129 | $config = new EE_Events_Archive_Config(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @return EED_Events_Archive_Caff |
29 | 29 | */ |
30 | 30 | public static function instance() { |
31 | - return parent::get_instance( __CLASS__ ); |
|
31 | + return parent::get_instance(__CLASS__); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @return void |
50 | 50 | */ |
51 | 51 | public static function set_hooks_admin() { |
52 | - define( 'EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
53 | - define( 'EVENT_ARCHIVE_CAFF_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
54 | - add_action( 'AHEE__template_settings__template__before_settings_form', array( 'EED_Events_Archive_Caff', 'template_settings_form' ), 10 ); |
|
55 | - add_filter( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', array( 'EED_Events_Archive_Caff', 'update_template_settings' ), 10, 2 ); |
|
52 | + define('EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
53 | + define('EVENT_ARCHIVE_CAFF_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
54 | + add_action('AHEE__template_settings__template__before_settings_form', array('EED_Events_Archive_Caff', 'template_settings_form'), 10); |
|
55 | + add_filter('FHEE__General_Settings_Admin_Page__update_template_settings__data', array('EED_Events_Archive_Caff', 'update_template_settings'), 10, 2); |
|
56 | 56 | // AJAX |
57 | - add_action( 'wp_ajax_espresso_update_event_archive_order', array( 'EED_Events_Archive_Caff', 'update_event_archive_order' ) ); |
|
58 | - add_action( 'wp_ajax_nopriv_espresso_update_event_archive_order', array( 'EED_Events_Archive_Caff', 'update_event_archive_order' ) ); |
|
57 | + add_action('wp_ajax_espresso_update_event_archive_order', array('EED_Events_Archive_Caff', 'update_event_archive_order')); |
|
58 | + add_action('wp_ajax_nopriv_espresso_update_event_archive_order', array('EED_Events_Archive_Caff', 'update_event_archive_order')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param WP $WP |
69 | 69 | * @return void |
70 | 70 | */ |
71 | - public function run( $WP ) { |
|
71 | + public function run($WP) { |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -83,33 +83,33 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public static function template_settings_form() { |
85 | 85 | // grab general settings admin page and remove the existing hook callback |
86 | - $gen_set_admin = EE_Registry::instance()->LIB->EE_Admin_Page_Loader->get_admin_page_object( 'general_settings' ); |
|
87 | - if ( $gen_set_admin instanceof General_Settings_Admin_Page ) { |
|
88 | - remove_action( 'AHEE__template_settings__template__before_settings_form', array( $gen_set_admin, 'template_settings_caff_features' ), 100 ); |
|
86 | + $gen_set_admin = EE_Registry::instance()->LIB->EE_Admin_Page_Loader->get_admin_page_object('general_settings'); |
|
87 | + if ($gen_set_admin instanceof General_Settings_Admin_Page) { |
|
88 | + remove_action('AHEE__template_settings__template__before_settings_form', array($gen_set_admin, 'template_settings_caff_features'), 100); |
|
89 | 89 | } |
90 | 90 | // first just grab the template settings |
91 | 91 | $config = EE_Registry::instance()->CFG->template_settings; |
92 | 92 | // then if the Event Archive config is valid, use that, else create a new one |
93 | - $config = isset( $config->EED_Events_Archive ) && $config->EED_Events_Archive instanceof EE_Events_Archive_Config ? $config->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
94 | - $config = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $config ); |
|
95 | - $config->display_status_banner = isset( $config->display_status_banner ) ? $config->display_status_banner : 0; |
|
96 | - $config->display_description = isset( $config->display_description ) ? $config->display_description : 1; |
|
97 | - $config->display_ticket_selector = isset( $config->display_ticket_selector ) ? $config->display_ticket_selector : 0; |
|
98 | - $config->display_datetimes = isset( $config->display_datetimes ) ? $config->display_datetimes : 1; |
|
99 | - $config->display_venue = isset( $config->display_venue ) ? $config->display_venue : 0; |
|
100 | - $config->display_expired_events = isset( $config->display_expired_events ) ? $config->display_expired_events : 0; |
|
93 | + $config = isset($config->EED_Events_Archive) && $config->EED_Events_Archive instanceof EE_Events_Archive_Config ? $config->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
94 | + $config = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $config); |
|
95 | + $config->display_status_banner = isset($config->display_status_banner) ? $config->display_status_banner : 0; |
|
96 | + $config->display_description = isset($config->display_description) ? $config->display_description : 1; |
|
97 | + $config->display_ticket_selector = isset($config->display_ticket_selector) ? $config->display_ticket_selector : 0; |
|
98 | + $config->display_datetimes = isset($config->display_datetimes) ? $config->display_datetimes : 1; |
|
99 | + $config->display_venue = isset($config->display_venue) ? $config->display_venue : 0; |
|
100 | + $config->display_expired_events = isset($config->display_expired_events) ? $config->display_expired_events : 0; |
|
101 | 101 | // display order options |
102 | - $config->use_sortable_display_order = isset( $config->use_sortable_display_order )? $config->use_sortable_display_order : false; |
|
103 | - $config->display_order_tickets = isset( $config->display_order_tickets )? $config->display_order_tickets : 100; |
|
104 | - $config->display_order_datetimes = isset( $config->display_order_datetimes )? $config->display_order_datetimes : 110; |
|
105 | - $config->display_order_event = isset( $config->display_order_event )? $config->display_order_event : 120; |
|
106 | - $config->display_order_venue = isset( $config->display_order_venue )? $config->display_order_venue : 130; |
|
102 | + $config->use_sortable_display_order = isset($config->use_sortable_display_order) ? $config->use_sortable_display_order : false; |
|
103 | + $config->display_order_tickets = isset($config->display_order_tickets) ? $config->display_order_tickets : 100; |
|
104 | + $config->display_order_datetimes = isset($config->display_order_datetimes) ? $config->display_order_datetimes : 110; |
|
105 | + $config->display_order_event = isset($config->display_order_event) ? $config->display_order_event : 120; |
|
106 | + $config->display_order_venue = isset($config->display_order_venue) ? $config->display_order_venue : 130; |
|
107 | 107 | // get template parts |
108 | - $template_parts = EED_Events_Archive::instance()->initialize_template_parts( $config ); |
|
108 | + $template_parts = EED_Events_Archive::instance()->initialize_template_parts($config); |
|
109 | 109 | // convert to array so that we can add more properties |
110 | - $config = get_object_vars( $config ); |
|
111 | - $config[ 'event_archive_display_order' ] = $template_parts->generate_sortable_list_of_template_parts( 'event-archive-sortable-js', '', 'archive-sortable-li archive-sortable-js' ); |
|
112 | - EEH_Template::display_template( EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $config ); |
|
110 | + $config = get_object_vars($config); |
|
111 | + $config['event_archive_display_order'] = $template_parts->generate_sortable_list_of_template_parts('event-archive-sortable-js', '', 'archive-sortable-li archive-sortable-js'); |
|
112 | + EEH_Template::display_template(EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH.'admin-event-list-settings.template.php', $config); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -125,24 +125,24 @@ discard block |
||
125 | 125 | * @param array $REQ |
126 | 126 | * @return EE_Events_Archive_Config |
127 | 127 | */ |
128 | - public static function update_template_settings( $CFG, $REQ ) { |
|
128 | + public static function update_template_settings($CFG, $REQ) { |
|
129 | 129 | $config = new EE_Events_Archive_Config(); |
130 | 130 | // unless we are resetting the config... |
131 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
132 | - $config->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
133 | - $config->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
134 | - $config->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
135 | - $config->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
136 | - $config->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
137 | - $config->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; |
|
138 | - $config->use_sortable_display_order = isset( $REQ['EED_Events_Archive_use_sortable_display_order'] ) ? absint( $REQ['EED_Events_Archive_use_sortable_display_order'] ) : 0; |
|
139 | - $config->display_order_tickets = isset( $CFG->EED_Events_Archive->display_order_tickets ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_tickets : 100; |
|
140 | - $config->display_order_datetimes = isset( $CFG->EED_Events_Archive->display_order_datetimes ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_datetimes : 110; |
|
141 | - $config->display_order_event = isset( $CFG->EED_Events_Archive->display_order_event ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_event : 120; |
|
142 | - $config->display_order_venue = isset( $CFG->EED_Events_Archive->display_order_venue ) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_venue : 130; |
|
131 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
132 | + $config->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
133 | + $config->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
134 | + $config->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
135 | + $config->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
136 | + $config->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
137 | + $config->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; |
|
138 | + $config->use_sortable_display_order = isset($REQ['EED_Events_Archive_use_sortable_display_order']) ? absint($REQ['EED_Events_Archive_use_sortable_display_order']) : 0; |
|
139 | + $config->display_order_tickets = isset($CFG->EED_Events_Archive->display_order_tickets) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_tickets : 100; |
|
140 | + $config->display_order_datetimes = isset($CFG->EED_Events_Archive->display_order_datetimes) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_datetimes : 110; |
|
141 | + $config->display_order_event = isset($CFG->EED_Events_Archive->display_order_event) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_event : 120; |
|
142 | + $config->display_order_venue = isset($CFG->EED_Events_Archive->display_order_venue) && $config->use_sortable_display_order ? $CFG->EED_Events_Archive->display_order_venue : 130; |
|
143 | 143 | } |
144 | 144 | $CFG->EED_Events_Archive = $config; |
145 | - do_action( 'AHEE__EED_Events_Archive__update_template_settings__after_update', $CFG, $REQ ); |
|
145 | + do_action('AHEE__EED_Events_Archive__update_template_settings__after_update', $CFG, $REQ); |
|
146 | 146 | return $CFG; |
147 | 147 | } |
148 | 148 | |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public static function update_event_archive_order() { |
158 | 158 | $config_saved = false; |
159 | - $template_parts = sanitize_text_field( $_POST[ 'elements' ] ); |
|
160 | - if ( ! empty( $template_parts ) ) { |
|
161 | - $template_parts = explode( ',', trim( $template_parts, ',' ) ); |
|
162 | - foreach ( $template_parts as $key => $template_part ) { |
|
159 | + $template_parts = sanitize_text_field($_POST['elements']); |
|
160 | + if ( ! empty($template_parts)) { |
|
161 | + $template_parts = explode(',', trim($template_parts, ',')); |
|
162 | + foreach ($template_parts as $key => $template_part) { |
|
163 | 163 | $template_part = "display_order_$template_part"; |
164 | - $priority = ( $key * 10 ) + 100; |
|
164 | + $priority = ($key * 10) + 100; |
|
165 | 165 | if ( |
166 | 166 | property_exists( |
167 | 167 | EE_Registry::instance()->CFG->template_settings->EED_Events_Archive, |
@@ -170,16 +170,16 @@ discard block |
||
170 | 170 | ) { |
171 | 171 | EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->{$template_part} = $priority; |
172 | 172 | } |
173 | - do_action( "AHEE__EED_Events_Archive__update_event_archive_order__$template_part", $priority ); |
|
173 | + do_action("AHEE__EED_Events_Archive__update_event_archive_order__$template_part", $priority); |
|
174 | 174 | } |
175 | - $config_saved = EE_Registry::instance()->CFG->update_espresso_config( false, false ); |
|
175 | + $config_saved = EE_Registry::instance()->CFG->update_espresso_config(false, false); |
|
176 | 176 | } |
177 | - if ( $config_saved ) { |
|
178 | - EE_Error::add_success( __( 'Display Order has been successfully updated.', 'event_espresso' ) ); |
|
177 | + if ($config_saved) { |
|
178 | + EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso')); |
|
179 | 179 | } else { |
180 | - EE_Error::add_error( __( 'Display Order was not updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
180 | + EE_Error::add_error(__('Display Order was not updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
181 | 181 | } |
182 | - echo wp_json_encode( EE_Error::get_notices( false ) ); |
|
182 | + echo wp_json_encode(EE_Error::get_notices(false)); |
|
183 | 183 | exit(); |
184 | 184 | } |
185 | 185 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | protected function _get_billing_values_from_form( $billing_form ){ |
443 | 443 | if($billing_form instanceof EE_Form_Section_Proper ){ |
444 | 444 | return $billing_form->input_pretty_values( true ); |
445 | - }else{ |
|
445 | + } else{ |
|
446 | 446 | return NULL; |
447 | 447 | } |
448 | 448 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | public function supports_sending_refunds(){ |
551 | 551 | if($this->_gateway && $this->_gateway instanceof EE_Gateway){ |
552 | 552 | return $this->_gateway->supports_sending_refunds(); |
553 | - }else{ |
|
553 | + } else{ |
|
554 | 554 | return false; |
555 | 555 | } |
556 | 556 | } |
@@ -588,11 +588,11 @@ discard block |
||
588 | 588 | public function payment_occurs(){ |
589 | 589 | if( ! $this->_gateway){ |
590 | 590 | return EE_PMT_Base::offline; |
591 | - }elseif($this->_gateway instanceof EE_Onsite_Gateway){ |
|
591 | + } elseif($this->_gateway instanceof EE_Onsite_Gateway){ |
|
592 | 592 | return EE_PMT_Base::onsite; |
593 | - }elseif($this->_gateway instanceof EE_Offsite_Gateway){ |
|
593 | + } elseif($this->_gateway instanceof EE_Offsite_Gateway){ |
|
594 | 594 | return EE_PMT_Base::offsite; |
595 | - }else{ |
|
595 | + } else{ |
|
596 | 596 | throw new EE_Error(sprintf(__("Payment method type '%s's gateway isn't an instance of EE_Onsite_Gateway, EE_Offsite_Gateway, or null. It must be one of those", "event_espresso"),get_class($this))); |
597 | 597 | } |
598 | 598 | } |
@@ -277,17 +277,17 @@ |
||
277 | 277 | //if we know who the attendee is, and this is a billing form |
278 | 278 | //that uses attendee info, populate it |
279 | 279 | if ( |
280 | - apply_filters( |
|
281 | - 'FHEE__populate_billing_form_fields_from_attendee', |
|
282 | - ( |
|
283 | - $this->_billing_form instanceof EE_Billing_Attendee_Info_Form |
|
284 | - && $transaction instanceof EE_Transaction |
|
285 | - && $transaction->primary_registration() instanceof EE_Registration |
|
286 | - && $transaction->primary_registration()->attendee() instanceof EE_Attendee |
|
287 | - ), |
|
288 | - $this->_billing_form, |
|
289 | - $transaction |
|
290 | - ) |
|
280 | + apply_filters( |
|
281 | + 'FHEE__populate_billing_form_fields_from_attendee', |
|
282 | + ( |
|
283 | + $this->_billing_form instanceof EE_Billing_Attendee_Info_Form |
|
284 | + && $transaction instanceof EE_Transaction |
|
285 | + && $transaction->primary_registration() instanceof EE_Registration |
|
286 | + && $transaction->primary_registration()->attendee() instanceof EE_Attendee |
|
287 | + ), |
|
288 | + $this->_billing_form, |
|
289 | + $transaction |
|
290 | + ) |
|
291 | 291 | ){ |
292 | 292 | $this->_billing_form->populate_from_attendee( $transaction->primary_registration()->attendee() ); |
293 | 293 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @since $VID:$ |
15 | 15 | * |
16 | 16 | */ |
17 | -abstract class EE_PMT_Base{ |
|
17 | +abstract class EE_PMT_Base { |
|
18 | 18 | |
19 | 19 | const onsite = 'on-site'; |
20 | 20 | const offsite = 'off-site'; |
@@ -95,31 +95,31 @@ discard block |
||
95 | 95 | * @return EE_PMT_Base |
96 | 96 | */ |
97 | 97 | function __construct($pm_instance = NULL) { |
98 | - if ( $pm_instance instanceof EE_Payment_Method ){ |
|
98 | + if ($pm_instance instanceof EE_Payment_Method) { |
|
99 | 99 | $this->set_instance($pm_instance); |
100 | 100 | } |
101 | - if($this->_gateway){ |
|
102 | - $this->_gateway->set_payment_model( EEM_Payment::instance() ); |
|
103 | - $this->_gateway->set_payment_log( EEM_Change_Log::instance() ); |
|
104 | - $this->_gateway->set_template_helper( new EEH_Template() ); |
|
105 | - $this->_gateway->set_line_item_helper( new EEH_Line_Item() ); |
|
106 | - $this->_gateway->set_money_helper( new EEH_Money() ); |
|
101 | + if ($this->_gateway) { |
|
102 | + $this->_gateway->set_payment_model(EEM_Payment::instance()); |
|
103 | + $this->_gateway->set_payment_log(EEM_Change_Log::instance()); |
|
104 | + $this->_gateway->set_template_helper(new EEH_Template()); |
|
105 | + $this->_gateway->set_line_item_helper(new EEH_Line_Item()); |
|
106 | + $this->_gateway->set_money_helper(new EEH_Money()); |
|
107 | 107 | } |
108 | - if ( ! isset( $this->_has_billing_form ) ) { |
|
108 | + if ( ! isset($this->_has_billing_form)) { |
|
109 | 109 | // by default, On Site gateways have a billing form |
110 | - if ( $this->payment_occurs() == EE_PMT_Base::onsite ) { |
|
111 | - $this->set_has_billing_form( true ); |
|
110 | + if ($this->payment_occurs() == EE_PMT_Base::onsite) { |
|
111 | + $this->set_has_billing_form(true); |
|
112 | 112 | } else { |
113 | - $this->set_has_billing_form( false ); |
|
113 | + $this->set_has_billing_form(false); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | - if( ! $this->_pretty_name){ |
|
117 | + if ( ! $this->_pretty_name) { |
|
118 | 118 | throw new EE_Error(sprintf(__("You must set the pretty name for the Payment Method Type in the constructor (_pretty_name), and please make it internationalized", "event_espresso"))); |
119 | 119 | } |
120 | 120 | //if the child didn't specify a default button, use the credit card one |
121 | - if( $this->_default_button_url === NULL){ |
|
122 | - $this->_default_button_url = EE_PLUGIN_DIR_URL . 'payment_methods' . DS . 'pay-by-credit-card.png'; |
|
121 | + if ($this->_default_button_url === NULL) { |
|
122 | + $this->_default_button_url = EE_PLUGIN_DIR_URL.'payment_methods'.DS.'pay-by-credit-card.png'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @param boolean $has_billing_form |
130 | 130 | */ |
131 | - public function set_has_billing_form( $has_billing_form ) { |
|
132 | - $this->_has_billing_form = filter_var( $has_billing_form, FILTER_VALIDATE_BOOLEAN ); |
|
131 | + public function set_has_billing_form($has_billing_form) { |
|
132 | + $this->_has_billing_form = filter_var($has_billing_form, FILTER_VALIDATE_BOOLEAN); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | /** |
138 | 138 | * sets the file_folder property |
139 | 139 | */ |
140 | - protected function _set_file_folder(){ |
|
140 | + protected function _set_file_folder() { |
|
141 | 141 | $reflector = new ReflectionClass(get_class($this)); |
142 | 142 | $fn = $reflector->getFileName(); |
143 | - $this->_file_folder = dirname($fn).DS; |
|
143 | + $this->_file_folder = dirname($fn).DS; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | /** |
149 | 149 | * sets the file URL with a trailing slash for this PMT |
150 | 150 | */ |
151 | - protected function _set_file_url(){ |
|
152 | - $plugins_dir_fixed = str_replace('\\',DS,WP_PLUGIN_DIR); |
|
153 | - $file_folder_fixed = str_replace('\\',DS,$this->file_folder()); |
|
154 | - $file_path = str_replace($plugins_dir_fixed,WP_PLUGIN_URL,$file_folder_fixed); |
|
151 | + protected function _set_file_url() { |
|
152 | + $plugins_dir_fixed = str_replace('\\', DS, WP_PLUGIN_DIR); |
|
153 | + $file_folder_fixed = str_replace('\\', DS, $this->file_folder()); |
|
154 | + $file_path = str_replace($plugins_dir_fixed, WP_PLUGIN_URL, $file_folder_fixed); |
|
155 | 155 | $this->_file_url = $file_path; |
156 | 156 | } |
157 | 157 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * Gets the default description on all payment methods of this type |
160 | 160 | * @return string |
161 | 161 | */ |
162 | - public function default_description(){ |
|
162 | + public function default_description() { |
|
163 | 163 | return $this->_default_description; |
164 | 164 | } |
165 | 165 | |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | * Returns the folder containing the PMT child class, with a trailing slash |
170 | 170 | * @return string |
171 | 171 | */ |
172 | - public function file_folder(){ |
|
173 | - if( ! $this->_file_folder ) { |
|
172 | + public function file_folder() { |
|
173 | + if ( ! $this->_file_folder) { |
|
174 | 174 | $this->_set_file_folder(); |
175 | 175 | } |
176 | 176 | return $this->_file_folder; |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * @return string |
183 | 183 | */ |
184 | - public function file_url(){ |
|
185 | - if( ! $this->_file_url ) { |
|
184 | + public function file_url() { |
|
185 | + if ( ! $this->_file_url) { |
|
186 | 186 | $this->_set_file_url(); |
187 | 187 | } |
188 | 188 | return $this->_file_url; |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | * Its important teh payment method instance is set before |
196 | 196 | * @param EE_Payment_Method $payment_method_instance |
197 | 197 | */ |
198 | - function set_instance($payment_method_instance){ |
|
198 | + function set_instance($payment_method_instance) { |
|
199 | 199 | $this->_pm_instance = $payment_method_instance; |
200 | 200 | //if they have already requested the settings form, make sure its |
201 | 201 | //data matches this model object |
202 | - if($this->_settings_form){ |
|
202 | + if ($this->_settings_form) { |
|
203 | 203 | $this->settings_form()->populate_model_obj($payment_method_instance); |
204 | 204 | } |
205 | - if($this->_gateway && $this->_gateway instanceof EE_Gateway){ |
|
205 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
206 | 206 | $this->_gateway->set_settings($payment_method_instance->settings_array()); |
207 | 207 | } |
208 | 208 | } |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | * Gets teh form for displaying to admins where they setup the payment method |
214 | 214 | * @return EE_Payment_Method_Form |
215 | 215 | */ |
216 | - function settings_form(){ |
|
217 | - if( ! $this->_settings_form){ |
|
216 | + function settings_form() { |
|
217 | + if ( ! $this->_settings_form) { |
|
218 | 218 | $this->_settings_form = $this->generate_new_settings_form(); |
219 | - $this->_settings_form->set_payment_method_type( $this ); |
|
220 | - $this->_settings_form->_construct_finalize(NULL, NULL ); |
|
219 | + $this->_settings_form->set_payment_method_type($this); |
|
220 | + $this->_settings_form->_construct_finalize(NULL, NULL); |
|
221 | 221 | //if we have already assigned a model object to this pmt, make |
222 | 222 | //sure its reflected in teh form we just generated |
223 | - if($this->_pm_instance){ |
|
223 | + if ($this->_pm_instance) { |
|
224 | 224 | $this->_settings_form->populate_model_obj($this->_pm_instance); |
225 | 225 | } |
226 | 226 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * this payment method type's settings form later in the request |
247 | 247 | * @param EE_Payment_Method_Form $form |
248 | 248 | */ |
249 | - public function set_settings_form($form){ |
|
249 | + public function set_settings_form($form) { |
|
250 | 250 | $this->_settings_form = $form; |
251 | 251 | } |
252 | 252 | |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | * @param array $extra_args |
270 | 270 | * @return \EE_Billing_Attendee_Info_Form|\EE_Billing_Info_Form|null |
271 | 271 | */ |
272 | - public function billing_form( EE_Transaction $transaction = NULL, $extra_args = array() ){ |
|
272 | + public function billing_form(EE_Transaction $transaction = NULL, $extra_args = array()) { |
|
273 | 273 | // has billing form already been regenerated ? or overwrite cache? |
274 | - if ( ! $this->_billing_form instanceof EE_Billing_Info_Form || ! $this->_cache_billing_form ){ |
|
275 | - $this->_billing_form = $this->generate_new_billing_form( $transaction, $extra_args ); |
|
274 | + if ( ! $this->_billing_form instanceof EE_Billing_Info_Form || ! $this->_cache_billing_form) { |
|
275 | + $this->_billing_form = $this->generate_new_billing_form($transaction, $extra_args); |
|
276 | 276 | } |
277 | 277 | //if we know who the attendee is, and this is a billing form |
278 | 278 | //that uses attendee info, populate it |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | $this->_billing_form, |
289 | 289 | $transaction |
290 | 290 | ) |
291 | - ){ |
|
292 | - $this->_billing_form->populate_from_attendee( $transaction->primary_registration()->attendee() ); |
|
291 | + ) { |
|
292 | + $this->_billing_form->populate_from_attendee($transaction->primary_registration()->attendee()); |
|
293 | 293 | } |
294 | 294 | return $this->_billing_form; |
295 | 295 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @param \EE_Transaction $transaction |
301 | 301 | * @return \EE_Billing_Info_Form |
302 | 302 | */ |
303 | - abstract function generate_new_billing_form( EE_Transaction $transaction = NULL ); |
|
303 | + abstract function generate_new_billing_form(EE_Transaction $transaction = NULL); |
|
304 | 304 | |
305 | 305 | |
306 | 306 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @param \EE_Billing_Info_Form $billing_form |
312 | 312 | * @return \EE_Billing_Info_Form |
313 | 313 | */ |
314 | - public function apply_billing_form_debug_settings( EE_Billing_Info_Form $billing_form ) { |
|
314 | + public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) { |
|
315 | 315 | return $billing_form; |
316 | 316 | } |
317 | 317 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * if you have form |
323 | 323 | * @param EE_Payment_Method $form |
324 | 324 | */ |
325 | - public function set_billing_form($form){ |
|
325 | + public function set_billing_form($form) { |
|
326 | 326 | $this->_billing_form = $form; |
327 | 327 | } |
328 | 328 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | * Returns whether or not this payment method requires HTTPS to be used |
333 | 333 | * @return boolean |
334 | 334 | */ |
335 | - function requires_https(){ |
|
335 | + function requires_https() { |
|
336 | 336 | return $this->_requires_https; |
337 | 337 | } |
338 | 338 | |
@@ -350,9 +350,9 @@ discard block |
||
350 | 350 | * @return EE_Payment |
351 | 351 | * @throws EE_Error |
352 | 352 | */ |
353 | - function process_payment( EE_Transaction $transaction, $amount = null, $billing_info = null, $return_url = null,$fail_url = '', $method = 'CART', $by_admin = false ){ |
|
353 | + function process_payment(EE_Transaction $transaction, $amount = null, $billing_info = null, $return_url = null, $fail_url = '', $method = 'CART', $by_admin = false) { |
|
354 | 354 | // @todo: add surcharge for the payment method, if any |
355 | - if ( $this->_gateway ) { |
|
355 | + if ($this->_gateway) { |
|
356 | 356 | //there is a gateway, so we're going to make a payment object |
357 | 357 | //but wait! do they already have a payment in progress that we thought was failed? |
358 | 358 | $duplicate_properties = array( |
@@ -363,10 +363,10 @@ discard block |
||
363 | 363 | 'PAY_amount' => $amount !== null ? $amount : $transaction->remaining(), |
364 | 364 | 'PAY_gateway_response' => null, |
365 | 365 | ); |
366 | - $payment = EEM_Payment::instance()->get_one( array( $duplicate_properties )); |
|
366 | + $payment = EEM_Payment::instance()->get_one(array($duplicate_properties)); |
|
367 | 367 | //if we didn't already have a payment in progress for the same thing, |
368 | 368 | //then we actually want to make a new payment |
369 | - if ( ! $payment instanceof EE_Payment ){ |
|
369 | + if ( ! $payment instanceof EE_Payment) { |
|
370 | 370 | $payment = EE_Payment::new_instance( |
371 | 371 | array_merge( |
372 | 372 | $duplicate_properties, |
@@ -382,10 +382,10 @@ discard block |
||
382 | 382 | } |
383 | 383 | //make sure the payment has been saved to show we started it, and so it has an ID should the gateway try to log it |
384 | 384 | $payment->save(); |
385 | - $billing_values = $this->_get_billing_values_from_form( $billing_info ); |
|
385 | + $billing_values = $this->_get_billing_values_from_form($billing_info); |
|
386 | 386 | |
387 | 387 | // Offsite Gateway |
388 | - if( $this->_gateway instanceof EE_Offsite_Gateway ){ |
|
388 | + if ($this->_gateway instanceof EE_Offsite_Gateway) { |
|
389 | 389 | |
390 | 390 | $payment = $this->_gateway->set_redirection_info( |
391 | 391 | $payment, |
@@ -401,17 +401,17 @@ discard block |
||
401 | 401 | ); |
402 | 402 | $payment->save(); |
403 | 403 | // Onsite Gateway |
404 | - } elseif ( $this->_gateway instanceof EE_Onsite_Gateway ) { |
|
404 | + } elseif ($this->_gateway instanceof EE_Onsite_Gateway) { |
|
405 | 405 | |
406 | - $payment = $this->_gateway->do_direct_payment($payment,$billing_values); |
|
406 | + $payment = $this->_gateway->do_direct_payment($payment, $billing_values); |
|
407 | 407 | $payment->save(); |
408 | 408 | |
409 | 409 | } else { |
410 | 410 | throw new EE_Error( |
411 | 411 | sprintf( |
412 | - __('Gateway for payment method type "%s" is "%s", not a subclass of either EE_Offsite_Gateway or EE_Onsite_Gateway, or null (to indicate NO gateway)', 'event_espresso' ), |
|
412 | + __('Gateway for payment method type "%s" is "%s", not a subclass of either EE_Offsite_Gateway or EE_Onsite_Gateway, or null (to indicate NO gateway)', 'event_espresso'), |
|
413 | 413 | get_class($this), |
414 | - gettype( $this->_gateway ) |
|
414 | + gettype($this->_gateway) |
|
415 | 415 | ) |
416 | 416 | ); |
417 | 417 | } |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | } |
434 | 434 | |
435 | 435 | // if there is billing info, clean it and save it now |
436 | - if( $billing_info instanceof EE_Billing_Attendee_Info_Form ){ |
|
437 | - $this->_save_billing_info_to_attendee( $billing_info, $transaction ); |
|
436 | + if ($billing_info instanceof EE_Billing_Attendee_Info_Form) { |
|
437 | + $this->_save_billing_info_to_attendee($billing_info, $transaction); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | return $payment; |
@@ -447,10 +447,10 @@ discard block |
||
447 | 447 | * @param EE_Billing_Info_Form $billing_form |
448 | 448 | * @return array |
449 | 449 | */ |
450 | - protected function _get_billing_values_from_form( $billing_form ){ |
|
451 | - if($billing_form instanceof EE_Form_Section_Proper ){ |
|
452 | - return $billing_form->input_pretty_values( true ); |
|
453 | - }else{ |
|
450 | + protected function _get_billing_values_from_form($billing_form) { |
|
451 | + if ($billing_form instanceof EE_Form_Section_Proper) { |
|
452 | + return $billing_form->input_pretty_values(true); |
|
453 | + } else { |
|
454 | 454 | return NULL; |
455 | 455 | } |
456 | 456 | } |
@@ -464,13 +464,13 @@ discard block |
||
464 | 464 | * @return EE_Payment |
465 | 465 | * @throws EE_Error |
466 | 466 | */ |
467 | - public function handle_ipn($req_data,$transaction){ |
|
467 | + public function handle_ipn($req_data, $transaction) { |
|
468 | 468 | $transaction = EEM_Transaction::instance()->ensure_is_obj($transaction); |
469 | - if( ! $this->_gateway instanceof EE_Offsite_Gateway){ |
|
470 | - throw new EE_Error(sprintf(__("Could not handle IPN because '%s' is not an offsite gateway", "event_espresso"), print_r( $this->_gateway, TRUE ))); |
|
469 | + if ( ! $this->_gateway instanceof EE_Offsite_Gateway) { |
|
470 | + throw new EE_Error(sprintf(__("Could not handle IPN because '%s' is not an offsite gateway", "event_espresso"), print_r($this->_gateway, TRUE))); |
|
471 | 471 | |
472 | 472 | } |
473 | - $payment = $this->_gateway->handle_payment_update( $req_data, $transaction ); |
|
473 | + $payment = $this->_gateway->handle_payment_update($req_data, $transaction); |
|
474 | 474 | return $payment; |
475 | 475 | } |
476 | 476 | |
@@ -483,22 +483,22 @@ discard block |
||
483 | 483 | * @param EE_Transaction $transaction |
484 | 484 | * @return boolean success |
485 | 485 | */ |
486 | - protected function _save_billing_info_to_attendee($billing_form, $transaction){ |
|
487 | - if( ! $transaction || ! $transaction instanceof EE_Transaction){ |
|
486 | + protected function _save_billing_info_to_attendee($billing_form, $transaction) { |
|
487 | + if ( ! $transaction || ! $transaction instanceof EE_Transaction) { |
|
488 | 488 | EE_Error::add_error(__("Cannot save billing info because no transaction was specified", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
489 | 489 | return false; |
490 | 490 | } |
491 | 491 | $primary_reg = $transaction->primary_registration(); |
492 | - if( ! $primary_reg ){ |
|
492 | + if ( ! $primary_reg) { |
|
493 | 493 | EE_Error::add_error(__("Cannot save billing info because the transaction has no primary registration", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
494 | 494 | return false; |
495 | 495 | } |
496 | 496 | $attendee = $primary_reg->attendee(); |
497 | - if( ! $attendee ){ |
|
497 | + if ( ! $attendee) { |
|
498 | 498 | EE_Error::add_error(__("Cannot save billing info because the transaction's primary registration has no attendee!", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
499 | 499 | return false; |
500 | 500 | } |
501 | - return $attendee->save_and_clean_billing_info_for_payment_method($billing_form, $transaction->payment_method() ); |
|
501 | + return $attendee->save_and_clean_billing_info_for_payment_method($billing_form, $transaction->payment_method()); |
|
502 | 502 | |
503 | 503 | } |
504 | 504 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | * @param array $req_data |
512 | 512 | * @return EE_Payment |
513 | 513 | */ |
514 | - protected function find_payment_for_ipn( EE_Transaction $transaction, $req_data = array() ){ |
|
514 | + protected function find_payment_for_ipn(EE_Transaction $transaction, $req_data = array()) { |
|
515 | 515 | return $transaction->last_payment(); |
516 | 516 | } |
517 | 517 | |
@@ -528,8 +528,8 @@ discard block |
||
528 | 528 | * and identifies the IPN as being for this payment method (not just fo ra payment method of this type) |
529 | 529 | * @throws EE_Error |
530 | 530 | */ |
531 | - public function handle_unclaimed_ipn( $req_data = array() ){ |
|
532 | - throw new EE_Error(sprintf(__("Payment Method '%s' cannot handle unclaimed IPNs", "event_espresso"), get_class($this) )); |
|
531 | + public function handle_unclaimed_ipn($req_data = array()) { |
|
532 | + throw new EE_Error(sprintf(__("Payment Method '%s' cannot handle unclaimed IPNs", "event_espresso"), get_class($this))); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | * @param EE_Transaction $transaction |
546 | 546 | * @return EE_Payment |
547 | 547 | */ |
548 | - public function finalize_payment_for($transaction){ |
|
548 | + public function finalize_payment_for($transaction) { |
|
549 | 549 | return $transaction->last_payment(); |
550 | 550 | } |
551 | 551 | |
@@ -555,10 +555,10 @@ discard block |
||
555 | 555 | * Whether or not this payment method's gateway supports sending refund requests |
556 | 556 | * @return boolean |
557 | 557 | */ |
558 | - public function supports_sending_refunds(){ |
|
559 | - if($this->_gateway && $this->_gateway instanceof EE_Gateway){ |
|
558 | + public function supports_sending_refunds() { |
|
559 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
560 | 560 | return $this->_gateway->supports_sending_refunds(); |
561 | - }else{ |
|
561 | + } else { |
|
562 | 562 | return false; |
563 | 563 | } |
564 | 564 | } |
@@ -572,14 +572,14 @@ discard block |
||
572 | 572 | * @throws EE_Error |
573 | 573 | * @return EE_Payment |
574 | 574 | */ |
575 | - public function process_refund( EE_Payment $payment, $refund_info = array()){ |
|
576 | - if ( $this->_gateway && $this->_gateway instanceof EE_Gateway ) { |
|
577 | - return $this->_gateway->do_direct_refund( $payment, $refund_info ); |
|
575 | + public function process_refund(EE_Payment $payment, $refund_info = array()) { |
|
576 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
577 | + return $this->_gateway->do_direct_refund($payment, $refund_info); |
|
578 | 578 | } else { |
579 | 579 | throw new EE_Error( |
580 | 580 | sprintf( |
581 | - __( 'Payment Method Type "%s" does not support sending refund requests', 'event_espresso' ), |
|
582 | - get_class( $this ) |
|
581 | + __('Payment Method Type "%s" does not support sending refund requests', 'event_espresso'), |
|
582 | + get_class($this) |
|
583 | 583 | ) |
584 | 584 | ); |
585 | 585 | } |
@@ -593,15 +593,15 @@ discard block |
||
593 | 593 | * @return string |
594 | 594 | * @throws EE_Error |
595 | 595 | */ |
596 | - public function payment_occurs(){ |
|
597 | - if( ! $this->_gateway){ |
|
596 | + public function payment_occurs() { |
|
597 | + if ( ! $this->_gateway) { |
|
598 | 598 | return EE_PMT_Base::offline; |
599 | - }elseif($this->_gateway instanceof EE_Onsite_Gateway){ |
|
599 | + }elseif ($this->_gateway instanceof EE_Onsite_Gateway) { |
|
600 | 600 | return EE_PMT_Base::onsite; |
601 | - }elseif($this->_gateway instanceof EE_Offsite_Gateway){ |
|
601 | + }elseif ($this->_gateway instanceof EE_Offsite_Gateway) { |
|
602 | 602 | return EE_PMT_Base::offsite; |
603 | - }else{ |
|
604 | - throw new EE_Error(sprintf(__("Payment method type '%s's gateway isn't an instance of EE_Onsite_Gateway, EE_Offsite_Gateway, or null. It must be one of those", "event_espresso"),get_class($this))); |
|
603 | + } else { |
|
604 | + throw new EE_Error(sprintf(__("Payment method type '%s's gateway isn't an instance of EE_Onsite_Gateway, EE_Offsite_Gateway, or null. It must be one of those", "event_espresso"), get_class($this))); |
|
605 | 605 | } |
606 | 606 | } |
607 | 607 | |
@@ -614,8 +614,8 @@ discard block |
||
614 | 614 | * @param EE_Payment $payment |
615 | 615 | * @return string |
616 | 616 | */ |
617 | - public function payment_overview_content(EE_Payment $payment){ |
|
618 | - return EEH_Template::display_template(EE_LIBRARIES.'payment_methods'.DS.'templates'.DS.'payment_details_content.template.php', array('payment_method'=>$this->_pm_instance,'payment'=>$payment) , true); |
|
617 | + public function payment_overview_content(EE_Payment $payment) { |
|
618 | + return EEH_Template::display_template(EE_LIBRARIES.'payment_methods'.DS.'templates'.DS.'payment_details_content.template.php', array('payment_method'=>$this->_pm_instance, 'payment'=>$payment), true); |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | * @type array $template_args any arguments you want passed to the template file while rendering. |
629 | 629 | * Keys will be variable names and values with be their values. |
630 | 630 | */ |
631 | - public function help_tabs_config(){ |
|
631 | + public function help_tabs_config() { |
|
632 | 632 | return array(); |
633 | 633 | } |
634 | 634 | |
@@ -639,9 +639,9 @@ discard block |
||
639 | 639 | * the payment method's table's PMT_type column) |
640 | 640 | * @return string |
641 | 641 | */ |
642 | - public function system_name(){ |
|
642 | + public function system_name() { |
|
643 | 643 | $classname = get_class($this); |
644 | - return str_replace("EE_PMT_",'',$classname); |
|
644 | + return str_replace("EE_PMT_", '', $classname); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | * A pretty i18n version of the PMT name |
651 | 651 | * @return string |
652 | 652 | */ |
653 | - public function pretty_name(){ |
|
653 | + public function pretty_name() { |
|
654 | 654 | return $this->_pretty_name; |
655 | 655 | } |
656 | 656 | |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | * Gets the default absolute URL to the payment method type's button |
661 | 661 | * @return string |
662 | 662 | */ |
663 | - public function default_button_url(){ |
|
663 | + public function default_button_url() { |
|
664 | 664 | return $this->_default_button_url; |
665 | 665 | } |
666 | 666 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | * Gets the gateway used by this payment method (if any) |
671 | 671 | * @return EE_Gateway |
672 | 672 | */ |
673 | - public function get_gateway(){ |
|
673 | + public function get_gateway() { |
|
674 | 674 | return $this->_gateway; |
675 | 675 | } |
676 | 676 | |
@@ -679,8 +679,8 @@ discard block |
||
679 | 679 | /** |
680 | 680 | * @return string html for the link to a help tab |
681 | 681 | */ |
682 | - public function get_help_tab_link(){ |
|
683 | - return EEH_Template::get_help_tab_link( $this->get_help_tab_name() ); |
|
682 | + public function get_help_tab_link() { |
|
683 | + return EEH_Template::get_help_tab_link($this->get_help_tab_name()); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | |
@@ -689,8 +689,8 @@ discard block |
||
689 | 689 | * Returns the name of the help tab for this PMT |
690 | 690 | * @return string |
691 | 691 | */ |
692 | - public function get_help_tab_name(){ |
|
693 | - return 'ee_' . strtolower( $this->system_name() ) . '_help_tab'; |
|
692 | + public function get_help_tab_name() { |
|
693 | + return 'ee_'.strtolower($this->system_name()).'_help_tab'; |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | /** |
@@ -698,8 +698,8 @@ discard block |
||
698 | 698 | * this PMT by an admin |
699 | 699 | * @return string |
700 | 700 | */ |
701 | - public function cap_name(){ |
|
702 | - return 'ee_payment_method_' . strtolower( $this->system_name() ); |
|
701 | + public function cap_name() { |
|
702 | + return 'ee_payment_method_'.strtolower($this->system_name()); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | /** |
@@ -711,9 +711,9 @@ discard block |
||
711 | 711 | * @param EE_Payment $payment |
712 | 712 | * @return void |
713 | 713 | */ |
714 | - public function update_txn_based_on_payment( $payment ){ |
|
715 | - if( $this->_gateway instanceof EE_Gateway ){ |
|
716 | - $this->_gateway->update_txn_based_on_payment( $payment ); |
|
714 | + public function update_txn_based_on_payment($payment) { |
|
715 | + if ($this->_gateway instanceof EE_Gateway) { |
|
716 | + $this->_gateway->update_txn_based_on_payment($payment); |
|
717 | 717 | } |
718 | 718 | } |
719 | 719 | |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | * @return string |
729 | 729 | */ |
730 | 730 | public function introductory_html() { |
731 | - return EEH_Template::locate_template( $this->file_folder() . 'templates' . DS . strtolower( $this->system_name() ) . '_intro.template.php', array( 'pmt_obj' => $this, 'pm_instance' => $this->_pm_instance ) ); |
|
731 | + return EEH_Template::locate_template($this->file_folder().'templates'.DS.strtolower($this->system_name()).'_intro.template.php', array('pmt_obj' => $this, 'pm_instance' => $this->_pm_instance)); |
|
732 | 732 | } |
733 | 733 | |
734 | 734 |
@@ -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 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param string $shortcode |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - protected function _parser( $shortcode ) { |
|
64 | + protected function _parser($shortcode) { |
|
65 | 65 | |
66 | - if ( ! $this->_data instanceof EE_Datetime ) { |
|
66 | + if ( ! $this->_data instanceof EE_Datetime) { |
|
67 | 67 | return ''; //get out cause we can only parse with the datetime object. |
68 | 68 | } |
69 | 69 | |
70 | - switch ( $shortcode ) { |
|
70 | + switch ($shortcode) { |
|
71 | 71 | |
72 | 72 | case '[DATETIME_START]' : |
73 | 73 | return $this->_data->get_i18n_datetime('DTT_EVT_start'); |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | return $this->_data->get_timezone(); |
82 | 82 | break; |
83 | 83 | case '[DATE_START]' : |
84 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) ); |
|
84 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format')); |
|
85 | 85 | break; |
86 | 86 | case '[DATE_END]' : |
87 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) ); |
|
87 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format')); |
|
88 | 88 | break; |
89 | 89 | case '[TIME_START]' : |
90 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) ); |
|
90 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format')); |
|
91 | 91 | break; |
92 | 92 | case '[TIME_END]' : |
93 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) ); |
|
93 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format')); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
97 | - if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE ) { |
|
98 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
97 | + if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) { |
|
98 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
99 | 99 | |
100 | - $link_text = empty( $attrs['link_text'] ) ? __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text']; |
|
100 | + $link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text']; |
|
101 | 101 | |
102 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() ); |
|
102 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url()); |
|
103 | 103 | |
104 | - return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>'; |
|
104 | + return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>'; |
|
105 | 105 | |
106 | 106 | } |
107 | 107 |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //namespace EventEspresso\core\libraries\templates; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | /** |
8 | 8 | * Class EE_Template_Part |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | * @param string $template |
48 | 48 | * @param int $priority |
49 | 49 | */ |
50 | - public function __construct( $name, $label, $template, $priority = 100 ) { |
|
51 | - $this->set_name( $name ); |
|
52 | - $this->set_label( $label ); |
|
53 | - $this->set_template( $template ); |
|
54 | - $this->set_priority( $priority ); |
|
50 | + public function __construct($name, $label, $template, $priority = 100) { |
|
51 | + $this->set_name($name); |
|
52 | + $this->set_label($label); |
|
53 | + $this->set_template($template); |
|
54 | + $this->set_priority($priority); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * @param mixed $name |
70 | 70 | */ |
71 | - public function set_name( $name ) { |
|
71 | + public function set_name($name) { |
|
72 | 72 | $this->name = $name; |
73 | 73 | } |
74 | 74 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * @param string $label |
88 | 88 | */ |
89 | - public function set_label( $label ) { |
|
89 | + public function set_label($label) { |
|
90 | 90 | $this->label = $label; |
91 | 91 | } |
92 | 92 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * @param string $template |
106 | 106 | */ |
107 | - public function set_template( $template ) { |
|
107 | + public function set_template($template) { |
|
108 | 108 | $this->template = $template; |
109 | 109 | } |
110 | 110 | |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | /** |
123 | 123 | * @param int $priority |
124 | 124 | */ |
125 | - public function set_priority( $priority ) { |
|
126 | - $this->priority = intval( $priority ); |
|
125 | + public function set_priority($priority) { |
|
126 | + $this->priority = intval($priority); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //namespace EventEspresso\core\libraries\templates; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | /** |
8 | 8 | * Class EE_Template_Part_PriorityQueue |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | * @param int $priority |
32 | 32 | * @return bool |
33 | 33 | */ |
34 | - public function insert( $object, $priority = 100 ) { |
|
35 | - if ( $object instanceof EE_Template_Part ) { |
|
36 | - parent::insert( $object, $priority ); |
|
34 | + public function insert($object, $priority = 100) { |
|
35 | + if ($object instanceof EE_Template_Part) { |
|
36 | + parent::insert($object, $priority); |
|
37 | 37 | return true; |
38 | 38 | } else { |
39 | 39 | return false; |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @param int $priority2 |
53 | 53 | * @return bool |
54 | 54 | */ |
55 | - public function compare( $priority1, $priority2 ) { |
|
56 | - if ( $priority1 === $priority2 ) { |
|
55 | + public function compare($priority1, $priority2) { |
|
56 | + if ($priority1 === $priority2) { |
|
57 | 57 | return 0; |
58 | 58 | } |
59 | 59 | return $priority1 > $priority2 ? -1 : 1; |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | * @return EE_Request_Stack_Builder |
45 | 45 | */ |
46 | 46 | public function unshift( /*$class_name, $args*/ ) { |
47 | - if ( func_num_args() === 0 ) { |
|
48 | - throw new InvalidArgumentException( "Missing argument(s) when calling unshift" ); |
|
47 | + if (func_num_args() === 0) { |
|
48 | + throw new InvalidArgumentException("Missing argument(s) when calling unshift"); |
|
49 | 49 | } |
50 | 50 | $middleware = func_get_args(); |
51 | 51 | //$this->middleware_stack->unshift( $middleware ); |
52 | - array_unshift( $this->_middleware_stack, $middleware ); |
|
52 | + array_unshift($this->_middleware_stack, $middleware); |
|
53 | 53 | return $this; |
54 | 54 | } |
55 | 55 | |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | * @return EE_Request_Stack_Builder |
67 | 67 | */ |
68 | 68 | public function push( /*$class_name, $args...*/ ) { |
69 | - if ( func_num_args() === 0 ) { |
|
70 | - throw new InvalidArgumentException( "Missing argument(s) when calling push" ); |
|
69 | + if (func_num_args() === 0) { |
|
70 | + throw new InvalidArgumentException("Missing argument(s) when calling push"); |
|
71 | 71 | } |
72 | 72 | $middleware = func_get_args(); |
73 | 73 | //$this->middleware_stack->push( $middleware ); |
74 | - array_push( $this->_middleware_stack, $middleware ); |
|
74 | + array_push($this->_middleware_stack, $middleware); |
|
75 | 75 | return $this; |
76 | 76 | } |
77 | 77 | |
@@ -84,20 +84,20 @@ discard block |
||
84 | 84 | * @param EEI_Request_Decorator $application |
85 | 85 | * @return EE_Request_Stack |
86 | 86 | */ |
87 | - public function resolve( EEI_Request_Decorator $application ) { |
|
88 | - $middlewares = array( $application ); |
|
89 | - foreach ( $this->_middleware_stack as $middleware_args ) { |
|
90 | - $class_name = array_shift( $middleware_args ); |
|
91 | - if ( is_callable( $class_name ) ) { |
|
92 | - $application = $class_name( $application ); |
|
87 | + public function resolve(EEI_Request_Decorator $application) { |
|
88 | + $middlewares = array($application); |
|
89 | + foreach ($this->_middleware_stack as $middleware_args) { |
|
90 | + $class_name = array_shift($middleware_args); |
|
91 | + if (is_callable($class_name)) { |
|
92 | + $application = $class_name($application); |
|
93 | 93 | } else { |
94 | - array_unshift( $middleware_args, $application ); |
|
95 | - $reflection = new ReflectionClass( $class_name ); |
|
96 | - $application = $reflection->newInstanceArgs( $middleware_args ); |
|
94 | + array_unshift($middleware_args, $application); |
|
95 | + $reflection = new ReflectionClass($class_name); |
|
96 | + $application = $reflection->newInstanceArgs($middleware_args); |
|
97 | 97 | } |
98 | - array_unshift( $middlewares, $application ); |
|
98 | + array_unshift($middlewares, $application); |
|
99 | 99 | } |
100 | - return new EE_Request_Stack( $application, $middlewares ); |
|
100 | + return new EE_Request_Stack($application, $middlewares); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 |