Completed
Branch new-admin-design (7f58b2)
by
unknown
02:54
created
form_sections/strategies/layout/EE_Fieldset_Section_Layout.strategy.php 2 patches
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -12,107 +12,107 @@
 block discarded – undo
12 12
 class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout
13 13
 {
14 14
 
15
-    /**
16
-     * legend_class
17
-     *
18
-     * @var string
19
-     */
20
-    protected $_legend_class;
21
-
22
-    /**
23
-     * legend_text
24
-     *
25
-     * @var string
26
-     */
27
-    protected $_legend_text;
28
-
29
-
30
-
31
-    /**
32
-     *    construct
33
-     *
34
-     * @param array $options
35
-     */
36
-    public function __construct($options = array())
37
-    {
38
-        foreach ($options as $key => $value) {
39
-            $key = '_' . $key;
40
-            if (property_exists($this, $key)) {
41
-                $this->{$key} = $value;
42
-            }
43
-        }
44
-    }
45
-
46
-
47
-
48
-    /**
49
-     * opening div tag for a form
50
-     *
51
-     * @return string
52
-     */
53
-    public function layout_form_begin()
54
-    {
55
-        $html = EEH_HTML::nl(1)
56
-                . '<fieldset id="'
57
-                . $this->_form_section->html_id()
58
-                . '" class="'
59
-                . $this->_form_section->html_class()
60
-                . '" style="'
61
-                . $this->_form_section->html_style()
62
-                . '">';
63
-        $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>';
64
-        return $html;
65
-    }
66
-
67
-
68
-
69
-    /**
70
-     * closing div tag for a form
71
-     *
72
-     * @return string
73
-     */
74
-    public function layout_form_end()
75
-    {
76
-        return EEH_HTML::nl(-1) . '</fieldset>';
77
-    }
78
-
79
-
80
-
81
-    /**
82
-     * @param string $legend_class
83
-     */
84
-    public function set_legend_class($legend_class)
85
-    {
86
-        $this->_legend_class = $legend_class;
87
-    }
88
-
89
-
90
-
91
-    /**
92
-     * @return string
93
-     */
94
-    public function legend_class()
95
-    {
96
-        return $this->_legend_class;
97
-    }
98
-
99
-
100
-
101
-    /**
102
-     * @param string $legend_text
103
-     */
104
-    public function set_legend_text($legend_text)
105
-    {
106
-        $this->_legend_text = $legend_text;
107
-    }
108
-
109
-
110
-
111
-    /**
112
-     * @return string
113
-     */
114
-    public function legend_text()
115
-    {
116
-        return $this->_legend_text;
117
-    }
15
+	/**
16
+	 * legend_class
17
+	 *
18
+	 * @var string
19
+	 */
20
+	protected $_legend_class;
21
+
22
+	/**
23
+	 * legend_text
24
+	 *
25
+	 * @var string
26
+	 */
27
+	protected $_legend_text;
28
+
29
+
30
+
31
+	/**
32
+	 *    construct
33
+	 *
34
+	 * @param array $options
35
+	 */
36
+	public function __construct($options = array())
37
+	{
38
+		foreach ($options as $key => $value) {
39
+			$key = '_' . $key;
40
+			if (property_exists($this, $key)) {
41
+				$this->{$key} = $value;
42
+			}
43
+		}
44
+	}
45
+
46
+
47
+
48
+	/**
49
+	 * opening div tag for a form
50
+	 *
51
+	 * @return string
52
+	 */
53
+	public function layout_form_begin()
54
+	{
55
+		$html = EEH_HTML::nl(1)
56
+				. '<fieldset id="'
57
+				. $this->_form_section->html_id()
58
+				. '" class="'
59
+				. $this->_form_section->html_class()
60
+				. '" style="'
61
+				. $this->_form_section->html_style()
62
+				. '">';
63
+		$html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>';
64
+		return $html;
65
+	}
66
+
67
+
68
+
69
+	/**
70
+	 * closing div tag for a form
71
+	 *
72
+	 * @return string
73
+	 */
74
+	public function layout_form_end()
75
+	{
76
+		return EEH_HTML::nl(-1) . '</fieldset>';
77
+	}
78
+
79
+
80
+
81
+	/**
82
+	 * @param string $legend_class
83
+	 */
84
+	public function set_legend_class($legend_class)
85
+	{
86
+		$this->_legend_class = $legend_class;
87
+	}
88
+
89
+
90
+
91
+	/**
92
+	 * @return string
93
+	 */
94
+	public function legend_class()
95
+	{
96
+		return $this->_legend_class;
97
+	}
98
+
99
+
100
+
101
+	/**
102
+	 * @param string $legend_text
103
+	 */
104
+	public function set_legend_text($legend_text)
105
+	{
106
+		$this->_legend_text = $legend_text;
107
+	}
108
+
109
+
110
+
111
+	/**
112
+	 * @return string
113
+	 */
114
+	public function legend_text()
115
+	{
116
+		return $this->_legend_text;
117
+	}
118 118
 }
