@@ -6,20 +6,20 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Hidden_Input extends EE_Form_Input_Base{ |
|
9 | +class EE_Hidden_Input extends EE_Form_Input_Base { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $input_settings |
13 | 13 | */ |
14 | - function __construct($input_settings = array()){ |
|
14 | + function __construct($input_settings = array()) { |
|
15 | 15 | //require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php'); |
16 | 16 | $this->_set_display_strategy(new EE_Hidden_Display_Strategy()); |
17 | - if ( isset( $input_settings['normalization_strategy'] ) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base ) { |
|
18 | - $this->_set_normalization_strategy( $input_settings['normalization_strategy'] ); |
|
17 | + if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) { |
|
18 | + $this->_set_normalization_strategy($input_settings['normalization_strategy']); |
|
19 | 19 | } else { |
20 | - $this->_set_normalization_strategy( new EE_Text_Normalization() ); |
|
20 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
21 | 21 | } |
22 | - parent::__construct( $input_settings ); |
|
22 | + parent::__construct($input_settings); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Month_Input extends EE_Select_Input{ |
|
9 | +class EE_Month_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param bool $leading_zero |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct( $leading_zero = false, $input_settings = array()){ |
|
16 | - if($leading_zero){ |
|
15 | + function __construct($leading_zero = false, $input_settings = array()) { |
|
16 | + if ($leading_zero) { |
|
17 | 17 | $select_options = array( |
18 | 18 | '01'=>'01', |
19 | 19 | '02'=>'02', |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | '11'=>'11', |
29 | 29 | '12'=>'12' |
30 | 30 | ); |
31 | - }else{ |
|
31 | + } else { |
|
32 | 32 | $select_options = array( |
33 | 33 | 1=>'01', |
34 | 34 | 2=>'02', |
@@ -44,6 +44,6 @@ discard block |
||
44 | 44 | 12=>'12' |
45 | 45 | ); |
46 | 46 | } |
47 | - parent::__construct($select_options,$input_settings); |
|
47 | + parent::__construct($select_options, $input_settings); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -90,7 +90,7 @@ |
||
90 | 90 | //so in case teh IPN is arriving later, let's try to process an IPN! |
91 | 91 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ |
92 | 92 | return $this->handle_ipn($_POST, $transaction ); |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | return parent::finalize_payment_for( $transaction ); |
95 | 95 | } |
96 | 96 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * EE_Month_Input |
|
4 | - * |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage |
|
7 | - * @author Mike Nelson |
|
8 | - */ |
|
3 | + * EE_Month_Input |
|
4 | + * |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage |
|
7 | + * @author Mike Nelson |
|
8 | + */ |
|
9 | 9 | class EE_Month_Input extends EE_Select_Input{ |
10 | 10 | |
11 | 11 | /** |
@@ -6,17 +6,17 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Password_Input extends EE_Form_Input_Base{ |
|
9 | +class EE_Password_Input extends EE_Form_Input_Base { |
|
10 | 10 | |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct($input_settings = array()){ |
|
15 | + function __construct($input_settings = array()) { |
|
16 | 16 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password')); |
17 | 17 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
18 | 18 | parent::__construct($input_settings); |
19 | - $this->set_html_class( $this->html_class() . 'password' ); |
|
19 | + $this->set_html_class($this->html_class().'password'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 |
@@ -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_Radio_Button_Input |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | * @since $VID:$ |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Radio_Button_Input extends EE_Form_Input_With_Options_Base{ |
|
14 | +class EE_Radio_Button_Input extends EE_Form_Input_With_Options_Base { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param array $answer_options |
18 | 18 | * @param array $input_settings |
19 | 19 | */ |
20 | - function __construct( $answer_options, $input_settings = array() ){ |
|
21 | - $this->_set_display_strategy( new EE_Radio_Button_Display_Strategy() ); |
|
22 | - $this->_add_validation_strategy( new EE_Enum_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ); |
|
20 | + function __construct($answer_options, $input_settings = array()) { |
|
21 | + $this->_set_display_strategy(new EE_Radio_Button_Display_Strategy()); |
|
22 | + $this->_add_validation_strategy(new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
23 | 23 | $this->_multiple_selections = FALSE; |
24 | - parent::__construct( $answer_options, $input_settings ); |
|
24 | + parent::__construct($answer_options, $input_settings); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
28 | 28 | \ 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_Select_Input |
4 | 4 | * |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | * @since 4.6 |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_Select_Input extends EE_Form_Input_With_Options_Base{ |
|
13 | +class EE_Select_Input extends EE_Form_Input_With_Options_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param array $answer_options |
17 | 17 | * @param array $input_settings |
18 | 18 | */ |
19 | - function __construct( $answer_options, $input_settings = array() ){ |
|
20 | - $this->_set_display_strategy( new EE_Select_Display_Strategy( $answer_options )); |
|
21 | - $this->_add_validation_strategy( new EE_Enum_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ); |
|
22 | - parent::__construct( $answer_options, $input_settings ); |
|
19 | + function __construct($answer_options, $input_settings = array()) { |
|
20 | + $this->_set_display_strategy(new EE_Select_Display_Strategy($answer_options)); |
|
21 | + $this->_add_validation_strategy(new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
22 | + parent::__construct($answer_options, $input_settings); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit( 'No direct script access allowed' ); } |
2 | 2 | /** |
3 | - * Class EE_Select_Input |
|
4 | - * |
|
5 | - * Generates an HTML <select> form input |
|
6 | - * |
|
7 | - * @package Event Espresso |
|
8 | - * @subpackage core |
|
9 | - * @author Mike Nelson |
|
10 | - * @since 4.6 |
|
11 | - * |
|
12 | - */ |
|
3 | + * Class EE_Select_Input |
|
4 | + * |
|
5 | + * Generates an HTML <select> form input |
|
6 | + * |
|
7 | + * @package Event Espresso |
|
8 | + * @subpackage core |
|
9 | + * @author Mike Nelson |
|
10 | + * @since 4.6 |
|
11 | + * |
|
12 | + */ |
|
13 | 13 | class EE_Select_Input extends EE_Form_Input_With_Options_Base{ |
14 | 14 | |
15 | 15 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @subpackage |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input{ |
|
11 | +class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | protected $_naming_method; |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | * example: if the class were an EE_Event, this could be slug(), description(), name() (default) |
25 | 25 | * } |
26 | 26 | */ |
27 | - public function __construct( $answer_options = array(), $input_settings = array() ) { |
|
28 | - if( isset( $input_settings['naming_method'] )){ |
|
29 | - $this->set_option_naming_method( $input_settings['naming_method'] ); |
|
27 | + public function __construct($answer_options = array(), $input_settings = array()) { |
|
28 | + if (isset($input_settings['naming_method'])) { |
|
29 | + $this->set_option_naming_method($input_settings['naming_method']); |
|
30 | 30 | } |
31 | - parent::__construct( $answer_options, $input_settings ); |
|
31 | + parent::__construct($answer_options, $input_settings); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Sets the method name which will be called when outputting the options list |
36 | 36 | * @param string $method |
37 | 37 | */ |
38 | - public function set_option_naming_method($method){ |
|
38 | + public function set_option_naming_method($method) { |
|
39 | 39 | $this->_naming_method = $method; |
40 | 40 | } |
41 | 41 | |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | * @param EE_Base_Class[] $answer_options |
47 | 47 | * @return null|void |
48 | 48 | */ |
49 | - public function set_select_options( $answer_options = array() ) { |
|
49 | + public function set_select_options($answer_options = array()) { |
|
50 | 50 | //convert the model objects to select from into normal select options |
51 | 51 | $select_options = array(); |
52 | - foreach( $answer_options as $model_obj ){ |
|
53 | - if( $this->_naming_method ){ |
|
54 | - $display_value = call_user_func( array( $model_obj, $this->_naming_method )); |
|
55 | - }else{ |
|
52 | + foreach ($answer_options as $model_obj) { |
|
53 | + if ($this->_naming_method) { |
|
54 | + $display_value = call_user_func(array($model_obj, $this->_naming_method)); |
|
55 | + } else { |
|
56 | 56 | $display_value = $model_obj->name(); |
57 | 57 | } |
58 | - $select_options[ $model_obj->ID() ] = $display_value; |
|
58 | + $select_options[$model_obj->ID()] = $display_value; |
|
59 | 59 | } |
60 | 60 | parent::set_select_options($select_options); |
61 | 61 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | * into the format EE_Select_Multiple expects |
68 | 68 | * @param EE_Base_Class[]|array $values |
69 | 69 | */ |
70 | - public function set_default($values){ |
|
70 | + public function set_default($values) { |
|
71 | 71 | $defaults_as_simple_ids = array(); |
72 | - foreach($values as $key => $value){ |
|
73 | - if($value instanceof EE_Base_Class){ |
|
72 | + foreach ($values as $key => $value) { |
|
73 | + if ($value instanceof EE_Base_Class) { |
|
74 | 74 | $defaults_as_simple_ids[] = $value->ID(); |
75 | - }else{ |
|
75 | + } else { |
|
76 | 76 | $defaults_as_simple_ids[] = $value; |
77 | 77 | } |
78 | 78 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach( $answer_options as $model_obj ){ |
53 | 53 | if( $this->_naming_method ){ |
54 | 54 | $display_value = call_user_func( array( $model_obj, $this->_naming_method )); |
55 | - }else{ |
|
55 | + } else{ |
|
56 | 56 | $display_value = $model_obj->name(); |
57 | 57 | } |
58 | 58 | $select_options[ $model_obj->ID() ] = $display_value; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | foreach($values as $key => $value){ |
73 | 73 | if($value instanceof EE_Base_Class){ |
74 | 74 | $defaults_as_simple_ids[] = $value->ID(); |
75 | - }else{ |
|
75 | + } else{ |
|
76 | 76 | $defaults_as_simple_ids[] = $value; |
77 | 77 | } |
78 | 78 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * EE_Select_Multi_Model_Input |
|
4 | - * Just like EE_Select_Multiple_Input, except the array of options is an array of |
|
5 | - * model objects, and the optional 'default' param CAN be an array of model objects too |
|
6 | - * |
|
7 | - * @package Event Espresso |
|
8 | - * @subpackage |
|
9 | - * @author Mike Nelson |
|
10 | - */ |
|
3 | + * EE_Select_Multi_Model_Input |
|
4 | + * Just like EE_Select_Multiple_Input, except the array of options is an array of |
|
5 | + * model objects, and the optional 'default' param CAN be an array of model objects too |
|
6 | + * |
|
7 | + * @package Event Espresso |
|
8 | + * @subpackage |
|
9 | + * @author Mike Nelson |
|
10 | + */ |
|
11 | 11 | class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input{ |
12 | 12 | |
13 | 13 |
@@ -6,17 +6,17 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base{ |
|
9 | +class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array | EE_Question_Option[] $answer_options |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - public function __construct( $answer_options, $input_settings = array() ) { |
|
16 | - $this->_set_display_strategy( new EE_Select_Multiple_Display_Strategy() ); |
|
17 | - $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 ) ))); |
|
15 | + public function __construct($answer_options, $input_settings = array()) { |
|
16 | + $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy()); |
|
17 | + $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)))); |
|
18 | 18 | $this->_multiple_selections = TRUE; |
19 | - parent::__construct( $answer_options, $input_settings ); |
|
19 | + parent::__construct($answer_options, $input_settings); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * EE_Select_Multiple_Input |
|
4 | - * |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage |
|
7 | - * @author Mike Nelson |
|
8 | - */ |
|
3 | + * EE_Select_Multiple_Input |
|
4 | + * |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage |
|
7 | + * @author Mike Nelson |
|
8 | + */ |
|
9 | 9 | class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base{ |
10 | 10 | |
11 | 11 | /** |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_State_Select_Input extends EE_Select_Input{ |
|
9 | +class EE_State_Select_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $state_options |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct( $state_options, $input_settings = array() ){ |
|
15 | + function __construct($state_options, $input_settings = array()) { |
|
16 | 16 | $state_options = apply_filters( |
17 | 17 | 'FHEE__EE_State_Select_Input____construct__state_options', |
18 | - $this->get_state_answer_options( $state_options ), |
|
18 | + $this->get_state_answer_options($state_options), |
|
19 | 19 | $this |
20 | 20 | ); |
21 | - parent::__construct( $state_options, $input_settings ); |
|
21 | + parent::__construct($state_options, $input_settings); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | * @param array $state_options |
30 | 30 | * @return array |
31 | 31 | */ |
32 | - public function get_state_answer_options( $state_options = NULL ){ |
|
32 | + public function get_state_answer_options($state_options = NULL) { |
|
33 | 33 | // if passed something that is NOT an array |
34 | - if ( ! is_array( $state_options )) { |
|
34 | + if ( ! is_array($state_options)) { |
|
35 | 35 | // get possibly cached list of states |
36 | 36 | $states = EEM_State::instance()->get_all_active_states(); |
37 | - if ( ! empty( $states )) { |
|
37 | + if ( ! empty($states)) { |
|
38 | 38 | //set the default |
39 | 39 | $state_options[''][''] = ''; |
40 | - foreach( $states as $state ){ |
|
41 | - if ( $state instanceof EE_State ) { |
|
42 | - $state_options[ $state->country()->name() ][ $state->ID() ] = $state->name(); |
|
40 | + foreach ($states as $state) { |
|
41 | + if ($state instanceof EE_State) { |
|
42 | + $state_options[$state->country()->name()][$state->ID()] = $state->name(); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } else { |
@@ -8,15 +8,15 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Submit_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Submit_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $options |
15 | 15 | */ |
16 | - function __construct($options = array()){ |
|
16 | + function __construct($options = array()) { |
|
17 | 17 | $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
19 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
19 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
20 | 20 | parent::__construct($options); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |