Completed
Branch BUG/tickets-password-protected (b3a330)
by
unknown
09:09 queued 27s
created
strategies/normalization/EE_Credit_Card_Normalization.strategy.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
 class EE_Credit_Card_Normalization extends EE_Text_Normalization
10 10
 {
11 11
 
12
-    /**
13
-     * @param string $value_to_normalize
14
-     * @return mixed
15
-     */
16
-    public function normalize($value_to_normalize)
17
-    {
18
-        $normalized_by_parent = parent::normalize($value_to_normalize);
19
-        // we want to make it consistent, so remove whitespace from cc number
20
-        return preg_replace('/\s+/', '', $normalized_by_parent);
21
-    }
12
+	/**
13
+	 * @param string $value_to_normalize
14
+	 * @return mixed
15
+	 */
16
+	public function normalize($value_to_normalize)
17
+	{
18
+		$normalized_by_parent = parent::normalize($value_to_normalize);
19
+		// we want to make it consistent, so remove whitespace from cc number
20
+		return preg_replace('/\s+/', '', $normalized_by_parent);
21
+	}
22 22
 }
Please login to merge, or discard this patch.
form_sections/strategies/normalization/EE_Text_Normalization.strategy.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -10,38 +10,38 @@
 block discarded – undo
10 10
 class EE_Text_Normalization extends EE_Normalization_Strategy_Base
11 11
 {
12 12
 
13
-    /**
14
-     * @param string $value_to_normalize
15
-     * @return array|mixed|string
16
-     */
17
-    public function normalize($value_to_normalize)
18
-    {
19
-        if (is_array($value_to_normalize)) {
20
-            return (string) array_shift($value_to_normalize);
21
-        }
22
-        // consider `"null"` values to be equivalent to null.
23
-        if ($value_to_normalize === '' || $value_to_normalize === null) {
24
-            return null;
25
-        }
26
-        return (string) $value_to_normalize;
27
-    }
13
+	/**
14
+	 * @param string $value_to_normalize
15
+	 * @return array|mixed|string
16
+	 */
17
+	public function normalize($value_to_normalize)
18
+	{
19
+		if (is_array($value_to_normalize)) {
20
+			return (string) array_shift($value_to_normalize);
21
+		}
22
+		// consider `"null"` values to be equivalent to null.
23
+		if ($value_to_normalize === '' || $value_to_normalize === null) {
24
+			return null;
25
+		}
26
+		return (string) $value_to_normalize;
27
+	}
28 28
 
29 29
 
30 30
 
31
-    /**
32
-     * IF its a string in PHP, it will be a string in the HTML form. easy
33
-     *
34
-     * @param string $normalized_value
35
-     * @return string
36
-     */
37
-    public function unnormalize($normalized_value)
38
-    {
39
-        // account for default "select here" option values
40
-        if ($normalized_value === null) {
41
-            return '';
42
-        }
43
-        // double-check it's a string. It's possible this value was a question option that happened to be a numeric
44
-        // string, in which case PHP has automatically converted it to an integer!
45
-        return (string) $normalized_value;
46
-    }
31
+	/**
32
+	 * IF its a string in PHP, it will be a string in the HTML form. easy
33
+	 *
34
+	 * @param string $normalized_value
35
+	 * @return string
36
+	 */
37
+	public function unnormalize($normalized_value)
38
+	{
39
+		// account for default "select here" option values
40
+		if ($normalized_value === null) {
41
+			return '';
42
+		}
43
+		// double-check it's a string. It's possible this value was a question option that happened to be a numeric
44
+		// string, in which case PHP has automatically converted it to an integer!
45
+		return (string) $normalized_value;
46
+	}
47 47
 }
Please login to merge, or discard this patch.
form_sections/strategies/layout/EE_Form_Section_Layout_Base.strategy.php 2 patches
Indentation   +284 added lines, -284 removed lines patch added patch discarded remove patch
@@ -12,288 +12,288 @@
 block discarded – undo
12 12
 abstract class EE_Form_Section_Layout_Base