Please login to merge, or discard this patch.
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.
form_sections/strategies/layout/EE_Admin_Two_Column_Layout.strategy.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function layout_form_begin($additional_args = array())
17 17
     {
18
-        $this->_form_section->set_html_class($this->_form_section->html_class() . ' form-table');
18
+        $this->_form_section->set_html_class($this->_form_section->html_class().' form-table');
19 19
         return parent::layout_form_begin($additional_args);
20 20
     }
21 21
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
53 53
             || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
54 54
         ) {
55
-            $input->set_html_class($input->html_class() . ' large-text');
55
+            $input->set_html_class($input->html_class().' large-text');
56 56
         }
57 57
         if ($input instanceof EE_Text_Area_Input) {
58 58
             $input->set_rows(4);
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
         $input_html = $input->get_html_for_input();
62 62
         // maybe add errors and help text ?
63 63
         $input_html .= $input->get_html_for_errors() !== ''
64
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
64
+            ? EEH_HTML::nl().$input->get_html_for_errors()
65 65
             : '';
66 66
         $input_html .= $input->get_html_for_help() !== ''
67
-            ? EEH_HTML::nl() . $input->get_html_for_help()
67
+            ? EEH_HTML::nl().$input->get_html_for_help()
68 68
             : '';
69 69
         // overriding parent to add wp admin specific things.
70 70
         $html = '';
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                     '',
79 79
                     '',
80 80
                     'scope="row"'
81
-                ) . EEH_HTML::td($input_html)
81
+                ).EEH_HTML::td($input_html)
82 82
             );
83 83
         }
84 84
         return $html;
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -7,63 +7,63 @@
 block discarded – undo
7 7
 class EE_Admin_Two_Column_Layout extends EE_Two_Column_Layout
