@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Line_Item_Display |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Line_Item_Display |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_Line_Item_Display { |
15 | 15 | |
16 | 16 | private $strategy = NULL; |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Default_Line_Item_Display_Strategy |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Default_Line_Item_Display_Strategy |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class EE_Default_Line_Item_Display_Strategy implements EEI_Line_Item_Display { |
16 | 16 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // quantity td |
165 | 165 | $html .= EEH_HTML::td( $line_item->quantity(), '', 'item_l jst-rght' ); |
166 | 166 | $tax_rate = $line_item->is_taxable() |
167 | - && EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes |
|
167 | + && EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes |
|
168 | 168 | ? 1 + ( $this->_tax_rate / 100 ) |
169 | 169 | : 1; |
170 | 170 | // price td |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Invoice_Line_Item_Display_Strategy |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Invoice_Line_Item_Display_Strategy |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_Invoice_Line_Item_Display_Strategy implements EEI_Line_Item_Display { |
15 | 15 | |
16 | 16 | /** |
@@ -11,49 +11,49 @@ discard block |
||
11 | 11 | * |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Select_Display_Strategy extends EE_Display_Strategy_Base{ |
|
14 | +class EE_Select_Display_Strategy extends EE_Display_Strategy_Base { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * |
18 | 18 | * @throws EE_Error |
19 | 19 | * @return string of html to display the field |
20 | 20 | */ |
21 | - function display(){ |
|
22 | - if( ! $this->_input instanceof EE_Form_Input_With_Options_Base){ |
|
23 | - throw new EE_Error( sprintf( __( 'Cannot use Select Display Strategy with an input that doesn\'t have options', 'event_espresso' ))); |
|
21 | + function display() { |
|
22 | + if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
23 | + throw new EE_Error(sprintf(__('Cannot use Select Display Strategy with an input that doesn\'t have options', 'event_espresso'))); |
|
24 | 24 | } |
25 | 25 | |
26 | - $html = EEH_HTML::nl( 0, 'select' ); |
|
26 | + $html = EEH_HTML::nl(0, 'select'); |
|
27 | 27 | $html .= '<select'; |
28 | - $html .= ' id="' . $this->_input->html_id() . '"'; |
|
29 | - $html .= ' name="' . $this->_input->html_name() . '"'; |
|
30 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
31 | - $html .= ' class="' . $class . '"'; |
|
28 | + $html .= ' id="'.$this->_input->html_id().'"'; |
|
29 | + $html .= ' name="'.$this->_input->html_name().'"'; |
|
30 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
31 | + $html .= ' class="'.$class.'"'; |
|
32 | 32 | // add html5 required |
33 | 33 | $html .= $this->_input->required() ? ' required' : ''; |
34 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
35 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
34 | + $html .= ' style="'.$this->_input->html_style().'"'; |
|
35 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
36 | 36 | $html .= '>'; |
37 | 37 | |
38 | - if ( EEH_Array::is_multi_dimensional_array( $this->_input->options() )) { |
|
39 | - EEH_HTML::indent( 1, 'optgroup' ); |
|
40 | - foreach( $this->_input->options() as $opt_group_label => $opt_group ){ |
|
38 | + if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
|
39 | + EEH_HTML::indent(1, 'optgroup'); |
|
40 | + foreach ($this->_input->options() as $opt_group_label => $opt_group) { |
|
41 | 41 | if ( ! empty($opt_group_label)) { |
42 | - $html .= EEH_HTML::nl(0, 'optgroup') . '<optgroup label="' . esc_attr($opt_group_label) . '">'; |
|
42 | + $html .= EEH_HTML::nl(0, 'optgroup').'<optgroup label="'.esc_attr($opt_group_label).'">'; |
|
43 | 43 | } |
44 | - EEH_HTML::indent( 1, 'option' ); |
|
45 | - $html .= $this->_display_options( $opt_group ); |
|
44 | + EEH_HTML::indent(1, 'option'); |
|
45 | + $html .= $this->_display_options($opt_group); |
|
46 | 46 | EEH_HTML::indent( -1, 'option' ); |
47 | 47 | if ( ! empty($opt_group_label)) { |
48 | - $html .= EEH_HTML::nl( 0, 'optgroup' ) . '</optgroup>'; |
|
48 | + $html .= EEH_HTML::nl(0, 'optgroup').'</optgroup>'; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | EEH_HTML::indent( -1, 'optgroup' ); |
52 | 52 | } else { |
53 | - $html.=$this->_display_options( $this->_input->options() ); |
|
53 | + $html .= $this->_display_options($this->_input->options()); |
|
54 | 54 | } |
55 | 55 | |
56 | - $html.= EEH_HTML::nl( 0, 'select' ) . '</select>'; |
|
56 | + $html .= EEH_HTML::nl(0, 'select').'</select>'; |
|
57 | 57 | return $html; |
58 | 58 | } |
59 | 59 | |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | * @param array $options |
65 | 65 | * @return string |
66 | 66 | */ |
67 | - protected function _display_options($options){ |
|
67 | + protected function _display_options($options) { |
|
68 | 68 | $html = ''; |
69 | - EEH_HTML::indent( 1, 'option' ); |
|
70 | - foreach( $options as $value => $display_text ){ |
|
69 | + EEH_HTML::indent(1, 'option'); |
|
70 | + foreach ($options as $value => $display_text) { |
|
71 | 71 | //even if this input uses EE_Text_Normalization if one of the array keys is a numeric string, like "123", |
72 | 72 | //PHP will have converted it to a PHP integer (eg 123). So we need to make sure it's a string |
73 | - $unnormalized_value = $this->_input->get_normalization_strategy()->unnormalize_one( $value ); |
|
74 | - $selected = $this->_check_if_option_selected($unnormalized_value ) ? ' selected="selected"' : ''; |
|
75 | - $html.= EEH_HTML::nl( 0, 'option' ) . '<option value="' . esc_attr($unnormalized_value ) . '"' . $selected . '>' . $display_text . '</option>'; |
|
73 | + $unnormalized_value = $this->_input->get_normalization_strategy()->unnormalize_one($value); |
|
74 | + $selected = $this->_check_if_option_selected($unnormalized_value) ? ' selected="selected"' : ''; |
|
75 | + $html .= EEH_HTML::nl(0, 'option').'<option value="'.esc_attr($unnormalized_value).'"'.$selected.'>'.$display_text.'</option>'; |
|
76 | 76 | } |
77 | 77 | EEH_HTML::indent( -1, 'option' ); |
78 | 78 | return $html; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param string|int $option_value unnormalized value option (string). How it will appear in the HTML. |
87 | 87 | * @return string |
88 | 88 | */ |
89 | - protected function _check_if_option_selected($option_value ){ |
|
89 | + protected function _check_if_option_selected($option_value) { |
|
90 | 90 | return $option_value === $this->_input->raw_value(); |
91 | 91 | } |
92 | 92 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * |
14 | 14 | */ |
15 | -class EE_Select2_Display_Strategy extends EE_Select_Display_Strategy{ |
|
15 | +class EE_Select2_Display_Strategy extends EE_Select_Display_Strategy { |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Arguments that will be passed into the select2 javascript constructor |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param array $select2_js_args pass in the EXACT array of JS arguments you want |
26 | 26 | * to pass into the select2 js/html input. See https://select2.github.io |
27 | 27 | */ |
28 | - public function __construct( $select2_js_args = array() ) { |
|
28 | + public function __construct($select2_js_args = array()) { |
|
29 | 29 | $this->_select2_js_args = $select2_js_args; |
30 | 30 | parent::__construct(); |
31 | 31 | } |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | public function enqueue_js() { |
38 | 38 | // need to first deregister the select2 script in case some other plugin **cough cough Toolset Types cough** |
39 | 39 | // is carelessly registering an older version of Select2 on admin pages that don't even belong to them |
40 | - wp_deregister_script( 'select2' ); |
|
41 | - wp_deregister_style( 'select2' ); |
|
42 | - wp_register_script( 'select2', EE_GLOBAL_ASSETS_URL . 'scripts/select2.min.js', array(), '4.0.2', true ); |
|
43 | - wp_register_style( 'select2', EE_GLOBAL_ASSETS_URL . 'css/select2.min.css', array(), '4.0.2', 'all' ); |
|
44 | - wp_enqueue_script( 'form_section_select2_init', EE_GLOBAL_ASSETS_URL . 'scripts/form_section_select2_init.js', array( 'select2' ), '1.0.0', true ); |
|
45 | - wp_enqueue_style( 'select2', EE_GLOBAL_ASSETS_URL . 'css/select2.min.css', array(), '4.0.2', 'all' ); |
|
40 | + wp_deregister_script('select2'); |
|
41 | + wp_deregister_style('select2'); |
|
42 | + wp_register_script('select2', EE_GLOBAL_ASSETS_URL.'scripts/select2.min.js', array(), '4.0.2', true); |
|
43 | + wp_register_style('select2', EE_GLOBAL_ASSETS_URL.'css/select2.min.css', array(), '4.0.2', 'all'); |
|
44 | + wp_enqueue_script('form_section_select2_init', EE_GLOBAL_ASSETS_URL.'scripts/form_section_select2_init.js', array('select2'), '1.0.0', true); |
|
45 | + wp_enqueue_style('select2', EE_GLOBAL_ASSETS_URL.'css/select2.min.css', array(), '4.0.2', 'all'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Sets the exact js args which will be passed into the select2 js/html input |
58 | 58 | * @param array $js_args |
59 | 59 | */ |
60 | - public function set_js_args( $js_args ) { |
|
60 | + public function set_js_args($js_args) { |
|
61 | 61 | $this->_select2_js_args = $js_args; |
62 | 62 | } |
63 | 63 | |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | * @param array $other_js_data |
67 | 67 | * @return array |
68 | 68 | */ |
69 | - public function get_other_js_data( $other_js_data = array() ) { |
|
70 | - $other_js_data = parent::get_other_js_data( $other_js_data ); |
|
71 | - if( ! isset( $other_js_data[ 'select2s' ] ) ) { |
|
69 | + public function get_other_js_data($other_js_data = array()) { |
|
70 | + $other_js_data = parent::get_other_js_data($other_js_data); |
|
71 | + if ( ! isset($other_js_data['select2s'])) { |
|
72 | 72 | $other_js_data['select2s'] = array(); |
73 | 73 | } |
74 | - $other_js_data[ 'select2s' ][ $this->_input->html_id() ] = $this->get_js_args(); |
|
74 | + $other_js_data['select2s'][$this->_input->html_id()] = $this->get_js_args(); |
|
75 | 75 | return $other_js_data; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit( 'No direct script access allowed' ); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * Class EE_Country_Select_Input |
4 | 4 | * |
@@ -11,23 +11,23 @@ discard block |
||
11 | 11 | * |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Country_Select_Input extends EE_Select_Input{ |
|
14 | +class EE_Country_Select_Input extends EE_Select_Input { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param array $country_options |
18 | 18 | * @param array $input_settings |
19 | 19 | * @return EE_Country_Select_Input |
20 | 20 | */ |
21 | - public function __construct( $country_options = NULL, $input_settings = array() ){ |
|
21 | + public function __construct($country_options = NULL, $input_settings = array()) { |
|
22 | 22 | $country_options = apply_filters( |
23 | 23 | 'FHEE__EE_Country_Select_Input____construct__country_options', |
24 | - $this->get_country_answer_options( $country_options ), |
|
24 | + $this->get_country_answer_options($country_options), |
|
25 | 25 | $this |
26 | 26 | ); |
27 | - $input_settings['html_class'] = isset( $input_settings['html_class'] ) |
|
28 | - ? $input_settings['html_class'] . ' ee-country-select-js' |
|
27 | + $input_settings['html_class'] = isset($input_settings['html_class']) |
|
28 | + ? $input_settings['html_class'].' ee-country-select-js' |
|
29 | 29 | : 'ee-country-select-js'; |
30 | - parent::__construct( $country_options, $input_settings ); |
|
30 | + parent::__construct($country_options, $input_settings); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -38,16 +38,16 @@ discard block |
||
38 | 38 | * @param array $country_options |
39 | 39 | * @return array |
40 | 40 | */ |
41 | - public function get_country_answer_options( $country_options = NULL ){ |
|
41 | + public function get_country_answer_options($country_options = NULL) { |
|
42 | 42 | // if passed something that is NOT an array |
43 | - if ( ! is_array( $country_options )) { |
|
43 | + if ( ! is_array($country_options)) { |
|
44 | 44 | // get possibly cached list of countries |
45 | 45 | $countries = EEM_Country::instance()->get_all_active_countries(); |
46 | - if ( ! empty( $countries )) { |
|
47 | - $country_options[ '' ] = ''; |
|
48 | - foreach( $countries as $country ){ |
|
49 | - if ( $country instanceof EE_Country ) { |
|
50 | - $country_options[ $country->ID() ] = $country->name(); |
|
46 | + if ( ! empty($countries)) { |
|
47 | + $country_options[''] = ''; |
|
48 | + foreach ($countries as $country) { |
|
49 | + if ($country instanceof EE_Country) { |
|
50 | + $country_options[$country->ID()] = $country->name(); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } else { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * |
4 | 4 | * Class EE_Checkbox_Multi_Input |
@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | * |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Checkbox_Multi_Input extends EE_Form_Input_With_Options_Base{ |
|
14 | +class EE_Checkbox_Multi_Input extends EE_Form_Input_With_Options_Base { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param array $input_settings |
18 | 18 | * @param array | EE_Question_Option[] $answer_options |
19 | 19 | */ |
20 | - public function __construct( $answer_options, $input_settings = array() ) { |
|
21 | - $this->_set_display_strategy( new EE_Checkbox_Display_Strategy() ); |
|
22 | - $this->_add_validation_strategy( new EE_Many_Valued_Validation_Strategy( array( new EE_Enum_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ))); |
|
20 | + public function __construct($answer_options, $input_settings = array()) { |
|
21 | + $this->_set_display_strategy(new EE_Checkbox_Display_Strategy()); |
|
22 | + $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array(new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)))); |
|
23 | 23 | $this->_multiple_selections = TRUE; |
24 | - parent::__construct( $answer_options, $input_settings ); |
|
24 | + parent::__construct($answer_options, $input_settings); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_PMT_Paypal_Standard extends EE_PMT_Base{ |
|
13 | +class EE_PMT_Paypal_Standard extends EE_PMT_Base { |
|
14 | 14 | |
15 | 15 | const shipping_info_none = 1; |
16 | 16 | const shipping_info_optional = 0; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param \EE_Transaction $transaction |
47 | 47 | * @return NULL |
48 | 48 | */ |
49 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
49 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
50 | 50 | return NULL; |
51 | 51 | } |
52 | 52 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | * @throws \EE_Error |
60 | 60 | */ |
61 | 61 | public function generate_new_settings_form() { |
62 | - require_once( $this->file_folder() . 'EE_Paypal_Standard_Form.form.php' ); |
|
63 | - $form = new EE_Paypal_Standard_Form( $this ); |
|
64 | - $form->get_input( 'PMD_debug_mode' )->set_html_label_text( |
|
65 | - sprintf( __( "Use PayPal Sandbox %s", 'event_espresso' ), $this->get_help_tab_link() ) |
|
62 | + require_once($this->file_folder().'EE_Paypal_Standard_Form.form.php'); |
|
63 | + $form = new EE_Paypal_Standard_Form($this); |
|
64 | + $form->get_input('PMD_debug_mode')->set_html_label_text( |
|
65 | + sprintf(__("Use PayPal Sandbox %s", 'event_espresso'), $this->get_help_tab_link()) |
|
66 | 66 | ); |
67 | - $form->get_input( 'shipping_details' )->set_html_label_text( |
|
68 | - sprintf( __( "Shipping Address Options %s", "event_espresso" ), $this->get_help_tab_link() ) |
|
67 | + $form->get_input('shipping_details')->set_html_label_text( |
|
68 | + sprintf(__("Shipping Address Options %s", "event_espresso"), $this->get_help_tab_link()) |
|
69 | 69 | ); |
70 | 70 | return $form; |
71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @see EE_PMT_Base::help_tabs_config() |
78 | 78 | * @return array |
79 | 79 | */ |
80 | - public function help_tabs_config(){ |
|
80 | + public function help_tabs_config() { |
|
81 | 81 | return array( |
82 | 82 | $this->get_help_tab_name() => array( |
83 | 83 | 'title'=> __("PayPal Standard Settings", 'event_espresso'), |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | * @return EE_Payment |
100 | 100 | * @throws \EE_Error |
101 | 101 | */ |
102 | - public function finalize_payment_for($transaction){ |
|
102 | + public function finalize_payment_for($transaction) { |
|
103 | 103 | // PayPal standard actually sends the IPN info along with the user when they return to our site |
104 | 104 | // so in case the IPN is arriving later, let's try to process an IPN! |
105 | - if( $_SERVER['REQUEST_METHOD'] === 'POST' ){ |
|
106 | - return $this->handle_ipn($_POST, $transaction ); |
|
107 | - }else{ |
|
108 | - return parent::finalize_payment_for( $transaction ); |
|
105 | + if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
|
106 | + return $this->handle_ipn($_POST, $transaction); |
|
107 | + } else { |
|
108 | + return parent::finalize_payment_for($transaction); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 |
@@ -13,45 +13,45 @@ |
||
13 | 13 | class EE_Detect_File_Editor_Request extends EE_Middleware |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * Converts a Request to a Response |
|
18 | - * |
|
19 | - * @param EE_Request $request |
|
20 | - * @param EE_Response $response |
|
21 | - * @return EE_Response |
|
22 | - */ |
|
23 | - public function handle_request(EE_Request $request, EE_Response $response) |
|
24 | - { |
|
25 | - $this->_request = $request; |
|
26 | - $this->_response = $response; |
|
27 | - $this->setFiltersForRequest(); |
|
28 | - $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
29 | - return $this->_response; |
|
30 | - } |
|
16 | + /** |
|
17 | + * Converts a Request to a Response |
|
18 | + * |
|
19 | + * @param EE_Request $request |
|
20 | + * @param EE_Response $response |
|
21 | + * @return EE_Response |
|
22 | + */ |
|
23 | + public function handle_request(EE_Request $request, EE_Response $response) |
|
24 | + { |
|
25 | + $this->_request = $request; |
|
26 | + $this->_response = $response; |
|
27 | + $this->setFiltersForRequest(); |
|
28 | + $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
29 | + return $this->_response; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * This sets any filters that need set on this request. |
|
35 | - */ |
|
36 | - protected function setFiltersForRequest() |
|
37 | - { |
|
38 | - if (! $this->isFileEditorRequest()) { |
|
39 | - return; |
|
40 | - } |
|
41 | - add_filter('FHEE_load_EE_Session', '__return_false', 999); |
|
42 | - } |
|
33 | + /** |
|
34 | + * This sets any filters that need set on this request. |
|
35 | + */ |
|
36 | + protected function setFiltersForRequest() |
|
37 | + { |
|
38 | + if (! $this->isFileEditorRequest()) { |
|
39 | + return; |
|
40 | + } |
|
41 | + add_filter('FHEE_load_EE_Session', '__return_false', 999); |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * Conditions for a "file editor request" |
|
47 | - * @see wp-admin/includes/file.php |
|
48 | - * The file editor does a loopback request to the admin AND to the frontend when checking active theme or |
|
49 | - * active plugin edits. So these conditions consider that. |
|
50 | - * @return bool |
|
51 | - */ |
|
52 | - protected function isFileEditorRequest() |
|
53 | - { |
|
54 | - return $this->_request->get('wp_scrape_key') |
|
55 | - && $this->_request->get('wp_scrape_nonce'); |
|
56 | - } |
|
45 | + /** |
|
46 | + * Conditions for a "file editor request" |
|
47 | + * @see wp-admin/includes/file.php |
|
48 | + * The file editor does a loopback request to the admin AND to the frontend when checking active theme or |
|
49 | + * active plugin edits. So these conditions consider that. |
|
50 | + * @return bool |
|
51 | + */ |
|
52 | + protected function isFileEditorRequest() |
|
53 | + { |
|
54 | + return $this->_request->get('wp_scrape_key') |
|
55 | + && $this->_request->get('wp_scrape_nonce'); |
|
56 | + } |
|
57 | 57 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | protected function setFiltersForRequest() |
37 | 37 | { |
38 | - if (! $this->isFileEditorRequest()) { |
|
38 | + if ( ! $this->isFileEditorRequest()) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | add_filter('FHEE_load_EE_Session', '__return_false', 999); |