Completed
Branch dependabot/composer/wp-graphql... (d51bd9)
by
unknown
05:53 queued 14s
created
core/libraries/form_sections/inputs/EE_Month_Input.input.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
         $key_begin_range = $january_is_month_1 ? 1 : 0;
20 20
         $key_range = range($key_begin_range, $key_begin_range + 11);
21 21
         if ($leading_zero) {
22
-            array_walk($key_range, array( $this, '_zero_pad' ));
22
+            array_walk($key_range, array($this, '_zero_pad'));
23 23
         }
24 24
         $value_range = range(1, 12);
25
-        array_walk($value_range, array( $this, '_zero_pad' ));
25
+        array_walk($value_range, array($this, '_zero_pad'));
26 26
         parent::__construct(
27 27
             array_combine(
28 28
                 $key_range,
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -9,36 +9,36 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Month_Input extends EE_Select_Input
11 11
 {
12
-    /**
13
-     * @param bool  $leading_zero
14
-     * @param array $input_settings
15
-     * @param bool $january_is_month_1 whether january should have value of 1; or it should be month 0
16
-     */
17
-    public function __construct($leading_zero = false, $input_settings = array(), $january_is_month_1 = true)
18
-    {
19
-        $key_begin_range = $january_is_month_1 ? 1 : 0;
20
-        $key_range = range($key_begin_range, $key_begin_range + 11);
21
-        if ($leading_zero) {
22
-            array_walk($key_range, array( $this, '_zero_pad' ));
23
-        }
24
-        $value_range = range(1, 12);
25
-        array_walk($value_range, array( $this, '_zero_pad' ));
26
-        parent::__construct(
27
-            array_combine(
28
-                $key_range,
29
-                $value_range
30
-            ),
31
-            $input_settings
32
-        );
33
-    }
12
+	/**
13
+	 * @param bool  $leading_zero
14
+	 * @param array $input_settings
15
+	 * @param bool $january_is_month_1 whether january should have value of 1; or it should be month 0
16
+	 */
17
+	public function __construct($leading_zero = false, $input_settings = array(), $january_is_month_1 = true)
18
+	{
19
+		$key_begin_range = $january_is_month_1 ? 1 : 0;
20
+		$key_range = range($key_begin_range, $key_begin_range + 11);
21
+		if ($leading_zero) {
22
+			array_walk($key_range, array( $this, '_zero_pad' ));
23
+		}
24
+		$value_range = range(1, 12);
25
+		array_walk($value_range, array( $this, '_zero_pad' ));
26
+		parent::__construct(
27
+			array_combine(
28
+				$key_range,
29
+				$value_range
30
+			),
31
+			$input_settings
32
+		);
33
+	}
34 34
 
35
-    /**
36
-     * Changes int 1 to 01, etc. Useful with array_walk
37
-     * @param int $input
38
-     * @param mixed $key
39
-     */
40
-    protected function _zero_pad(&$input, $key)
41
-    {
42
-        $input = str_pad($input, 2, '0', STR_PAD_LEFT);
43
-    }
35
+	/**
36
+	 * Changes int 1 to 01, etc. Useful with array_walk
37
+	 * @param int $input
38
+	 * @param mixed $key
39
+	 */
40
+	protected function _zero_pad(&$input, $key)
41
+	{
42
+		$input = str_pad($input, 2, '0', STR_PAD_LEFT);
43
+	}
44 44
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multi_Model_Input.input.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
         $select_options = array();
56 56
         foreach ($answer_options as $model_obj) {
57 57
             if ($this->_naming_method) {
58
-                $display_value = call_user_func(array( $model_obj, $this->_naming_method ));
58
+                $display_value = call_user_func(array($model_obj, $this->_naming_method));
59 59
             } else {
60 60
                 $display_value = $model_obj->name();
61 61
             }
62
-            $select_options[ $model_obj->ID() ] = $display_value;
62
+            $select_options[$model_obj->ID()] = $display_value;
63 63
         }
64 64
         parent::set_select_options($select_options);
65 65
     }
Please login to merge, or discard this patch.
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -11,75 +11,75 @@
 block discarded – undo
11 11
  */
12 12
 class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input
13 13
 {
14
-    protected $_naming_method;
14
+	protected $_naming_method;
15 15
 
16 16
 
17 17
 
18
-    /**
19
-     *
20
-     * @param EE_Base_Class[] $answer_options
21
-     * @param array $input_settings {
22
-     *      @var EE_Base_Class[] or array $default
23
-     *      @var string $naming_method function name on the class which will be used for getting the displayed-name.
24
-     *     example:     if the class were an EE_Event, this could be slug(), description(), name() (default)
25
-     * }
26
-     */
27
-    public function __construct($answer_options = array(), $input_settings = array())
28
-    {
29
-        if (isset($input_settings['naming_method'])) {
30
-            $this->set_option_naming_method($input_settings['naming_method']);
31
-        }
32
-        parent::__construct($answer_options, $input_settings);
33
-    }
18
+	/**
19
+	 *
20
+	 * @param EE_Base_Class[] $answer_options
21
+	 * @param array $input_settings {
22
+	 *      @var EE_Base_Class[] or array $default
23
+	 *      @var string $naming_method function name on the class which will be used for getting the displayed-name.
24
+	 *     example:     if the class were an EE_Event, this could be slug(), description(), name() (default)
25
+	 * }
26
+	 */
27
+	public function __construct($answer_options = array(), $input_settings = array())
28
+	{
29
+		if (isset($input_settings['naming_method'])) {
30
+			$this->set_option_naming_method($input_settings['naming_method']);
31
+		}
32
+		parent::__construct($answer_options, $input_settings);
33
+	}
34 34
 
35
-    /**
36
-     * Sets the method name which will be called when outputting the options list
37
-     * @param string $method
38
-     */
39
-    public function set_option_naming_method($method)
40
-    {
41
-        $this->_naming_method = $method;
42
-    }
35
+	/**
36
+	 * Sets the method name which will be called when outputting the options list
37
+	 * @param string $method
38
+	 */
39
+	public function set_option_naming_method($method)
40
+	{
41
+		$this->_naming_method = $method;
42
+	}
43 43
 
44 44
 
45 45
 
46
-    /**
47
-     * You CAN pass an array of model objects instead of simple values for teh options
48
-     * @param EE_Base_Class[] $answer_options
49
-     * @return null|void
50
-     */
51
-    public function set_select_options($answer_options = array())
52
-    {
53
-        // convert the model objects to select from into normal select options
54
-        $select_options = array();
55
-        foreach ($answer_options as $model_obj) {
56
-            if ($this->_naming_method) {
57
-                $display_value = call_user_func(array( $model_obj, $this->_naming_method ));
58
-            } else {
59
-                $display_value = $model_obj->name();
60
-            }
61
-            $select_options[ $model_obj->ID() ] = $display_value;
62
-        }
63
-        parent::set_select_options($select_options);
64
-    }
46
+	/**
47
+	 * You CAN pass an array of model objects instead of simple values for teh options
48
+	 * @param EE_Base_Class[] $answer_options
49
+	 * @return null|void
50
+	 */
51
+	public function set_select_options($answer_options = array())
52
+	{
53
+		// convert the model objects to select from into normal select options
54
+		$select_options = array();
55
+		foreach ($answer_options as $model_obj) {
56
+			if ($this->_naming_method) {
57
+				$display_value = call_user_func(array( $model_obj, $this->_naming_method ));
58
+			} else {
59
+				$display_value = $model_obj->name();
60
+			}
61
+			$select_options[ $model_obj->ID() ] = $display_value;
62
+		}
63
+		parent::set_select_options($select_options);
64
+	}
65 65
 
66 66
 
67 67
 
68
-    /**
69
-     * if they passed in an array of model objects for the default, convert it
70
-     * into the format EE_Select_Multiple expects
71
-     * @param EE_Base_Class[]|array $values
72
-     */
73
-    public function set_default($values)
74
-    {
75
-        $defaults_as_simple_ids = array();
76
-        foreach ($values as $key => $value) {
77
-            if ($value instanceof EE_Base_Class) {
78
-                $defaults_as_simple_ids[] = $value->ID();
79
-            } else {
80
-                $defaults_as_simple_ids[] = $value;
81
-            }
82
-        }
83
-        parent::set_default($defaults_as_simple_ids);
84
-    }
68
+	/**
69
+	 * if they passed in an array of model objects for the default, convert it
70
+	 * into the format EE_Select_Multiple expects
71
+	 * @param EE_Base_Class[]|array $values
72
+	 */
73
+	public function set_default($values)
74
+	{
75
+		$defaults_as_simple_ids = array();
76
+		foreach ($values as $key => $value) {
77
+			if ($value instanceof EE_Base_Class) {
78
+				$defaults_as_simple_ids[] = $value->ID();
79
+			} else {
80
+				$defaults_as_simple_ids[] = $value;
81
+			}
82
+		}
83
+		parent::set_default($defaults_as_simple_ids);
84
+	}
85 85
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multiple_Input.input.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     public function __construct($answer_options, $input_settings = array())
17 17
     {
18 18
         $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy());
19
-        $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) )));
19
+        $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 20
         $this->_multiple_selections = true;