8 8
 {
9 9
 
10
-    /**
11
-     * Overriding the parent table layout to include <tbody> tags
12
-     *
13
-     * @param array $additional_args
14
-     * @return string
15
-     */
16
-    public function layout_form_begin($additional_args = array())
17
-    {
18
-        $this->_form_section->set_html_class($this->_form_section->html_class() . ' form-table');
19
-        return parent::layout_form_begin($additional_args);
20
-    }
10
+	/**
11
+	 * Overriding the parent table layout to include <tbody> tags
12
+	 *
13
+	 * @param array $additional_args
14
+	 * @return string
15
+	 */
16
+	public function layout_form_begin($additional_args = array())
17
+	{
18
+		$this->_form_section->set_html_class($this->_form_section->html_class() . ' form-table');
19
+		return parent::layout_form_begin($additional_args);
20
+	}
21 21
 
22 22
 
23 23
 
24
-    /**
25
-     * Lays out the row for the input, including label and errors
26
-     *
27
-     * @param EE_Form_Input_Base $input
28
-     * @return string
29
-     * @throws EE_Error
30
-     */
31
-    public function layout_input($input)
32
-    {
33
-        if (
34
-            $input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
35
-            || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
36
-            || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
37
-        ) {
38
-            $input->set_html_class($input->html_class() . ' large-text');
39
-        }
40
-        if ($input instanceof EE_Text_Area_Input) {
41
-            $input->set_rows(4);
42
-            $input->set_cols(60);
43
-        }
44
-        $input_html = $input->get_html_for_input();
45
-        // maybe add errors and help text ?
46
-        $input_html .= $input->get_html_for_errors() !== ''
47
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
48
-            : '';
49
-        $input_html .= $input->get_html_for_help() !== ''
50
-            ? EEH_HTML::nl() . $input->get_html_for_help()
51
-            : '';
52
-        // overriding parent to add wp admin specific things.
53
-        $html = '';
54
-        if ($input instanceof EE_Hidden_Input) {
55
-            $html .= EEH_HTML::no_row($input->get_html_for_input());
56
-        } else {
57
-            $html .= EEH_HTML::tr(
58
-                EEH_HTML::th(
59
-                    $input->get_html_for_label(),
60
-                    '',
61
-                    '',
62
-                    '',
63
-                    'scope="row"'
64
-                ) . EEH_HTML::td($input_html)
65
-            );
66
-        }
67
-        return $html;
68
-    }
24
+	/**
25
+	 * Lays out the row for the input, including label and errors
26
+	 *
27
+	 * @param EE_Form_Input_Base $input
28
+	 * @return string
29
+	 * @throws EE_Error
30
+	 */
31
+	public function layout_input($input)
32
+	{
33
+		if (
34
+			$input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
35
+			|| $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
36
+			|| $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
37
+		) {
38
+			$input->set_html_class($input->html_class() . ' large-text');
39
+		}
40
+		if ($input instanceof EE_Text_Area_Input) {
41
+			$input->set_rows(4);
42
+			$input->set_cols(60);
43
+		}
44
+		$input_html = $input->get_html_for_input();
45
+		// maybe add errors and help text ?
46
+		$input_html .= $input->get_html_for_errors() !== ''
47
+			? EEH_HTML::nl() . $input->get_html_for_errors()
48
+			: '';
49
+		$input_html .= $input->get_html_for_help() !== ''
50
+			? EEH_HTML::nl() . $input->get_html_for_help()
51
+			: '';
52
+		// overriding parent to add wp admin specific things.
53
+		$html = '';
54
+		if ($input instanceof EE_Hidden_Input) {
55
+			$html .= EEH_HTML::no_row($input->get_html_for_input());
56
+		} else {
57
+			$html .= EEH_HTML::tr(
58
+				EEH_HTML::th(
59
+					$input->get_html_for_label(),
60
+					'',
61
+					'',
62
+					'',
63
+					'scope="row"'
64
+				) . EEH_HTML::td($input_html)
65
+			);
66
+		}
67
+		return $html;
68
+	}
69 69
 }
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
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -12,117 +12,117 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * This is a flag indicating whether to use '<br>' tags after each input in the layout
17
-     * strategy.
18
-     *
19
-     * @var bool
20
-     */
21
-    protected $_use_break_tags = true;
22
-
23
-
24
-
25
-    /**
26
-     * EE_No_Layout constructor.
27
-     *
28
-     * @param array $options  Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags
29
-     *                        property on the class.
30
-     */
31
-    public function __construct($options = array())
32
-    {
33
-        $this->_use_break_tags = is_array($options) && isset($options['use_break_tags'])
34
-            ? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN)
35
-            : $this->_use_break_tags;
36
-        parent::__construct();
37
-    }
38
-
39
-
40
-
41
-    /**
42
-     * Add line break at beginning of form
43
-     *
44
-     * @return string
45
-     */
46
-    public function layout_form_begin()
47
-    {
48
-        return EEH_HTML::nl(1);
49
-    }
50
-
51
-
52
-
53
-    /**
54
-     * Lays out the row for the input, including label and errors
55
-     *
56
-     * @param EE_Form_Input_Base $input
57
-     * @return string
58
-     * @throws \EE_Error
59
-     */
60
-    public function layout_input($input)
61
-    {
62
-        $html = '';
63
-        if ($input instanceof EE_Hidden_Input) {
64
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
65
-        } elseif ($input instanceof EE_Submit_Input) {
66
-            $html .= $this->br();
67
-            $html .= $input->get_html_for_input();
68
-        } elseif ($input instanceof EE_Select_Input) {
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();
74
-            $html .= $this->br();
75
-        } elseif ($input instanceof EE_Form_Input_With_Options_Base) {
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();
80
-        } else {
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();
86
-        }
87
-        $html .= EEH_HTML::nl(-1);
88
-        return $html;
89
-    }
90
-
91
-
92
-
93
-    /**
94
-     * Lays out a row for the subsection
95
-     *
96
-     * @param EE_Form_Section_Proper $form_section
97
-     * @return string
98
-     */
99
-    public function layout_subsection($form_section)
100
-    {
101
-        //      d( $form_section );
102
-        return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
103
-    }
104
-
105
-
106
-
107
-    /**
108
-     * Add line break at end of form.
109
-     *
110
-     * @return string
111
-     */
112
-    public function layout_form_end()
113
-    {
114
-        return EEH_HTML::nl(-1);
115
-    }
116
-
117
-
118
-
119
-    /**
120
-     * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property.
121
-     *
122
-     * @return string
123
-     */
124
-    protected function br()
125
-    {
126
-        return $this->_use_break_tags ? EEH_HTML::br() : '';
127
-    }
15
+	/**
16
+	 * This is a flag indicating whether to use '<br>' tags after each input in the layout
17
+	 * strategy.
18
+	 *
19
+	 * @var bool
20
+	 */
21
+	protected $_use_break_tags = true;
22
+
23
+
24
+
25
+	/**
26
+	 * EE_No_Layout constructor.
27
+	 *
28
+	 * @param array $options  Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags
29
+	 *                        property on the class.
30
+	 */
31
+	public function __construct($options = array())
32
+	{
33
+		$this->_use_break_tags = is_array($options) && isset($options['use_break_tags'])
34
+			? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN)
35
+			: $this->_use_break_tags;
36
+		parent::__construct();
37
+	}
38
+
39
+
40
+
41
+	/**
42
+	 * Add line break at beginning of form
43
+	 *
44
+	 * @return string
45
+	 */
46
+	public function layout_form_begin()
47
+	{
48
+		return EEH_HTML::nl(1);
49
+	}
50
+
51
+
52
+
53
+	/**
54
+	 * Lays out the row for the input, including label and errors
55
+	 *
56
+	 * @param EE_Form_Input_Base $input
57
+	 * @return string
58
+	 * @throws \EE_Error
59
+	 */
60
+	public function layout_input($input)
61
+	{
62
+		$html = '';
63
+		if ($input instanceof EE_Hidden_Input) {
64
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
65
+		} elseif ($input instanceof EE_Submit_Input) {
66
+			$html .= $this->br();
67
+			$html .= $input->get_html_for_input();
68
+		} elseif ($input instanceof EE_Select_Input) {
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();
74
+			$html .= $this->br();
75
+		} elseif ($input instanceof EE_Form_Input_With_Options_Base) {
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();
80
+		} else {
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();
86
+		}
87
+		$html .= EEH_HTML::nl(-1);
88
+		return $html;
89
+	}
90
+
91
+
92
+
93
+	/**
94
+	 * Lays out a row for the subsection
95
+	 *
96
+	 * @param EE_Form_Section_Proper $form_section
97
+	 * @return string
98
+	 */
99
+	public function layout_subsection($form_section)
100
+	{
101
+		//      d( $form_section );
102
+		return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
103
+	}
104
+
105
+
106
+
107
+	/**
108
+	 * Add line break at end of form.
109
+	 *
110
+	 * @return string
111
+	 */
112
+	public function layout_form_end()
113
+	{
114
+		return EEH_HTML::nl(-1);
115
+	}
116
+
117
+
118
+
119
+	/**
120
+	 * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property.
121
+	 *
122
+	 * @return string
123
+	 */
124
+	protected function br()
125
+	{
126
+		return $this->_use_break_tags ? EEH_HTML::br() : '';
127
+	}
128 128
 }
