summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc15
1 files changed, 5 insertions, 10 deletions
diff --git a/includes/form.inc b/includes/form.inc
index e8f1c7910..86fd2c72c 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3042,33 +3042,28 @@ function theme_form_element($variables) {
$output = '<div class="' . implode(' ', $class) . '">' . "\n";
- if (isset($element['#field_prefix'])) {
- $output .= '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ';
- }
+ $prefix = isset($element['#field_prefix']) ? '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ' : '';
+ $suffix = isset($element['#field_suffix']) ? ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>' : '';
switch ($element['#title_display']) {
case 'before':
$output .= ' ' . theme('form_element_label', $variables);
- $output .= ' ' . $element['#children'] . "\n";
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
break;
case 'invisible':
case 'after':
- $output .= ' ' . $element['#children'];
+ $output .= ' ' . $prefix . $element['#children'] . $suffix;
$output .= ' ' . theme('form_element_label', $variables) . "\n";
break;
case 'none':
case 'attribute':
// Output no label and no required marker, only the children.
- $output .= ' ' . $element['#children'] . "\n";
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
break;
}
- if (isset($element['#field_suffix'])) {
- $output .= ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>';
- }
-
if (!empty($element['#description'])) {
$output .= ' <div class="description">' . $element['#description'] . "</div>\n";
}