21 21
         parent::__construct($answer_options, $input_settings);
22 22
     }
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base
11 11
 {
12
-    /**
13
-     * @param array | EE_Question_Option[] $answer_options
14
-     * @param array $input_settings
15
-     */
16
-    public function __construct($answer_options, $input_settings = array())
17
-    {
18
-        $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy());
19
-        $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
-        $this->_multiple_selections = true;
21
-        parent::__construct($answer_options, $input_settings);
22
-    }
12
+	/**
13
+	 * @param array | EE_Question_Option[] $answer_options
14
+	 * @param array $input_settings
15
+	 */
16
+	public function __construct($answer_options, $input_settings = array())
17
+	{
18
+		$this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy());
19
+		$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
+		$this->_multiple_selections = true;
21
+		parent::__construct($answer_options, $input_settings);
22
+	}
23 23
 }
Please login to merge, or discard this patch.
strategies/normalization/EE_Many_Valued_Normalization.strategy.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         }
44 44
         $normalized_array_value = array();
45 45
         foreach ($items_to_normalize as $key => $individual_item) {
46
-            $normalized_array_value[ $key ] = $this->normalize_one($individual_item);
46
+            $normalized_array_value[$key] = $this->normalize_one($individual_item);
47 47
         }
48 48
         return $normalized_array_value;
49 49
     }
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
         if ($normalized_values === null) {
75 75
             $normalized_values = array();
76 76
         }
77
-        if (! is_array($normalized_values)) {
77
+        if ( ! is_array($normalized_values)) {
78 78
             $normalized_values = array($normalized_values);
79 79
         }
80 80
         $non_normal_values = array();
81 81
         foreach ($normalized_values as $key => $value) {
82
-            $non_normal_values[ $key ] = $this->unnormalize_one($value);
82
+            $non_normal_values[$key] = $this->unnormalize_one($value);
83 83
         }
84 84
         return $non_normal_values;
85 85
     }