13 13
 {
14 14
 
15
-    /**
16
-     * Form form section to lay out
17
-     *
18
-     * @var EE_Form_Section_Proper
19
-     */
20
-    protected $_form_section;
21
-
22
-
23
-
24
-    /**
25
-     *  __construct
26
-     */
27
-    public function __construct()
28
-    {
29
-    }
30
-
31
-
32
-
33
-    /**
34
-     * The form section on which this strategy is to perform
35
-     *
36
-     * @param EE_Form_Section_Proper $form
37
-     */
38
-    public function _construct_finalize(EE_Form_Section_Proper $form)
39
-    {
40
-        $this->_form_section = $form;
41
-    }
42
-
43
-
44
-
45
-    /**
46
-     * @return EE_Form_Section_Proper
47
-     */
48
-    public function form_section()
49
-    {
50
-        return $this->_form_section;
51
-    }
52
-
53
-
54
-
55
-    /**
56
-     * Also has teh side effect of enqueuing any needed JS and CSS for
57
-     * this form.
58
-     * Creates all the HTML necessary for displaying this form, its inputs, and
59
-     * proper subsections.
60
-     * Returns the HTML
61
-     *
62
-     * @return string HTML for displaying
63
-     * @throws EE_Error
64
-     */
65
-    public function layout_form()
66
-    {
67
-        $html = '';
68
-        // layout_form_begin
69
-        $html .= apply_filters(
70
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(),
71
-            $this->layout_form_begin(),
72
-            $this->_form_section
73
-        );
74
-        // layout_form_loop
75
-        $html .= apply_filters(
76
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(),
77
-            $this->layout_form_loop(),
78
-            $this->_form_section
79
-        );
80
-        // layout_form_end
81
-        $html .= apply_filters(
82
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(),
83
-            $this->layout_form_end(),
84
-            $this->_form_section
85
-        );
86
-        $html = $this->add_form_section_hooks_and_filters($html);
87
-        return $html;
88
-    }
89
-
90
-
91
-
92
-    /**
93
-     * @return string
94
-     * @throws EE_Error
95
-     */
96
-    public function layout_form_loop()
97
-    {
98
-        $html = '';
99
-        foreach ($this->_form_section->subsections() as $name => $subsection) {
100
-            if ($subsection instanceof EE_Form_Input_Base) {
101
-                $html .= apply_filters(
102
-                    'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'
103
-                    . $name . '__in_' . $this->_form_section->name(),
104
-                    $this->layout_input($subsection),
105
-                    $this->_form_section,
106
-                    $subsection
107
-                );
108
-            } elseif ($subsection instanceof EE_Form_Section_Base) {
109
-                $html .= apply_filters(
110
-                    'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'
111
-                    . $name . '__in_' . $this->_form_section->name(),
112
-                    $this->layout_subsection($subsection),
113
-                    $this->_form_section,
114
-                    $subsection
115
-                );
116
-            }
117
-        }
118
-        return $html;
119
-    }
120
-
121
-
122
-
123
-    /**
124
-     * Should be used to start teh form section (Eg a table tag, or a div tag, etc.)
125
-     *
126
-     * @return string
127
-     */
128
-    abstract public function layout_form_begin();
129
-
130
-
131
-
132
-    /**
133
-     * Should be used to end the form section (eg a /table tag, or a /div tag, etc)
134
-     *
135
-     * @return string
136
-     */
137
-    abstract public function layout_form_end();
138
-
139
-
140
-
141
-    /**
142
-     * Should be used internally by layout_form() to layout each input (eg, if this layout
143
-     * is putting each input in a row of its own, this should probably be called by a
144
-     *  foreach loop in layout_form() (WITHOUT adding any content directly within layout_form()'s foreach loop.
145
-     * Eg, this method should add the tr and td tags). This method is exposed in case you want to completely
146
-     * customize the form's layout, but would like to make use of it for laying out
147
-     * 'easy-to-layout' inputs
148
-     *
149
-     * @param EE_Form_Input_Base $input
150
-     * @return string html
151
-     */
152
-    abstract public function layout_input($input);
153
-
154
-
155
-
156
-    /**
157
-     * Similar to layout_input(), should be used internally by layout_form() within a
158
-     * loop to layout each proper subsection. Unlike layout_input(), however, it is assumed
159
-     * that the proper subsection will layout its container, label, etc on its own.
160
-     *
161
-     * @param EE_Form_Section_Base $subsection
162
-     * @return string html
163
-     */
164
-    abstract public function layout_subsection($subsection);
165
-
166
-
167
-
168
-    /**
169
-     * Gets the HTML for the label tag and its contents for the input
170
-     *
171
-     * @param EE_Form_Input_Base $input
172
-     * @return string
173
-     */
174
-    public function display_label($input)
175
-    {
176
-        if ($input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
177
-            return '';
178
-        }
179
-        $class = $input->required()
180
-            ? 'ee-required-label ' . $input->html_label_class()
181
-            : $input->html_label_class();
182
-        $label_text = $input->required()
183
-            ? $input->html_label_text() . '<span class="ee-asterisk">*</span>'
184
-            : $input->html_label_text();
185
-        return '<label id="'
186
-               . $input->html_label_id()
187
-               . '" class="'
188
-               . $class
189
-               . '" style="'
190
-               . $input->html_label_style()
191
-               . '" for="' . $input->html_name()
192
-               . '">'
193
-               . $label_text
194
-               . '</label>';
195
-    }
196
-
197
-
198
-
199
-    /**
200
-     * Gets the HTML for all the form's form-wide errors (ie, errors which
201
-     * are not for specific inputs. E.g., if two inputs somehow disagree,
202
-     * those errors would probably be on the form section, not one of its inputs)
203
-     * @return string
204
-     */
205
-    public function display_form_wide_errors()
206
-    {
207
-        $html = '';
208
-        if ($this->_form_section->get_validation_errors()) {
209
-            $html .= "<div class='ee-form-wide-errors'>";
210
-            // get all the errors on THIS form section (errors which aren't
211
-            // for specific inputs, but instead for the entire form section)
212
-            foreach ($this->_form_section->get_validation_errors() as $error) {
213
-                $html .= $error->getMessage() . '<br>';
214
-            }
215
-            $html .= '</div>';
216
-        }
217
-        return apply_filters(
218
-            'FHEE__EE_Form_Section_Layout_Base__display_form_wide_errors',
219
-            $html,
220
-            $this
221
-        );
222
-    }
223
-
224
-
225
-
226
-    /**
227
-     * returns the HTML for the server-side validation errors for the specified input
228
-     * Note that if JS is enabled, it should remove these and instead
229
-     * populate the form's errors in the jquery validate fashion
230
-     * using the localized data provided to the JS
231
-     *
232
-     * @param EE_Form_Input_Base $input
233
-     * @return string
234
-     */
235
-    public function display_errors($input)
236
-    {
237
-        if ($input->get_validation_errors()) {
238
-            return "<label  id='"
239
-                   . $input->html_id()
240
-                   . "-error' class='error' for='{$input->html_name()}'>"
241
-                   . $input->get_validation_error_string()
242
-                   . '</label>';
243
-        }
244
-        return '';
245
-    }
246
-
247
-
248
-
249
-    /**
250
-     * Displays the help span for the specified input
251
-     *
252
-     * @param EE_Form_Input_Base $input
253
-     * @return string
254
-     */
255
-    public function display_help_text($input)
256
-    {
257
-        $help_text  = $input->html_help_text();
258
-        if ($help_text !== '' && $help_text !== null) {
259
-            $tag = is_admin() ? 'p' : 'span';
260
-            return '<'
261
-                   . $tag
262
-                   . ' id="'
263
-                   . $input->html_id()
264
-                   . '-help" class="'
265
-                   . $input->html_help_class()
266
-                   . '" style="'
267
-                   . $input->html_help_style()
268
-                   . '">'
269
-                   . $help_text
270
-                   . '</'
271
-                   . $tag
272
-                   . '>';
273
-        }
274
-        return '';
275
-    }
276
-
277
-
278
-
279
-    /**
280
-     * Does an action and hook onto the end of teh form
281
-     *
282
-     * @param string $html
283
-     * @return string
284
-     */
285
-    public function add_form_section_hooks_and_filters($html)
286
-    {
287
-        // replace dashes and spaces with underscores
288
-        $hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id());
289
-        do_action('AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section);
290
-        $html = (string) apply_filters(
291
-            'AFEE__Form_Section_Layout__' . $hook_name . '__html',
292
-            $html,
293
-            $this->_form_section
294
-        );
295
-        $html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->';
296
-        $html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->';
297
-        return $html;
298
-    }
15
+	/**
16
+	 * Form form section to lay out
17
+	 *
18
+	 * @var EE_Form_Section_Proper
19
+	 */
20
+	protected $_form_section;
21
+
22
+
23
+
24
+	/**
25
+	 *  __construct
26
+	 */
27
+	public function __construct()
28
+	{
29
+	}
30
+
31
+
32
+
33
+	/**
34
+	 * The form section on which this strategy is to perform
35
+	 *
36
+	 * @param EE_Form_Section_Proper $form
37
+	 */
38
+	public function _construct_finalize(EE_Form_Section_Proper $form)
39
+	{
40
+		$this->_form_section = $form;
41
+	}
42
+
43
+
44
+
45
+	/**
46
+	 * @return EE_Form_Section_Proper
47
+	 */
48
+	public function form_section()
49
+	{
50
+		return $this->_form_section;
51
+	}
52
+
53
+
54
+
55
+	/**
56
+	 * Also has teh side effect of enqueuing any needed JS and CSS for
57
+	 * this form.
58
+	 * Creates all the HTML necessary for displaying this form, its inputs, and
59
+	 * proper subsections.
60
+	 * Returns the HTML
61
+	 *
62
+	 * @return string HTML for displaying
63
+	 * @throws EE_Error
64
+	 */
65
+	public function layout_form()
66
+	{
67
+		$html = '';
68
+		// layout_form_begin
69
+		$html .= apply_filters(
70
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(),
71
+			$this->layout_form_begin(),
72
+			$this->_form_section
73
+		);
74
+		// layout_form_loop
75
+		$html .= apply_filters(
76
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(),
77
+			$this->layout_form_loop(),
78
+			$this->_form_section
79
+		);
80
+		// layout_form_end
81
+		$html .= apply_filters(
82
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(),
83
+			$this->layout_form_end(),
84
+			$this->_form_section
85
+		);
86
+		$html = $this->add_form_section_hooks_and_filters($html);
87
+		return $html;
88
+	}
89
+
90
+
91
+
92
+	/**
93
+	 * @return string
94
+	 * @throws EE_Error
95
+	 */
96
+	public function layout_form_loop()
97
+	{
98
+		$html = '';
99
+		foreach ($this->_form_section->subsections() as $name => $subsection) {
100
+			if ($subsection instanceof EE_Form_Input_Base) {
101
+				$html .= apply_filters(
102
+					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'
103
+					. $name . '__in_' . $this->_form_section->name(),
104
+					$this->layout_input($subsection),
105
+					$this->_form_section,
106
+					$subsection
107
+				);
108
+			} elseif ($subsection instanceof EE_Form_Section_Base) {
109
+				$html .= apply_filters(
110
+					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'
111
+					. $name . '__in_' . $this->_form_section->name(),
112
+					$this->layout_subsection($subsection),
113
+					$this->_form_section,
114
+					$subsection
115
+				);
116
+			}
117
+		}
118
+		return $html;
119
+	}
120
+
121
+
122
+
123
+	/**
124
+	 * Should be used to start teh form section (Eg a table tag, or a div tag, etc.)
125
+	 *
126
+	 * @return string
127
+	 */
128
+	abstract public function layout_form_begin();
129
+
130
+
131
+
132
+	/**
133
+	 * Should be used to end the form section (eg a /table tag, or a /div tag, etc)
134
+	 *
135
+	 * @return string
136
+	 */
137
+	abstract public function layout_form_end();
138
+
139
+
140
+
141
+	/**
142
+	 * Should be used internally by layout_form() to layout each input (eg, if this layout
143
+	 * is putting each input in a row of its own, this should probably be called by a
144
+	 *  foreach loop in layout_form() (WITHOUT adding any content directly within layout_form()'s foreach loop.
145
+	 * Eg, this method should add the tr and td tags). This method is exposed in case you want to completely
146
+	 * customize the form's layout, but would like to make use of it for laying out
147
+	 * 'easy-to-layout' inputs
148
+	 *
149
+	 * @param EE_Form_Input_Base $input
150
+	 * @return string html
151
+	 */
152
+	abstract public function layout_input($input);
153
+
154
+
155
+
156
+	/**
157
+	 * Similar to layout_input(), should be used internally by layout_form() within a
158
+	 * loop to layout each proper subsection. Unlike layout_input(), however, it is assumed
159
+	 * that the proper subsection will layout its container, label, etc on its own.
160
+	 *
161
+	 * @param EE_Form_Section_Base $subsection
162
+	 * @return string html
163
+	 */
164
+	abstract public function layout_subsection($subsection);
165
+
166
+
167
+
168
+	/**
169
+	 * Gets the HTML for the label tag and its contents for the input
170
+	 *
171
+	 * @param EE_Form_Input_Base $input
172
+	 * @return string
173
+	 */
174
+	public function display_label($input)
175
+	{
176
+		if ($input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
177
+			return '';
178
+		}
179
+		$class = $input->required()
180
+			? 'ee-required-label ' . $input->html_label_class()
181
+			: $input->html_label_class();
182
+		$label_text = $input->required()
183
+			? $input->html_label_text() . '<span class="ee-asterisk">*</span>'
184
+			: $input->html_label_text();
185
+		return '<label id="'
186
+			   . $input->html_label_id()
187
+			   . '" class="'
188
+			   . $class
189
+			   . '" style="'
190
+			   . $input->html_label_style()
191
+			   . '" for="' . $input->html_name()
192
+			   . '">'
193
+			   . $label_text
194
+			   . '</label>';
195
+	}
196
+
197
+
198
+
199
+	/**
200
+	 * Gets the HTML for all the form's form-wide errors (ie, errors which
201
+	 * are not for specific inputs. E.g., if two inputs somehow disagree,
202
+	 * those errors would probably be on the form section, not one of its inputs)
203
+	 * @return string
204
+	 */
205
+	public function display_form_wide_errors()
206
+	{
207
+		$html = '';
208
+		if ($this->_form_section->get_validation_errors()) {
209
+			$html .= "<div class='ee-form-wide-errors'>";
210
+			// get all the errors on THIS form section (errors which aren't
211
+			// for specific inputs, but instead for the entire form section)
212
+			foreach ($this->_form_section->get_validation_errors() as $error) {
213
+				$html .= $error->getMessage() . '<br>';
214
+			}
215
+			$html .= '</div>';
216
+		}
217
+		return apply_filters(
218
+			'FHEE__EE_Form_Section_Layout_Base__display_form_wide_errors',
219
+			$html,
220
+			$this
221
+		);
222
+	}
223
+
224
+
225
+
226
+	/**
227
+	 * returns the HTML for the server-side validation errors for the specified input
228
+	 * Note that if JS is enabled, it should remove these and instead
229
+	 * populate the form's errors in the jquery validate fashion
230
+	 * using the localized data provided to the JS
231
+	 *
232
+	 * @param EE_Form_Input_Base $input
233
+	 * @return string
234
+	 */
235
+	public function display_errors($input)
236
+	{
237
+		if ($input->get_validation_errors()) {
238
+			return "<label  id='"
239
+				   . $input->html_id()
240
+				   . "-error' class='error' for='{$input->html_name()}'>"
241
+				   . $input->get_validation_error_string()
242
+				   . '</label>';
243
+		}
244
+		return '';
245
+	}
246
+
247
+
248
+
249
+	/**
250
+	 * Displays the help span for the specified input
251
+	 *
252
+	 * @param EE_Form_Input_Base $input
253
+	 * @return string
254
+	 */
255
+	public function display_help_text($input)
256
+	{
257
+		$help_text  = $input->html_help_text();
258
+		if ($help_text !== '' && $help_text !== null) {
259
+			$tag = is_admin() ? 'p' : 'span';
260
+			return '<'
261
+				   . $tag
262
+				   . ' id="'
263
+				   . $input->html_id()
264
+				   . '-help" class="'
265
+				   . $input->html_help_class()
266
+				   . '" style="'
267
+				   . $input->html_help_style()
268
+				   . '">'
269
+				   . $help_text
270
+				   . '</'
271
+				   . $tag
272
+				   . '>';
273
+		}
274
+		return '';
275
+	}
276
+
277
+
278
+
279
+	/**
280
+	 * Does an action and hook onto the end of teh form
281
+	 *
282
+	 * @param string $html
283
+	 * @return string
284
+	 */
285
+	public function add_form_section_hooks_and_filters($html)
286
+	{
287
+		// replace dashes and spaces with underscores
288
+		$hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id());
289
+		do_action('AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section);
290
+		$html = (string) apply_filters(
291
+			'AFEE__Form_Section_Layout__' . $hook_name . '__html',
292
+			$html,
293
+			$this->_form_section
294
+		);
295
+		$html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->';
296
+		$html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->';
297
+		return $html;
298
+	}
299 299
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
         $html = '';
68 68
         // layout_form_begin
69 69
         $html .= apply_filters(
70
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(),
70
+            'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_'.$this->_form_section->name(),
71 71
             $this->layout_form_begin(),
72 72
             $this->_form_section
73 73
         );
74 74
         // layout_form_loop
75 75
         $html .= apply_filters(
76
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(),
76
+            'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_'.$this->_form_section->name(),
77 77
             $this->layout_form_loop(),
78 78
             $this->_form_section
79 79
         );
80 80
         // layout_form_end
81 81
         $html .= apply_filters(
82
-            'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(),
82
+            'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_'.$this->_form_section->name(),
83 83
             $this->layout_form_end(),
84 84
             $this->_form_section
85 85
         );
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             if ($subsection instanceof EE_Form_Input_Base) {
101 101
                 $html .= apply_filters(
102 102
                     'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'
103
-                    . $name . '__in_' . $this->_form_section->name(),
103
+                    . $name.'__in_'.$this->_form_section->name(),
104 104
                     $this->layout_input($subsection),
105 105
                     $this->_form_section,
106 106
                     $subsection
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             } elseif ($subsection instanceof EE_Form_Section_Base) {
109 109
                 $html .= apply_filters(
110 110
                     'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'
111
-                    . $name . '__in_' . $this->_form_section->name(),
111
+                    . $name.'__in_'.$this->_form_section->name(),
112 112
                     $this->layout_subsection($subsection),
113 113
                     $this->_form_section,
114 114
                     $subsection
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
             return '';
178 178
         }
179 179
         $class = $input->required()
180
-            ? 'ee-required-label ' . $input->html_label_class()
180
+            ? 'ee-required-label '.$input->html_label_class()
181 181
             : $input->html_label_class();
182 182
         $label_text = $input->required()
183
-            ? $input->html_label_text() . '<span class="ee-asterisk">*</span>'
183
+            ? $input->html_label_text().'<span class="ee-asterisk">*</span>'
184 184
             : $input->html_label_text();
185 185
         return '<label id="'
186 186
                . $input->html_label_id()
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                . $class
189 189
                . '" style="'
190 190
                . $input->html_label_style()
191
-               . '" for="' . $input->html_name()
191
+               . '" for="'.$input->html_name()
192 192
                . '">'
193 193
                . $label_text
194 194
                . '</label>';
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             // get all the errors on THIS form section (errors which aren't
211 211
             // for specific inputs, but instead for the entire form section)
212 212
             foreach ($this->_form_section->get_validation_errors() as $error) {
213
-                $html .= $error->getMessage() . '<br>';
213
+                $html .= $error->getMessage().'<br>';
214 214
             }
215 215
             $html .= '</div>';
216 216
         }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function display_help_text($input)
256 256
     {
257
-        $help_text  = $input->html_help_text();
257
+        $help_text = $input->html_help_text();
258 258
         if ($help_text !== '' && $help_text !== null) {
259 259
             $tag = is_admin() ? 'p' : 'span';
260 260
             return '<'
@@ -286,14 +286,14 @@  discard block
 block discarded – undo
286 286
     {
287 287
         // replace dashes and spaces with underscores
288 288
         $hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id());
289
-        do_action('AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section);
289
+        do_action('AHEE__Form_Section_Layout__'.$hook_name, $this->_form_section);
290 290
         $html = (string) apply_filters(
291
-            'AFEE__Form_Section_Layout__' . $hook_name . '__html',
291
+            'AFEE__Form_Section_Layout__'.$hook_name.'__html',
292 292
             $html,
293 293
             $this->_form_section
294 294
         );
295
-        $html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->';
296
-        $html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->';
295
+        $html .= EEH_HTML::nl().'<!-- AHEE__Form_Section_Layout__'.$hook_name.'__html -->';
296
+        $html .= EEH_HTML::nl().'<!-- AFEE__Form_Section_Layout__'.$hook_name.' -->';
297 297
         return $html;
298 298
     }
299 299
 }
Please login to merge, or discard this patch.
libraries/form_sections/strategies/layout/EE_Template_Layout.strategy.php 2 patches
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -23,200 +23,200 @@
 block discarded – undo
23 23
 class EE_Template_Layout extends EE_Div_Per_Section_Layout
24 24
 {
25 25
 
26
-    protected $_layout_template_file       = null;
27
-
28
-    protected $_layout_begin_template_file = null;
29
-
30
-    protected $_input_template_file        = null;
31
-
32
-    protected $_subsection_template_file   = null;
33
-
34
-    protected $_layout_end_template_file   = null;
35
-
36
-    protected $_template_args              = array();
37
-
38
-
39
-
40
-    /**
41
-     * @param array $template_options {
42
-     * @type string $_layout_template_file
43
-     * @type string $_begin_template_file
44
-     * @type string $_input_template_file
45
-     * @type string $_subsection_template_file
46
-     * @type string $_end_template_file
47
-     * @type array  $_template_args
48
-     *                                }
49
-     */
50
-    public function __construct($template_options = array())
51
-    {
52
-        // loop through incoming options
53
-        foreach ($template_options as $key => $value) {
54
-            // add underscore to $key to match property names
55
-            $_key = '_' . $key;
56
-            if (property_exists($this, $_key)) {
57
-                $this->{$_key} = $value;
58
-            }
59
-        }
60
-        parent::__construct();
61
-    }
62
-
63
-
64
-
65
-    /**
66
-     * Also has the side effect of enqueuing any needed JS and CSS for
67
-     * this form.
68
-     * Creates all the HTML necessary for displaying this form, its inputs, and
69
-     * proper subsections.
70
-     * Returns the HTML
71
-     *
72
-     * @return string
73
-     */
74
-    public function layout_form()
75
-    {
76
-        if ($this->_layout_template_file) {
77
-            return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), true, true);
78
-        } else {
79
-            return parent::layout_form();
80
-        }
81
-    }
82
-
83
-
84
-
85
-    /**
86
-     * opening div tag for a form
87
-     *
88
-     * @return string
89
-     */
90
-    public function layout_form_begin()
91
-    {
92
-        if ($this->_layout_begin_template_file) {
93
-            return EEH_Template::locate_template(
94
-                $this->_layout_begin_template_file,
95
-                $this->template_args(),
96
-                true,
97
-                true
98
-            );
99
-        } else {
100
-            return parent::layout_form_begin();
101
-        }
102
-    }
103
-
104
-
105
-
106
-    /**
107
-     * If an input_template_file was provided upon construction, uses that to layout the input. Otherwise uses parent.
108
-     *
109
-     * @see EE_DIv_Per_Section_Layout::layout_input() for documentation
110
-     * @param EE_Form_Input_Base $input
111
-     * @return string
112
-     */
113
-    public function layout_input($input)
114
-    {
115
-        if ($this->_input_template_file) {
116
-            return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), true, true);
117
-        }
118
-        return parent::layout_input($input);
119
-    }
120
-
121
-
122
-
123
-    /**
124
-     * If a subsection_template_file was provided upon construction, uses that to layout the subsection. Otherwise uses parent.
125
-     *
126
-     * @see EE_Div_Per_Section_Layout::layout_subsection() for documentation
127
-     * @param EE_Form_Section_Proper $form_section
128
-     * @return string
129
-     */
130
-    public function layout_subsection($form_section)
131
-    {
132
-        if ($this->_subsection_template_file) {
133
-            return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), true, true);
134
-        }
135
-        return parent::layout_subsection($form_section);
136
-    }
137
-
138
-
139
-
140
-    /**
141
-     * closing div tag for a form
142
-     *
143
-     * @return string
144
-     */
145
-    public function layout_form_end()
146
-    {
147
-        if ($this->_layout_end_template_file) {
148
-            return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), true, true);
149
-        } else {
150
-            return parent::layout_form_end();
151
-        }
152
-    }
153
-
154
-
155
-
156
-    /**
157
-     * @param array $template_args
158
-     */
159
-    public function set_template_args($template_args = array())
160
-    {
161
-        $this->_template_args = $template_args;
162
-    }
163
-
164
-
165
-
166
-    /**
167
-     * @param array $template_args
168
-     */
169
-    public function add_template_args($template_args = array())
170
-    {
171
-        $this->_template_args = array_merge_recursive($this->_template_args, $template_args);
172
-    }
173
-
174
-
175
-
176
-    /**
177
-     * @return array
178
-     */
179
-    public function template_args()
180
-    {
181
-        foreach ($this->form_section()->subsections() as $subsection_name => $subsection) {
182
-            $subsection_name = self::prep_form_subsection_key_name($subsection_name);
183
-            if (strpos($subsection_name, '[') !== false) {
184
-                $sub_name = explode('[', $subsection_name);
185
-                $this->_template_args[ $sub_name[0] ][ rtrim($sub_name[1], ']') ] = $this->layout_subsection($subsection);
186
-            } else {
187
-                $this->_template_args[ $subsection_name ] = $this->layout_subsection($subsection);
188
-            }
189
-        }
190
-        //      d( $this->_template_args );
191
-        return $this->_template_args;
192
-    }
193
-
194
-
195
-
196
-    /**
197
-     * prep_form_section_key_name
198
-     *
199
-     * @access public
200
-     * @param string $subsection_name
201
-     * @return string
202
-     */
203
-    public static function prep_form_subsection_key_name($subsection_name = '')
204
-    {
205
-        $subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name);
206
-        return is_numeric(substr($subsection_name, 0, 1)) ? 'form_' . $subsection_name : $subsection_name;
207
-    }
208
-
209
-
210
-
211
-    /**
212
-     * get_subform - just a wrapper for the above method
213
-     *
214
-     * @access public
215
-     * @param string $subsection_name
216
-     * @return string
217
-     */
218
-    public static function get_subform_name($subsection_name = '')
219
-    {
220
-        return EE_Template_Layout::prep_form_subsection_key_name($subsection_name);
221
-    }
26
+	protected $_layout_template_file       = null;
27
+
28
+	protected $_layout_begin_template_file = null;
29
+
30
+	protected $_input_template_file        = null;
31
+
32
+	protected $_subsection_template_file   = null;
33
+
34
+	protected $_layout_end_template_file   = null;
35
+
36
+	protected $_template_args              = array();
37
+
38
+
39
+
40
+	/**
41
+	 * @param array $template_options {
42
+	 * @type string $_layout_template_file
43
+	 * @type string $_begin_template_file
44
+	 * @type string $_input_template_file
45
+	 * @type string $_subsection_template_file
46
+	 * @type string $_end_template_file
47
+	 * @type array  $_template_args
48
+	 *                                }
49
+	 */
50
+	public function __construct($template_options = array())
51
+	{
52
+		// loop through incoming options
53
+		foreach ($template_options as $key => $value) {
54
+			// add underscore to $key to match property names
55
+			$_key = '_' . $key;
56
+			if (property_exists($this, $_key)) {
57
+				$this->{$_key} = $value;
58
+			}
59
+		}
60
+		parent::__construct();
61
+	}
62
+
63
+
64
+
65
+	/**
66
+	 * Also has the side effect of enqueuing any needed JS and CSS for
67
+	 * this form.
68
+	 * Creates all the HTML necessary for displaying this form, its inputs, and
69
+	 * proper subsections.
70
+	 * Returns the HTML
71
+	 *
72
+	 * @return string
73
+	 */
74
+	public function layout_form()
75
+	{
76
+		if ($this->_layout_template_file) {
77
+			return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), true, true);
78
+		} else {
79
+			return parent::layout_form();
80
+		}
81
+	}
82
+
83
+
84
+
85
+	/**
86
+	 * opening div tag for a form
87
+	 *
88
+	 * @return string
89
+	 */
90
+	public function layout_form_begin()
91
+	{
92
+		if ($this->_layout_begin_template_file) {
93
+			return EEH_Template::locate_template(
94
+				$this->_layout_begin_template_file,
95
+				$this->template_args(),
96
+				true,
97
+				true
98
+			);
99
+		} else {
100
+			return parent::layout_form_begin();
101
+		}
102
+	}
103
+
104
+
105
+
106
+	/**
107
+	 * If an input_template_file was provided upon construction, uses that to layout the input. Otherwise uses parent.
108
+	 *
109
+	 * @see EE_DIv_Per_Section_Layout::layout_input() for documentation
110
+	 * @param EE_Form_Input_Base $input
111
+	 * @return string
112
+	 */
113
+	public function layout_input($input)
114
+	{
115
+		if ($this->_input_template_file) {
116
+			return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), true, true);
117
+		}
118
+		return parent::layout_input($input);
119
+	}
120
+
121
+
122
+
123
+	/**
124
+	 * If a subsection_template_file was provided upon construction, uses that to layout the subsection. Otherwise uses parent.
125
+	 *
126
+	 * @see EE_Div_Per_Section_Layout::layout_subsection() for documentation
127
+	 * @param EE_Form_Section_Proper $form_section
128
+	 * @return string
129
+	 */
130
+	public function layout_subsection($form_section)
131
+	{
132
+		if ($this->_subsection_template_file) {
133
+			return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), true, true);
134
+		}
135
+		return parent::layout_subsection($form_section);
136
+	}
137
+
138
+
139
+
140
+	/**
141
+	 * closing div tag for a form
142
+	 *
143
+	 * @return string
144
+	 */
145
+	public function layout_form_end()
146
+	{
147
+		if ($this->_layout_end_template_file) {
148
+			return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), true, true);
149
+		} else {
150
+			return parent::layout_form_end();
151
+		}
152
+	}
153
+
154
+
155
+
156
+	/**
157
+	 * @param array $template_args
158
+	 */
159
+	public function set_template_args($template_args = array())
160
+	{
161
+		$this->_template_args = $template_args;
162
+	}
163
+
164
+
165
+
166
+	/**
167
+	 * @param array $template_args
168
+	 */
169
+	public function add_template_args($template_args = array())
170
+	{
171
+		$this->_template_args = array_merge_recursive($this->_template_args, $template_args);
172
+	}
173
+
174
+
175
+
176
+	/**
177
+	 * @return array
178
+	 */
179
+	public function template_args()
180
+	{
181
+		foreach ($this->form_section()->subsections() as $subsection_name => $subsection) {
182
+			$subsection_name = self::prep_form_subsection_key_name($subsection_name);
183
+			if (strpos($subsection_name, '[') !== false) {
184
+				$sub_name = explode('[', $subsection_name);
185
+				$this->_template_args[ $sub_name[0] ][ rtrim($sub_name[1], ']') ] = $this->layout_subsection($subsection);
186
+			} else {
187
+				$this->_template_args[ $subsection_name ] = $this->layout_subsection($subsection);
188
+			}
189
+		}
190
+		//      d( $this->_template_args );
191
+		return $this->_template_args;
192
+	}
193
+
194
+
195
+
196
+	/**
197
+	 * prep_form_section_key_name
198
+	 *
199
+	 * @access public
200
+	 * @param string $subsection_name
201
+	 * @return string
202
+	 */
203
+	public static function prep_form_subsection_key_name($subsection_name = '')
204
+	{
205
+		$subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name);
206
+		return is_numeric(substr($subsection_name, 0, 1)) ? 'form_' . $subsection_name : $subsection_name;
207
+	}
208
+
209
+
210
+
211
+	/**
212
+	 * get_subform - just a wrapper for the above method
213
+	 *
214
+	 * @access public
215
+	 * @param string $subsection_name
216
+	 * @return string
217
+	 */
218
+	public static function get_subform_name($subsection_name = '')
219
+	{
220
+		return EE_Template_Layout::prep_form_subsection_key_name($subsection_name);
221
+	}
222 222
 }
