@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * EEH_URL helper |
4 | 6 | * Helper class for URL-related PHP functions |
@@ -62,7 +64,7 @@ discard block |
||
62 | 64 | isset($results['response']['code']) && |
63 | 65 | $results['response']['code'] == '200'){ |
64 | 66 | return true; |
65 | - }else{ |
|
67 | + } else{ |
|
66 | 68 | return false; |
67 | 69 | } |
68 | 70 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * |
10 | 10 | * ------------------------------------------------------------------------ |
11 | 11 | */ |
12 | -class EEH_URL{ |
|
12 | +class EEH_URL { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * _add_query_arg |
@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | * @param string $url |
21 | 21 | * @return string |
22 | 22 | */ |
23 | - public static function add_query_args_and_nonce( $args = array(), $url = '' ) { |
|
24 | - if ( empty( $url )) { |
|
25 | - $user_msg = __('An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.', 'event_espresso' ); |
|
26 | - $dev_msg = $user_msg . "\n" . sprintf( |
|
27 | - __('In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s::add_query_args_and_nonce method.', 'event_espresso' ), |
|
23 | + public static function add_query_args_and_nonce($args = array(), $url = '') { |
|
24 | + if (empty($url)) { |
|
25 | + $user_msg = __('An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.', 'event_espresso'); |
|
26 | + $dev_msg = $user_msg."\n".sprintf( |
|
27 | + __('In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s::add_query_args_and_nonce method.', 'event_espresso'), |
|
28 | 28 | __CLASS__ |
29 | 29 | ); |
30 | - EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
30 | + EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__); |
|
31 | 31 | } |
32 | 32 | // check that an action exists |
33 | - if ( isset( $args['action'] ) && ! empty( $args['action'] )) { |
|
34 | - $args = array_merge( $args, array( $args['action'] . '_nonce' => wp_create_nonce( $args['action'] . '_nonce' ))); |
|
33 | + if (isset($args['action']) && ! empty($args['action'])) { |
|
34 | + $args = array_merge($args, array($args['action'].'_nonce' => wp_create_nonce($args['action'].'_nonce'))); |
|
35 | 35 | } else { |
36 | - $args = array_merge( $args, array( 'action' => 'default', 'default_nonce' => wp_create_nonce( 'default_nonce' ))); |
|
36 | + $args = array_merge($args, array('action' => 'default', 'default_nonce' => wp_create_nonce('default_nonce'))); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | //finally, let's always add a return address (if present) :) |
40 | - $args = !empty( $_REQUEST['action'] ) ? array_merge( $args, array( 'return' => $_REQUEST['action'] ) ) : $args; |
|
40 | + $args = ! empty($_REQUEST['action']) ? array_merge($args, array('return' => $_REQUEST['action'])) : $args; |
|
41 | 41 | |
42 | - return add_query_arg( $args, $url ); |
|
42 | + return add_query_arg($args, $url); |
|
43 | 43 | |
44 | 44 | } |
45 | 45 | |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | * @param string $url |
52 | 52 | * @return boolean |
53 | 53 | */ |
54 | - public static function remote_file_exists($url){ |
|
55 | - $results = wp_remote_request($url,array( |
|
54 | + public static function remote_file_exists($url) { |
|
55 | + $results = wp_remote_request($url, array( |
|
56 | 56 | 'method'=>'GET', |
57 | 57 | 'redirection'=>1, |
58 | 58 | )); |
59 | - if( ! $results instanceof WP_Error && |
|
59 | + if ( ! $results instanceof WP_Error && |
|
60 | 60 | isset($results['response']) && |
61 | 61 | isset($results['response']['code']) && |
62 | - $results['response']['code'] == '200'){ |
|
62 | + $results['response']['code'] == '200') { |
|
63 | 63 | return true; |
64 | - }else{ |
|
64 | + } else { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | } |
@@ -77,29 +77,29 @@ discard block |
||
77 | 77 | * @param bool $base_url_only - TRUE will only return the scheme and host with no other parameters |
78 | 78 | * @return string |
79 | 79 | */ |
80 | - public static function refactor_url( $url = '', $remove_query = TRUE, $base_url_only = FALSE ) { |
|
80 | + public static function refactor_url($url = '', $remove_query = TRUE, $base_url_only = FALSE) { |
|
81 | 81 | // break apart incoming URL |
82 | - $url_bits = parse_url( $url ); |
|
82 | + $url_bits = parse_url($url); |
|
83 | 83 | // HTTP or HTTPS ? |
84 | - $scheme = isset( $url_bits[ 'scheme' ] ) ? $url_bits[ 'scheme' ] . '://' : 'http://'; |
|
84 | + $scheme = isset($url_bits['scheme']) ? $url_bits['scheme'].'://' : 'http://'; |
|
85 | 85 | // domain |
86 | - $host = isset( $url_bits[ 'host' ] ) ? $url_bits[ 'host' ] : ''; |
|
86 | + $host = isset($url_bits['host']) ? $url_bits['host'] : ''; |
|
87 | 87 | // if only the base URL is requested, then return that now |
88 | - if ( $base_url_only ) { |
|
89 | - return $scheme . $host; |
|
88 | + if ($base_url_only) { |
|
89 | + return $scheme.$host; |
|
90 | 90 | } |
91 | - $port = isset( $url_bits[ 'port' ] ) ? ':' . $url_bits[ 'port' ] : ''; |
|
92 | - $user = isset( $url_bits[ 'user' ] ) ? $url_bits[ 'user' ] : ''; |
|
93 | - $pass = isset( $url_bits[ 'pass' ] ) ? ':' . $url_bits[ 'pass' ] : ''; |
|
94 | - $pass = ( $user || $pass ) ? $pass . '@' : ''; |
|
95 | - $path = isset( $url_bits[ 'path' ] ) ? $url_bits[ 'path' ] : ''; |
|
91 | + $port = isset($url_bits['port']) ? ':'.$url_bits['port'] : ''; |
|
92 | + $user = isset($url_bits['user']) ? $url_bits['user'] : ''; |
|
93 | + $pass = isset($url_bits['pass']) ? ':'.$url_bits['pass'] : ''; |
|
94 | + $pass = ($user || $pass) ? $pass.'@' : ''; |
|
95 | + $path = isset($url_bits['path']) ? $url_bits['path'] : ''; |
|
96 | 96 | // if the query string is not required, then return what we have so far |
97 | - if ( $remove_query ) { |
|
98 | - return $scheme . $user . $pass . $host . $port . $path; |
|
97 | + if ($remove_query) { |
|
98 | + return $scheme.$user.$pass.$host.$port.$path; |
|
99 | 99 | } |
100 | - $query = isset( $url_bits[ 'query' ] ) ? '?' . $url_bits[ 'query' ] : ''; |
|
101 | - $fragment = isset( $url_bits[ 'fragment' ] ) ? '#' . $url_bits[ 'fragment' ] : ''; |
|
102 | - return $scheme . $user . $pass . $host . $port . $path . $query . $fragment; |
|
100 | + $query = isset($url_bits['query']) ? '?'.$url_bits['query'] : ''; |
|
101 | + $fragment = isset($url_bits['fragment']) ? '#'.$url_bits['fragment'] : ''; |
|
102 | + return $scheme.$user.$pass.$host.$port.$path.$query.$fragment; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -112,29 +112,29 @@ discard block |
||
112 | 112 | * @param bool $as_array TRUE (default) will return query params as an array of key value pairs, FALSE will simply return the query string |
113 | 113 | * @return string|array |
114 | 114 | */ |
115 | - public static function get_query_string( $url = '', $as_array = TRUE ) { |
|
115 | + public static function get_query_string($url = '', $as_array = TRUE) { |
|
116 | 116 | // break apart incoming URL |
117 | - $url_bits = parse_url( $url ); |
|
117 | + $url_bits = parse_url($url); |
|
118 | 118 | // grab query string from URL |
119 | - $query = isset( $url_bits[ 'query' ] ) ? $url_bits[ 'query' ] : ''; |
|
119 | + $query = isset($url_bits['query']) ? $url_bits['query'] : ''; |
|
120 | 120 | // if we don't want the query string formatted into an array of key => value pairs, then just return it as is |
121 | - if ( ! $as_array ) { |
|
121 | + if ( ! $as_array) { |
|
122 | 122 | return $query; |
123 | 123 | } |
124 | 124 | // if no query string exists then just return an empty array now |
125 | - if ( empty( $query )) { |
|
125 | + if (empty($query)) { |
|
126 | 126 | return array(); |
127 | 127 | } |
128 | 128 | // empty array to hold results |
129 | 129 | $query_params = array(); |
130 | 130 | // now break apart the query string into separate params |
131 | - $query = explode( '&', $query ); |
|
131 | + $query = explode('&', $query); |
|
132 | 132 | // loop thru our query params |
133 | - foreach ( $query as $query_args ) { |
|
133 | + foreach ($query as $query_args) { |
|
134 | 134 | // break apart the key value pairs |
135 | - $query_args = explode( '=', $query_args ); |
|
135 | + $query_args = explode('=', $query_args); |
|
136 | 136 | // and add to our results array |
137 | - $query_params[ $query_args[0] ] = $query_args[1]; |
|
137 | + $query_params[$query_args[0]] = $query_args[1]; |
|
138 | 138 | } |
139 | 139 | return $query_params; |
140 | 140 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * prevent_prefetching |
146 | 146 | * @return void |
147 | 147 | */ |
148 | - public static function prevent_prefetching(){ |
|
148 | + public static function prevent_prefetching() { |
|
149 | 149 | // prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process |
150 | 150 | remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); |
151 | 151 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * add_nocache_headers |
157 | 157 | * @return void |
158 | 158 | */ |
159 | - public static function add_nocache_headers(){ |
|
159 | + public static function add_nocache_headers() { |
|
160 | 160 | // add no cache headers |
161 | 161 | // add_action( 'wp_head' , array( 'EED_Single_Page_Checkout', 'nocache_headers' ), 10 ); |
162 | 162 | // plus a little extra for nginx |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | -class EE_Sample_Form extends EE_Form_Section_Proper{ |
|
3 | - function __construct(){ |
|
2 | +class EE_Sample_Form extends EE_Form_Section_Proper { |
|
3 | + function __construct() { |
|
4 | 4 | $this->_subsections = array( |
5 | 5 | 'h1'=>new EE_Form_Section_HTML('hello wordl'), |
6 | - 'name'=>new EE_Text_Input(array('required'=>true,'default'=>'your name here')), |
|
6 | + 'name'=>new EE_Text_Input(array('required'=>true, 'default'=>'your name here')), |
|
7 | 7 | 'email'=>new EE_Email_Input(array('required'=>false)), |
8 | - 'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=> __("Small", "event_espresso"),'m'=> __("Medium", "event_espresso"),'l'=> __("Large", "event_espresso")),array('required'=>true,'default'=>'s')), |
|
8 | + 'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=> __("Small", "event_espresso"), 'm'=> __("Medium", "event_espresso"), 'l'=> __("Large", "event_espresso")), array('required'=>true, 'default'=>'s')), |
|
9 | 9 | 'month_normal'=>new EE_Month_Input(), |
10 | 10 | 'month_leading_zero'=>new EE_Month_Input(true), |
11 | 11 | 'year_2'=>new EE_Year_Input(false, 1, 1), |
12 | - 'year_4'=>new EE_Year_Input(true, 0,10,array('default'=>'2017')), |
|
12 | + 'year_4'=>new EE_Year_Input(true, 0, 10, array('default'=>'2017')), |
|
13 | 13 | 'yes_no'=>new EE_Yes_No_Input(array('html_label_text'=> __("Yes or No", "event_espresso"))), |
14 | 14 | 'credit_card'=>new EE_Credit_Card_Input(), |
15 | 15 | 'image_1'=>new EE_Admin_File_Uploader_Input(), |
16 | 16 | 'image_2'=>new EE_Admin_File_Uploader_Input(), |
17 | - 'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP','mysql'=>'MYSQL'),array('default'=>array('php'))), |
|
17 | + 'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP', 'mysql'=>'MYSQL'), array('default'=>array('php'))), |
|
18 | 18 | 'float'=>new EE_Float_Input(), |
19 | 19 | 'essay'=>new EE_Text_Area_Input(), |
20 | 20 | 'amenities'=>new EE_Select_Multiple_Input( |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | * Extra validation for the 'name' input. |
41 | 41 | * @param EE_Text_Input $form_input |
42 | 42 | */ |
43 | - function _validate_name($form_input){ |
|
44 | - if($form_input->raw_value() != 'Mike'){ |
|
43 | + function _validate_name($form_input) { |
|
44 | + if ($form_input->raw_value() != 'Mike') { |
|
45 | 45 | $form_input->add_validation_error(__("You are not mike. You must be brent or darren. Thats ok, I guess", 'event_espresso'), 'not-mike'); |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | - function _validate(){ |
|
49 | + function _validate() { |
|
50 | 50 | parent::_validate(); |
51 | - if($this->_subsections['shirt_size']->normalized_value() =='s' |
|
52 | - && $this->_subsections['year_4']->normalized_value() < 2010){ |
|
51 | + if ($this->_subsections['shirt_size']->normalized_value() == 's' |
|
52 | + && $this->_subsections['year_4']->normalized_value() < 2010) { |
|
53 | 53 | $this->add_validation_error(__("If you want a small shirt, you should be born after 2010. Otherwise theyre just too big", 'event_espresso'), 'too-old'); |
54 | 54 | } |
55 | 55 | } |
@@ -2,16 +2,16 @@ |
||
2 | 2 | if (!defined('EVENT_ESPRESSO_VERSION')) |
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | /** |
5 | - * EE_Form_Section_HTML |
|
6 | - * HTML to be laid out like a proper subsection |
|
7 | - * |
|
8 | - * |
|
9 | - * @package Event Espresso |
|
10 | - * @subpackage |
|
11 | - * @author Mike Nelson |
|
12 | - * |
|
13 | - * ------------------------------------------------------------------------ |
|
14 | - */ |
|
5 | + * EE_Form_Section_HTML |
|
6 | + * HTML to be laid out like a proper subsection |
|
7 | + * |
|
8 | + * |
|
9 | + * @package Event Espresso |
|
10 | + * @subpackage |
|
11 | + * @author Mike Nelson |
|
12 | + * |
|
13 | + * ------------------------------------------------------------------------ |
|
14 | + */ |
|
15 | 15 | class EE_Form_Section_HTML extends EE_Form_Section_Base{ |
16 | 16 | |
17 | 17 | protected $_html = ''; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | /** |
5 | 5 | * EE_Form_Section_HTML |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * ------------------------------------------------------------------------ |
14 | 14 | */ |
15 | -class EE_Form_Section_HTML extends EE_Form_Section_Base{ |
|
15 | +class EE_Form_Section_HTML extends EE_Form_Section_Base { |
|
16 | 16 | |
17 | 17 | protected $_html = ''; |
18 | 18 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param string $html |
23 | 23 | * @param array $options_array |
24 | 24 | */ |
25 | - public function __construct( $html = '', $options_array = array() ) { |
|
25 | + public function __construct($html = '', $options_array = array()) { |
|
26 | 26 | $this->_html = $html; |
27 | - parent::__construct( $options_array ); |
|
27 | + parent::__construct($options_array); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | /** |
6 | 7 | * Event Espresso |
7 | 8 | * |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML{ |
|
29 | - public function __construct($template_file,$args = array(), $options_array = array()) { |
|
28 | +class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML { |
|
29 | + public function __construct($template_file, $args = array(), $options_array = array()) { |
|
30 | 30 | EE_Registry::instance()->load_helper('Template'); |
31 | - $html = EEH_Template::locate_template( $template_file, $args ); |
|
31 | + $html = EEH_Template::locate_template($template_file, $args); |
|
32 | 32 | |
33 | 33 | // echo " filepath:$template_file html $html"; |
34 | 34 | parent::__construct($html, $options_array); |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | /** |
6 | 7 | * Event Espresso |
7 | 8 | * |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * ------------------------------------------------------------------------ |
36 | 36 | */ |
37 | -abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base{ |
|
37 | +abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base { |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Array of validation errors in this section. Does not contain validation errors in subsections, however. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * called get_validation_errors_accumulated |
50 | 50 | * @return EE_Validation_Error[] |
51 | 51 | */ |
52 | - public function get_validation_errors(){ |
|
52 | + public function get_validation_errors() { |
|
53 | 53 | return $this->_validation_errors; |
54 | 54 | } |
55 | 55 | /** |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | * If we want this to be customizable, we may decide to create a strategy for displaying it. |
58 | 58 | * @return string |
59 | 59 | */ |
60 | - public function get_validation_error_string(){ |
|
60 | + public function get_validation_error_string() { |
|
61 | 61 | $validation_error_messages = array(); |
62 | - if($this->get_validation_errors()){ |
|
63 | - foreach($this->get_validation_errors() as $validation_error){ |
|
64 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
65 | - $validation_error_messages[] =$validation_error->getMessage(); |
|
62 | + if ($this->get_validation_errors()) { |
|
63 | + foreach ($this->get_validation_errors() as $validation_error) { |
|
64 | + if ($validation_error instanceof EE_Validation_Error) { |
|
65 | + $validation_error_messages[] = $validation_error->getMessage(); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | - return implode(", ",$validation_error_messages); |
|
69 | + return implode(", ", $validation_error_messages); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | * @return boolean |
83 | 83 | */ |
84 | 84 | public function is_valid() { |
85 | - if(count($this->_validation_errors)){ |
|
85 | + if (count($this->_validation_errors)) { |
|
86 | 86 | return false; |
87 | - }else{ |
|
87 | + } else { |
|
88 | 88 | return true; |
89 | 89 | } |
90 | 90 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @param Exception $previous_exception if there was an exception that caused the error, that exception |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - function add_validation_error( $message_or_object, $error_code = NULL, $previous_exception = NULL ){ |
|
113 | - if($message_or_object instanceof EE_Validation_Error){ |
|
114 | - $validation_error= $message_or_object; |
|
112 | + function add_validation_error($message_or_object, $error_code = NULL, $previous_exception = NULL) { |
|
113 | + if ($message_or_object instanceof EE_Validation_Error) { |
|
114 | + $validation_error = $message_or_object; |
|
115 | 115 | $validation_error->set_form_section($this); |
116 | - }else{ |
|
116 | + } else { |
|
117 | 117 | $validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception); |
118 | 118 | } |
119 | 119 | $this->_validation_errors[] = $validation_error; |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | 3 | exit('No direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -84,7 +85,7 @@ discard block |
||
84 | 85 | public function is_valid() { |
85 | 86 | if(count($this->_validation_errors)){ |
86 | 87 | return false; |
87 | - }else{ |
|
88 | + } else{ |
|
88 | 89 | return true; |
89 | 90 | } |
90 | 91 | } |
@@ -113,7 +114,7 @@ discard block |
||
113 | 114 | if($message_or_object instanceof EE_Validation_Error){ |
114 | 115 | $validation_error= $message_or_object; |
115 | 116 | $validation_error->set_form_section($this); |
116 | - }else{ |
|
117 | + } else{ |
|
117 | 118 | $validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception); |
118 | 119 | } |
119 | 120 | $this->_validation_errors[] = $validation_error; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class EE_Validation_Error extends Exception{ |
|
3 | +class EE_Validation_Error extends Exception { |
|
4 | 4 | /** |
5 | 5 | * Form Section from which this error originated. |
6 | 6 | * @var EE_Form_Section |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param EE_Form_Section_Validatable $form_section |
21 | 21 | * @param Exception $previous if there was an exception that caused this exception |
22 | 22 | */ |
23 | - function __construct( $message = null, $string_code = null,$form_section = null, $previous = null){ |
|
23 | + function __construct($message = null, $string_code = null, $form_section = null, $previous = null) { |
|
24 | 24 | $this->_form_section = $form_section; |
25 | 25 | $this->_string_code = $string_code; |
26 | 26 | parent::__construct($message, 500, $previous); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * returns teh form section which caused the error. |
31 | 31 | * @return EE_Form_Section_Validatable |
32 | 32 | */ |
33 | - public function get_form_section(){ |
|
33 | + public function get_form_section() { |
|
34 | 34 | return $this->_form_section; |
35 | 35 | } |
36 | 36 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param EE_Form_Section_Validatable $form_section |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function set_form_section($form_section){ |
|
41 | + public function set_form_section($form_section) { |
|
42 | 42 | $this->_form_section = $form_section; |
43 | 43 | } |
44 | 44 |
@@ -8,15 +8,15 @@ |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Admin_File_Uploader_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Admin_File_Uploader_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $input_settings |
15 | 15 | */ |
16 | - function __construct($input_settings = array()){ |
|
16 | + function __construct($input_settings = array()) { |
|
17 | 17 | $this->_set_display_strategy(new EE_Admin_File_Uploader_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
19 | - $this->_add_validation_strategy(new EE_URL_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ); |
|
19 | + $this->_add_validation_strategy(new EE_URL_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
20 | 20 | parent::__construct($input_settings); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -8,14 +8,14 @@ |
||
8 | 8 | * @subpackage |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_CVV_Input extends EE_Text_Input{ |
|
11 | +class EE_CVV_Input extends EE_Text_Input { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $input_settings |
15 | 15 | */ |
16 | 16 | public function __construct($input_settings = array()) { |
17 | 17 | $this->set_sensitive_data_removal_strategy(new EE_CCV_Sensitive_Data_Removal()); |
18 | - $this->_add_validation_strategy( new EE_Int_Validation_Strategy(isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ); |
|
18 | + $this->_add_validation_strategy(new EE_Int_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
19 | 19 | parent::__construct($input_settings); |
20 | 20 | } |
21 | 21 | } |
@@ -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 | * @since $VID:$ |
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 |