Please login to merge, or discard this patch.
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -9,90 +9,90 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Many_Valued_Normalization extends EE_Normalization_Strategy_Base
11 11
 {
12
-    protected $_individual_item_normalization_strategy = array();
13
-
14
-
15
-
16
-    /**
17
-     * @param EE_Normalization_Strategy_Base $individual_item_normalization_strategy
18
-     */
19
-    public function __construct($individual_item_normalization_strategy)
20
-    {
21
-        $this->_individual_item_normalization_strategy = $individual_item_normalization_strategy;
22
-        parent::__construct();
23
-    }
24
-
25
-
26
-
27
-    /**
28
-     * Normalizes the input into an array, and normalizes each item according to its
29
-     * individual item normalization strategy
30
-     *
31
-     * @param array | string $value_to_normalize
32
-     * @return array
33
-     */
34
-    public function normalize($value_to_normalize)
35
-    {
36
-        if (is_array($value_to_normalize)) {
37
-            $items_to_normalize = $value_to_normalize;
38
-        } elseif ($value_to_normalize !== null) {
39
-            $items_to_normalize = array($value_to_normalize);
40
-        } else {
41
-            $items_to_normalize = array();
42
-        }
43
-        $normalized_array_value = array();
44
-        foreach ($items_to_normalize as $key => $individual_item) {
45
-            $normalized_array_value[ $key ] = $this->normalize_one($individual_item);
46
-        }
47
-        return $normalized_array_value;
48
-    }
49
-
50
-
51
-
52
-    /**
53
-     * Normalized the one item (called for each array item in EE_Many_values_Normalization::normalize())
54
-     *
55
-     * @param string $individual_value_to_normalize but definitely NOT an array
56
-     * @return mixed
57
-     */
58
-    public function normalize_one($individual_value_to_normalize)
59
-    {
60
-        return $this->_individual_item_normalization_strategy->normalize($individual_value_to_normalize);
61
-    }
62
-
63
-
64
-
65
-    /**
66
-     * Converts the array of normalized things to an array of raw html values.
67
-     *
68
-     * @param array $normalized_values
69
-     * @return string[]
70
-     */
71
-    public function unnormalize($normalized_values)
72
-    {
73
-        if ($normalized_values === null) {
74
-            $normalized_values = array();
75
-        }
76
-        if (! is_array($normalized_values)) {
77
-            $normalized_values = array($normalized_values);
78
-        }
79
-        $non_normal_values = array();
80
-        foreach ($normalized_values as $key => $value) {
81
-            $non_normal_values[ $key ] = $this->unnormalize_one($value);
82
-        }
83
-        return $non_normal_values;
84
-    }
85
-
86
-
87
-
88
-    /**
89
-     * Unnormalizes an individual item in the array of values
90
-     *
91
-     * @param mixed $individual_value_to_unnormalize but certainly NOT an array
92
-     * @return string
93
-     */
94
-    public function unnormalize_one($individual_value_to_unnormalize)
95
-    {
96
-        return $this->_individual_item_normalization_strategy->unnormalize($individual_value_to_unnormalize);
97
-    }
12
+	protected $_individual_item_normalization_strategy = array();
13
+
14
+
15
+
16
+	/**
17
+	 * @param EE_Normalization_Strategy_Base $individual_item_normalization_strategy
18
+	 */
19
+	public function __construct($individual_item_normalization_strategy)
20
+	{
21
+		$this->_individual_item_normalization_strategy = $individual_item_normalization_strategy;
22
+		parent::__construct();
23
+	}
24
+
25
+
26
+
27
+	/**
28
+	 * Normalizes the input into an array, and normalizes each item according to its
29
+	 * individual item normalization strategy
30
+	 *
31
+	 * @param array | string $value_to_normalize
32
+	 * @return array
33
+	 */
34
+	public function normalize($value_to_normalize)
35
+	{
36
+		if (is_array($value_to_normalize)) {
37
+			$items_to_normalize = $value_to_normalize;
38
+		} elseif ($value_to_normalize !== null) {
39
+			$items_to_normalize = array($value_to_normalize);
40
+		} else {
41
+			$items_to_normalize = array();
42
+		}
43
+		$normalized_array_value = array();
44
+		foreach ($items_to_normalize as $key => $individual_item) {
45
+			$normalized_array_value[ $key ] = $this->normalize_one($individual_item);
46
+		}
47
+		return $normalized_array_value;
48
+	}
49
+
50
+
51
+
52
+	/**
53
+	 * Normalized the one item (called for each array item in EE_Many_values_Normalization::normalize())
54
+	 *
55
+	 * @param string $individual_value_to_normalize but definitely NOT an array
56
+	 * @return mixed
57
+	 */
58
+	public function normalize_one($individual_value_to_normalize)
59
+	{
60
+		return $this->_individual_item_normalization_strategy->normalize($individual_value_to_normalize);
61
+	}
62
+
63
+
64
+
65
+	/**
66
+	 * Converts the array of normalized things to an array of raw html values.
67
+	 *
68
+	 * @param array $normalized_values
69
+	 * @return string[]
70
+	 */
71
+	public function unnormalize($normalized_values)
72
+	{
73
+		if ($normalized_values === null) {
74
+			$normalized_values = array();
75
+		}
76
+		if (! is_array($normalized_values)) {
77
+			$normalized_values = array($normalized_values);
78
+		}
79
+		$non_normal_values = array();
80
+		foreach ($normalized_values as $key => $value) {
81
+			$non_normal_values[ $key ] = $this->unnormalize_one($value);
82
+		}
83
+		return $non_normal_values;
84
+	}
85
+
86
+
87
+
88
+	/**
89
+	 * Unnormalizes an individual item in the array of values
90
+	 *
91
+	 * @param mixed $individual_value_to_unnormalize but certainly NOT an array
92
+	 * @return string
93
+	 */
94
+	public function unnormalize_one($individual_value_to_unnormalize)
95
+	{
96
+		return $this->_individual_item_normalization_strategy->unnormalize($individual_value_to_unnormalize);
97
+	}
98 98
 }
Please login to merge, or discard this patch.
libraries/form_sections/strategies/layout/EE_Template_Layout.strategy.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         // loop through incoming options
53 53
         foreach ($template_options as $key => $value) {
54 54
             // add underscore to $key to match property names
55
-            $_key = '_' . $key;
55
+            $_key = '_'.$key;
56 56
             if (property_exists($this, $_key)) {
57 57
                 $this->{$_key} = $value;
58 58
             }
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
             $subsection_name = self::prep_form_subsection_key_name($subsection_name);
183 183
             if (strpos($subsection_name, '[') !== false) {
184 184
                 $sub_name = explode('[', $subsection_name);
185
-                $this->_template_args[ $sub_name[0] ][ rtrim($sub_name[1], ']') ] = $this->layout_subsection($subsection);
185
+                $this->_template_args[$sub_name[0]][rtrim($sub_name[1], ']')] = $this->layout_subsection($subsection);
186 186
             } else {
187
-                $this->_template_args[ $subsection_name ] = $this->layout_subsection($subsection);
187
+                $this->_template_args[$subsection_name] = $this->layout_subsection($subsection);
188 188
             }
189 189
         }
190 190
         //      d( $this->_template_args );
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     public static function prep_form_subsection_key_name($subsection_name = '')
204 204
     {
205 205
         $subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name);
206
-        return is_numeric(substr($subsection_name, 0, 1)) ? 'form_' . $subsection_name : $subsection_name;
206
+        return is_numeric(substr($subsection_name, 0, 1)) ? 'form_'.$subsection_name : $subsection_name;
207 207
     }
208 208
 
209 209
 
Please login to merge, or discard this patch.
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -22,200 +22,200 @@
 block discarded – undo
22 22
  */
23 23
 class EE_Template_Layout extends EE_Div_Per_Section_Layout