Please login to merge, or discard this patch.
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.
form_sections/strategies/layout/EE_Div_Per_Section_Layout.strategy.php 2 patches
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -14,136 +14,136 @@
 block discarded – undo
14 14
 class EE_Div_Per_Section_Layout extends EE_Form_Section_Layout_Base
15 15
 {
16 16
 
17
-    /**
18
-     * opening div tag for a form
19
-     *
20
-     * @return string
21
-     */
22
-    public function layout_form_begin()
23
-    {
24
-        return EEH_HTML::div(
25
-            '',
26
-            $this->_form_section->html_id(),
27
-            $this->_form_section->html_class(),
28
-            $this->_form_section->html_style()
29
-        );
30
-    }
31
-
32
-
33
-
34
-    /**
35
-     * Lays out the row for the input, including label and errors
36
-     *
37
-     * @param EE_Form_Input_Base $input
38
-     * @return string
39
-     * @throws \EE_Error
40
-     */
41
-    public function layout_input($input)
42
-    {
43
-        $html = '';
44
-        // set something unique for the id
45
-        $html_id = (string) $input->html_id() !== ''
46
-            ? (string) $input->html_id()
47
-            : spl_object_hash($input);
48
-        // and add a generic input type class
49
-        $html_class = sanitize_key(str_replace('_', '-', get_class($input))) . '-dv';
50
-        if ($input instanceof EE_Hidden_Input) {
51
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
52
-        } elseif ($input instanceof EE_Submit_Input) {
53
-            $html .= EEH_HTML::div(
54
-                $input->get_html_for_input(),
55
-                $html_id . '-submit-dv',
56
-                "{$input->html_class()}-submit-dv {$html_class}"
57
-            );
58
-        } elseif ($input instanceof EE_Select_Input) {
59
-            $html .= EEH_HTML::div(
60
-                EEH_HTML::nl(1) . $input->get_html_for_label() .
61
-                EEH_HTML::nl() . $input->get_html_for_errors() .
62
-                EEH_HTML::nl() . $input->get_html_for_input() .
63
-                EEH_HTML::nl() . $input->get_html_for_help(),
64
-                $html_id . '-input-dv',
65
-                "{$input->html_class()}-input-dv {$html_class}"
66
-            );
67
-        } elseif ($input instanceof EE_Form_Input_With_Options_Base) {
68
-            $html .= EEH_HTML::div(
69
-                EEH_HTML::nl() . $this->_display_label_for_option_type_question($input) .
70
-                EEH_HTML::nl() . $input->get_html_for_errors() .
71
-                EEH_HTML::nl() . $input->get_html_for_input() .
72
-                EEH_HTML::nl() . $input->get_html_for_help(),
73
-                $html_id . '-input-dv',
74
-                "{$input->html_class()}-input-dv {$html_class}"
75
-            );
76
-        } else {
77
-            $html .= EEH_HTML::div(
78
-                EEH_HTML::nl(1) . $input->get_html_for_label() .
79
-                EEH_HTML::nl() . $input->get_html_for_errors() .
80
-                EEH_HTML::nl() . $input->get_html_for_input() .
81
-                EEH_HTML::nl() . $input->get_html_for_help(),
82
-                $html_id . '-input-dv',
83
-                "{$input->html_class()}-input-dv {$html_class}"
84
-            );
85
-        }
86
-        return $html;
87
-    }
88
-
89
-
90
-
91
-    /**
92
-     *
93
-     * _display_label_for_option_type_question
94
-     * Gets the HTML for the 'label', which is just text for this (because labels
95
-     * should be for each input)
96
-     *
97
-     * @param EE_Form_Input_With_Options_Base $input
98
-     * @return string
99
-     */
100
-    protected function _display_label_for_option_type_question(EE_Form_Input_With_Options_Base $input)
101
-    {
102
-        if ($input->display_html_label_text()) {
103
-            $html_label_text = $input->html_label_text();
104
-            $label_html = EEH_HTML::div(
105
-                $input->required()
106
-                    ? $html_label_text . EEH_HTML::span('*', '', 'ee-asterisk')
107
-                    : $html_label_text,
108
-                $input->html_label_id(),
109
-                $input->required()
110
-                    ? 'ee-required-label ' . $input->html_label_class()
111
-                    : $input->html_label_class(),
112
-                $input->html_label_style(),
113
-                $input->html_other_attributes()
114
-            );
115
-            // if no content was provided to EEH_HTML::div() above (ie: an empty label),
116
-            // then we need to close the div manually
117
-            if (empty($html_label_text)) {
118
-                $label_html .= EEH_HTML::divx($input->html_label_id(), $input->html_label_class());
119
-            }
120
-            return $label_html;
121
-        }
122
-        return '';
123
-    }
124
-
125
-
126
-
127
-    /**
128
-     * Lays out a row for the subsection
129
-     *
130
-     * @param EE_Form_Section_Proper $form_section
131
-     * @return string
132
-     */
133
-    public function layout_subsection($form_section)
134
-    {
135
-        return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
136
-    }
137
-
138
-
139
-
140
-    /**
141
-     * closing div tag for a form
142
-     *
143
-     * @return string
144
-     */
145
-    public function layout_form_end()
146
-    {
147
-        return EEH_HTML::divx($this->_form_section->html_id(), $this->_form_section->html_class());
148
-    }
17
+	/**
18
+	 * opening div tag for a form
19
+	 *
20
+	 * @return string
21
+	 */
22
+	public function layout_form_begin()
23
+	{
24
+		return EEH_HTML::div(
25
+			'',
26
+			$this->_form_section->html_id(),
27
+			$this->_form_section->html_class(),
28
+			$this->_form_section->html_style()
29
+		);
30
+	}
31
+
32
+
33
+
34
+	/**
35
+	 * Lays out the row for the input, including label and errors
36
+	 *
37
+	 * @param EE_Form_Input_Base $input
38
+	 * @return string
39
+	 * @throws \EE_Error
40
+	 */
41
+	public function layout_input($input)
42
+	{
43
+		$html = '';
44
+		// set something unique for the id
45
+		$html_id = (string) $input->html_id() !== ''
46
+			? (string) $input->html_id()
47
+			: spl_object_hash($input);
48
+		// and add a generic input type class
49
+		$html_class = sanitize_key(str_replace('_', '-', get_class($input))) . '-dv';
50
+		if ($input instanceof EE_Hidden_Input) {
51
+			$html .= EEH_HTML::nl() . $input->get_html_for_input();
52
+		} elseif ($input instanceof EE_Submit_Input) {
53
+			$html .= EEH_HTML::div(
54
+				$input->get_html_for_input(),
55
+				$html_id . '-submit-dv',
56
+				"{$input->html_class()}-submit-dv {$html_class}"
57
+			);
58
+		} elseif ($input instanceof EE_Select_Input) {
59
+			$html .= EEH_HTML::div(
60
+				EEH_HTML::nl(1) . $input->get_html_for_label() .
61
+				EEH_HTML::nl() . $input->get_html_for_errors() .
62
+				EEH_HTML::nl() . $input->get_html_for_input() .
63
+				EEH_HTML::nl() . $input->get_html_for_help(),
64
+				$html_id . '-input-dv',
65
+				"{$input->html_class()}-input-dv {$html_class}"
66
+			);
67
+		} elseif ($input instanceof EE_Form_Input_With_Options_Base) {
68
+			$html .= EEH_HTML::div(
69
+				EEH_HTML::nl() . $this->_display_label_for_option_type_question($input) .
70
+				EEH_HTML::nl() . $input->get_html_for_errors() .
71
+				EEH_HTML::nl() . $input->get_html_for_input() .
72
+				EEH_HTML::nl() . $input->get_html_for_help(),
73
+				$html_id . '-input-dv',
74
+				"{$input->html_class()}-input-dv {$html_class}"
75
+			);
76
+		} else {
77
+			$html .= EEH_HTML::div(
78
+				EEH_HTML::nl(1) . $input->get_html_for_label() .
79
+				EEH_HTML::nl() . $input->get_html_for_errors() .
80
+				EEH_HTML::nl() . $input->get_html_for_input() .
81
+				EEH_HTML::nl() . $input->get_html_for_help(),
82
+				$html_id . '-input-dv',
83
+				"{$input->html_class()}-input-dv {$html_class}"
84
+			);
85
+		}
86
+		return $html;
87
+	}
88
+
89
+
90
+
91
+	/**
92
+	 *
93
+	 * _display_label_for_option_type_question
94
+	 * Gets the HTML for the 'label', which is just text for this (because labels
95
+	 * should be for each input)
96
+	 *
97
+	 * @param EE_Form_Input_With_Options_Base $input
98
+	 * @return string
99
+	 */
100
+	protected function _display_label_for_option_type_question(EE_Form_Input_With_Options_Base $input)
101
+	{
102
+		if ($input->display_html_label_text()) {
103
+			$html_label_text = $input->html_label_text();
104
+			$label_html = EEH_HTML::div(
105
+				$input->required()
106
+					? $html_label_text . EEH_HTML::span('*', '', 'ee-asterisk')
107
+					: $html_label_text,
108
+				$input->html_label_id(),
109
+				$input->required()
110
+					? 'ee-required-label ' . $input->html_label_class()
111
+					: $input->html_label_class(),
112
+				$input->html_label_style(),
113
+				$input->html_other_attributes()
114
+			);
115
+			// if no content was provided to EEH_HTML::div() above (ie: an empty label),
116
+			// then we need to close the div manually
117
+			if (empty($html_label_text)) {
118
+				$label_html .= EEH_HTML::divx($input->html_label_id(), $input->html_label_class());
119
+			}
120
+			return $label_html;
121
+		}
122
+		return '';
123
+	}
124
+
125
+
126
+
127
+	/**
128
+	 * Lays out a row for the subsection
129
+	 *
130
+	 * @param EE_Form_Section_Proper $form_section
131
+	 * @return string
132
+	 */
133
+	public function layout_subsection($form_section)
134
+	{
135
+		return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
136
+	}
137
+
138
+
139
+
140
+	/**
141
+	 * closing div tag for a form
142
+	 *
143
+	 * @return string
144
+	 */
145
+	public function layout_form_end()
146
+	{
147
+		return EEH_HTML::divx($this->_form_section->html_id(), $this->_form_section->html_class());
148
+	}
149 149
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -46,40 +46,40 @@  discard block
 block discarded – undo
46 46
             ? (string) $input->html_id()
47 47
             : spl_object_hash($input);
48 48
         // and add a generic input type class
49
-        $html_class = sanitize_key(str_replace('_', '-', get_class($input))) . '-dv';
49
+        $html_class = sanitize_key(str_replace('_', '-', get_class($input))).'-dv';
50 50
         if ($input instanceof EE_Hidden_Input) {
51
-            $html .= EEH_HTML::nl() . $input->get_html_for_input();
51
+            $html .= EEH_HTML::nl().$input->get_html_for_input();
52 52
         } elseif ($input instanceof EE_Submit_Input) {
53 53
             $html .= EEH_HTML::div(
54 54
                 $input->get_html_for_input(),
55
-                $html_id . '-submit-dv',
55
+                $html_id.'-submit-dv',
56 56
                 "{$input->html_class()}-submit-dv {$html_class}"
57 57
             );
58 58
         } elseif ($input instanceof EE_Select_Input) {
59 59
             $html .= EEH_HTML::div(
60
-                EEH_HTML::nl(1) . $input->get_html_for_label() .
61
-                EEH_HTML::nl() . $input->get_html_for_errors() .
62
-                EEH_HTML::nl() . $input->get_html_for_input() .
63
-                EEH_HTML::nl() . $input->get_html_for_help(),
64
-                $html_id . '-input-dv',
60
+                EEH_HTML::nl(1).$input->get_html_for_label().
61
+                EEH_HTML::nl().$input->get_html_for_errors().
62
+                EEH_HTML::nl().$input->get_html_for_input().
63
+                EEH_HTML::nl().$input->get_html_for_help(),
64
+                $html_id.'-input-dv',
65 65
                 "{$input->html_class()}-input-dv {$html_class}"
66 66
             );
67 67
         } elseif ($input instanceof EE_Form_Input_With_Options_Base) {
68 68
             $html .= EEH_HTML::div(
69
-                EEH_HTML::nl() . $this->_display_label_for_option_type_question($input) .
70
-                EEH_HTML::nl() . $input->get_html_for_errors() .
71
-                EEH_HTML::nl() . $input->get_html_for_input() .
72
-                EEH_HTML::nl() . $input->get_html_for_help(),
73
-                $html_id . '-input-dv',
69
+                EEH_HTML::nl().$this->_display_label_for_option_type_question($input).
70
+                EEH_HTML::nl().$input->get_html_for_errors().
71
+                EEH_HTML::nl().$input->get_html_for_input().
72
+                EEH_HTML::nl().$input->get_html_for_help(),
73
+                $html_id.'-input-dv',
74 74
                 "{$input->html_class()}-input-dv {$html_class}"
75 75
             );
76 76
         } else {
77 77
             $html .= EEH_HTML::div(
78
-                EEH_HTML::nl(1) . $input->get_html_for_label() .
79
-                EEH_HTML::nl() . $input->get_html_for_errors() .
80
-                EEH_HTML::nl() . $input->get_html_for_input() .
81
-                EEH_HTML::nl() . $input->get_html_for_help(),
82
-                $html_id . '-input-dv',
78
+                EEH_HTML::nl(1).$input->get_html_for_label().
79
+                EEH_HTML::nl().$input->get_html_for_errors().
80
+                EEH_HTML::nl().$input->get_html_for_input().
81
+                EEH_HTML::nl().$input->get_html_for_help(),
82
+                $html_id.'-input-dv',
83 83
                 "{$input->html_class()}-input-dv {$html_class}"
84 84
             );
85 85
         }
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
             $html_label_text = $input->html_label_text();
104 104
             $label_html = EEH_HTML::div(
105 105
                 $input->required()
106
-                    ? $html_label_text . EEH_HTML::span('*', '', 'ee-asterisk')
106
+                    ? $html_label_text.EEH_HTML::span('*', '', 'ee-asterisk')
107 107
                     : $html_label_text,
108 108
                 $input->html_label_id(),
109 109
                 $input->required()
110
-                    ? 'ee-required-label ' . $input->html_label_class()
110
+                    ? 'ee-required-label '.$input->html_label_class()
111 111
                     : $input->html_label_class(),
112 112
                 $input->html_label_style(),
113 113
                 $input->html_other_attributes()
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function layout_subsection($form_section)
134 134
     {
135
-        return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1);
135
+        return EEH_HTML::nl(1).$form_section->get_html().EEH_HTML::nl(-1);
136 136
     }
137 137
 
138 138
 
Please login to merge, or discard this patch.
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
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -7,80 +7,80 @@
 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 a row for the subsection
26
-     *
27
-     * @param EE_Form_Section_Proper $form_section
28
-     * @return string
29
-     */
30
-    public function layout_subsection($form_section)
31
-    {
32
-        if ($form_section instanceof EE_Form_Section_Proper
33
-            || $form_section instanceof EE_Form_Section_HTML
34
-        ) {
35
-            return EEH_HTML::no_row($form_section->get_html());
36
-        }
37
-        return '';
38
-    }
24
+	/**
25
+	 * Lays out a row for the subsection
26
+	 *
27
+	 * @param EE_Form_Section_Proper $form_section
28
+	 * @return string
29
+	 */
30
+	public function layout_subsection($form_section)
31
+	{
32
+		if ($form_section instanceof EE_Form_Section_Proper
33
+			|| $form_section instanceof EE_Form_Section_HTML
34
+		) {
35
+			return EEH_HTML::no_row($form_section->get_html());
36
+		}
37
+		return '';
38
+	}
39 39
 
40 40
 
41 41
 
42
-    /**
43
-     * Lays out the row for the input, including label and errors
44
-     *
45
-     * @param EE_Form_Input_Base $input
46
-     * @return string
47
-     * @throws EE_Error
48
-     */
49
-    public function layout_input($input)
50
-    {
51
-        if ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
52
-            || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
53
-            || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
54
-        ) {
55
-            $input->set_html_class($input->html_class() . ' large-text');
56
-        }
57
-        if ($input instanceof EE_Text_Area_Input) {
58
-            $input->set_rows(4);
59
-            $input->set_cols(60);
60
-        }
61
-        $input_html = $input->get_html_for_input();
62
-        // maybe add errors and help text ?
63
-        $input_html .= $input->get_html_for_errors() !== ''
64
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
65
-            : '';
66
-        $input_html .= $input->get_html_for_help() !== ''
67
-            ? EEH_HTML::nl() . $input->get_html_for_help()
68
-            : '';
69
-        // overriding parent to add wp admin specific things.
70
-        $html = '';
71
-        if ($input instanceof EE_Hidden_Input) {
72
-            $html .= EEH_HTML::no_row($input->get_html_for_input());
73
-        } else {
74
-            $html .= EEH_HTML::tr(
75
-                EEH_HTML::th(
76
-                    $input->get_html_for_label(),
77
-                    '',
78
-                    '',
79
-                    '',
80
-                    'scope="row"'
81
-                ) . EEH_HTML::td($input_html)
82
-            );
83
-        }
84
-        return $html;
85
-    }
42
+	/**
43
+	 * Lays out the row for the input, including label and errors
44
+	 *
45
+	 * @param EE_Form_Input_Base $input
46
+	 * @return string
47
+	 * @throws EE_Error
48
+	 */
49
+	public function layout_input($input)
50
+	{
51
+		if ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
52
+			|| $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
53
+			|| $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
54
+		) {
55
+			$input->set_html_class($input->html_class() . ' large-text');
56
+		}
57
+		if ($input instanceof EE_Text_Area_Input) {
58
+			$input->set_rows(4);
59
+			$input->set_cols(60);
60
+		}
61
+		$input_html = $input->get_html_for_input();
62
+		// maybe add errors and help text ?
63
+		$input_html .= $input->get_html_for_errors() !== ''
64
+			? EEH_HTML::nl() . $input->get_html_for_errors()
65
+			: '';
66
+		$input_html .= $input->get_html_for_help() !== ''
67
+			? EEH_HTML::nl() . $input->get_html_for_help()
68
+			: '';
69
+		// overriding parent to add wp admin specific things.
70
+		$html = '';
71
+		if ($input instanceof EE_Hidden_Input) {
72
+			$html .= EEH_HTML::no_row($input->get_html_for_input());
73
+		} else {
74
+			$html .= EEH_HTML::tr(
75
+				EEH_HTML::th(
76
+					$input->get_html_for_label(),
77
+					'',
78
+					'',
79
+					'',
80
+					'scope="row"'
81
+				) . EEH_HTML::td($input_html)
82
+			);
83
+		}
84
+		return $html;
85
+	}
86 86
 }
