diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-04-06 07:43:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-04-06 07:43:10 +0000 |
commit | 97bfa01725f1a1b7679b2c90045bd4fc6a758da5 (patch) | |
tree | ad62c6039b227c45df2c35062ecbfcb551f7680a | |
parent | 0f79c1e9462f16de3bd0bc3f199b48906cb092af (diff) | |
download | brdo-97bfa01725f1a1b7679b2c90045bd4fc6a758da5.tar.gz brdo-97bfa01725f1a1b7679b2c90045bd4fc6a758da5.tar.bz2 |
- Patch #18828 by me, jbond and TDobes: moves the textarea hook for 'pre' between the title and the textarea. This makes it easier for simply textarea enhancements like quicktags to add a toolbar just above the textarea.
-rw-r--r-- | includes/common.inc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/includes/common.inc b/includes/common.inc index b6a8807c8..15c8041d2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1256,25 +1256,18 @@ function form_password($title, $name, $value, $size, $maxlength, $description = */ function form_textarea($title, $name, $value, $cols, $rows, $description = NULL, $attributes = NULL, $required = FALSE) { $cols = $cols ? ' cols="'. $cols .'"' : ''; - $output = ''; - - // e.g. optionally plug in a WYSIWYG editor - foreach (module_list() as $module_name) { - if (module_hook($module_name, 'textarea')) { - $output .= module_invoke($module_name, 'textarea', 'pre', $name); - } - } + $pre = ''; + $post = ''; - $output .= theme('form_element', $title, '<textarea wrap="virtual"'. $cols .' rows="'. $rows .'" name="edit['. $name .']" id="edit-'. $name .'" class="'. _form_get_class('textarea', $required, _form_get_error($name)) .'"'. drupal_attributes($attributes) .'>'. check_plain($value) .'</textarea>', $description, 'edit-'. $name, $required, _form_get_error($name)); - - // e.g. optionally plug in a WYSIWYG editor + // optionally plug in a WYSIWYG editor foreach (module_list() as $module_name) { if (module_hook($module_name, 'textarea')) { - $output .= module_invoke($module_name, 'textarea', 'post', $name); + $pre .= module_invoke($module_name, 'textarea', 'pre', $name); + $post .= module_invoke($module_name, 'textarea', 'post', $name); } } - return $output; + return theme('form_element', $title, $pre .'<textarea wrap="virtual"'. $cols .' rows="'. $rows .'" name="edit['. $name .']" id="edit-'. $name .'" class="'. _form_get_class('textarea', $required, _form_get_error($name)) .'"'. drupal_attributes($attributes) .'>'. check_plain($value) .'</textarea>'. $post, $description, 'edit-'. $name, $required, _form_get_error($name)); } /** |