24 24
 {
25
-    protected $_layout_template_file       = null;
26
-
27
-    protected $_layout_begin_template_file = null;
28
-
29
-    protected $_input_template_file        = null;
30
-
31
-    protected $_subsection_template_file   = null;
32
-
33
-    protected $_layout_end_template_file   = null;
34
-
35
-    protected $_template_args              = array();
36
-
37
-
38
-
39
-    /**
40
-     * @param array $template_options {
41
-     * @type string $_layout_template_file
42
-     * @type string $_begin_template_file
43
-     * @type string $_input_template_file
44
-     * @type string $_subsection_template_file
45
-     * @type string $_end_template_file
46
-     * @type array  $_template_args
47
-     *                                }
48
-     */
49
-    public function __construct($template_options = array())
50
-    {
51
-        // loop through incoming options
52
-        foreach ($template_options as $key => $value) {
53
-            // add underscore to $key to match property names
54
-            $_key = '_' . $key;
55
-            if (property_exists($this, $_key)) {
56
-                $this->{$_key} = $value;
57
-            }
58
-        }
59
-        parent::__construct();
60
-    }
61
-
62
-
63
-
64
-    /**
65
-     * Also has the side effect of enqueuing any needed JS and CSS for
66
-     * this form.
67
-     * Creates all the HTML necessary for displaying this form, its inputs, and
68
-     * proper subsections.
69
-     * Returns the HTML
70
-     *
71
-     * @return string
72
-     */
73
-    public function layout_form()
74
-    {
75
-        if ($this->_layout_template_file) {
76
-            return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), true, true);
77
-        } else {
78
-            return parent::layout_form();
79
-        }
80
-    }
81
-
82
-
83
-
84
-    /**
85
-     * opening div tag for a form
86
-     *
87
-     * @return string
88
-     */
89
-    public function layout_form_begin()
90
-    {
91
-        if ($this->_layout_begin_template_file) {
92
-            return EEH_Template::locate_template(
93
-                $this->_layout_begin_template_file,
94
-                $this->template_args(),
95
-                true,
96
-                true
97
-            );
98
-        } else {
99
-            return parent::layout_form_begin();
100
-        }
101
-    }
102
-
103
-
104
-
105
-    /**
106
-     * If an input_template_file was provided upon construction, uses that to layout the input. Otherwise uses parent.
107
-     *
108
-     * @see EE_DIv_Per_Section_Layout::layout_input() for documentation
109
-     * @param EE_Form_Input_Base $input
110
-     * @return string
111
-     */
112
-    public function layout_input($input)
113
-    {
114
-        if ($this->_input_template_file) {
115
-            return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), true, true);
116
-        }
117
-        return parent::layout_input($input);
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * If a subsection_template_file was provided upon construction, uses that to layout the subsection. Otherwise uses parent.
124
-     *
125
-     * @see EE_Div_Per_Section_Layout::layout_subsection() for documentation
126
-     * @param EE_Form_Section_Proper $form_section
127
-     * @return string
128
-     */
129
-    public function layout_subsection($form_section)
130
-    {
131
-        if ($this->_subsection_template_file) {
132
-            return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), true, true);
133
-        }
134
-        return parent::layout_subsection($form_section);
135
-    }
136
-
137
-
138
-
139
-    /**
140
-     * closing div tag for a form
141
-     *
142
-     * @return string
143
-     */
144
-    public function layout_form_end()
145
-    {
146
-        if ($this->_layout_end_template_file) {
147
-            return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), true, true);
148
-        } else {
149
-            return parent::layout_form_end();
150
-        }
151
-    }
152
-
153
-
154
-
155
-    /**
156
-     * @param array $template_args
157
-     */
158
-    public function set_template_args($template_args = array())
159
-    {
160
-        $this->_template_args = $template_args;
161
-    }
162
-
163
-
164
-
165
-    /**
166
-     * @param array $template_args
167
-     */
168
-    public function add_template_args($template_args = array())
169
-    {
170
-        $this->_template_args = array_merge_recursive($this->_template_args, $template_args);
171
-    }
172
-
173
-
174
-
175
-    /**
176
-     * @return array
177
-     */
178
-    public function template_args()
179
-    {
180
-        foreach ($this->form_section()->subsections() as $subsection_name => $subsection) {
181
-            $subsection_name = self::prep_form_subsection_key_name($subsection_name);
182
-            if (strpos($subsection_name, '[') !== false) {
183
-                $sub_name = explode('[', $subsection_name);
184
-                $this->_template_args[ $sub_name[0] ][ rtrim($sub_name[1], ']') ] = $this->layout_subsection($subsection);
185
-            } else {
186
-                $this->_template_args[ $subsection_name ] = $this->layout_subsection($subsection);
187
-            }
188
-        }
189
-        //      d( $this->_template_args );
190
-        return $this->_template_args;
191
-    }
192
-
193
-
194
-
195
-    /**
196
-     * prep_form_section_key_name
197
-     *
198
-     * @access public
199
-     * @param string $subsection_name
200
-     * @return string
201
-     */
202
-    public static function prep_form_subsection_key_name($subsection_name = '')
203
-    {
204
-        $subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name);
205
-        return is_numeric(substr($subsection_name, 0, 1)) ? 'form_' . $subsection_name : $subsection_name;
206
-    }
207
-
208
-
209
-
210
-    /**
211
-     * get_subform - just a wrapper for the above method
212
-     *
213
-     * @access public
214
-     * @param string $subsection_name
215
-     * @return string
216
-     */
217
-    public static function get_subform_name($subsection_name = '')
218
-    {
219
-        return EE_Template_Layout::prep_form_subsection_key_name($subsection_name);
220
-    }
25
+	protected $_layout_template_file       = null;
26
+
27
+	protected $_layout_begin_template_file = null;
28
+
29
+	protected $_input_template_file        = null;
30
+
31
+	protected $_subsection_template_file   = null;
32
+
33
+	protected $_layout_end_template_file   = null;
34
+
35
+	protected $_template_args              = array();
36
+
37
+
38
+
39
+	/**
40
+	 * @param array $template_options {
41
+	 * @type string $_layout_template_file
42
+	 * @type string $_begin_template_file
43
+	 * @type string $_input_template_file
44
+	 * @type string $_subsection_template_file
45
+	 * @type string $_end_template_file
46
+	 * @type array  $_template_args
47
+	 *                                }
48
+	 */
49
+	public function __construct($template_options = array())
50
+	{
51
+		// loop through incoming options
52
+		foreach ($template_options as $key => $value) {
53
+			// add underscore to $key to match property names
54
+			$_key = '_' . $key;
55
+			if (property_exists($this, $_key)) {
56
+				$this->{$_key} = $value;
57
+			}
58
+		}
59
+		parent::__construct();
60
+	}
61
+
62
+
63
+
64
+	/**
65
+	 * Also has the side effect of enqueuing any needed JS and CSS for
66
+	 * this form.
67
+	 * Creates all the HTML necessary for displaying this form, its inputs, and
68
+	 * proper subsections.
69
+	 * Returns the HTML
70
+	 *
71
+	 * @return string
72
+	 */
73
+	public function layout_form()
74
+	{
75
+		if ($this->_layout_template_file) {
76
+			return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), true, true);
77
+		} else {
78
+			return parent::layout_form();
79
+		}
80
+	}
81
+
82
+
83
+
84
+	/**
85
+	 * opening div tag for a form
86
+	 *
87
+	 * @return string
88
+	 */
89
+	public function layout_form_begin()
90
+	{
91
+		if ($this->_layout_begin_template_file) {
92
+			return EEH_Template::locate_template(
93
+				$this->_layout_begin_template_file,
94
+				$this->template_args(),
95
+				true,
96
+				true
97
+			);
98
+		} else {
99
+			return parent::layout_form_begin();
100
+		}
101
+	}
102
+
103
+
104
+
105
+	/**
106
+	 * If an input_template_file was provided upon construction, uses that to layout the input. Otherwise uses parent.
107
+	 *
108
+	 * @see EE_DIv_Per_Section_Layout::layout_input() for documentation
109
+	 * @param EE_Form_Input_Base $input
110
+	 * @return string
111
+	 */
112
+	public function layout_input($input)
113
+	{
114
+		if ($this->_input_template_file) {
115
+			return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), true, true);
116
+		}
117
+		return parent::layout_input($input);
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * If a subsection_template_file was provided upon construction, uses that to layout the subsection. Otherwise uses parent.
124
+	 *
125
+	 * @see EE_Div_Per_Section_Layout::layout_subsection() for documentation
126
+	 * @param EE_Form_Section_Proper $form_section
127
+	 * @return string
128
+	 */
129
+	public function layout_subsection($form_section)
130
+	{
131
+		if ($this->_subsection_template_file) {
132
+			return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), true, true);
133
+		}
134
+		return parent::layout_subsection($form_section);
135
+	}
136
+
137
+
138
+
139
+	/**
140
+	 * closing div tag for a form
141
+	 *
142
+	 * @return string
143
+	 */
144
+	public function layout_form_end()
145
+	{
146
+		if ($this->_layout_end_template_file) {
147
+			return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), true, true);
148
+		} else {
149
+			return parent::layout_form_end();
150
+		}
151
+	}
152
+
153
+
154
+
155
+	/**
156
+	 * @param array $template_args
157
+	 */
158
+	public function set_template_args($template_args = array())
159
+	{
160
+		$this->_template_args = $template_args;
161
+	}
162
+
163
+
164
+
165
+	/**
166
+	 * @param array $template_args
167
+	 */
168
+	public function add_template_args($template_args = array())
169
+	{
170
+		$this->_template_args = array_merge_recursive($this->_template_args, $template_args);
171
+	}
172
+
173
+
174
+
175
+	/**
176
+	 * @return array
177
+	 */
178
+	public function template_args()
179
+	{
180
+		foreach ($this->form_section()->subsections() as $subsection_name => $subsection) {
181
+			$subsection_name = self::prep_form_subsection_key_name($subsection_name);
182
+			if (strpos($subsection_name, '[') !== false) {
183
+				$sub_name = explode('[', $subsection_name);
184
+				$this->_template_args[ $sub_name[0] ][ rtrim($sub_name[1], ']') ] = $this->layout_subsection($subsection);
185
+			} else {
186
+				$this->_template_args[ $subsection_name ] = $this->layout_subsection($subsection);
187
+			}
188
+		}
189
+		//      d( $this->_template_args );
190
+		return $this->_template_args;
191
+	}
192
+
193
+
194
+
195
+	/**
196
+	 * prep_form_section_key_name
197
+	 *
198
+	 * @access public
199
+	 * @param string $subsection_name
200
+	 * @return string
201
+	 */
202
+	public static function prep_form_subsection_key_name($subsection_name = '')
203
+	{
204
+		$subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name);
205
+		return is_numeric(substr($subsection_name, 0, 1)) ? 'form_' . $subsection_name : $subsection_name;
206
+	}
207
+
208
+
209
+
210
+	/**
211
+	 * get_subform - just a wrapper for the above method
212
+	 *
213
+	 * @access public
214
+	 * @param string $subsection_name
215
+	 * @return string
216
+	 */
217
+	public static function get_subform_name($subsection_name = '')
218
+	{
219
+		return EE_Template_Layout::prep_form_subsection_key_name($subsection_name);
220
+	}
221 221
 }
