@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @return mixed|null |
27 | 27 | * @throws \EE_Error |
28 | 28 | */ |
29 | - public static function create( $class_name, $arguments = array() ) { |
|
30 | - if ( empty( $class_name ) ) { |
|
29 | + public static function create($class_name, $arguments = array()) { |
|
30 | + if (empty($class_name)) { |
|
31 | 31 | throw new \EE_Error( |
32 | - __( 'You must provide a class name in order to instantiate it.', 'event_espresso' ) |
|
32 | + __('You must provide a class name in order to instantiate it.', 'event_espresso') |
|
33 | 33 | ); |
34 | 34 | } |
35 | 35 | // if ( ! class_exists( $class_name ) ) { |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | // ); |
42 | 42 | // } |
43 | 43 | $object = null; |
44 | - switch ( $class_name ) { |
|
44 | + switch ($class_name) { |
|
45 | 45 | |
46 | 46 | case 'EE_Request' : |
47 | - $object = new \EE_Request( $_GET, $_POST, $_COOKIE ); |
|
47 | + $object = new \EE_Request($_GET, $_POST, $_COOKIE); |
|
48 | 48 | break; |
49 | 49 | |
50 | 50 | case 'Iframe' : |
51 | - $title = isset( $arguments['title'] ) ? $arguments['title'] : null; |
|
52 | - $content = isset( $arguments['content'] ) ? $arguments['content'] : null; |
|
53 | - $object = new Iframe( $title, $content ); |
|
51 | + $title = isset($arguments['title']) ? $arguments['title'] : null; |
|
52 | + $content = isset($arguments['content']) ? $arguments['content'] : null; |
|
53 | + $object = new Iframe($title, $content); |
|
54 | 54 | break; |
55 | 55 | |
56 | 56 | default : |
57 | - $object = new $class_name( $arguments ); |
|
57 | + $object = new $class_name($arguments); |
|
58 | 58 | |
59 | 59 | } |
60 | 60 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | namespace EventEspresso\core\exceptions; |
3 | 3 | |
4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
5 | - exit('No direct script access allowed'); |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -21,71 +21,71 @@ discard block |
||
21 | 21 | class IpnException extends \LogicException |
22 | 22 | { |
23 | 23 | |
24 | - const DUPLICATE = 1; |
|
24 | + const DUPLICATE = 1; |
|
25 | 25 | |
26 | - const UNABLE_TO_VALIDATE = 2; |
|
26 | + const UNABLE_TO_VALIDATE = 2; |
|
27 | 27 | |
28 | - const UNSUPPORTED = 3; |
|
28 | + const UNSUPPORTED = 3; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @var \EE_Payment |
|
32 | - */ |
|
33 | - protected $payment; |
|
30 | + /** |
|
31 | + * @var \EE_Payment |
|
32 | + */ |
|
33 | + protected $payment; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @var mixed IPN data, usually an array or object |
|
37 | - */ |
|
38 | - protected $ipn_data; |
|
35 | + /** |
|
36 | + * @var mixed IPN data, usually an array or object |
|
37 | + */ |
|
38 | + protected $ipn_data; |
|
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | - public function __construct( |
|
43 | - $message, |
|
44 | - $code = 0, |
|
45 | - \Exception $previous = null, |
|
46 | - \EE_Payment $payment = null, |
|
47 | - $ipn_data = array() |
|
48 | - ) { |
|
49 | - parent::__construct($message, $code, $previous); |
|
50 | - $this->payment = $payment; |
|
51 | - $this->ipn_data = $ipn_data; |
|
52 | - } |
|
42 | + public function __construct( |
|
43 | + $message, |
|
44 | + $code = 0, |
|
45 | + \Exception $previous = null, |
|
46 | + \EE_Payment $payment = null, |
|
47 | + $ipn_data = array() |
|
48 | + ) { |
|
49 | + parent::__construct($message, $code, $previous); |
|
50 | + $this->payment = $payment; |
|
51 | + $this->ipn_data = $ipn_data; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Gets the payment associated with this IPN, if known |
|
58 | - * |
|
59 | - * @return \EE_Payment |
|
60 | - */ |
|
61 | - public function getPayment() |
|
62 | - { |
|
63 | - return $this->payment; |
|
64 | - } |
|
56 | + /** |
|
57 | + * Gets the payment associated with this IPN, if known |
|
58 | + * |
|
59 | + * @return \EE_Payment |
|
60 | + */ |
|
61 | + public function getPayment() |
|
62 | + { |
|
63 | + return $this->payment; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | - /** |
|
69 | - * Returns the payment's properties as an array (even if there is no payment, in which case it's an empty array) |
|
70 | - * |
|
71 | - * @return array |
|
72 | - * @throws \EE_Error |
|
73 | - */ |
|
74 | - public function getPaymentProperties() |
|
75 | - { |
|
76 | - return $this->getPayment() instanceof \EE_Payment ? $this->getPayment()->model_field_array() : array(); |
|
77 | - } |
|
68 | + /** |
|
69 | + * Returns the payment's properties as an array (even if there is no payment, in which case it's an empty array) |
|
70 | + * |
|
71 | + * @return array |
|
72 | + * @throws \EE_Error |
|
73 | + */ |
|
74 | + public function getPaymentProperties() |
|
75 | + { |
|
76 | + return $this->getPayment() instanceof \EE_Payment ? $this->getPayment()->model_field_array() : array(); |
|
77 | + } |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * Returns an array, object, or string, however, the IPN data was received |
|
83 | - * |
|
84 | - * @return mixed |
|
85 | - */ |
|
86 | - public function getIpnData() |
|
87 | - { |
|
88 | - return $this->ipn_data; |
|
89 | - } |
|
81 | + /** |
|
82 | + * Returns an array, object, or string, however, the IPN data was received |
|
83 | + * |
|
84 | + * @return mixed |
|
85 | + */ |
|
86 | + public function getIpnData() |
|
87 | + { |
|
88 | + return $this->ipn_data; |
|
89 | + } |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use EventEspresso\modules\invalid_checkout_access\InvalidCheckoutAccess; |
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 | |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | public static function set_hooks_admin() { |
37 | 37 | add_action( |
38 | 38 | 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', |
39 | - array( 'EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form' ), |
|
39 | + array('EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form'), |
|
40 | 40 | 15 |
41 | 41 | ); |
42 | 42 | add_filter( |
43 | 43 | 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', |
44 | - array( 'EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form' ) |
|
44 | + array('EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form') |
|
45 | 45 | ); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @var WP $WP |
55 | 55 | */ |
56 | - public function run( $WP ) { |
|
56 | + public function run($WP) { |
|
57 | 57 | // TODO: Implement run() method. |
58 | 58 | } |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return InvalidCheckoutAccess |
64 | 64 | */ |
65 | 65 | public static function getInvalidCheckoutAccess() { |
66 | - if ( ! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess ) { |
|
66 | + if ( ! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
67 | 67 | self::$invalid_checkout_access_form = new InvalidCheckoutAccess(); |
68 | 68 | } |
69 | 69 | return self::$invalid_checkout_access_form; |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | * @param \EE_Registration_Config $EE_Registration_Config |
91 | 91 | * @return \EE_Registration_Config |
92 | 92 | */ |
93 | - public static function process_invalid_checkout_access_form( \EE_Registration_Config $EE_Registration_Config ) { |
|
93 | + public static function process_invalid_checkout_access_form(\EE_Registration_Config $EE_Registration_Config) { |
|
94 | 94 | $invalid_checkout_access_form = \EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
95 | - return $invalid_checkout_access_form->processForm( $EE_Registration_Config ); |
|
95 | + return $invalid_checkout_access_form->processForm($EE_Registration_Config); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\exceptions; |
3 | 3 | |
4 | -defined( 'ABSPATH' ) || exit; |
|
4 | +defined('ABSPATH') || exit; |
|
5 | 5 | |
6 | 6 | |
7 | 7 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | * @param int $code |
23 | 23 | * @param \Exception $previous |
24 | 24 | */ |
25 | - public function __construct( $message = '', $code = 0, \Exception $previous = null ) { |
|
26 | - if ( empty( $message ) ) { |
|
27 | - $message = esc_html__( 'The session data is either missing or invalid.', 'event_espresso' ); |
|
25 | + public function __construct($message = '', $code = 0, \Exception $previous = null) { |
|
26 | + if (empty($message)) { |
|
27 | + $message = esc_html__('The session data is either missing or invalid.', 'event_espresso'); |
|
28 | 28 | } |
29 | - parent::__construct( $message, $code, $previous ); |
|
29 | + parent::__construct($message, $code, $previous); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <p><?php printf( esc_html__( 'Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso' ), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">','</a>' ); ?></p> |
|
2 | + <p><?php printf(esc_html__('Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso'), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">', '</a>'); ?></p> |
|
3 | 3 | </div> |
4 | 4 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <h3><?php esc_html_e( 'Frequently Asked Questions about Event Espresso', 'event_espresso' ); ?></h3> |
|
2 | + <h3><?php esc_html_e('Frequently Asked Questions about Event Espresso', 'event_espresso'); ?></h3> |
|
3 | 3 | |
4 | - <h4><?php esc_html_e( 'New to Event Espresso?', 'event_espresso' ); ?></h4> |
|
4 | + <h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4> |
|
5 | 5 | |
6 | - <p><?php printf( esc_html__( 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso' ), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">','</a>','<em>','</em>' ); ?></p> |
|
6 | + <p><?php printf(esc_html__('Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso'), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', '</a>', '<em>', '</em>'); ?></p> |
|
7 | 7 | </div> |
8 | 8 | \ No newline at end of file |
@@ -3,33 +3,33 @@ |
||
3 | 3 | global $post; |
4 | 4 | ?> |
5 | 5 | <div class="event-content"> |
6 | -<?php if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_entry_meta', TRUE )): ?> |
|
6 | +<?php if (apply_filters('FHEE__content_espresso_events_details_template__display_entry_meta', TRUE)): ?> |
|
7 | 7 | <div class="entry-meta"> |
8 | - <span class="tags-links"><?php espresso_event_categories( $post->ID, TRUE, TRUE ); ?></span> |
|
8 | + <span class="tags-links"><?php espresso_event_categories($post->ID, TRUE, TRUE); ?></span> |
|
9 | 9 | <?php |
10 | - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : |
|
10 | + if ( ! post_password_required() && (comments_open() || get_comments_number())) : |
|
11 | 11 | ?> |
12 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span> |
|
12 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'event_espresso'), __('1 Comment', 'event_espresso'), __('% Comments', 'event_espresso')); ?></span> |
|
13 | 13 | <?php |
14 | 14 | endif; |
15 | - edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' ); |
|
15 | + edit_post_link(__('Edit', 'event_espresso'), '<span class="edit-link">', '</span>'); |
|
16 | 16 | ?> |
17 | 17 | </div> |
18 | 18 | <?php endif; |
19 | - $event_phone = espresso_event_phone( $post->ID, FALSE ); |
|
20 | - if ( $event_phone != '' ) : ?> |
|
19 | + $event_phone = espresso_event_phone($post->ID, FALSE); |
|
20 | + if ($event_phone != '') : ?> |
|
21 | 21 | <p> |
22 | - <span class="small-text"><strong><?php _e( 'Event Phone:', 'event_espresso' ); ?> </strong></span> <?php echo $event_phone; ?> |
|
22 | + <span class="small-text"><strong><?php _e('Event Phone:', 'event_espresso'); ?> </strong></span> <?php echo $event_phone; ?> |
|
23 | 23 | </p> |
24 | -<?php endif; ?> |
|
24 | +<?php endif; ?> |
|
25 | 25 | <?php |
26 | - if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_the_content', true ) ) { |
|
27 | - do_action( 'AHEE_event_details_before_the_content', $post ); |
|
26 | + if (apply_filters('FHEE__content_espresso_events_details_template__display_the_content', true)) { |
|
27 | + do_action('AHEE_event_details_before_the_content', $post); |
|
28 | 28 | echo apply_filters( |
29 | 29 | 'FHEE__content_espresso_events_details_template__the_content', |
30 | - espresso_event_content_or_excerpt( 55, null, false ) |
|
30 | + espresso_event_content_or_excerpt(55, null, false) |
|
31 | 31 | ); |
32 | - do_action( 'AHEE_event_details_after_the_content', $post ); |
|
32 | + do_action('AHEE_event_details_after_the_content', $post); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </div> |
@@ -30,224 +30,224 @@ |
||
30 | 30 | class AdminOptionsSettings extends FormHandler |
31 | 31 | { |
32 | 32 | |
33 | - protected $template_args = array(); |
|
34 | - |
|
35 | - /** |
|
36 | - * Form constructor. |
|
37 | - * |
|
38 | - * @param \EE_Registry $registry |
|
39 | - */ |
|
40 | - public function __construct(\EE_Registry $registry) { |
|
41 | - parent::__construct( |
|
42 | - esc_html__('Admin Options', 'event_espresso'), |
|
43 | - esc_html__('Admin Options', 'event_espresso'), |
|
44 | - 'admin_option_settings', |
|
45 | - '', |
|
46 | - FormHandler::DO_NOT_SETUP_FORM, |
|
47 | - $registry |
|
48 | - ); |
|
49 | - } |
|
50 | - |
|
51 | - |
|
52 | - |
|
53 | - /** |
|
54 | - * @param array $template_args |
|
55 | - */ |
|
56 | - public function setTemplateArgs(array $template_args) |
|
57 | - { |
|
58 | - $this->template_args = $template_args; |
|
59 | - } |
|
60 | - |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * creates and returns the actual form |
|
65 | - * |
|
66 | - * @return EE_Form_Section_Proper |
|
67 | - * @throws \EE_Error |
|
68 | - */ |
|
69 | - public function generate() |
|
70 | - { |
|
71 | - $form = new \EE_Form_Section_Proper( |
|
72 | - array( |
|
73 | - 'name' => 'admin_option_settings', |
|
74 | - 'html_id' => 'admin_option_settings', |
|
75 | - 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
76 | - 'subsections' => array( |
|
77 | - 'help_tour_activation_hdr' => new EE_Form_Section_HTML( |
|
78 | - EEH_HTML::h2( |
|
79 | - esc_html__('Help Tour Global Activation', 'event_espresso') |
|
80 | - . ' ' |
|
81 | - . EEH_HTML::span( |
|
82 | - EEH_Template::get_help_tab_link('help_tour_activation_info'), |
|
83 | - 'help_tour_activation' |
|
84 | - ), |
|
85 | - '', 'ee-admin-settings-hdr' |
|
86 | - ) |
|
87 | - ), |
|
88 | - 'help_tour_activation' => new EE_Yes_No_Input( |
|
89 | - array( |
|
90 | - 'html_label_text' => esc_html__('Activate Global Help Tours?', 'event_espresso'), |
|
91 | - 'html_help_text' => esc_html__( |
|
92 | - 'This toggles whether the Event Espresso help tours are active globally or not.', |
|
93 | - 'event_espresso' |
|
94 | - ), |
|
95 | - 'default' => isset($this->registry->CFG->admin->help_tour_activation) |
|
96 | - ? filter_var($this->registry->CFG->admin->help_tour_activation, FILTER_VALIDATE_BOOLEAN) |
|
97 | - : true, |
|
98 | - 'required' => false |
|
99 | - ) |
|
100 | - ), |
|
101 | - 'compatibility_hdr' => new EE_Form_Section_HTML( |
|
102 | - EEH_HTML::h2( |
|
103 | - esc_html__('Compatibility Settings', 'event_espresso'), |
|
104 | - '', 'ee-admin-settings-hdr' |
|
105 | - ) |
|
106 | - ), |
|
107 | - 'encode_session_data' => new EE_Yes_No_Input( |
|
108 | - array( |
|
109 | - 'html_label_text' => esc_html__('Encode Session Data?', 'event_espresso'), |
|
110 | - 'html_help_text' => sprintf( |
|
111 | - esc_html__( |
|
112 | - 'Some servers and database configurations can cause problems when saving the Event Espresso session data. Setting this option to "Yes" adds an extra layer of encoding to session data to prevent serialization errors, but can be incompatible with some server configurations.%1$sIf you receive "500 internal server" type errors during registration, try turning this option on.%1$sIf you get fatal PHP errors regarding missing base64 functions, then turn this option off.', |
|
113 | - 'event_espresso' |
|
114 | - ), |
|
115 | - '<br>' |
|
116 | - ), |
|
117 | - 'default' => $this->registry->CFG->admin->encode_session_data(), |
|
118 | - 'required' => false |
|
119 | - ) |
|
120 | - ), |
|
121 | - ) |
|
122 | - ) |
|
123 | - ); |
|
124 | - if ( |
|
125 | - $this->registry->CAP->current_user_can( |
|
126 | - 'manage_options', |
|
127 | - 'display_admin_settings_options_promote_and_affiliate' |
|
128 | - ) |
|
129 | - ) { |
|
130 | - $form->add_subsections( |
|
131 | - array( |
|
132 | - 'promote_ee_hdr' => new EE_Form_Section_HTML( |
|
133 | - EEH_HTML::h2( |
|
134 | - esc_html__('Promote Event Espresso', 'event_espresso') |
|
135 | - . ' ' |
|
136 | - . EEH_HTML::span( |
|
137 | - EEH_Template::get_help_tab_link('affiliate_info'), |
|
138 | - 'affiliate_info' |
|
139 | - ), |
|
140 | - '', 'ee-admin-settings-hdr' |
|
141 | - ) |
|
142 | - ), |
|
143 | - 'show_reg_footer' => new EE_Yes_No_Input( |
|
144 | - array( |
|
145 | - 'html_label_text' => esc_html__( |
|
146 | - 'Link to Event Espresso in your Registration Page?', |
|
147 | - 'event_espresso' |
|
148 | - ) |
|
149 | - . EEH_Template::get_help_tab_link('email_validation_info'), |
|
150 | - 'html_help_text' => esc_html__( |
|
151 | - 'adds an unobtrusive link to Event Espresso\'s website in the footer of your registration form. Get an affiliate link (see below) and make money if people click the link and purchase Event Espresso.', |
|
152 | - 'event_espresso' |
|
153 | - ), |
|
154 | - 'default' => isset($this->registry->CFG->admin->show_reg_footer) |
|
155 | - ? filter_var($this->registry->CFG->admin->show_reg_footer, FILTER_VALIDATE_BOOLEAN) |
|
156 | - : true, |
|
157 | - 'required' => false |
|
158 | - ) |
|
159 | - ), |
|
160 | - 'affiliate_id' => new EE_Text_Input( |
|
161 | - array( |
|
162 | - 'html_label_text' => sprintf( |
|
163 | - esc_html__('Event Espresso %sAffiliate%s ID', 'event_espresso'), |
|
164 | - '<a href="http://eventespresso.com/affiliates/" target="_blank">', |
|
165 | - '</a>' |
|
166 | - ), |
|
167 | - 'html_help_text' => esc_html__( |
|
168 | - 'Earn cash for promoting Event Espresso.', |
|
169 | - 'event_espresso' |
|
170 | - ), |
|
171 | - 'html_class' => 'regular-text', |
|
172 | - 'default' => isset($this->registry->CFG->admin->affiliate_id) |
|
173 | - ? $this->registry->CFG->admin->get_pretty('affiliate_id') |
|
174 | - : '', |
|
175 | - 'required' => false |
|
176 | - ) |
|
177 | - ), |
|
178 | - ), |
|
179 | - 'help_tour_activation_hdr' |
|
180 | - ); |
|
181 | - } |
|
182 | - return $form; |
|
183 | - } |
|
184 | - |
|
185 | - |
|
186 | - |
|
187 | - /** |
|
188 | - * takes the generated form and displays it along with ony other non-form HTML that may be required |
|
189 | - * returns a string of HTML that can be directly echoed in a template |
|
190 | - * |
|
191 | - * @return string |
|
192 | - * @throws LogicException |
|
193 | - * @throws \EE_Error |
|
194 | - */ |
|
195 | - public function display() |
|
196 | - { |
|
197 | - add_filter( |
|
198 | - 'FHEE__EventEspresso_core_libraries_form_sections_form_handlers_FormHandler__display__before_form', |
|
199 | - array($this, 'handleOldAdminOptionsSettingsAction') |
|
200 | - ); |
|
201 | - return parent::display(); |
|
202 | - } |
|
203 | - |
|
204 | - |
|
205 | - |
|
206 | - /** |
|
207 | - * @return string |
|
208 | - */ |
|
209 | - public function handleOldAdminOptionsSettingsAction() |
|
210 | - { |
|
211 | - ob_start(); |
|
212 | - do_action('AHEE__admin_option_settings__template__before', $this->template_args); |
|
213 | - return ob_get_clean(); |
|
214 | - } |
|
215 | - |
|
216 | - |
|
217 | - |
|
218 | - /** |
|
219 | - * handles processing the form submission |
|
220 | - * returns true or false depending on whether the form was processed successfully or not |
|
221 | - * |
|
222 | - * @param array $form_data |
|
223 | - * @return bool |
|
224 | - * @throws InvalidFormSubmissionException |
|
225 | - * @throws EE_Error |
|
226 | - * @throws LogicException |
|
227 | - * @throws InvalidArgumentException |
|
228 | - * @throws InvalidDataTypeException |
|
229 | - */ |
|
230 | - public function process($form_data = array()) |
|
231 | - { |
|
232 | - // process form |
|
233 | - $valid_data = (array)parent::process($form_data); |
|
234 | - if (empty($valid_data)) { |
|
235 | - return false; |
|
236 | - } |
|
237 | - $this->registry->CFG->admin->show_reg_footer = isset( $form_data['show_reg_footer'] ) |
|
238 | - ? absint( $form_data['show_reg_footer'] ) |
|
239 | - : $this->registry->CFG->admin->show_reg_footer; |
|
240 | - $this->registry->CFG->admin->affiliate_id = isset( $form_data['affiliate_id'] ) |
|
241 | - ? sanitize_text_field( $form_data['affiliate_id'] ) |
|
242 | - : $this->registry->CFG->admin->affiliate_id; |
|
243 | - $this->registry->CFG->admin->help_tour_activation = isset( $form_data['help_tour_activation'] ) |
|
244 | - ? absint( $form_data['help_tour_activation']) |
|
245 | - : $this->registry->CFG->admin->help_tour_activation; |
|
246 | - if (isset($form_data['encode_session_data'])) { |
|
247 | - $this->registry->CFG->admin->set_encode_session_data($form_data['encode_session_data']); |
|
248 | - } |
|
249 | - return false; |
|
250 | - } |
|
33 | + protected $template_args = array(); |
|
34 | + |
|
35 | + /** |
|
36 | + * Form constructor. |
|
37 | + * |
|
38 | + * @param \EE_Registry $registry |
|
39 | + */ |
|
40 | + public function __construct(\EE_Registry $registry) { |
|
41 | + parent::__construct( |
|
42 | + esc_html__('Admin Options', 'event_espresso'), |
|
43 | + esc_html__('Admin Options', 'event_espresso'), |
|
44 | + 'admin_option_settings', |
|
45 | + '', |
|
46 | + FormHandler::DO_NOT_SETUP_FORM, |
|
47 | + $registry |
|
48 | + ); |
|
49 | + } |
|
50 | + |
|
51 | + |
|
52 | + |
|
53 | + /** |
|
54 | + * @param array $template_args |
|
55 | + */ |
|
56 | + public function setTemplateArgs(array $template_args) |
|
57 | + { |
|
58 | + $this->template_args = $template_args; |
|
59 | + } |
|
60 | + |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * creates and returns the actual form |
|
65 | + * |
|
66 | + * @return EE_Form_Section_Proper |
|
67 | + * @throws \EE_Error |
|
68 | + */ |
|
69 | + public function generate() |
|
70 | + { |
|
71 | + $form = new \EE_Form_Section_Proper( |
|
72 | + array( |
|
73 | + 'name' => 'admin_option_settings', |
|
74 | + 'html_id' => 'admin_option_settings', |
|
75 | + 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
76 | + 'subsections' => array( |
|
77 | + 'help_tour_activation_hdr' => new EE_Form_Section_HTML( |
|
78 | + EEH_HTML::h2( |
|
79 | + esc_html__('Help Tour Global Activation', 'event_espresso') |
|
80 | + . ' ' |
|
81 | + . EEH_HTML::span( |
|
82 | + EEH_Template::get_help_tab_link('help_tour_activation_info'), |
|
83 | + 'help_tour_activation' |
|
84 | + ), |
|
85 | + '', 'ee-admin-settings-hdr' |
|
86 | + ) |
|
87 | + ), |
|
88 | + 'help_tour_activation' => new EE_Yes_No_Input( |
|
89 | + array( |
|
90 | + 'html_label_text' => esc_html__('Activate Global Help Tours?', 'event_espresso'), |
|
91 | + 'html_help_text' => esc_html__( |
|
92 | + 'This toggles whether the Event Espresso help tours are active globally or not.', |
|
93 | + 'event_espresso' |
|
94 | + ), |
|
95 | + 'default' => isset($this->registry->CFG->admin->help_tour_activation) |
|
96 | + ? filter_var($this->registry->CFG->admin->help_tour_activation, FILTER_VALIDATE_BOOLEAN) |
|
97 | + : true, |
|
98 | + 'required' => false |
|
99 | + ) |
|
100 | + ), |
|
101 | + 'compatibility_hdr' => new EE_Form_Section_HTML( |
|
102 | + EEH_HTML::h2( |
|
103 | + esc_html__('Compatibility Settings', 'event_espresso'), |
|
104 | + '', 'ee-admin-settings-hdr' |
|
105 | + ) |
|
106 | + ), |
|
107 | + 'encode_session_data' => new EE_Yes_No_Input( |
|
108 | + array( |
|
109 | + 'html_label_text' => esc_html__('Encode Session Data?', 'event_espresso'), |
|
110 | + 'html_help_text' => sprintf( |
|
111 | + esc_html__( |
|
112 | + 'Some servers and database configurations can cause problems when saving the Event Espresso session data. Setting this option to "Yes" adds an extra layer of encoding to session data to prevent serialization errors, but can be incompatible with some server configurations.%1$sIf you receive "500 internal server" type errors during registration, try turning this option on.%1$sIf you get fatal PHP errors regarding missing base64 functions, then turn this option off.', |
|
113 | + 'event_espresso' |
|
114 | + ), |
|
115 | + '<br>' |
|
116 | + ), |
|
117 | + 'default' => $this->registry->CFG->admin->encode_session_data(), |
|
118 | + 'required' => false |
|
119 | + ) |
|
120 | + ), |
|
121 | + ) |
|
122 | + ) |
|
123 | + ); |
|
124 | + if ( |
|
125 | + $this->registry->CAP->current_user_can( |
|
126 | + 'manage_options', |
|
127 | + 'display_admin_settings_options_promote_and_affiliate' |
|
128 | + ) |
|
129 | + ) { |
|
130 | + $form->add_subsections( |
|
131 | + array( |
|
132 | + 'promote_ee_hdr' => new EE_Form_Section_HTML( |
|
133 | + EEH_HTML::h2( |
|
134 | + esc_html__('Promote Event Espresso', 'event_espresso') |
|
135 | + . ' ' |
|
136 | + . EEH_HTML::span( |
|
137 | + EEH_Template::get_help_tab_link('affiliate_info'), |
|
138 | + 'affiliate_info' |
|
139 | + ), |
|
140 | + '', 'ee-admin-settings-hdr' |
|
141 | + ) |
|
142 | + ), |
|
143 | + 'show_reg_footer' => new EE_Yes_No_Input( |
|
144 | + array( |
|
145 | + 'html_label_text' => esc_html__( |
|
146 | + 'Link to Event Espresso in your Registration Page?', |
|
147 | + 'event_espresso' |
|
148 | + ) |
|
149 | + . EEH_Template::get_help_tab_link('email_validation_info'), |
|
150 | + 'html_help_text' => esc_html__( |
|
151 | + 'adds an unobtrusive link to Event Espresso\'s website in the footer of your registration form. Get an affiliate link (see below) and make money if people click the link and purchase Event Espresso.', |
|
152 | + 'event_espresso' |
|
153 | + ), |
|
154 | + 'default' => isset($this->registry->CFG->admin->show_reg_footer) |
|
155 | + ? filter_var($this->registry->CFG->admin->show_reg_footer, FILTER_VALIDATE_BOOLEAN) |
|
156 | + : true, |
|
157 | + 'required' => false |
|
158 | + ) |
|
159 | + ), |
|
160 | + 'affiliate_id' => new EE_Text_Input( |
|
161 | + array( |
|
162 | + 'html_label_text' => sprintf( |
|
163 | + esc_html__('Event Espresso %sAffiliate%s ID', 'event_espresso'), |
|
164 | + '<a href="http://eventespresso.com/affiliates/" target="_blank">', |
|
165 | + '</a>' |
|
166 | + ), |
|
167 | + 'html_help_text' => esc_html__( |
|
168 | + 'Earn cash for promoting Event Espresso.', |
|
169 | + 'event_espresso' |
|
170 | + ), |
|
171 | + 'html_class' => 'regular-text', |
|
172 | + 'default' => isset($this->registry->CFG->admin->affiliate_id) |
|
173 | + ? $this->registry->CFG->admin->get_pretty('affiliate_id') |
|
174 | + : '', |
|
175 | + 'required' => false |
|
176 | + ) |
|
177 | + ), |
|
178 | + ), |
|
179 | + 'help_tour_activation_hdr' |
|
180 | + ); |
|
181 | + } |
|
182 | + return $form; |
|
183 | + } |
|
184 | + |
|
185 | + |
|
186 | + |
|
187 | + /** |
|
188 | + * takes the generated form and displays it along with ony other non-form HTML that may be required |
|
189 | + * returns a string of HTML that can be directly echoed in a template |
|
190 | + * |
|
191 | + * @return string |
|
192 | + * @throws LogicException |
|
193 | + * @throws \EE_Error |
|
194 | + */ |
|
195 | + public function display() |
|
196 | + { |
|
197 | + add_filter( |
|
198 | + 'FHEE__EventEspresso_core_libraries_form_sections_form_handlers_FormHandler__display__before_form', |
|
199 | + array($this, 'handleOldAdminOptionsSettingsAction') |
|
200 | + ); |
|
201 | + return parent::display(); |
|
202 | + } |
|
203 | + |
|
204 | + |
|
205 | + |
|
206 | + /** |
|
207 | + * @return string |
|
208 | + */ |
|
209 | + public function handleOldAdminOptionsSettingsAction() |
|
210 | + { |
|
211 | + ob_start(); |
|
212 | + do_action('AHEE__admin_option_settings__template__before', $this->template_args); |
|
213 | + return ob_get_clean(); |
|
214 | + } |
|
215 | + |
|
216 | + |
|
217 | + |
|
218 | + /** |
|
219 | + * handles processing the form submission |
|
220 | + * returns true or false depending on whether the form was processed successfully or not |
|
221 | + * |
|
222 | + * @param array $form_data |
|
223 | + * @return bool |
|
224 | + * @throws InvalidFormSubmissionException |
|
225 | + * @throws EE_Error |
|
226 | + * @throws LogicException |
|
227 | + * @throws InvalidArgumentException |
|
228 | + * @throws InvalidDataTypeException |
|
229 | + */ |
|
230 | + public function process($form_data = array()) |
|
231 | + { |
|
232 | + // process form |
|
233 | + $valid_data = (array)parent::process($form_data); |
|
234 | + if (empty($valid_data)) { |
|
235 | + return false; |
|
236 | + } |
|
237 | + $this->registry->CFG->admin->show_reg_footer = isset( $form_data['show_reg_footer'] ) |
|
238 | + ? absint( $form_data['show_reg_footer'] ) |
|
239 | + : $this->registry->CFG->admin->show_reg_footer; |
|
240 | + $this->registry->CFG->admin->affiliate_id = isset( $form_data['affiliate_id'] ) |
|
241 | + ? sanitize_text_field( $form_data['affiliate_id'] ) |
|
242 | + : $this->registry->CFG->admin->affiliate_id; |
|
243 | + $this->registry->CFG->admin->help_tour_activation = isset( $form_data['help_tour_activation'] ) |
|
244 | + ? absint( $form_data['help_tour_activation']) |
|
245 | + : $this->registry->CFG->admin->help_tour_activation; |
|
246 | + if (isset($form_data['encode_session_data'])) { |
|
247 | + $this->registry->CFG->admin->set_encode_session_data($form_data['encode_session_data']); |
|
248 | + } |
|
249 | + return false; |
|
250 | + } |
|
251 | 251 | |
252 | 252 | } |
253 | 253 | // End of file AdminOptionsSettings.php |
@@ -230,18 +230,18 @@ |
||
230 | 230 | public function process($form_data = array()) |
231 | 231 | { |
232 | 232 | // process form |
233 | - $valid_data = (array)parent::process($form_data); |
|
233 | + $valid_data = (array) parent::process($form_data); |
|
234 | 234 | if (empty($valid_data)) { |
235 | 235 | return false; |
236 | 236 | } |
237 | - $this->registry->CFG->admin->show_reg_footer = isset( $form_data['show_reg_footer'] ) |
|
238 | - ? absint( $form_data['show_reg_footer'] ) |
|
237 | + $this->registry->CFG->admin->show_reg_footer = isset($form_data['show_reg_footer']) |
|
238 | + ? absint($form_data['show_reg_footer']) |
|
239 | 239 | : $this->registry->CFG->admin->show_reg_footer; |
240 | - $this->registry->CFG->admin->affiliate_id = isset( $form_data['affiliate_id'] ) |
|
241 | - ? sanitize_text_field( $form_data['affiliate_id'] ) |
|
240 | + $this->registry->CFG->admin->affiliate_id = isset($form_data['affiliate_id']) |
|
241 | + ? sanitize_text_field($form_data['affiliate_id']) |
|
242 | 242 | : $this->registry->CFG->admin->affiliate_id; |
243 | - $this->registry->CFG->admin->help_tour_activation = isset( $form_data['help_tour_activation'] ) |
|
244 | - ? absint( $form_data['help_tour_activation']) |
|
243 | + $this->registry->CFG->admin->help_tour_activation = isset($form_data['help_tour_activation']) |
|
244 | + ? absint($form_data['help_tour_activation']) |
|
245 | 245 | : $this->registry->CFG->admin->help_tour_activation; |
246 | 246 | if (isset($form_data['encode_session_data'])) { |
247 | 247 | $this->registry->CFG->admin->set_encode_session_data($form_data['encode_session_data']); |
@@ -8,19 +8,19 @@ discard block |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Text_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Text_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @param array $options |
16 | 16 | */ |
17 | - public function __construct($options = array()){ |
|
17 | + public function __construct($options = array()) { |
|
18 | 18 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
19 | 19 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
20 | 20 | parent::__construct($options); |
21 | 21 | //if the input hasn't specifically mentioned a more lenient validation strategy, |
22 | 22 | //apply plaintext validation strategy |
23 | - if( ! $this->has_validation_strategy( |
|
23 | + if ( ! $this->has_validation_strategy( |
|
24 | 24 | array( |
25 | 25 | 'EE_Full_HTML_Validation_Strategy', |
26 | 26 | 'EE_Simple_HTML_Validation_Strategy' |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | ) { |
30 | 30 | //by default we use the plaintext validation. If you want something else, |
31 | 31 | //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
32 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
32 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 |