Please login to merge, or discard this patch.
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.
form_sections/strategies/layout/EE_Admin_One_Column_Layout.strategy.php 2 patches
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -3,88 +3,88 @@
 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 ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
45
-            || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
46
-            || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
47
-        ) {
48
-            $input->set_html_class($input->html_class() . ' large-text');
49
-        }
50
-        $input_html = $input->get_html_for_input();
51
-        // maybe add errors and help text ?
52
-        $input_html .= $input->get_html_for_errors() !== ''
53
-            ? EEH_HTML::nl() . $input->get_html_for_errors()
54
-            : '';
55
-        $input_html .= $input->get_html_for_help() !== ''
56
-            ? EEH_HTML::nl() . $input->get_html_for_help()
57
-            : '';
58
-        // overriding parent to add wp admin specific things.
59
-        $html = '';
60
-        if ($input instanceof EE_Hidden_Input) {
61
-            $html .= EEH_HTML::no_row($input->get_html_for_input());
62
-        } else {
63
-            $html .= EEH_HTML::tr(
64
-                EEH_HTML::td(
65
-                    $input->get_html_for_label()
66
-                    . EEH_HTML::nl()
67
-                    . $input_html
68
-                )
69
-            );
70
-        }
71
-        return $html;
72
-    }
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 ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy
45
+			|| $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy
46
+			|| $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy
47
+		) {
48
+			$input->set_html_class($input->html_class() . ' large-text');
49
+		}
50
+		$input_html = $input->get_html_for_input();
51
+		// maybe add errors and help text ?
52
+		$input_html .= $input->get_html_for_errors() !== ''
53
+			? EEH_HTML::nl() . $input->get_html_for_errors()
54
+			: '';
55
+		$input_html .= $input->get_html_for_help() !== ''
56
+			? EEH_HTML::nl() . $input->get_html_for_help()
57
+			: '';
58
+		// overriding parent to add wp admin specific things.
59
+		$html = '';
60
+		if ($input instanceof EE_Hidden_Input) {
61
+			$html .= EEH_HTML::no_row($input->get_html_for_input());
62
+		} else {
63
+			$html .= EEH_HTML::tr(
64
+				EEH_HTML::td(
65
+					$input->get_html_for_label()
66
+					. EEH_HTML::nl()
67
+					. $input_html
68
+				)
69
+			);
70
+		}
71
+		return $html;
72
+	}
73 73
 
74 74
 
75
-    /**
76
-     * Lays out a row for the subsection
77
-     *
78
-     * @param EE_Form_Section_Proper $form_section
79
-     * @return string
80
-     */
81
-    public function layout_subsection($form_section)
82
-    {
83
-        if ($form_section instanceof EE_Form_Section_Proper
84
-            || $form_section instanceof EE_Form_Section_HTML
85
-        ) {
86
-            return EEH_HTML::no_row($form_section->get_html());
87
-        }
88
-        return '';
89
-    }
75
+	/**
76
+	 * Lays out a row for the subsection
77
+	 *
78
+	 * @param EE_Form_Section_Proper $form_section
79
+	 * @return string
80
+	 */
81
+	public function layout_subsection($form_section)
82
+	{
83
+		if ($form_section instanceof EE_Form_Section_Proper
84
+			|| $form_section instanceof EE_Form_Section_HTML
85
+		) {
86
+			return EEH_HTML::no_row($form_section->get_html());
87
+		}
88
+		return '';
89
+	}
90 90
 }
Please login to merge, or discard this patch.
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.
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.