Please login to merge, or discard this patch.
form_sections/strategies/layout/EE_Fieldset_Section_Layout.strategy.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function __construct($options = array())
37 37
     {
38 38
         foreach ($options as $key => $value) {
39
-            $key = '_' . $key;
39
+            $key = '_'.$key;
40 40
             if (property_exists($this, $key)) {
41 41
                 $this->{$key} = $value;
42 42
             }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 . '" style="'
61 61
                 . $this->_form_section->html_style()
62 62
                 . '">';
63
-        $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>';
63
+        $html .= '<legend class="'.$this->legend_class().'">'.$this->legend_text().'</legend>';
64 64
         return $html;
65 65
     }
66 66
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function layout_form_end()
75 75
     {
76
-        return EEH_HTML::nl(-1) . '</fieldset>';
76
+        return EEH_HTML::nl(-1).'</fieldset>';
77 77
     }
78 78
 
79 79
 
Please login to merge, or discard this patch.
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -11,107 +11,107 @@
 block discarded – undo
11 11
  */
12 12
 class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout
13 13
 {
14
-    /**
15
-     * legend_class
16
-     *
17
-     * @var string
18
-     */
19
-    protected $_legend_class;
20
-
21
-    /**
22
-     * legend_text
23
-     *
24
-     * @var string
25
-     */
26
-    protected $_legend_text;
27
-
28
-
29
-
30
-    /**
31
-     *    construct
32
-     *
33
-     * @param array $options
34
-     */
35
-    public function __construct($options = array())
36
-    {
37
-        foreach ($options as $key => $value) {
38
-            $key = '_' . $key;
39
-            if (property_exists($this, $key)) {
40
-                $this->{$key} = $value;
41
-            }
42
-        }
43
-    }
44
-
45
-
46
-
47
-    /**
48
-     * opening div tag for a form
49
-     *
50
-     * @return string
51
-     */
52
-    public function layout_form_begin()
53
-    {
54
-        $html = EEH_HTML::nl(1)
55
-                . '<fieldset id="'
56
-                . $this->_form_section->html_id()
57
-                . '" class="'
58
-                . $this->_form_section->html_class()
59
-                . '" style="'
60
-                . $this->_form_section->html_style()
61
-                . '">';
62
-        $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>';
63
-        return $html;
64
-    }
65
-
66
-
67
-
68
-    /**
69
-     * closing div tag for a form
70
-     *
71
-     * @return string
72
-     */
73
-    public function layout_form_end()
74
-    {
75
-        return EEH_HTML::nl(-1) . '</fieldset>';
76
-    }
77
-
78
-
79
-
80
-    /**
81
-     * @param string $legend_class
82
-     */
83
-    public function set_legend_class($legend_class)
84
-    {
85
-        $this->_legend_class = $legend_class;
86
-    }
87
-
88
-
89
-
90
-    /**
91
-     * @return string
92
-     */
93
-    public function legend_class()
94
-    {
95
-        return $this->_legend_class;
96
-    }
97
-
98
-
99
-
100
-    /**
101
-     * @param string $legend_text
102
-     */
103
-    public function set_legend_text($legend_text)
104
-    {
105
-        $this->_legend_text = $legend_text;
106
-    }
107
-
108
-
109
-
110
-    /**
111
-     * @return string
112
-     */
113
-    public function legend_text()
114
-    {
115
-        return $this->_legend_text;
116
-    }
14
+	/**
15
+	 * legend_class
16
+	 *
17
+	 * @var string
18
+	 */
19
+	protected $_legend_class;
20
+
21
+	/**
22
+	 * legend_text
23
+	 *
24
+	 * @var string
25
+	 */
26
+	protected $_legend_text;
27
+
28
+
29
+
30
+	/**
31
+	 *    construct
32
+	 *
33
+	 * @param array $options
34
+	 */
35
+	public function __construct($options = array())
36
+	{
37
+		foreach ($options as $key => $value) {
38
+			$key = '_' . $key;
39
+			if (property_exists($this, $key)) {
40
+				$this->{$key} = $value;
41
+			}
42
+		}
43
+	}
44
+
45
+
46
+
47
+	/**
48
+	 * opening div tag for a form
49
+	 *
50
+	 * @return string
51
+	 */
52
+	public function layout_form_begin()
53
+	{
54
+		$html = EEH_HTML::nl(1)
55
+				. '<fieldset id="'
56
+				. $this->_form_section->html_id()
57
+				. '" class="'
58
+				. $this->_form_section->html_class()
59
+				. '" style="'
60
+				. $this->_form_section->html_style()
61
+				. '">';
62
+		$html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>';
63
+		return $html;
64
+	}
65
+
66
+
67
+
68
+	/**
69
+	 * closing div tag for a form
70
+	 *
71
+	 * @return string
72
+	 */
73
+	public function layout_form_end()
74
+	{
75
+		return EEH_HTML::nl(-1) . '</fieldset>';
76
+	}
77
+
78
+
79
+
80
+	/**
81
+	 * @param string $legend_class
82
+	 */
83
+	public function set_legend_class($legend_class)
84
+	{
85
+		$this->_legend_class = $legend_class;
86
+	}
87
+
88
+
89
+
90
+	/**
91
+	 * @return string
92
+	 */
93
+	public function legend_class()
94
+	{
95
+		return $this->_legend_class;
96
+	}
97
+
98
+
99
+
100
+	/**
101
+	 * @param string $legend_text
102
+	 */
103
+	public function set_legend_text($legend_text)
104
+	{
105
+		$this->_legend_text = $legend_text;
106
+	}
107
+
108
+
109
+
110
+	/**
111
+	 * @return string
112
+	 */
113
+	public function legend_text()
114
+	{
115
+		return $this->_legend_text;
116
+	}
117 117
 }
Please login to merge, or discard this patch.
form_sections/strategies/layout/EE_Admin_One_Column_Layout.strategy.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
         return EEH_HTML::table(
15 15
             '',
16 16
             $this->_form_section->html_id(),
17
-            $this->_form_section->html_class() . ' form-table',
17
+            $this->_form_section->html_class().' form-table',
18 18
             $this->_form_section->html_style()
19
-        ) . EEH_HTML::tbody();
19
+        ).EEH_HTML::tbody();
20 20
     }
