@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | <p class="spco-copy-all-attendee-pg"> |
4 | 4 | <label class="ee-checkbox-label-before ee-checkbox-label-wide"> |
5 | 5 | <?php _e( |
6 | - 'Use Attendee #1\'s information for ALL attendees', |
|
7 | - 'event_espresso' |
|
8 | - ); ?> |
|
6 | + 'Use Attendee #1\'s information for ALL attendees', |
|
7 | + 'event_espresso' |
|
8 | + ); ?> |
|
9 | 9 | <input id="spco-copy-all-attendee-chk" class="spco-copy-all-attendee-chk ee-do-not-validate" type="checkbox" |
10 | 10 | value="copy-all"> |
11 | 11 | </label> |
@@ -13,23 +13,23 @@ discard block |
||
13 | 13 | |
14 | 14 | <p class="spco-copy-attendee-pg"> |
15 | 15 | <?php echo apply_filters( |
16 | - 'FHEE__registration_page_attendee_information__copy_attendee_pg', |
|
17 | - sprintf( |
|
18 | - __( |
|
19 | - 'This option allows you to use the above information for all additional attendee question fields. %sPlease note:%s some events may have additional questions that you may still be required to answer in order to complete your registration.', |
|
20 | - 'event_espresso' |
|
21 | - ), |
|
22 | - '<strong>', |
|
23 | - '</strong>' |
|
24 | - ) |
|
25 | - ); ?></p> |
|
16 | + 'FHEE__registration_page_attendee_information__copy_attendee_pg', |
|
17 | + sprintf( |
|
18 | + __( |
|
19 | + 'This option allows you to use the above information for all additional attendee question fields. %sPlease note:%s some events may have additional questions that you may still be required to answer in order to complete your registration.', |
|
20 | + 'event_espresso' |
|
21 | + ), |
|
22 | + '<strong>', |
|
23 | + '</strong>' |
|
24 | + ) |
|
25 | + ); ?></p> |
|
26 | 26 | |
27 | 27 | <a id="display-more-attendee-copy-options" class="display-the-hidden smaller-text float-right" |
28 | 28 | rel="more-attendee-copy-options"><span class="dashicons dashicons-arrow-right"></span> |
29 | 29 | <?php _e( |
30 | - 'advanced copy options', |
|
31 | - 'event_espresso' |
|
32 | - ); ?></a> |
|
30 | + 'advanced copy options', |
|
31 | + 'event_espresso' |
|
32 | + ); ?></a> |
|
33 | 33 | <a id="hide-more-attendee-copy-options" class="hide-the-displayed smaller-text float-right" |
34 | 34 | rel="more-attendee-copy-options" style="display: none;"><span |
35 | 35 | class="dashicons dashicons-arrow-down"></span><?php _e('basic copy options', 'event_espresso'); ?></a> |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | |
39 | 39 | <p class="spco-copy-attendee-pg"> |
40 | 40 | <?php _e( |
41 | - 'Only copy the above information to the following selected additional attendees.', |
|
42 | - 'event_espresso' |
|
43 | - ); ?> |
|
41 | + 'Only copy the above information to the following selected additional attendees.', |
|
42 | + 'event_espresso' |
|
43 | + ); ?> |
|
44 | 44 | </p> |
45 | 45 | |
46 | 46 | <?php |
47 | - foreach ($spco_copy_attendee_chk as $spco_copy_chk) { |
|
48 | - echo $spco_copy_chk; |
|
49 | - } ?> |
|
47 | + foreach ($spco_copy_attendee_chk as $spco_copy_chk) { |
|
48 | + echo $spco_copy_chk; |
|
49 | + } ?> |
|
50 | 50 | |
51 | 51 | </div> |
52 | 52 | <div class="clear-float"></div> |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <p id="spco-auto-copy-attendee-pg" class="smaller-text lt-grey-text"> |
2 | 2 | <?php echo apply_filters( |
3 | - 'FHEE__registration_page_attendee_information__auto_copy_attendee_pg', |
|
4 | - __( |
|
5 | - 'The above information will be used for any additional tickets/attendees.', |
|
6 | - 'event_espresso' |
|
7 | - ) |
|
8 | - ); ?> |
|
3 | + 'FHEE__registration_page_attendee_information__auto_copy_attendee_pg', |
|
4 | + __( |
|
5 | + 'The above information will be used for any additional tickets/attendees.', |
|
6 | + 'event_espresso' |
|
7 | + ) |
|
8 | + ); ?> |
|
9 | 9 | </p> |
10 | 10 | \ No newline at end of file |
@@ -5,16 +5,16 @@ discard block |
||
5 | 5 | ?> |
6 | 6 | <p id="spco-attendee_information-pg" class="spco-steps-pg small-text drk-grey-text"> |
7 | 7 | <?php echo apply_filters( |
8 | - 'FHEE__registration_page_attendee_information__attendee_information_pg', |
|
9 | - sprintf( |
|
10 | - __( |
|
11 | - 'In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', |
|
12 | - 'event_espresso' |
|
13 | - ), |
|
14 | - '<br />', |
|
15 | - '<span class="asterisk">*</span>' |
|
16 | - ) |
|
17 | - ); ?> |
|
8 | + 'FHEE__registration_page_attendee_information__attendee_information_pg', |
|
9 | + sprintf( |
|
10 | + __( |
|
11 | + 'In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', |
|
12 | + 'event_espresso' |
|
13 | + ), |
|
14 | + '<br />', |
|
15 | + '<span class="asterisk">*</span>' |
|
16 | + ) |
|
17 | + ); ?> |
|
18 | 18 | </p> |
19 | 19 | |
20 | 20 | <?php |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $prev_ticket = 0; |
24 | 24 | |
25 | 25 | if (count($registrations) > 0) { |
26 | - foreach ($registrations as $registration) { |
|
27 | - if ($registration instanceof EE_Registration) { |
|
28 | - $att_nmbr++; |
|
29 | - ?> |
|
26 | + foreach ($registrations as $registration) { |
|
27 | + if ($registration instanceof EE_Registration) { |
|
28 | + $att_nmbr++; |
|
29 | + ?> |
|
30 | 30 | |
31 | 31 | <div id="spco-attendee-panel-dv-<?php echo $registration->reg_url_link(); ?>" |
32 | 32 | class="spco-attendee-panel-dv spco-attendee-ticket-<?php echo $registration->ticket()->ID(); ?>"> |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | <th scope="col" width=""><?php _e('Name and Description', 'event_espresso'); ?></th> |
47 | 47 | <th scope="col" width="7.5%" class="jst-rght"> |
48 | 48 | <?php _e( |
49 | - 'Qty', |
|
50 | - 'event_espresso' |
|
51 | - ); ?></th> |
|
49 | + 'Qty', |
|
50 | + 'event_espresso' |
|
51 | + ); ?></th> |
|
52 | 52 | <th scope="col" width="17.5%" class="jst-rght"> |
53 | 53 | <?php _e( |
54 | - 'Price', |
|
55 | - 'event_espresso' |
|
56 | - ); ?></th> |
|
54 | + 'Price', |
|
55 | + 'event_espresso' |
|
56 | + ); ?></th> |
|
57 | 57 | <th scope="col" width="17.5%" class="jst-rght"> |
58 | 58 | <?php _e( |
59 | - 'Total', |
|
60 | - 'event_espresso' |
|
61 | - ); ?></th> |
|
59 | + 'Total', |
|
60 | + 'event_espresso' |
|
61 | + ); ?></th> |
|
62 | 62 | </tr> |
63 | 63 | </thead> |
64 | 64 | <tbody> |
@@ -70,19 +70,19 @@ discard block |
||
70 | 70 | <?php } ?> |
71 | 71 | |
72 | 72 | <?php |
73 | - // ATTENDEE QUESTIONS |
|
74 | - $reg_form = EE_Template_Layout::get_subform_name($registration->reg_url_link()); |
|
75 | - echo ${$reg_form}; |
|
76 | - ?> |
|
73 | + // ATTENDEE QUESTIONS |
|
74 | + $reg_form = EE_Template_Layout::get_subform_name($registration->reg_url_link()); |
|
75 | + echo ${$reg_form}; |
|
76 | + ?> |
|
77 | 77 | |
78 | 78 | </div> |
79 | 79 | <?php |
80 | - $prev_event = $registration->event()->ID(); |
|
81 | - $prev_ticket = $registration->ticket()->ID(); |
|
82 | - } // if ( $registration instanceof EE_Registration ) |
|
83 | - } // end foreach ( $registrations as $registration ) |
|
80 | + $prev_event = $registration->event()->ID(); |
|
81 | + $prev_ticket = $registration->ticket()->ID(); |
|
82 | + } // if ( $registration instanceof EE_Registration ) |
|
83 | + } // end foreach ( $registrations as $registration ) |
|
84 | 84 | |
85 | - echo $default_hidden_inputs; |
|
85 | + echo $default_hidden_inputs; |
|
86 | 86 | } // end if ( count( $registrations ) > 0 ) |
87 | 87 | |
88 | 88 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | </h4> |
38 | 38 | <?php } ?> |
39 | 39 | <?php if ($registration->ticket()->ID() !== $prev_ticket) { ?> |
40 | - <?php if (! $revisit) { ?> |
|
40 | + <?php if ( ! $revisit) { ?> |
|
41 | 41 | <div class="spco-ticket-info-dv small-text"> |
42 | 42 | <h5><?php _e('Details', 'event_espresso'); ?></h5> |
43 | 43 | <table> |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | </tr> |
63 | 63 | </thead> |
64 | 64 | <tbody> |
65 | - <?php echo $ticket_line_item[ $registration->ticket()->ID() ]; ?> |
|
65 | + <?php echo $ticket_line_item[$registration->ticket()->ID()]; ?> |
|
66 | 66 | </tbody> |
67 | 67 | </table> |
68 | 68 | </div> |
@@ -1,90 +1,90 @@ |
||
1 | 1 | <div id="ee-single-page-checkout-dv" class=""> |
2 | 2 | <?php |
3 | - if (! $empty_cart) { |
|
4 | - if (apply_filters('FHEE__registration_page_wrapper_template__display_time_limit', false)) { ?> |
|
3 | + if (! $empty_cart) { |
|
4 | + if (apply_filters('FHEE__registration_page_wrapper_template__display_time_limit', false)) { ?> |
|
5 | 5 | <p id="spco-registration-time-limit-pg" class="spco-steps-pg ee-attention important-notice" |
6 | 6 | style="display: none;"> |
7 | 7 | <?php echo sprintf( |
8 | - apply_filters( |
|
9 | - 'FHEE__registration_page_wrapper_template___time_limit', |
|
10 | - __('You have %1$s to complete your registration.', 'event_espresso') |
|
11 | - ), |
|
12 | - '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit . '</span>' |
|
13 | - ); |
|
14 | - ?> |
|
8 | + apply_filters( |
|
9 | + 'FHEE__registration_page_wrapper_template___time_limit', |
|
10 | + __('You have %1$s to complete your registration.', 'event_espresso') |
|
11 | + ), |
|
12 | + '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit . '</span>' |
|
13 | + ); |
|
14 | + ?> |
|
15 | 15 | <span id="spco-registration-expiration-spn" class="" style="display:none;"></span> |
16 | 16 | </p> |
17 | 17 | <?php } |
18 | - if (! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', true)) { |
|
19 | - ?> |
|
18 | + if (! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', true)) { |
|
19 | + ?> |
|
20 | 20 | <h2 id="spco-steps-big-hdr" class="spco-steps-big-hdr"><?php _e(' Steps', 'event_espresso'); ?></h2> |
21 | 21 | |
22 | 22 | <div id="spco-steps-display-dv"> |
23 | 23 | <?php |
24 | - $step_nmbr = 1; |
|
25 | - $total_steps = count($reg_steps) - 1; |
|
26 | - foreach ($reg_steps as $reg_step) { |
|
27 | - if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
28 | - $slug = $reg_step->slug(); |
|
29 | - $step_display_dv_class = $reg_step->is_current_step() ? 'active-step' : 'inactive-step'; |
|
30 | - ?> |
|
24 | + $step_nmbr = 1; |
|
25 | + $total_steps = count($reg_steps) - 1; |
|
26 | + foreach ($reg_steps as $reg_step) { |
|
27 | + if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
28 | + $slug = $reg_step->slug(); |
|
29 | + $step_display_dv_class = $reg_step->is_current_step() ? 'active-step' : 'inactive-step'; |
|
30 | + ?> |
|
31 | 31 | <div id="spco-step-<?php echo $slug; ?>-display-dv" |
32 | 32 | class="spco-step-display-dv <?php echo $step_display_dv_class; ?> steps-<?php echo $total_steps; ?>"> |
33 | 33 | <h4 id="spco-step-<?php echo $slug; ?>-display-hdr" class="spco-steps-display-hdr"> |
34 | 34 | <span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span> <span |
35 | 35 | class="spco-step-name"> |
36 | 36 | <?php echo str_replace( |
37 | - ' ', |
|
38 | - '<br/> ', |
|
39 | - $reg_step->name() |
|
40 | - ); ?></span> |
|
37 | + ' ', |
|
38 | + '<br/> ', |
|
39 | + $reg_step->name() |
|
40 | + ); ?></span> |
|
41 | 41 | </h4> |
42 | 42 | </div> |
43 | 43 | |
44 | 44 | <?php |
45 | - if ($step_nmbr < $total_steps) { ?> |
|
45 | + if ($step_nmbr < $total_steps) { ?> |
|
46 | 46 | <div class="spco-step-arrow-dv">»</div> |
47 | 47 | <?php |
48 | - } |
|
49 | - $step_nmbr++; |
|
50 | - } |
|
51 | - } |
|
52 | - ?> |
|
48 | + } |
|
49 | + $step_nmbr++; |
|
50 | + } |
|
51 | + } |
|
52 | + ?> |
|
53 | 53 | <div class="clear-float"></div> |
54 | 54 | </div> |
55 | 55 | |
56 | 56 | <?php |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | - do_action('AHEE__SPCO__before_registration_steps'); |
|
60 | - $step_nmbr = 1; |
|
61 | - foreach ($reg_steps as $reg_step) { |
|
62 | - if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
63 | - $slug = $reg_step->slug(); |
|
64 | - do_action('AHEE__' . $slug . '__reg_step_start', $reg_step); |
|
65 | - // todo: deprecate hook AHEE__registration_page_attendee_information__start |
|
66 | - ?> |
|
59 | + do_action('AHEE__SPCO__before_registration_steps'); |
|
60 | + $step_nmbr = 1; |
|
61 | + foreach ($reg_steps as $reg_step) { |
|
62 | + if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
63 | + $slug = $reg_step->slug(); |
|
64 | + do_action('AHEE__' . $slug . '__reg_step_start', $reg_step); |
|
65 | + // todo: deprecate hook AHEE__registration_page_attendee_information__start |
|
66 | + ?> |
|
67 | 67 | <div id="spco-<?php echo $slug; ?>-dv" class="spco-step-dv <?php echo $reg_step->div_class(); ?>"> |
68 | 68 | <?php echo $reg_step->display_reg_form(); ?> |
69 | 69 | <?php do_action('AHEE__SPCO_after_reg_step_form', $slug, $next_step); ?> |
70 | 70 | </div> |
71 | 71 | <?php $step_nmbr++; |
72 | - } |
|
73 | - } |
|
74 | - do_action('AHEE__SPCO__after_registration_steps'); |
|
75 | - } else { |
|
76 | - ?> |
|
72 | + } |
|
73 | + } |
|
74 | + do_action('AHEE__SPCO__after_registration_steps'); |
|
75 | + } else { |
|
76 | + ?> |
|
77 | 77 | <h3 id="spco-empty-cart-hdr" class="spco-step-title-hdr"> |
78 | 78 | <?php esc_html_e( |
79 | - 'Nothing in your Event Queue', |
|
80 | - 'event_espresso' |
|
81 | - ); ?></h3> |
|
79 | + 'Nothing in your Event Queue', |
|
80 | + 'event_espresso' |
|
81 | + ); ?></h3> |
|
82 | 82 | <p><?php echo $empty_msg; ?></p> |
83 | 83 | <?php echo $cookies_not_set_msg; ?> |
84 | 84 | <?php |
85 | - } |
|
86 | - do_action('AHEE__SPCO__reg_form_footer'); |
|
87 | - ?> |
|
85 | + } |
|
86 | + do_action('AHEE__SPCO__reg_form_footer'); |
|
87 | + ?> |
|
88 | 88 | |
89 | 89 | </div> |
90 | 90 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <div id="ee-single-page-checkout-dv" class=""> |
2 | 2 | <?php |
3 | - if (! $empty_cart) { |
|
3 | + if ( ! $empty_cart) { |
|
4 | 4 | if (apply_filters('FHEE__registration_page_wrapper_template__display_time_limit', false)) { ?> |
5 | 5 | <p id="spco-registration-time-limit-pg" class="spco-steps-pg ee-attention important-notice" |
6 | 6 | style="display: none;"> |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | 'FHEE__registration_page_wrapper_template___time_limit', |
10 | 10 | __('You have %1$s to complete your registration.', 'event_espresso') |
11 | 11 | ), |
12 | - '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit . '</span>' |
|
12 | + '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">'.$registration_time_limit.'</span>' |
|
13 | 13 | ); |
14 | 14 | ?> |
15 | 15 | <span id="spco-registration-expiration-spn" class="" style="display:none;"></span> |
16 | 16 | </p> |
17 | 17 | <?php } |
18 | - if (! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', true)) { |
|
18 | + if ( ! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', true)) { |
|
19 | 19 | ?> |
20 | 20 | <h2 id="spco-steps-big-hdr" class="spco-steps-big-hdr"><?php _e(' Steps', 'event_espresso'); ?></h2> |
21 | 21 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | foreach ($reg_steps as $reg_step) { |
62 | 62 | if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
63 | 63 | $slug = $reg_step->slug(); |
64 | - do_action('AHEE__' . $slug . '__reg_step_start', $reg_step); |
|
64 | + do_action('AHEE__'.$slug.'__reg_step_start', $reg_step); |
|
65 | 65 | // todo: deprecate hook AHEE__registration_page_attendee_information__start |
66 | 66 | ?> |
67 | 67 | <div id="spco-<?php echo $slug; ?>-dv" class="spco-step-dv <?php echo $reg_step->div_class(); ?>"> |
@@ -12,87 +12,87 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @return EED_Invoice |
|
17 | - */ |
|
18 | - public static function instance() |
|
19 | - { |
|
20 | - return parent::get_instance(__CLASS__); |
|
21 | - } |
|
15 | + /** |
|
16 | + * @return EED_Invoice |
|
17 | + */ |
|
18 | + public static function instance() |
|
19 | + { |
|
20 | + return parent::get_instance(__CLASS__); |
|
21 | + } |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public static function set_hooks() |
|
31 | - { |
|
32 | - EE_Config::register_route('download_invoice', 'EED_Invoice', 'download_invoice'); |
|
33 | - EE_Config::register_route('launch_invoice', 'EED_Invoice', 'launch_invoice'); |
|
34 | - } |
|
24 | + /** |
|
25 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public static function set_hooks() |
|
31 | + { |
|
32 | + EE_Config::register_route('download_invoice', 'EED_Invoice', 'download_invoice'); |
|
33 | + EE_Config::register_route('launch_invoice', 'EED_Invoice', 'launch_invoice'); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
39 | - * |
|
40 | - * @access public |
|
41 | - * @return void |
|
42 | - */ |
|
43 | - public static function set_hooks_admin() |
|
44 | - { |
|
45 | - } |
|
37 | + /** |
|
38 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
39 | + * |
|
40 | + * @access public |
|
41 | + * @return void |
|
42 | + */ |
|
43 | + public static function set_hooks_admin() |
|
44 | + { |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * run - initial module setup |
|
50 | - * |
|
51 | - * @access public |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public function run($WP) |
|
55 | - { |
|
56 | - if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) { |
|
57 | - require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php'); |
|
58 | - } else { |
|
59 | - $msg = __('The Invoice.class.php file could not be loaded.', 'event_espresso'); |
|
60 | - EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
61 | - } |
|
62 | - } |
|
48 | + /** |
|
49 | + * run - initial module setup |
|
50 | + * |
|
51 | + * @access public |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public function run($WP) |
|
55 | + { |
|
56 | + if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) { |
|
57 | + require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php'); |
|
58 | + } else { |
|
59 | + $msg = __('The Invoice.class.php file could not be loaded.', 'event_espresso'); |
|
60 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | - /** |
|
66 | - * invoice_launch |
|
67 | - * |
|
68 | - * @access public |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - public function launch_invoice() |
|
72 | - { |
|
73 | - $this->run(null); |
|
74 | - if (EE_Registry::instance()->REQ->is_set('id')) { |
|
75 | - $id = sanitize_key(EE_Registry::instance()->REQ->get('id')); |
|
76 | - $invoice = new Invoice($id); |
|
77 | - $invoice->send_invoice(); |
|
78 | - } |
|
79 | - } |
|
65 | + /** |
|
66 | + * invoice_launch |
|
67 | + * |
|
68 | + * @access public |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + public function launch_invoice() |
|
72 | + { |
|
73 | + $this->run(null); |
|
74 | + if (EE_Registry::instance()->REQ->is_set('id')) { |
|
75 | + $id = sanitize_key(EE_Registry::instance()->REQ->get('id')); |
|
76 | + $invoice = new Invoice($id); |
|
77 | + $invoice->send_invoice(); |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | 81 | |
82 | - /** |
|
83 | - * download_invoice |
|
84 | - * |
|
85 | - * @access public |
|
86 | - * @return void |
|
87 | - */ |
|
88 | - public function download_invoice() |
|
89 | - { |
|
90 | - $this->run(null); |
|
91 | - if (EE_Registry::instance()->REQ->is_set('id')) { |
|
92 | - $id = sanitize_key(EE_Registry::instance()->REQ->get('id')); |
|
93 | - $invoice = new Invoice($_REQUEST['id']); |
|
94 | - // send invoice but force download |
|
95 | - $invoice->send_invoice(true); |
|
96 | - } |
|
97 | - } |
|
82 | + /** |
|
83 | + * download_invoice |
|
84 | + * |
|
85 | + * @access public |
|
86 | + * @return void |
|
87 | + */ |
|
88 | + public function download_invoice() |
|
89 | + { |
|
90 | + $this->run(null); |
|
91 | + if (EE_Registry::instance()->REQ->is_set('id')) { |
|
92 | + $id = sanitize_key(EE_Registry::instance()->REQ->get('id')); |
|
93 | + $invoice = new Invoice($_REQUEST['id']); |
|
94 | + // send invoice but force download |
|
95 | + $invoice->send_invoice(true); |
|
96 | + } |
|
97 | + } |
|
98 | 98 | } |
@@ -53,8 +53,8 @@ |
||
53 | 53 | */ |
54 | 54 | public function run($WP) |
55 | 55 | { |
56 | - if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) { |
|
57 | - require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php'); |
|
56 | + if (is_readable(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php')) { |
|
57 | + require_once(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php'); |
|
58 | 58 | } else { |
59 | 59 | $msg = __('The Invoice.class.php file could not be loaded.', 'event_espresso'); |
60 | 60 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
@@ -29,176 +29,176 @@ |
||
29 | 29 | class EED_Venues_Archive extends EED_Module |
30 | 30 | { |
31 | 31 | |
32 | - /** |
|
33 | - * @return EED_Venues_Archive |
|
34 | - */ |
|
35 | - public static function instance() |
|
36 | - { |
|
37 | - return parent::get_instance(__CLASS__); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
43 | - * |
|
44 | - * @return void |
|
45 | - * @throws InvalidArgumentException |
|
46 | - * @throws InvalidDataTypeException |
|
47 | - * @throws InvalidInterfaceException |
|
48 | - */ |
|
49 | - public static function set_hooks() |
|
50 | - { |
|
51 | - /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_type_definitions */ |
|
52 | - $custom_post_type_definitions = LoaderFactory::getLoader()->getShared( |
|
53 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' |
|
54 | - ); |
|
55 | - $custom_post_types = $custom_post_type_definitions->getDefinitions(); |
|
56 | - EE_Config::register_route( |
|
57 | - $custom_post_types['espresso_venues']['plural_slug'], |
|
58 | - 'Venues_Archive', |
|
59 | - 'run' |
|
60 | - ); |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
65 | - * |
|
66 | - * @access public |
|
67 | - * @return void |
|
68 | - */ |
|
69 | - public static function set_hooks_admin() |
|
70 | - { |
|
71 | - } |
|
72 | - |
|
73 | - |
|
74 | - /** |
|
75 | - * run - initial module setup |
|
76 | - * |
|
77 | - * @access public |
|
78 | - * @param \WP $WP |
|
79 | - */ |
|
80 | - public function run($WP) |
|
81 | - { |
|
82 | - // check what template is loaded |
|
83 | - add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
84 | - add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * template_include |
|
90 | - * |
|
91 | - * @access public |
|
92 | - * @param string $template |
|
93 | - * @return string |
|
94 | - */ |
|
95 | - public function template_include($template) |
|
96 | - { |
|
97 | - // not a custom template? |
|
98 | - if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true) |
|
99 | - ->get_selected_template() != 'archive-espresso_venues.php' |
|
100 | - ) { |
|
101 | - EEH_Template::load_espresso_theme_functions(); |
|
102 | - // then add extra event data via hooks |
|
103 | - add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
104 | - // don't know if theme uses the_excerpt |
|
105 | - add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
106 | - // or the_content |
|
107 | - add_filter('the_content', array($this, 'venue_details'), 100); |
|
108 | - // don't display entry meta because the existing theme will take care of that |
|
109 | - add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
110 | - } |
|
111 | - return $template; |
|
112 | - } |
|
113 | - |
|
114 | - |
|
115 | - /** |
|
116 | - * the_title |
|
117 | - * |
|
118 | - * @access public |
|
119 | - * @param string $title |
|
120 | - * @return string |
|
121 | - */ |
|
122 | - public function the_title($title = '') |
|
123 | - { |
|
124 | - return $title; |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - /** |
|
129 | - * venue_details |
|
130 | - * |
|
131 | - * @access public |
|
132 | - * @param string $content |
|
133 | - * @return string |
|
134 | - */ |
|
135 | - public function venue_details($content) |
|
136 | - { |
|
137 | - global $post; |
|
138 | - if ($post->post_type == 'espresso_venues' |
|
139 | - && ! post_password_required() |
|
140 | - ) { |
|
141 | - // since the 'content-espresso_venues-details.php' template might be used directly from within a theme, |
|
142 | - // it uses the_content() for displaying the $post->post_content |
|
143 | - // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
|
144 | - // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
|
145 | - remove_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
146 | - remove_filter('the_content', array($this, 'venue_details'), 100); |
|
147 | - // add filters we want |
|
148 | - add_filter('the_content', array($this, 'venue_location'), 110); |
|
149 | - add_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
150 | - // now load our template |
|
151 | - $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
152 | - // now add our filter back in, plus some others |
|
153 | - add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
154 | - add_filter('the_content', array($this, 'venue_details'), 100); |
|
155 | - // remove other filters we added so they won't get applied to the next post |
|
156 | - remove_filter('the_content', array($this, 'venue_location'), 110); |
|
157 | - remove_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
158 | - // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
|
159 | - } |
|
160 | - return ! empty($template) ? $template : $content; |
|
161 | - } |
|
162 | - |
|
163 | - |
|
164 | - /** |
|
165 | - * venue_location |
|
166 | - * |
|
167 | - * @access public |
|
168 | - * @param string $content |
|
169 | - * @return string |
|
170 | - */ |
|
171 | - public function venue_location($content) |
|
172 | - { |
|
173 | - return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
174 | - } |
|
175 | - |
|
176 | - |
|
177 | - /** |
|
178 | - * wp_enqueue_scripts |
|
179 | - * |
|
180 | - * @access public |
|
181 | - * @return void |
|
182 | - */ |
|
183 | - public function wp_enqueue_scripts() |
|
184 | - { |
|
185 | - // get some style |
|
186 | - if (apply_filters('FHEE_enable_default_espresso_css', true) && is_archive()) { |
|
187 | - // first check theme folder |
|
188 | - if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
189 | - wp_register_style( |
|
190 | - $this->theme, |
|
191 | - get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
192 | - array('dashicons', 'espresso_default') |
|
193 | - ); |
|
194 | - } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
195 | - wp_register_style( |
|
196 | - $this->theme, |
|
197 | - EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
198 | - array('dashicons', 'espresso_default') |
|
199 | - ); |
|
200 | - } |
|
201 | - wp_enqueue_style($this->theme); |
|
202 | - } |
|
203 | - } |
|
32 | + /** |
|
33 | + * @return EED_Venues_Archive |
|
34 | + */ |
|
35 | + public static function instance() |
|
36 | + { |
|
37 | + return parent::get_instance(__CLASS__); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
43 | + * |
|
44 | + * @return void |
|
45 | + * @throws InvalidArgumentException |
|
46 | + * @throws InvalidDataTypeException |
|
47 | + * @throws InvalidInterfaceException |
|
48 | + */ |
|
49 | + public static function set_hooks() |
|
50 | + { |
|
51 | + /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_type_definitions */ |
|
52 | + $custom_post_type_definitions = LoaderFactory::getLoader()->getShared( |
|
53 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' |
|
54 | + ); |
|
55 | + $custom_post_types = $custom_post_type_definitions->getDefinitions(); |
|
56 | + EE_Config::register_route( |
|
57 | + $custom_post_types['espresso_venues']['plural_slug'], |
|
58 | + 'Venues_Archive', |
|
59 | + 'run' |
|
60 | + ); |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
65 | + * |
|
66 | + * @access public |
|
67 | + * @return void |
|
68 | + */ |
|
69 | + public static function set_hooks_admin() |
|
70 | + { |
|
71 | + } |
|
72 | + |
|
73 | + |
|
74 | + /** |
|
75 | + * run - initial module setup |
|
76 | + * |
|
77 | + * @access public |
|
78 | + * @param \WP $WP |
|
79 | + */ |
|
80 | + public function run($WP) |
|
81 | + { |
|
82 | + // check what template is loaded |
|
83 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
84 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * template_include |
|
90 | + * |
|
91 | + * @access public |
|
92 | + * @param string $template |
|
93 | + * @return string |
|
94 | + */ |
|
95 | + public function template_include($template) |
|
96 | + { |
|
97 | + // not a custom template? |
|
98 | + if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true) |
|
99 | + ->get_selected_template() != 'archive-espresso_venues.php' |
|
100 | + ) { |
|
101 | + EEH_Template::load_espresso_theme_functions(); |
|
102 | + // then add extra event data via hooks |
|
103 | + add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
104 | + // don't know if theme uses the_excerpt |
|
105 | + add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
106 | + // or the_content |
|
107 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
108 | + // don't display entry meta because the existing theme will take care of that |
|
109 | + add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
110 | + } |
|
111 | + return $template; |
|
112 | + } |
|
113 | + |
|
114 | + |
|
115 | + /** |
|
116 | + * the_title |
|
117 | + * |
|
118 | + * @access public |
|
119 | + * @param string $title |
|
120 | + * @return string |
|
121 | + */ |
|
122 | + public function the_title($title = '') |
|
123 | + { |
|
124 | + return $title; |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + /** |
|
129 | + * venue_details |
|
130 | + * |
|
131 | + * @access public |
|
132 | + * @param string $content |
|
133 | + * @return string |
|
134 | + */ |
|
135 | + public function venue_details($content) |
|
136 | + { |
|
137 | + global $post; |
|
138 | + if ($post->post_type == 'espresso_venues' |
|
139 | + && ! post_password_required() |
|
140 | + ) { |
|
141 | + // since the 'content-espresso_venues-details.php' template might be used directly from within a theme, |
|
142 | + // it uses the_content() for displaying the $post->post_content |
|
143 | + // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
|
144 | + // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
|
145 | + remove_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
146 | + remove_filter('the_content', array($this, 'venue_details'), 100); |
|
147 | + // add filters we want |
|
148 | + add_filter('the_content', array($this, 'venue_location'), 110); |
|
149 | + add_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
150 | + // now load our template |
|
151 | + $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
152 | + // now add our filter back in, plus some others |
|
153 | + add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
154 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
155 | + // remove other filters we added so they won't get applied to the next post |
|
156 | + remove_filter('the_content', array($this, 'venue_location'), 110); |
|
157 | + remove_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
158 | + // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
|
159 | + } |
|
160 | + return ! empty($template) ? $template : $content; |
|
161 | + } |
|
162 | + |
|
163 | + |
|
164 | + /** |
|
165 | + * venue_location |
|
166 | + * |
|
167 | + * @access public |
|
168 | + * @param string $content |
|
169 | + * @return string |
|
170 | + */ |
|
171 | + public function venue_location($content) |
|
172 | + { |
|
173 | + return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
174 | + } |
|
175 | + |
|
176 | + |
|
177 | + /** |
|
178 | + * wp_enqueue_scripts |
|
179 | + * |
|
180 | + * @access public |
|
181 | + * @return void |
|
182 | + */ |
|
183 | + public function wp_enqueue_scripts() |
|
184 | + { |
|
185 | + // get some style |
|
186 | + if (apply_filters('FHEE_enable_default_espresso_css', true) && is_archive()) { |
|
187 | + // first check theme folder |
|
188 | + if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
189 | + wp_register_style( |
|
190 | + $this->theme, |
|
191 | + get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
192 | + array('dashicons', 'espresso_default') |
|
193 | + ); |
|
194 | + } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
195 | + wp_register_style( |
|
196 | + $this->theme, |
|
197 | + EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
198 | + array('dashicons', 'espresso_default') |
|
199 | + ); |
|
200 | + } |
|
201 | + wp_enqueue_style($this->theme); |
|
202 | + } |
|
203 | + } |
|
204 | 204 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function venue_location($content) |
172 | 172 | { |
173 | - return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
173 | + return $content.EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -185,16 +185,16 @@ discard block |
||
185 | 185 | // get some style |
186 | 186 | if (apply_filters('FHEE_enable_default_espresso_css', true) && is_archive()) { |
187 | 187 | // first check theme folder |
188 | - if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
188 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
189 | 189 | wp_register_style( |
190 | 190 | $this->theme, |
191 | - get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
191 | + get_stylesheet_directory_uri().$this->theme.DS.'style.css', |
|
192 | 192 | array('dashicons', 'espresso_default') |
193 | 193 | ); |
194 | - } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
194 | + } elseif (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) { |
|
195 | 195 | wp_register_style( |
196 | 196 | $this->theme, |
197 | - EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
197 | + EE_TEMPLATES_URL.$this->theme.DS.'style.css', |
|
198 | 198 | array('dashicons', 'espresso_default') |
199 | 199 | ); |
200 | 200 | } |
@@ -29,171 +29,171 @@ |
||
29 | 29 | class EED_Venue_Single extends EED_Module |
30 | 30 | { |
31 | 31 | |
32 | - /** |
|
33 | - * @return EED_Venue_Single |
|
34 | - */ |
|
35 | - public static function instance() |
|
36 | - { |
|
37 | - return parent::get_instance(__CLASS__); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
43 | - * |
|
44 | - * @return void |
|
45 | - * @throws InvalidArgumentException |
|
46 | - * @throws InvalidDataTypeException |
|
47 | - * @throws InvalidInterfaceException |
|
48 | - */ |
|
49 | - public static function set_hooks() |
|
50 | - { |
|
51 | - /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_type_definitions */ |
|
52 | - $custom_post_type_definitions = LoaderFactory::getLoader()->getShared( |
|
53 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' |
|
54 | - ); |
|
55 | - $custom_post_types = $custom_post_type_definitions->getDefinitions(); |
|
56 | - EE_Config::register_route( |
|
57 | - $custom_post_types['espresso_venues']['singular_slug'], |
|
58 | - 'Venue_Single', |
|
59 | - 'run' |
|
60 | - ); |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
65 | - * |
|
66 | - * @access public |
|
67 | - * @return void |
|
68 | - */ |
|
69 | - public static function set_hooks_admin() |
|
70 | - { |
|
71 | - } |
|
72 | - |
|
73 | - |
|
74 | - /** |
|
75 | - * run - initial module setup |
|
76 | - * |
|
77 | - * @access public |
|
78 | - * @param \WP $WP |
|
79 | - */ |
|
80 | - public function run($WP) |
|
81 | - { |
|
82 | - // check what template is loaded |
|
83 | - add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
84 | - add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * template_include |
|
90 | - * |
|
91 | - * @access public |
|
92 | - * @param string $template |
|
93 | - * @return string |
|
94 | - */ |
|
95 | - public function template_include($template) |
|
96 | - { |
|
97 | - // not a custom template? |
|
98 | - if (EE_Registry::instance() |
|
99 | - ->load_core('Front_Controller', array(), false, true) |
|
100 | - ->get_selected_template() != 'single-espresso_venues.php' |
|
101 | - ) { |
|
102 | - EEH_Template::load_espresso_theme_functions(); |
|
103 | - // then add extra event data via hooks |
|
104 | - add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
105 | - add_filter('the_content', array($this, 'venue_details'), 100); |
|
106 | - // don't display entry meta because the existing theme will take car of that |
|
107 | - add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
108 | - } |
|
109 | - return $template; |
|
110 | - } |
|
111 | - |
|
112 | - |
|
113 | - /** |
|
114 | - * the_title |
|
115 | - * |
|
116 | - * @access public |
|
117 | - * @param string $title |
|
118 | - * @return string |
|
119 | - */ |
|
120 | - public function the_title($title = '') |
|
121 | - { |
|
122 | - return $title; |
|
123 | - } |
|
124 | - |
|
125 | - |
|
126 | - /** |
|
127 | - * venue_details |
|
128 | - * |
|
129 | - * @access public |
|
130 | - * @param string $content |
|
131 | - * @return string |
|
132 | - */ |
|
133 | - public function venue_details($content) |
|
134 | - { |
|
135 | - global $post; |
|
136 | - if ($post->post_type == 'espresso_venues' |
|
137 | - && ! post_password_required() |
|
138 | - ) { |
|
139 | - // since the 'content-espresso_venues-details.php' template might be used directly from within a theme, |
|
140 | - // it uses the_content() for displaying the $post->post_content |
|
141 | - // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
|
142 | - // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
|
143 | - remove_filter('the_content', array($this, 'venue_details'), 100); |
|
144 | - // add filters we want |
|
145 | - add_filter('the_content', array($this, 'venue_location'), 110); |
|
146 | - // now load our template |
|
147 | - $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
148 | - // remove other filters we added so they won't get applied to the next post |
|
149 | - remove_filter('the_content', array($this, 'venue_location'), 110); |
|
150 | - } |
|
151 | - // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
|
152 | - return ! empty($template) ? $template : $content; |
|
153 | - } |
|
154 | - |
|
155 | - |
|
156 | - /** |
|
157 | - * venue_location |
|
158 | - * |
|
159 | - * @access public |
|
160 | - * @param string $content |
|
161 | - * @return string |
|
162 | - */ |
|
163 | - public function venue_location($content) |
|
164 | - { |
|
165 | - return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
166 | - } |
|
167 | - |
|
168 | - |
|
169 | - /** |
|
170 | - * wp_enqueue_scripts |
|
171 | - * |
|
172 | - * @access public |
|
173 | - * @return void |
|
174 | - */ |
|
175 | - public function wp_enqueue_scripts() |
|
176 | - { |
|
177 | - // get some style |
|
178 | - if (apply_filters('FHEE_enable_default_espresso_css', true) && is_single()) { |
|
179 | - // first check theme folder |
|
180 | - if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
181 | - wp_register_style( |
|
182 | - $this->theme, |
|
183 | - get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
184 | - array('dashicons', 'espresso_default') |
|
185 | - ); |
|
186 | - } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
187 | - wp_register_style( |
|
188 | - $this->theme, |
|
189 | - EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
190 | - array('dashicons', 'espresso_default') |
|
191 | - ); |
|
192 | - } |
|
193 | - wp_enqueue_style($this->theme); |
|
194 | - if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
195 | - add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
196 | - } |
|
197 | - } |
|
198 | - } |
|
32 | + /** |
|
33 | + * @return EED_Venue_Single |
|
34 | + */ |
|
35 | + public static function instance() |
|
36 | + { |
|
37 | + return parent::get_instance(__CLASS__); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
43 | + * |
|
44 | + * @return void |
|
45 | + * @throws InvalidArgumentException |
|
46 | + * @throws InvalidDataTypeException |
|
47 | + * @throws InvalidInterfaceException |
|
48 | + */ |
|
49 | + public static function set_hooks() |
|
50 | + { |
|
51 | + /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_type_definitions */ |
|
52 | + $custom_post_type_definitions = LoaderFactory::getLoader()->getShared( |
|
53 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' |
|
54 | + ); |
|
55 | + $custom_post_types = $custom_post_type_definitions->getDefinitions(); |
|
56 | + EE_Config::register_route( |
|
57 | + $custom_post_types['espresso_venues']['singular_slug'], |
|
58 | + 'Venue_Single', |
|
59 | + 'run' |
|
60 | + ); |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
65 | + * |
|
66 | + * @access public |
|
67 | + * @return void |
|
68 | + */ |
|
69 | + public static function set_hooks_admin() |
|
70 | + { |
|
71 | + } |
|
72 | + |
|
73 | + |
|
74 | + /** |
|
75 | + * run - initial module setup |
|
76 | + * |
|
77 | + * @access public |
|
78 | + * @param \WP $WP |
|
79 | + */ |
|
80 | + public function run($WP) |
|
81 | + { |
|
82 | + // check what template is loaded |
|
83 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
84 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * template_include |
|
90 | + * |
|
91 | + * @access public |
|
92 | + * @param string $template |
|
93 | + * @return string |
|
94 | + */ |
|
95 | + public function template_include($template) |
|
96 | + { |
|
97 | + // not a custom template? |
|
98 | + if (EE_Registry::instance() |
|
99 | + ->load_core('Front_Controller', array(), false, true) |
|
100 | + ->get_selected_template() != 'single-espresso_venues.php' |
|
101 | + ) { |
|
102 | + EEH_Template::load_espresso_theme_functions(); |
|
103 | + // then add extra event data via hooks |
|
104 | + add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
105 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
106 | + // don't display entry meta because the existing theme will take car of that |
|
107 | + add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
108 | + } |
|
109 | + return $template; |
|
110 | + } |
|
111 | + |
|
112 | + |
|
113 | + /** |
|
114 | + * the_title |
|
115 | + * |
|
116 | + * @access public |
|
117 | + * @param string $title |
|
118 | + * @return string |
|
119 | + */ |
|
120 | + public function the_title($title = '') |
|
121 | + { |
|
122 | + return $title; |
|
123 | + } |
|
124 | + |
|
125 | + |
|
126 | + /** |
|
127 | + * venue_details |
|
128 | + * |
|
129 | + * @access public |
|
130 | + * @param string $content |
|
131 | + * @return string |
|
132 | + */ |
|
133 | + public function venue_details($content) |
|
134 | + { |
|
135 | + global $post; |
|
136 | + if ($post->post_type == 'espresso_venues' |
|
137 | + && ! post_password_required() |
|
138 | + ) { |
|
139 | + // since the 'content-espresso_venues-details.php' template might be used directly from within a theme, |
|
140 | + // it uses the_content() for displaying the $post->post_content |
|
141 | + // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
|
142 | + // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
|
143 | + remove_filter('the_content', array($this, 'venue_details'), 100); |
|
144 | + // add filters we want |
|
145 | + add_filter('the_content', array($this, 'venue_location'), 110); |
|
146 | + // now load our template |
|
147 | + $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
148 | + // remove other filters we added so they won't get applied to the next post |
|
149 | + remove_filter('the_content', array($this, 'venue_location'), 110); |
|
150 | + } |
|
151 | + // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
|
152 | + return ! empty($template) ? $template : $content; |
|
153 | + } |
|
154 | + |
|
155 | + |
|
156 | + /** |
|
157 | + * venue_location |
|
158 | + * |
|
159 | + * @access public |
|
160 | + * @param string $content |
|
161 | + * @return string |
|
162 | + */ |
|
163 | + public function venue_location($content) |
|
164 | + { |
|
165 | + return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
166 | + } |
|
167 | + |
|
168 | + |
|
169 | + /** |
|
170 | + * wp_enqueue_scripts |
|
171 | + * |
|
172 | + * @access public |
|
173 | + * @return void |
|
174 | + */ |
|
175 | + public function wp_enqueue_scripts() |
|
176 | + { |
|
177 | + // get some style |
|
178 | + if (apply_filters('FHEE_enable_default_espresso_css', true) && is_single()) { |
|
179 | + // first check theme folder |
|
180 | + if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
181 | + wp_register_style( |
|
182 | + $this->theme, |
|
183 | + get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
184 | + array('dashicons', 'espresso_default') |
|
185 | + ); |
|
186 | + } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
187 | + wp_register_style( |
|
188 | + $this->theme, |
|
189 | + EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
190 | + array('dashicons', 'espresso_default') |
|
191 | + ); |
|
192 | + } |
|
193 | + wp_enqueue_style($this->theme); |
|
194 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
195 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
196 | + } |
|
197 | + } |
|
198 | + } |
|
199 | 199 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function venue_location($content) |
164 | 164 | { |
165 | - return $content . EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
165 | + return $content.EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | // get some style |
178 | 178 | if (apply_filters('FHEE_enable_default_espresso_css', true) && is_single()) { |
179 | 179 | // first check theme folder |
180 | - if (is_readable(get_stylesheet_directory() . $this->theme . DS . 'style.css')) { |
|
180 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
181 | 181 | wp_register_style( |
182 | 182 | $this->theme, |
183 | - get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', |
|
183 | + get_stylesheet_directory_uri().$this->theme.DS.'style.css', |
|
184 | 184 | array('dashicons', 'espresso_default') |
185 | 185 | ); |
186 | - } elseif (is_readable(EE_TEMPLATES . $this->theme . DS . 'style.css')) { |
|
186 | + } elseif (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) { |
|
187 | 187 | wp_register_style( |
188 | 188 | $this->theme, |
189 | - EE_TEMPLATES_URL . $this->theme . DS . 'style.css', |
|
189 | + EE_TEMPLATES_URL.$this->theme.DS.'style.css', |
|
190 | 190 | array('dashicons', 'espresso_default') |
191 | 191 | ); |
192 | 192 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
125 | 125 | wp_enqueue_script( |
126 | 126 | 'batch_runner_init', |
127 | - BATCH_URL . 'assets/batch_runner_init.js', |
|
127 | + BATCH_URL.'assets/batch_runner_init.js', |
|
128 | 128 | array('batch_runner'), |
129 | 129 | EVENT_ESPRESSO_VERSION, |
130 | 130 | true |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
149 | 149 | wp_enqueue_script( |
150 | 150 | 'batch_file_runner_init', |
151 | - BATCH_URL . 'assets/batch_file_runner_init.js', |
|
151 | + BATCH_URL.'assets/batch_file_runner_init.js', |
|
152 | 152 | array('batch_runner'), |
153 | 153 | EVENT_ESPRESSO_VERSION, |
154 | 154 | true |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | array( |
161 | 161 | 'download_and_redirecting' => sprintf( |
162 | 162 | __('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), |
163 | - '<a href="' . $_REQUEST['return_url'] . '">', |
|
163 | + '<a href="'.$_REQUEST['return_url'].'">', |
|
164 | 164 | '</a>' |
165 | 165 | ), |
166 | 166 | 'return_url' => $_REQUEST['return_url'], |
@@ -179,18 +179,18 @@ discard block |
||
179 | 179 | { |
180 | 180 | wp_register_script( |
181 | 181 | 'progress_bar', |
182 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.js', |
|
182 | + EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.js', |
|
183 | 183 | array('jquery') |
184 | 184 | ); |
185 | 185 | wp_enqueue_style( |
186 | 186 | 'progress_bar', |
187 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.css', |
|
187 | + EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.css', |
|
188 | 188 | array(), |
189 | 189 | EVENT_ESPRESSO_VERSION |
190 | 190 | ); |
191 | 191 | wp_enqueue_script( |
192 | 192 | 'batch_runner', |
193 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', |
|
193 | + EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/batch_runner.js', |
|
194 | 194 | array('progress_bar') |
195 | 195 | ); |
196 | 196 | // just copy the bits of EE admin's eei18n that we need in the JS |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | public function override_template($template) |
226 | 226 | { |
227 | 227 | if (isset($_REQUEST['espresso_batch']) && isset($_REQUEST['batch'])) { |
228 | - return EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_frontend_wrapper.template.html'; |
|
228 | + return EE_MODULES.'batch'.DS.'templates'.DS.'batch_frontend_wrapper.template.html'; |
|
229 | 229 | } |
230 | 230 | return $template; |
231 | 231 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | public function show_admin_page() |
253 | 253 | { |
254 | 254 | echo EEH_Template::locate_template( |
255 | - EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', |
|
255 | + EE_MODULES.'batch'.DS.'templates'.DS.'batch_wrapper.template.html', |
|
256 | 256 | array('batch_request_type' => $this->batch_request_type()) |
257 | 257 | ); |
258 | 258 | } |
@@ -23,336 +23,336 @@ |
||
23 | 23 | class EED_Batch extends EED_Module |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
|
28 | - * processes data only |
|
29 | - */ |
|
30 | - const batch_job = 'job'; |
|
31 | - /** |
|
32 | - * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
|
33 | - * produces a file for download |
|
34 | - */ |
|
35 | - const batch_file_job = 'file'; |
|
36 | - /** |
|
37 | - * Possibly value for $_REQUEST[ 'batch' ]. Indicates this request is NOT |
|
38 | - * for a batch job. It's the same as not providing the $_REQUEST[ 'batch' ] |
|
39 | - * at all |
|
40 | - */ |
|
41 | - const batch_not_job = 'none'; |
|
26 | + /** |
|
27 | + * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
|
28 | + * processes data only |
|
29 | + */ |
|
30 | + const batch_job = 'job'; |
|
31 | + /** |
|
32 | + * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
|
33 | + * produces a file for download |
|
34 | + */ |
|
35 | + const batch_file_job = 'file'; |
|
36 | + /** |
|
37 | + * Possibly value for $_REQUEST[ 'batch' ]. Indicates this request is NOT |
|
38 | + * for a batch job. It's the same as not providing the $_REQUEST[ 'batch' ] |
|
39 | + * at all |
|
40 | + */ |
|
41 | + const batch_not_job = 'none'; |
|
42 | 42 | |
43 | - /** |
|
44 | - * |
|
45 | - * @var string 'file', or 'job', or false to indicate its not a batch request at all |
|
46 | - */ |
|
47 | - protected $_batch_request_type = null; |
|
43 | + /** |
|
44 | + * |
|
45 | + * @var string 'file', or 'job', or false to indicate its not a batch request at all |
|
46 | + */ |
|
47 | + protected $_batch_request_type = null; |
|
48 | 48 | |
49 | - /** |
|
50 | - * Because we want to use the response in both the localized JS and in the body |
|
51 | - * we need to make this response available between method calls |
|
52 | - * |
|
53 | - * @var \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
54 | - */ |
|
55 | - protected $_job_step_response = null; |
|
49 | + /** |
|
50 | + * Because we want to use the response in both the localized JS and in the body |
|
51 | + * we need to make this response available between method calls |
|
52 | + * |
|
53 | + * @var \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
54 | + */ |
|
55 | + protected $_job_step_response = null; |
|
56 | 56 | |
57 | - /** |
|
58 | - * Gets the batch instance |
|
59 | - * |
|
60 | - * @return EED_Batch |
|
61 | - */ |
|
62 | - public static function instance() |
|
63 | - { |
|
64 | - return self::get_instance(); |
|
65 | - } |
|
57 | + /** |
|
58 | + * Gets the batch instance |
|
59 | + * |
|
60 | + * @return EED_Batch |
|
61 | + */ |
|
62 | + public static function instance() |
|
63 | + { |
|
64 | + return self::get_instance(); |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * Sets hooks to enable batch jobs on the frontend. Disabled by default |
|
69 | - * because it's an attack vector and there are currently no implementations |
|
70 | - */ |
|
71 | - public static function set_hooks() |
|
72 | - { |
|
73 | - // because this is a possibel attack vector, let's have this disabled until |
|
74 | - // we at least have a real use for it on the frontend |
|
75 | - if (apply_filters('FHEE__EED_Batch__set_hooks__enable_frontend_batch', false)) { |
|
76 | - add_action('wp_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
77 | - add_filter('template_include', array(self::instance(), 'override_template'), 99); |
|
78 | - } |
|
79 | - } |
|
67 | + /** |
|
68 | + * Sets hooks to enable batch jobs on the frontend. Disabled by default |
|
69 | + * because it's an attack vector and there are currently no implementations |
|
70 | + */ |
|
71 | + public static function set_hooks() |
|
72 | + { |
|
73 | + // because this is a possibel attack vector, let's have this disabled until |
|
74 | + // we at least have a real use for it on the frontend |
|
75 | + if (apply_filters('FHEE__EED_Batch__set_hooks__enable_frontend_batch', false)) { |
|
76 | + add_action('wp_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
77 | + add_filter('template_include', array(self::instance(), 'override_template'), 99); |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * Initializes some hooks for the admin in order to run batch jobs |
|
83 | - */ |
|
84 | - public static function set_hooks_admin() |
|
85 | - { |
|
86 | - add_action('admin_menu', array(self::instance(), 'register_admin_pages')); |
|
87 | - add_action('admin_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
81 | + /** |
|
82 | + * Initializes some hooks for the admin in order to run batch jobs |
|
83 | + */ |
|
84 | + public static function set_hooks_admin() |
|
85 | + { |
|
86 | + add_action('admin_menu', array(self::instance(), 'register_admin_pages')); |
|
87 | + add_action('admin_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
88 | 88 | |
89 | - // ajax |
|
90 | - add_action('wp_ajax_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
91 | - add_action('wp_ajax_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
92 | - add_action('wp_ajax_nopriv_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
93 | - add_action('wp_ajax_nopriv_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
94 | - } |
|
89 | + // ajax |
|
90 | + add_action('wp_ajax_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
91 | + add_action('wp_ajax_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
92 | + add_action('wp_ajax_nopriv_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
93 | + add_action('wp_ajax_nopriv_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Enqueues batch scripts on the frontend or admin, and creates a job |
|
98 | - */ |
|
99 | - public function enqueue_scripts() |
|
100 | - { |
|
101 | - if (isset($_REQUEST['espresso_batch']) |
|
102 | - || |
|
103 | - ( |
|
104 | - isset($_REQUEST['page']) |
|
105 | - && $_REQUEST['page'] == 'espresso_batch' |
|
106 | - ) |
|
107 | - ) { |
|
108 | - switch ($this->batch_request_type()) { |
|
109 | - case self::batch_job: |
|
110 | - $this->enqueue_scripts_styles_batch_create(); |
|
111 | - break; |
|
112 | - case self::batch_file_job: |
|
113 | - $this->enqueue_scripts_styles_batch_file_create(); |
|
114 | - break; |
|
115 | - } |
|
116 | - } |
|
117 | - } |
|
96 | + /** |
|
97 | + * Enqueues batch scripts on the frontend or admin, and creates a job |
|
98 | + */ |
|
99 | + public function enqueue_scripts() |
|
100 | + { |
|
101 | + if (isset($_REQUEST['espresso_batch']) |
|
102 | + || |
|
103 | + ( |
|
104 | + isset($_REQUEST['page']) |
|
105 | + && $_REQUEST['page'] == 'espresso_batch' |
|
106 | + ) |
|
107 | + ) { |
|
108 | + switch ($this->batch_request_type()) { |
|
109 | + case self::batch_job: |
|
110 | + $this->enqueue_scripts_styles_batch_create(); |
|
111 | + break; |
|
112 | + case self::batch_file_job: |
|
113 | + $this->enqueue_scripts_styles_batch_file_create(); |
|
114 | + break; |
|
115 | + } |
|
116 | + } |
|
117 | + } |
|
118 | 118 | |
119 | - /** |
|
120 | - * Create a batch job, enqueues a script to run it, and localizes some data for it |
|
121 | - */ |
|
122 | - public function enqueue_scripts_styles_batch_create() |
|
123 | - { |
|
124 | - $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
|
125 | - wp_enqueue_script( |
|
126 | - 'batch_runner_init', |
|
127 | - BATCH_URL . 'assets/batch_runner_init.js', |
|
128 | - array('batch_runner'), |
|
129 | - EVENT_ESPRESSO_VERSION, |
|
130 | - true |
|
131 | - ); |
|
132 | - wp_localize_script('batch_runner_init', 'ee_job_response', $job_response->to_array()); |
|
133 | - wp_localize_script( |
|
134 | - 'batch_runner_init', |
|
135 | - 'ee_job_i18n', |
|
136 | - array( |
|
137 | - 'return_url' => $_REQUEST['return_url'], |
|
138 | - ) |
|
139 | - ); |
|
140 | - } |
|
119 | + /** |
|
120 | + * Create a batch job, enqueues a script to run it, and localizes some data for it |
|
121 | + */ |
|
122 | + public function enqueue_scripts_styles_batch_create() |
|
123 | + { |
|
124 | + $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
|
125 | + wp_enqueue_script( |
|
126 | + 'batch_runner_init', |
|
127 | + BATCH_URL . 'assets/batch_runner_init.js', |
|
128 | + array('batch_runner'), |
|
129 | + EVENT_ESPRESSO_VERSION, |
|
130 | + true |
|
131 | + ); |
|
132 | + wp_localize_script('batch_runner_init', 'ee_job_response', $job_response->to_array()); |
|
133 | + wp_localize_script( |
|
134 | + 'batch_runner_init', |
|
135 | + 'ee_job_i18n', |
|
136 | + array( |
|
137 | + 'return_url' => $_REQUEST['return_url'], |
|
138 | + ) |
|
139 | + ); |
|
140 | + } |
|
141 | 141 | |
142 | - /** |
|
143 | - * Creates a batch job which will download a file, enqueues a script to run the job, and localizes some data for it |
|
144 | - */ |
|
145 | - public function enqueue_scripts_styles_batch_file_create() |
|
146 | - { |
|
147 | - // creates a job based on the request variable |
|
148 | - $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
|
149 | - wp_enqueue_script( |
|
150 | - 'batch_file_runner_init', |
|
151 | - BATCH_URL . 'assets/batch_file_runner_init.js', |
|
152 | - array('batch_runner'), |
|
153 | - EVENT_ESPRESSO_VERSION, |
|
154 | - true |
|
155 | - ); |
|
156 | - wp_localize_script('batch_file_runner_init', 'ee_job_response', $job_response->to_array()); |
|
157 | - wp_localize_script( |
|
158 | - 'batch_file_runner_init', |
|
159 | - 'ee_job_i18n', |
|
160 | - array( |
|
161 | - 'download_and_redirecting' => sprintf( |
|
162 | - __('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), |
|
163 | - '<a href="' . $_REQUEST['return_url'] . '">', |
|
164 | - '</a>' |
|
165 | - ), |
|
166 | - 'return_url' => $_REQUEST['return_url'], |
|
167 | - ) |
|
168 | - ); |
|
169 | - } |
|
142 | + /** |
|
143 | + * Creates a batch job which will download a file, enqueues a script to run the job, and localizes some data for it |
|
144 | + */ |
|
145 | + public function enqueue_scripts_styles_batch_file_create() |
|
146 | + { |
|
147 | + // creates a job based on the request variable |
|
148 | + $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
|
149 | + wp_enqueue_script( |
|
150 | + 'batch_file_runner_init', |
|
151 | + BATCH_URL . 'assets/batch_file_runner_init.js', |
|
152 | + array('batch_runner'), |
|
153 | + EVENT_ESPRESSO_VERSION, |
|
154 | + true |
|
155 | + ); |
|
156 | + wp_localize_script('batch_file_runner_init', 'ee_job_response', $job_response->to_array()); |
|
157 | + wp_localize_script( |
|
158 | + 'batch_file_runner_init', |
|
159 | + 'ee_job_i18n', |
|
160 | + array( |
|
161 | + 'download_and_redirecting' => sprintf( |
|
162 | + __('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), |
|
163 | + '<a href="' . $_REQUEST['return_url'] . '">', |
|
164 | + '</a>' |
|
165 | + ), |
|
166 | + 'return_url' => $_REQUEST['return_url'], |
|
167 | + ) |
|
168 | + ); |
|
169 | + } |
|
170 | 170 | |
171 | - /** |
|
172 | - * Enqueues scripts and styles common to any batch job, and creates |
|
173 | - * a job from the request data, and stores the response in the |
|
174 | - * $this->_job_step_response property |
|
175 | - * |
|
176 | - * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
177 | - */ |
|
178 | - protected function _enqueue_batch_job_scripts_and_styles_and_start_job() |
|
179 | - { |
|
180 | - wp_register_script( |
|
181 | - 'progress_bar', |
|
182 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.js', |
|
183 | - array('jquery') |
|
184 | - ); |
|
185 | - wp_enqueue_style( |
|
186 | - 'progress_bar', |
|
187 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.css', |
|
188 | - array(), |
|
189 | - EVENT_ESPRESSO_VERSION |
|
190 | - ); |
|
191 | - wp_enqueue_script( |
|
192 | - 'batch_runner', |
|
193 | - EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', |
|
194 | - array('progress_bar') |
|
195 | - ); |
|
196 | - // just copy the bits of EE admin's eei18n that we need in the JS |
|
197 | - wp_localize_script( |
|
198 | - 'batch_runner', |
|
199 | - 'eei18n', |
|
200 | - array( |
|
201 | - 'ajax_url' => WP_AJAX_URL, |
|
202 | - 'is_admin' => (bool) is_admin(), |
|
203 | - 'error_message' => esc_html__('An error occurred and the job has been stopped. Please refresh the page to try again.', 'event_espresso'), |
|
204 | - ) |
|
205 | - ); |
|
206 | - $job_handler_classname = stripslashes($_GET['job_handler']); |
|
207 | - $request_data = array_diff_key( |
|
208 | - $_REQUEST, |
|
209 | - array_flip(array('action', 'page', 'ee', 'batch')) |
|
210 | - ); |
|
211 | - $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
212 | - // eg 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' |
|
213 | - $job_response = $batch_runner->create_job($job_handler_classname, $request_data); |
|
214 | - // remember the response for later. We need it to display the page body |
|
215 | - $this->_job_step_response = $job_response; |
|
216 | - return $job_response; |
|
217 | - } |
|
171 | + /** |
|
172 | + * Enqueues scripts and styles common to any batch job, and creates |
|
173 | + * a job from the request data, and stores the response in the |
|
174 | + * $this->_job_step_response property |
|
175 | + * |
|
176 | + * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
177 | + */ |
|
178 | + protected function _enqueue_batch_job_scripts_and_styles_and_start_job() |
|
179 | + { |
|
180 | + wp_register_script( |
|
181 | + 'progress_bar', |
|
182 | + EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.js', |
|
183 | + array('jquery') |
|
184 | + ); |
|
185 | + wp_enqueue_style( |
|
186 | + 'progress_bar', |
|
187 | + EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.css', |
|
188 | + array(), |
|
189 | + EVENT_ESPRESSO_VERSION |
|
190 | + ); |
|
191 | + wp_enqueue_script( |
|
192 | + 'batch_runner', |
|
193 | + EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', |
|
194 | + array('progress_bar') |
|
195 | + ); |
|
196 | + // just copy the bits of EE admin's eei18n that we need in the JS |
|
197 | + wp_localize_script( |
|
198 | + 'batch_runner', |
|
199 | + 'eei18n', |
|
200 | + array( |
|
201 | + 'ajax_url' => WP_AJAX_URL, |
|
202 | + 'is_admin' => (bool) is_admin(), |
|
203 | + 'error_message' => esc_html__('An error occurred and the job has been stopped. Please refresh the page to try again.', 'event_espresso'), |
|
204 | + ) |
|
205 | + ); |
|
206 | + $job_handler_classname = stripslashes($_GET['job_handler']); |
|
207 | + $request_data = array_diff_key( |
|
208 | + $_REQUEST, |
|
209 | + array_flip(array('action', 'page', 'ee', 'batch')) |
|
210 | + ); |
|
211 | + $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
212 | + // eg 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' |
|
213 | + $job_response = $batch_runner->create_job($job_handler_classname, $request_data); |
|
214 | + // remember the response for later. We need it to display the page body |
|
215 | + $this->_job_step_response = $job_response; |
|
216 | + return $job_response; |
|
217 | + } |
|
218 | 218 | |
219 | - /** |
|
220 | - * If we are doing a frontend batch job, this makes it so WP shows our template's HTML |
|
221 | - * |
|
222 | - * @param string $template |
|
223 | - * @return string |
|
224 | - */ |
|
225 | - public function override_template($template) |
|
226 | - { |
|
227 | - if (isset($_REQUEST['espresso_batch']) && isset($_REQUEST['batch'])) { |
|
228 | - return EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_frontend_wrapper.template.html'; |
|
229 | - } |
|
230 | - return $template; |
|
231 | - } |
|
219 | + /** |
|
220 | + * If we are doing a frontend batch job, this makes it so WP shows our template's HTML |
|
221 | + * |
|
222 | + * @param string $template |
|
223 | + * @return string |
|
224 | + */ |
|
225 | + public function override_template($template) |
|
226 | + { |
|
227 | + if (isset($_REQUEST['espresso_batch']) && isset($_REQUEST['batch'])) { |
|
228 | + return EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_frontend_wrapper.template.html'; |
|
229 | + } |
|
230 | + return $template; |
|
231 | + } |
|
232 | 232 | |
233 | - /** |
|
234 | - * Adds an admin page which doesn't appear in the admin menu |
|
235 | - */ |
|
236 | - public function register_admin_pages() |
|
237 | - { |
|
238 | - add_submenu_page( |
|
239 | - '', // parent slug. we don't want this to actually appear in the menu |
|
240 | - __('Batch Job', 'event_espresso'), // page title |
|
241 | - 'n/a', // menu title |
|
242 | - 'read', // we want this page to actually be accessible to anyone, |
|
243 | - 'espresso_batch', // menu slug |
|
244 | - array(self::instance(), 'show_admin_page') |
|
245 | - ); |
|
246 | - } |
|
233 | + /** |
|
234 | + * Adds an admin page which doesn't appear in the admin menu |
|
235 | + */ |
|
236 | + public function register_admin_pages() |
|
237 | + { |
|
238 | + add_submenu_page( |
|
239 | + '', // parent slug. we don't want this to actually appear in the menu |
|
240 | + __('Batch Job', 'event_espresso'), // page title |
|
241 | + 'n/a', // menu title |
|
242 | + 'read', // we want this page to actually be accessible to anyone, |
|
243 | + 'espresso_batch', // menu slug |
|
244 | + array(self::instance(), 'show_admin_page') |
|
245 | + ); |
|
246 | + } |
|
247 | 247 | |
248 | - /** |
|
249 | - * Renders the admin page, after most of the work was already done during enqueuing scripts |
|
250 | - * of creating the job and localizing some data |
|
251 | - */ |
|
252 | - public function show_admin_page() |
|
253 | - { |
|
254 | - echo EEH_Template::locate_template( |
|
255 | - EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', |
|
256 | - array('batch_request_type' => $this->batch_request_type()) |
|
257 | - ); |
|
258 | - } |
|
248 | + /** |
|
249 | + * Renders the admin page, after most of the work was already done during enqueuing scripts |
|
250 | + * of creating the job and localizing some data |
|
251 | + */ |
|
252 | + public function show_admin_page() |
|
253 | + { |
|
254 | + echo EEH_Template::locate_template( |
|
255 | + EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', |
|
256 | + array('batch_request_type' => $this->batch_request_type()) |
|
257 | + ); |
|
258 | + } |
|
259 | 259 | |
260 | - /** |
|
261 | - * Receives ajax calls for continuing a job |
|
262 | - */ |
|
263 | - public function batch_continue() |
|
264 | - { |
|
265 | - $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
266 | - $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
267 | - $response_obj = $batch_runner->continue_job($job_id); |
|
268 | - $this->_return_json($response_obj->to_array()); |
|
269 | - } |
|
260 | + /** |
|
261 | + * Receives ajax calls for continuing a job |
|
262 | + */ |
|
263 | + public function batch_continue() |
|
264 | + { |
|
265 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
266 | + $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
267 | + $response_obj = $batch_runner->continue_job($job_id); |
|
268 | + $this->_return_json($response_obj->to_array()); |
|
269 | + } |
|
270 | 270 | |
271 | - /** |
|
272 | - * Receives the ajax call to cleanup a job |
|
273 | - * |
|
274 | - * @return type |
|
275 | - */ |
|
276 | - public function batch_cleanup() |
|
277 | - { |
|
278 | - $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
279 | - $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
280 | - $response_obj = $batch_runner->cleanup_job($job_id); |
|
281 | - $this->_return_json($response_obj->to_array()); |
|
282 | - } |
|
271 | + /** |
|
272 | + * Receives the ajax call to cleanup a job |
|
273 | + * |
|
274 | + * @return type |
|
275 | + */ |
|
276 | + public function batch_cleanup() |
|
277 | + { |
|
278 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
279 | + $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
|
280 | + $response_obj = $batch_runner->cleanup_job($job_id); |
|
281 | + $this->_return_json($response_obj->to_array()); |
|
282 | + } |
|
283 | 283 | |
284 | 284 | |
285 | - /** |
|
286 | - * Returns a json response |
|
287 | - * |
|
288 | - * @param array $data The data we want to send echo via in the JSON response's "data" element |
|
289 | - * |
|
290 | - * The returned json object is created from an array in the following format: |
|
291 | - * array( |
|
292 | - * 'notices' => '', // - contains any EE_Error formatted notices |
|
293 | - * 'data' => array() //this can be any key/value pairs that a method returns for later json parsing by the js. |
|
294 | - * We're also going to include the template args with every package (so js can pick out any specific template |
|
295 | - * args that might be included in here) |
|
296 | - * 'isEEajax' => true,//indicates this is a response from EE |
|
297 | - * ) |
|
298 | - */ |
|
299 | - protected function _return_json($data) |
|
300 | - { |
|
301 | - $json = array( |
|
302 | - 'notices' => EE_Error::get_notices(), |
|
303 | - 'data' => $data, |
|
304 | - 'isEEajax' => true |
|
305 | - // special flag so any ajax.Success methods in js can identify this return package as a EEajax package. |
|
306 | - ); |
|
285 | + /** |
|
286 | + * Returns a json response |
|
287 | + * |
|
288 | + * @param array $data The data we want to send echo via in the JSON response's "data" element |
|
289 | + * |
|
290 | + * The returned json object is created from an array in the following format: |
|
291 | + * array( |
|
292 | + * 'notices' => '', // - contains any EE_Error formatted notices |
|
293 | + * 'data' => array() //this can be any key/value pairs that a method returns for later json parsing by the js. |
|
294 | + * We're also going to include the template args with every package (so js can pick out any specific template |
|
295 | + * args that might be included in here) |
|
296 | + * 'isEEajax' => true,//indicates this is a response from EE |
|
297 | + * ) |
|
298 | + */ |
|
299 | + protected function _return_json($data) |
|
300 | + { |
|
301 | + $json = array( |
|
302 | + 'notices' => EE_Error::get_notices(), |
|
303 | + 'data' => $data, |
|
304 | + 'isEEajax' => true |
|
305 | + // special flag so any ajax.Success methods in js can identify this return package as a EEajax package. |
|
306 | + ); |
|
307 | 307 | |
308 | 308 | |
309 | - // make sure there are no php errors or headers_sent. Then we can set correct json header. |
|
310 | - if (null === error_get_last() || ! headers_sent()) { |
|
311 | - header('Content-Type: application/json; charset=UTF-8'); |
|
312 | - } |
|
313 | - echo wp_json_encode($json); |
|
314 | - exit(); |
|
315 | - } |
|
309 | + // make sure there are no php errors or headers_sent. Then we can set correct json header. |
|
310 | + if (null === error_get_last() || ! headers_sent()) { |
|
311 | + header('Content-Type: application/json; charset=UTF-8'); |
|
312 | + } |
|
313 | + echo wp_json_encode($json); |
|
314 | + exit(); |
|
315 | + } |
|
316 | 316 | |
317 | - /** |
|
318 | - * Gets the job step response which was done during the enqueuing of scripts |
|
319 | - * |
|
320 | - * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
321 | - */ |
|
322 | - public function job_step_response() |
|
323 | - { |
|
324 | - return $this->_job_step_response; |
|
325 | - } |
|
317 | + /** |
|
318 | + * Gets the job step response which was done during the enqueuing of scripts |
|
319 | + * |
|
320 | + * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
|
321 | + */ |
|
322 | + public function job_step_response() |
|
323 | + { |
|
324 | + return $this->_job_step_response; |
|
325 | + } |
|
326 | 326 | |
327 | - /** |
|
328 | - * Gets the batch request type indicated in the $_REQUEST |
|
329 | - * |
|
330 | - * @return string: EED_Batch::batch_job, EED_Batch::batch_file_job, EED_Batch::batch_not_job |
|
331 | - */ |
|
332 | - public function batch_request_type() |
|
333 | - { |
|
334 | - if ($this->_batch_request_type === null) { |
|
335 | - if (isset($_GET['batch'])) { |
|
336 | - if ($_GET['batch'] == self::batch_job) { |
|
337 | - $this->_batch_request_type = self::batch_job; |
|
338 | - } elseif ($_GET['batch'] == self::batch_file_job) { |
|
339 | - $this->_batch_request_type = self::batch_file_job; |
|
340 | - } |
|
341 | - } |
|
342 | - // if we didn't find that it was a batch request, indicate it wasn't |
|
343 | - if ($this->_batch_request_type === null) { |
|
344 | - $this->_batch_request_type = self::batch_not_job; |
|
345 | - } |
|
346 | - } |
|
347 | - return $this->_batch_request_type; |
|
348 | - } |
|
327 | + /** |
|
328 | + * Gets the batch request type indicated in the $_REQUEST |
|
329 | + * |
|
330 | + * @return string: EED_Batch::batch_job, EED_Batch::batch_file_job, EED_Batch::batch_not_job |
|
331 | + */ |
|
332 | + public function batch_request_type() |
|
333 | + { |
|
334 | + if ($this->_batch_request_type === null) { |
|
335 | + if (isset($_GET['batch'])) { |
|
336 | + if ($_GET['batch'] == self::batch_job) { |
|
337 | + $this->_batch_request_type = self::batch_job; |
|
338 | + } elseif ($_GET['batch'] == self::batch_file_job) { |
|
339 | + $this->_batch_request_type = self::batch_file_job; |
|
340 | + } |
|
341 | + } |
|
342 | + // if we didn't find that it was a batch request, indicate it wasn't |
|
343 | + if ($this->_batch_request_type === null) { |
|
344 | + $this->_batch_request_type = self::batch_not_job; |
|
345 | + } |
|
346 | + } |
|
347 | + return $this->_batch_request_type; |
|
348 | + } |
|
349 | 349 | |
350 | - /** |
|
351 | - * Unnecessary |
|
352 | - * |
|
353 | - * @param type $WP |
|
354 | - */ |
|
355 | - public function run($WP) |
|
356 | - { |
|
357 | - } |
|
350 | + /** |
|
351 | + * Unnecessary |
|
352 | + * |
|
353 | + * @param type $WP |
|
354 | + */ |
|
355 | + public function run($WP) |
|
356 | + { |
|
357 | + } |
|
358 | 358 | } |
@@ -10,11 +10,11 @@ |
||
10 | 10 | * @ version 4+ |
11 | 11 | */ |
12 | 12 | ?> |
13 | -<p><?php _e('Organizer Name: ', 'event_espresso') . espresso_organization_name($VNU_ID); ?><br/> |
|
14 | - <?php _e('Organizer Email: ', 'event_espresso') . espresso_organization_email($VNU_ID); ?><br/> |
|
15 | - <?php _e('Venue Phone: ', 'event_espresso') . espresso_venue_phone($VNU_ID); ?></p> |
|
16 | -<p><?php _e('Categories: ', 'event_espresso') . espresso_venue_categories($VNU_ID); ?></p> |
|
17 | -<p><?php _e('Address: ', 'event_espresso') . espresso_venue_address($VNU_ID); ?></p> |
|
18 | -<p><?php _e('Website: ', 'event_espresso') . espresso_venue_website($VNU_ID); ?></p> |
|
19 | -<p><?php echo __('Description: ', 'event_espresso') . $venue_description; ?></p><br/> |
|
13 | +<p><?php _e('Organizer Name: ', 'event_espresso').espresso_organization_name($VNU_ID); ?><br/> |
|
14 | + <?php _e('Organizer Email: ', 'event_espresso').espresso_organization_email($VNU_ID); ?><br/> |
|
15 | + <?php _e('Venue Phone: ', 'event_espresso').espresso_venue_phone($VNU_ID); ?></p> |
|
16 | +<p><?php _e('Categories: ', 'event_espresso').espresso_venue_categories($VNU_ID); ?></p> |
|
17 | +<p><?php _e('Address: ', 'event_espresso').espresso_venue_address($VNU_ID); ?></p> |
|
18 | +<p><?php _e('Website: ', 'event_espresso').espresso_venue_website($VNU_ID); ?></p> |
|
19 | +<p><?php echo __('Description: ', 'event_espresso').$venue_description; ?></p><br/> |
|
20 | 20 | |
21 | 21 | \ No newline at end of file |