Completed
Branch BUG-7537 (2c2d2f)
by
unknown
20:37 queued 10:27
created
core/libraries/form_sections/inputs/EE_Hidden_Input.input.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Password_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Radio_Button_Input.input.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multi_Model_Input.input.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multiple_Input.input.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_State_Select_Input.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Submit_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Yes_No_Input.input.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Yes_No_Input extends EE_Select_Input{
9
+class EE_Yes_No_Input extends EE_Select_Input {
10 10
 
11 11
 	/**
12 12
 	 * @param array $options
13 13
 	 */
14
-	function __construct( $options = array()){
15
-		$select_options = array(true=>  __("Yes", "event_espresso"),false=>  __("No", "event_espresso"));
14
+	function __construct($options = array()) {
15
+		$select_options = array(true=>  __("Yes", "event_espresso"), false=>  __("No", "event_espresso"));
16 16
 
17
-		parent::__construct($select_options,$options);
17
+		parent::__construct($select_options, $options);
18 18
 	}
19 19
 }
Please login to merge, or discard this patch.
strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 		$results = wp_remote_head( $src );
71 71
 		if( is_array( $results) && ! $results instanceof WP_Error){
72 72
 			return strpos($results['headers']['content-type'], "image" ) !== FALSE;
73
-		}else{
73
+		} else{
74 74
 			return FALSE;
75 75
 		}
76 76
 	}
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since                4.6
9 9
  *
10 10
  */
11
-class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base{
11
+class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base {
12 12
 
13 13
 	/**
14 14
 	 * return EE_Admin_File_Uploader_Display_Strategy
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 * Besides that, no special consideration should be required to make the media uploader appear, besides having
30 30
 	 * this input displayed.
31 31
 	 */
32
-	static function enqueue_scripts(){
32
+	static function enqueue_scripts() {
33 33
 		wp_enqueue_media();
34 34
 		wp_enqueue_script('media-upload');
35
-		wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
35
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
36 36
 	}
37 37
 
38 38
 
@@ -42,19 +42,19 @@  discard block
 block discarded – undo
42 42
 	 * @return string of html to display the field
43 43
 	 */
44 44
 
45
-	function display(){
45
+	function display() {
46 46
 		// the actual input
47 47
 		$input = '<input type="text" size="34" ';
48
-		$input .= 'name="' . $this->_input->html_name() . '" ';
49
-		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
50
-		$input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
51
-		$input .= $this->_input->other_html_attributes() . '>';
48
+		$input .= 'name="'.$this->_input->html_name().'" ';
49
+		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" ';
50
+		$input .= 'value="'.$this->_input->raw_value_in_form().'" ';
51
+		$input .= $this->_input->other_html_attributes().'>';
52 52
 		// image uploader
53
-		$uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' );
53
+		$uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload');
54 54
 		//only attempt to show the image if it at least exists
55
-		$image = $this->src_exists( $this->_input->raw_value() ) ? EEH_HTML::br(2) . EEH_HTML::img( $this->_input->raw_value(), __( 'logo', 'event_espresso' ), '', 'ee_media_image' ) : '';
55
+		$image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : '';
56 56
 		// html string
57
-		return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' );
57
+		return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area');
58 58
 	}
59 59
 
60 60
 
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 	 * @param string $src
66 66
 	 * @return boolean
67 67
 	 */
68
-	protected function src_exists( $src ){
69
-		$results = wp_remote_head( $src );
70
-		if( is_array( $results) && ! $results instanceof WP_Error){
71
-			return strpos($results['headers']['content-type'], "image" ) !== FALSE;
72
-		}else{
68
+	protected function src_exists($src) {
69
+		$results = wp_remote_head($src);
70
+		if (is_array($results) && ! $results instanceof WP_Error) {
71
+			return strpos($results['headers']['content-type'], "image") !== FALSE;
72
+		} else {
73 73
 			return FALSE;
74 74
 		}
75 75
 	}
Please login to merge, or discard this patch.