21 21
 
22 22
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function layout_form_end($additional_args = array())
30 30
     {
31
-        return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id());
31
+        return EEH_HTML::tbodyx().EEH_HTML::tablex($this->_form_section->html_id());
32 32
     }
33 33
 
34 34
 
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
             || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
46 46
             || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
47 47
         ) {
48
-            $input->set_html_class($input->html_class() . ' large-text');
48
+            $input->set_html_class($input->html_class().' large-text');
49 49
         }
50 50
         $input_html = $input->get_html_for_input();
51 51
         // maybe add errors and help text ?
52 52
         $input_html .= $input->get_html_for_errors() !== ''
53
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
53
+            ? EEH_HTML::nl().$input->get_html_for_errors()
54 54
             : '';
55 55
         $input_html .= $input->get_html_for_help() !== ''
56
-            ? EEH_HTML::nl() . $input->get_html_for_help()
56
+            ? EEH_HTML::nl().$input->get_html_for_help()
57 57
             : '';
58 58
         // overriding parent to add wp admin specific things.
59 59
         $html = '';
Please login to merge, or discard this patch.
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -3,90 +3,90 @@
 block discarded – undo
3 3
 class EE_Admin_One_Column_Layout extends EE_Form_Section_Layout_Base
4 4
 {
5 5
 
6
-    /**
7
-     * Starts the form section
8
-     *
9
-     * @param array $additional_args
10
-     * @return string
11
-     */
12
-    public function layout_form_begin($additional_args = array())
13
-    {
14
-        return EEH_HTML::table(
15
-            '',
16
-            $this->_form_section->html_id(),
17
-            $this->_form_section->html_class() . ' form-table',
18
-            $this->_form_section->html_style()
19
-        ) . EEH_HTML::tbody();
20
-    }
6
+	/**
7
+	 * Starts the form section
8
+	 *
9
+	 * @param array $additional_args
10
+	 * @return string
11
+	 */
12
+	public function layout_form_begin($additional_args = array())
13
+	{
14
+		return EEH_HTML::table(
15
+			'',
16
+			$this->_form_section->html_id(),
17
+			$this->_form_section->html_class() . ' form-table',
18
+			$this->_form_section->html_style()
19
+		) . EEH_HTML::tbody();
20
+	}
21 21
 
22 22
 
23
-    /**
24
-     * Ends the form section
25
-     *
26
-     * @param array $additional_args
27
-     * @return string
28
-     */
29
-    public function layout_form_end($additional_args = array())
30
-    {
31
-        return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id());
32
-    }
23
+	/**
24
+	 * Ends the form section
25
+	 *
26
+	 * @param array $additional_args
27
+	 * @return string
28
+	 */
29
+	public function layout_form_end($additional_args = array())
30
+	{
31
+		return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id());
32
+	}
33 33
 
34 34
 
35
-    /**
36
-     * Lays out the row for the input, including label and errors
37
-     *
38
-     * @param EE_Form_Input_Base $input
39
-     * @return string
40
-     * @throws EE_Error
41
-     */
42
-    public function layout_input($input)
43
-    {
44
-        if (
45
-            $input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
46
-            || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
47
-            || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
48
-        ) {
49
-            $input->set_html_class($input->html_class() . ' large-text');
50
-        }
51
-        $input_html = $input->get_html_for_input();
52
-        // maybe add errors and help text ?
53
-        $input_html .= $input->get_html_for_errors() !== ''
54
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
55
-            : '';
56
-        $input_html .= $input->get_html_for_help() !== ''
57
-            ? EEH_HTML::nl() . $input->get_html_for_help()
58
-            : '';
59
-        // overriding parent to add wp admin specific things.
60
-        $html = '';
61
-        if ($input instanceof EE_Hidden_Input) {
62
-            $html .= EEH_HTML::no_row($input->get_html_for_input());
63
-        } else {
64
-            $html .= EEH_HTML::tr(
65
-                EEH_HTML::td(
66
-                    $input->get_html_for_label()
67
-                    . EEH_HTML::nl()
68
-                    . $input_html
69
-                )
70
-            );
71
-        }
72
-        return $html;
73
-    }
35
+	/**
36
+	 * Lays out the row for the input, including label and errors
37
+	 *
38
+	 * @param EE_Form_Input_Base $input
39
+	 * @return string
40
+	 * @throws EE_Error
41
+	 */
42
+	public function layout_input($input)
43
+	{
44
+		if (
45
+			$input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
46
+			|| $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
47
+			|| $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
48
+		) {
49
+			$input->set_html_class($input->html_class() . ' large-text');
50
+		}
51
+		$input_html = $input->get_html_for_input();
52
+		// maybe add errors and help text ?
53
+		$input_html .= $input->get_html_for_errors() !== ''
54
+			? EEH_HTML::nl() . $input->get_html_for_errors()
55
+			: '';
56
+		$input_html .= $input->get_html_for_help() !== ''
57
+			? EEH_HTML::nl() . $input->get_html_for_help()
58
+			: '';
59
+		// overriding parent to add wp admin specific things.
60
+		$html = '';
61
+		if ($input instanceof EE_Hidden_Input) {
62
+			$html .= EEH_HTML::no_row($input->get_html_for_input());
63
+		} else {
64
+			$html .= EEH_HTML::tr(
65
+				EEH_HTML::td(
66
+					$input->get_html_for_label()
67
+					. EEH_HTML::nl()
68
+					. $input_html
69
+				)
70
+			);
71
+		}
72
+		return $html;
73
+	}
74 74
 
