Commit 54d7a298 authored by Dries's avatar Dries

- Patch #131432 by dereine, alienbrain, sun: #field_prefix() and...

- Patch #131432 by dereine, alienbrain, sun: #field_prefix() and #field_suffix() work on textfields only.
parent cf476fef
......@@ -2753,15 +2753,8 @@ function theme_textfield($variables) {
}
_form_set_class($element, $class);
if (isset($element['#field_prefix'])) {
$output .= '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ';
}
$output .= '<input type="text"' . $maxlength . ' name="' . $element['#name'] . '" id="' . $element['#id'] . '"' . $size . ' value="' . check_plain($element['#value']) . '"' . drupal_attributes($element['#attributes']) . ' />';
if (isset($element['#field_suffix'])) {
$output .= ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>';
}
return $output . $extra;
}
......@@ -2943,6 +2936,10 @@ 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> ';
}
switch ($element['#title_display']) {
case 'before':
$output .= ' ' . theme('form_element_label', $variables);
......@@ -2961,6 +2958,10 @@ function theme_form_element($variables) {
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";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment