Completed
Branch FET-10580-form-html-parser (5302d2)
by
unknown
25:39 queued 14:00
created
core/libraries/form_sections/inputs/EE_Datepicker_Input.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,21 +6,21 @@  discard block
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Datepicker_Input extends EE_Form_Input_Base{
9
+class EE_Datepicker_Input extends EE_Form_Input_Base {
10 10
 
11 11
 	/**
12 12
 	 * @param array $input_settings
13 13
 	 */
14
-	function __construct( $input_settings = array() ){
15
-		$this->_set_display_strategy( new EE_Text_Input_Display_Strategy( 'datepicker' ) );
16
-		$this->_set_normalization_strategy( new EE_Text_Normalization() );
14
+	function __construct($input_settings = array()) {
15
+		$this->_set_display_strategy(new EE_Text_Input_Display_Strategy('datepicker'));
16
+		$this->_set_normalization_strategy(new EE_Text_Normalization());
17 17
 		//we could do better for validation, but at least verify its plaintext
18
-		$this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) );
19
-		parent::__construct( $input_settings );
20
-		$this->set_html_class( $this->html_class() . ' datepicker' );
18
+		$this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
19
+		parent::__construct($input_settings);
20
+		$this->set_html_class($this->html_class().' datepicker');
21 21
 		// add some style and make it dance
22
-		add_action( 'wp_enqueue_scripts', array( 'EE_Datepicker_Input', 'enqueue_styles_and_scripts' ));
23
-		add_action( 'admin_enqueue_scripts', array( 'EE_Datepicker_Input', 'enqueue_styles_and_scripts' ));
22
+		add_action('wp_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
23
+		add_action('admin_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
24 24
 	}
25 25
 
26 26
 
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public static function enqueue_styles_and_scripts() {
35 35
 		// load css
36
-		wp_register_style( 'espresso-ui-theme', EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION, TRUE );
37
-		wp_enqueue_style( 'espresso-ui-theme');
36
+		wp_register_style('espresso-ui-theme', EE_GLOBAL_ASSETS_URL.'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION, TRUE);
37
+		wp_enqueue_style('espresso-ui-theme');
38 38
 	}
39 39
 
40 40
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Fixed_Hidden_Input.input.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Brent Christensen
8 8
  */
9
-class EE_Fixed_Hidden_Input extends EE_Hidden_Input{
9
+class EE_Fixed_Hidden_Input extends EE_Hidden_Input {
10 10
 
11 11
 
12 12
 	/**
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 * @param array $req_data like $_POST
18 18
 	 * @return boolean whether or not there was an error
19 19
 	 */
20
-	protected function _normalize( $req_data ) {
20
+	protected function _normalize($req_data) {
21 21
 	}
22 22
 
23 23
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Float_Input.input.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Float_Input extends EE_Form_Input_Base{
9
+class EE_Float_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
 		$this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
16
-		$this->_set_normalization_strategy(new EE_Float_Normalization( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) );
17
-		$this->_add_validation_strategy( new EE_Float_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) );
16
+		$this->_set_normalization_strategy(new EE_Float_Normalization(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
17
+		$this->_add_validation_strategy(new EE_Float_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
18 18
 		parent::__construct($input_settings);
19 19
 	}
20 20
 }
21 21
\ No newline at end of file
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_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   +18 added lines, -18 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
 	 * Its important this media only get enqueued AFTER init, but before the footer... where the
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 	 * this input displayed.
21 21
 	 * @deprecated. enqueue_js should be called automatically now
22 22
 	 */
23
-	static function enqueue_scripts(){
24
-		EE_Error::doing_it_wrong( __FUNCTION__, __( 'EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form'), '4.9.8.rc.015' );
23
+	static function enqueue_scripts() {
24
+		EE_Error::doing_it_wrong(__FUNCTION__, __('EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form'), '4.9.8.rc.015');
25 25
 		wp_enqueue_media();
26 26
 		wp_enqueue_script('media-upload');
27
-		wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
27
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
28 28
 	}
29 29
 	
30 30
 	/**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	public function enqueue_js() {
34 34
 		wp_enqueue_media();
35 35
 		wp_enqueue_script('media-upload');
36
-		wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
36
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
37 37
 		parent::enqueue_js();
38 38
 	}
39 39
 
@@ -44,19 +44,19 @@  discard block
 block discarded – undo
44 44
 	 * @return string of html to display the field
45 45
 	 */
46 46
 
47
-	function display(){
47
+	function display() {
48 48
 		// the actual input
49 49
 		$input = '<input type="text" size="34" ';
50
-		$input .= 'name="' . $this->_input->html_name() . '" ';
51
-		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
52
-		$input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
53
-		$input .= $this->_input->other_html_attributes() . '>';
50
+		$input .= 'name="'.$this->_input->html_name().'" ';
51
+		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" ';
52
+		$input .= 'value="'.$this->_input->raw_value_in_form().'" ';
53
+		$input .= $this->_input->other_html_attributes().'>';
54 54
 		// image uploader
55
-		$uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' );
55
+		$uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload');
56 56
 		//only attempt to show the image if it at least exists
57
-		$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' ) : '';
57
+		$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') : '';
58 58
 		// html string
59
-		return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' );
59
+		return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area');
60 60
 	}
61 61
 
62 62
 
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
 	 * @param string $src
68 68
 	 * @return boolean
69 69
 	 */
70
-	protected function src_exists( $src ){
71
-		$results = wp_remote_head( $src );
72
-		if( is_array( $results) && ! $results instanceof WP_Error){
73
-			return strpos($results['headers']['content-type'], "image" ) !== FALSE;
74
-		}else{
70
+	protected function src_exists($src) {
71
+		$results = wp_remote_head($src);
72
+		if (is_array($results) && ! $results instanceof WP_Error) {
73
+			return strpos($results['headers']['content-type'], "image") !== FALSE;
74
+		} else {
75 75
 			return FALSE;
76 76
 		}
77 77
 	}
Please login to merge, or discard this patch.