75 75
 
76
-    /**
77
-     * Lays out a row for the subsection
78
-     *
79
-     * @param EE_Form_Section_Proper $form_section
80
-     * @return string
81
-     */
82
-    public function layout_subsection($form_section)
83
-    {
84
-        if (
85
-            $form_section instanceof EE_Form_Section_Proper
86
-            || $form_section instanceof EE_Form_Section_HTML
87
-        ) {
88
-            return EEH_HTML::no_row($form_section->get_html());
89
-        }
90
-        return '';
91
-    }
76
+	/**
77
+	 * Lays out a row for the subsection
78
+	 *
79
+	 * @param EE_Form_Section_Proper $form_section
80
+	 * @return string
81
+	 */
82
+	public function layout_subsection($form_section)
83
+	{
84
+		if (
85
+			$form_section instanceof EE_Form_Section_Proper
86
+			|| $form_section instanceof EE_Form_Section_HTML
87
+		) {
88
+			return EEH_HTML::no_row($form_section->get_html());
89
+		}
90
+		return '';
91
+	}
92 92
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/strategies/layout/EE_No_Layout.strategy.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $html = '';
63 63
         if ($input instanceof EE_Hidden_Input) {
64
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
64
+            $html .= EEH_HTML::nl().$input->get_html_for_input();
65 65
         } elseif ($input instanceof EE_Submit_Input) {
66 66
             $html .= $this->br();
67 67
             $html .= $input->get_html_for_input();
68 68
         } elseif ($input instanceof EE_Select_Input) {
69 69
             $html .= $this->br();
70
-            $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
71
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
72
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
73
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
70
+            $html .= EEH_HTML::nl(1).$input->get_html_for_label();
71
+            $html .= EEH_HTML::nl().$input->get_html_for_errors();
72
+            $html .= EEH_HTML::nl().$input->get_html_for_input();
73
+            $html .= EEH_HTML::nl().$input->get_html_for_help();
74 74
             $html .= $this->br();
75 75
         } elseif ($input instanceof EE_Form_Input_With_Options_Base) {
76 76
             $html .= $this->br();
77
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
78
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
79
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
77
+            $html .= EEH_HTML::nl().$input->get_html_for_errors();
78
+            $html .= EEH_HTML::nl().$input->get_html_for_input();
79
+            $html .= EEH_HTML::nl().$input->get_html_for_help();
80 80
         } else {
81 81
             $html .= $this->br();
82
-            $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
83
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
84
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
85
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
82
+            $html .= EEH_HTML::nl(1).$input->get_html_for_label();
83
+            $html .= EEH_HTML::nl().$input->get_html_for_errors();
84
+            $html .= EEH_HTML::nl().$input->get_html_for_input();
85
+            $html .= EEH_HTML::nl().$input->get_html_for_help();
86 86
         }
87 87
         $html .= EEH_HTML::nl(-1);
88 88
         return $html;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     public function layout_subsection($form_section)
100 100
     {
101 101
         //      d( $form_section );
102
-        return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
102
+        return EEH_HTML::nl(1).$form_section->get_html().EEH_HTML::nl(-1);
103 103
     }
104 104
 
105 105
 
Please login to merge, or discard this patch.
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -10,117 +10,117 @@
 block discarded – undo
10 10
  */
11 11
 class EE_No_Layout extends EE_Div_Per_Section_Layout
12 12
 {
13
-    /**
14
-     * This is a flag indicating whether to use '<br>' tags after each input in the layout
15
-     * strategy.
16
-     *
17
-     * @var bool
18
-     */
19
-    protected $_use_break_tags = true;
20
-
21
-
22
-
23
-    /**
24
-     * EE_No_Layout constructor.
25
-     *
26
-     * @param array $options  Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags
27
-     *                        property on the class.
28
-     */
29
-    public function __construct($options = array())
30
-    {
31
-        $this->_use_break_tags = is_array($options) && isset($options['use_break_tags'])
32
-            ? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN)
33
-            : $this->_use_break_tags;
34
-        parent::__construct();
35
-    }
36
-
37
-
38
-
39
-    /**
40
-     * Add line break at beginning of form
41
-     *
42
-     * @return string
43
-     */
44
-    public function layout_form_begin()
45
-    {
46
-        return EEH_HTML::nl(1);
47
-    }
48
-
49
-
50
-
51
-    /**
52
-     * Lays out the row for the input, including label and errors
53
-     *
54
-     * @param EE_Form_Input_Base $input
55
-     * @return string
56
-     * @throws \EE_Error
57
-     */
58
-    public function layout_input($input)
59
-    {
60
-        $html = '';
61
-        if ($input instanceof EE_Hidden_Input) {
62
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
63
-        } elseif ($input instanceof EE_Submit_Input) {
64
-            $html .= $this->br();
65
-            $html .= $input->get_html_for_input();
66
-        } elseif ($input instanceof EE_Select_Input) {
67
-            $html .= $this->br();
68
-            $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
69
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
70
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
71
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
72
-            $html .= $this->br();
73
-        } elseif ($input instanceof EE_Form_Input_With_Options_Base) {
74
-            $html .= $this->br();
75
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
76
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
77
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
78
-        } else {
79
-            $html .= $this->br();
80
-            $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
81
-            $html .= EEH_HTML::nl() . $input->get_html_for_errors();
82
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
83
-            $html .= EEH_HTML::nl() . $input->get_html_for_help();
84
-        }
85
-        $html .= EEH_HTML::nl(-1);
86
-        return $html;
87
-    }
88
-
89
-
90
-
91
-    /**
92
-     * Lays out a row for the subsection
93
-     *
94
-     * @param EE_Form_Section_Proper $form_section
95
-     * @return string
96
-     */
97
-    public function layout_subsection($form_section)
98
-    {
99
-        //      d( $form_section );
100
-        return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
101
-    }
102
-
103
-
104
-
105
-    /**
106
-     * Add line break at end of form.
107
-     *
108
-     * @return string
109
-     */
110
-    public function layout_form_end()
111
-    {
112
-        return EEH_HTML::nl(-1);
113
-    }
114
-
115
-
116
-
117
-    /**
118
-     * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property.
119
-     *
120
-     * @return string
121
-     */
122
-    protected function br()
123
-    {
124
-        return $this->_use_break_tags ? EEH_HTML::br() : '';
125
-    }
13
+	/**
14
+	 * This is a flag indicating whether to use '<br>' tags after each input in the layout
15
+	 * strategy.
16
+	 *
17
+	 * @var bool
18
+	 */
19
+	protected $_use_break_tags = true;
20
+
21
+
22
+
23
+	/**
24
+	 * EE_No_Layout constructor.
25
+	 *
26
+	 * @param array $options  Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags
27
+	 *                        property on the class.
28
+	 */
29
+	public function __construct($options = array())
30
+	{
31
+		$this->_use_break_tags = is_array($options) && isset($options['use_break_tags'])
32
+			? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN)
33
+			: $this->_use_break_tags;
34
+		parent::__construct();
35
+	}
36
+
37
+
38
+
39
+	/**
40
+	 * Add line break at beginning of form
41
+	 *
42
+	 * @return string
43
+	 */
44
+	public function layout_form_begin()
45
+	{
46
+		return EEH_HTML::nl(1);
47
+	}
48
+
49
+
50
+
51
+	/**
52
+	 * Lays out the row for the input, including label and errors
53
+	 *
54
+	 * @param EE_Form_Input_Base $input
55
+	 * @return string
56
+	 * @throws \EE_Error
57
+	 */
58
+	public function layout_input($input)
59
+	{
60
+		$html = '';
61
+		if ($input instanceof EE_Hidden_Input) {
62
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
63
+		} elseif ($input instanceof EE_Submit_Input) {
64
+			$html .= $this->br();
65
+			$html .= $input->get_html_for_input();
66
+		} elseif ($input instanceof EE_Select_Input) {
67
+			$html .= $this->br();
68
+			$html .= EEH_HTML::nl(1) . $input->get_html_for_label();
69
+			$html .= EEH_HTML::nl() . $input->get_html_for_errors();
70
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
71
+			$html .= EEH_HTML::nl() . $input->get_html_for_help();
72
+			$html .= $this->br();
73
+		} elseif ($input instanceof EE_Form_Input_With_Options_Base) {
74
+			$html .= $this->br();
75
+			$html .= EEH_HTML::nl() . $input->get_html_for_errors();
76
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
77
+			$html .= EEH_HTML::nl() . $input->get_html_for_help();
78
+		} else {
79
+			$html .= $this->br();
80
+			$html .= EEH_HTML::nl(1) . $input->get_html_for_label();
81
+			$html .= EEH_HTML::nl() . $input->get_html_for_errors();
82
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
83
+			$html .= EEH_HTML::nl() . $input->get_html_for_help();
84
+		}
85
+		$html .= EEH_HTML::nl(-1);
86
+		return $html;
87
+	}
88
+
89
+
90
+
91
+	/**
92
+	 * Lays out a row for the subsection
93
+	 *
94
+	 * @param EE_Form_Section_Proper $form_section
95
+	 * @return string
96
+	 */
97
+	public function layout_subsection($form_section)
98
+	{
99
+		//      d( $form_section );
100
+		return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
101
+	}
102
+
103
+
104
+
105
+	/**
106
+	 * Add line break at end of form.
107
+	 *
108
+	 * @return string
109
+	 */
110
+	public function layout_form_end()
111
+	{
112
+		return EEH_HTML::nl(-1);
113
+	}
114
+
115
+
116
+
117
+	/**
118
+	 * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property.
119
+	 *
120
+	 * @return string
121
+	 */
122
+	protected function br()
123
+	{
124
+		return $this->_use_break_tags ? EEH_HTML::br() : '';
125
+	}
126 126
 }