Please login to merge, or discard this patch.
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.
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.
sensitive_data_removal/EE_Sensitive_Data_Removal_Base.strategy.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
  */
12 12
 abstract class EE_Sensitive_Data_Removal_Base extends EE_Form_Input_Strategy_Base
13 13
 {
14
-    /**
15
-     * Removes all the sensitive data from this normalized value.
16
-     * For example, should could 'mask' a credit card from
17
-     * '1234 1234 1234 1234' TO '**** **** **** 1234'.
18
-     * Or turn a ccv number from
19
-     * '123' to '***',
20
-     * or turn a password from
21
-     * 'CantHac7Th15' to '*************',
22
-     * or just leave htevalue as-is
23
-     * @return mixed
24
-     */
25
-    abstract public function remove_sensitive_data($normalized_value);
14
+	/**
15
+	 * Removes all the sensitive data from this normalized value.
16
+	 * For example, should could 'mask' a credit card from
17
+	 * '1234 1234 1234 1234' TO '**** **** **** 1234'.
18
+	 * Or turn a ccv number from
19
+	 * '123' to '***',
20
+	 * or turn a password from
21
+	 * 'CantHac7Th15' to '*************',
22
+	 * or just leave htevalue as-is
23
+	 * @return mixed
24
+	 */
25
+	abstract public function remove_sensitive_data($normalized_value);
26 26
 }
Please login to merge, or discard this patch.
sensitive_data_removal/EE_All_Sensitive_Data_Removal.strategy.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,23 +11,23 @@
 block discarded – undo
11 11
  */
12 12
 class EE_All_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base
13 13
 {
14
-    public function remove_sensitive_data($normalized_value)
15
-    {
16
-        switch (gettype($normalized_value)) {
17
-            case "boolean":
18
-                return false;
19
-            case "integer":
20
-            case "double":
21
-                return 0;
22
-            case "string":
23
-                return '';
24
-            case "array":
25
-                return array();
26
-            case "object":
27
-            case "resource":
28
-            case "NULL":
29
-            default:
30
-                return null;
31
-        }
32
-    }
14
+	public function remove_sensitive_data($normalized_value)
15
+	{
16
+		switch (gettype($normalized_value)) {
17
+			case "boolean":
18
+				return false;
19
+			case "integer":
20
+			case "double":
21
+				return 0;
22
+			case "string":
23
+				return '';
24
+			case "array":
25
+				return array();
26
+			case "object":
27
+			case "resource":
28
+			case "NULL":
29
+			default:
30
+				return null;
31
+		}
32
+	}
33 33
 }
Please login to merge, or discard this patch.
strategies/sensitive_data_removal/EE_No_Sensitive_Data_Removal.strategy.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
  */
12 12
 class EE_No_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base
13 13
 {
14
-    public function remove_sensitive_data($normalized_value)
15
-    {
16
-        return $normalized_value;
17
-    }
14
+	public function remove_sensitive_data($normalized_value)
15
+	{
16
+		return $normalized_value;
17
+	}
18 18
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/base/EE_Form_Section_HTML.form.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,30 +14,30 @@
 block discarded – undo
14 14
 class EE_Form_Section_HTML extends EE_Form_Section_Base
15 15
 {
16 16
 
17
-    protected $_html = '';
17
+	protected $_html = '';
18 18
 
19 19
 
20 20
 
21
-    /**
22
-     * @param string $html
23
-     * @param array $options_array
24
-     */
25
-    public function __construct($html = '', $options_array = array())
26
-    {
27
-        $this->_html = $html;
28
-        parent::__construct($options_array);
29
-    }
21
+	/**
22
+	 * @param string $html
23
+	 * @param array $options_array
24
+	 */
25
+	public function __construct($html = '', $options_array = array())
26
+	{
27
+		$this->_html = $html;
28
+		parent::__construct($options_array);
29
+	}
30 30
 
31 31
 
32 32
 
33
-    /**
34
-     * Returns the HTML
35
-     * @return string
36
-     */
37
-    public function get_html()
38
-    {
39
-        return $this->_html;
40
-    }
33
+	/**
34
+	 * Returns the HTML
35
+	 * @return string
36
+	 */
37
+	public function get_html()
38
+	{
39
+		return $this->_html;
40
+	}
41 41
 }
42 42
 
43 43
 // End of file EE_Form_Section_HTML.form.php
Please login to merge, or discard this patch.