Please login to merge, or discard this patch.
strategies/validation/EE_Many_Valued_Validation_Strategy.strategy.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -13,58 +13,58 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base
15 15
 {
16
-    protected $_individual_item_validation_strategies = array();
17
-    /**
18
-     *
19
-     * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base)
20
-     */
21
-    public function __construct($individual_item_validation_strategies)
22
-    {
23
-        if (! is_array($individual_item_validation_strategies)) {
24
-            $individual_item_validation_strategies = array($individual_item_validation_strategies);
25
-        }
26
-        $this->_individual_item_validation_strategies = $individual_item_validation_strategies;
27
-        parent::__construct();
28
-    }
16
+	protected $_individual_item_validation_strategies = array();
17
+	/**
18
+	 *
19
+	 * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base)
20
+	 */
21
+	public function __construct($individual_item_validation_strategies)
22
+	{
23
+		if (! is_array($individual_item_validation_strategies)) {
24
+			$individual_item_validation_strategies = array($individual_item_validation_strategies);
25
+		}
26
+		$this->_individual_item_validation_strategies = $individual_item_validation_strategies;
27
+		parent::__construct();
28
+	}
29 29
 
30 30
 
31 31
 
32
-    /**
33
-     * Applies all teh individual item validation strategies on each item in the array
34
-     * @param array $normalized_value
35
-     * @return boolean
36
-     */
37
-    public function validate($normalized_value)
38
-    {
39
-        if (is_array($normalized_value)) {
40
-            $items_to_validate = $normalized_value;
41
-        } else {
42
-            $items_to_validate = array($normalized_value);
43
-        }
44
-        foreach ($items_to_validate as $individual_item) {
45
-            foreach ($this->_individual_item_validation_strategies as $validation_strategy) {
46
-                if ($validation_strategy instanceof EE_Validation_Strategy_Base) {
47
-                    $validation_strategy->validate($individual_item);
48
-                }
49
-            }
50
-        }
51
-        return true;
52
-    }
32
+	/**
33
+	 * Applies all teh individual item validation strategies on each item in the array
34
+	 * @param array $normalized_value
35
+	 * @return boolean
36
+	 */
37
+	public function validate($normalized_value)
38
+	{
39
+		if (is_array($normalized_value)) {
40
+			$items_to_validate = $normalized_value;
41
+		} else {
42
+			$items_to_validate = array($normalized_value);
43
+		}
44
+		foreach ($items_to_validate as $individual_item) {
45
+			foreach ($this->_individual_item_validation_strategies as $validation_strategy) {
46
+				if ($validation_strategy instanceof EE_Validation_Strategy_Base) {
47
+					$validation_strategy->validate($individual_item);
48
+				}
49
+			}
50
+		}
51
+		return true;
52
+	}
53 53
 
54 54
 
55 55
 
56
-    /**
57
-     * Extends parent's _construct_finalize so we ALSO set the input
58
-     * on each sub-validation-strategy
59
-     * @param \EE_Form_Input_Base $form_input
60
-     */
61
-    public function _construct_finalize(\EE_Form_Input_Base $form_input)
62
-    {
63
-        parent::_construct_finalize($form_input);
64
-        foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) {
65
-            if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) {
66
-                $item_validation_strategy->_construct_finalize($form_input);
67
-            }
68
-        }
69
-    }
56
+	/**
57
+	 * Extends parent's _construct_finalize so we ALSO set the input
58
+	 * on each sub-validation-strategy
59
+	 * @param \EE_Form_Input_Base $form_input
60
+	 */
61
+	public function _construct_finalize(\EE_Form_Input_Base $form_input)
62
+	{
63
+		parent::_construct_finalize($form_input);
64
+		foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) {
65
+			if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) {
66
+				$item_validation_strategy->_construct_finalize($form_input);
67
+			}
68
+		}
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function __construct($individual_item_validation_strategies)
22 22
     {
23
-        if (! is_array($individual_item_validation_strategies)) {
23
+        if ( ! is_array($individual_item_validation_strategies)) {
24 24
             $individual_item_validation_strategies = array($individual_item_validation_strategies);
25 25
         }
26 26
         $this->_individual_item_validation_strategies = $individual_item_validation_strategies;
Please login to merge, or discard this patch.