diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-08-21 17:06:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-08-21 17:06:51 +0000 |
commit | 47b72af6129036dad48f34013f0895b144eb4583 (patch) | |
tree | b991d1f12fbcda5650899403c4707a0abb8e4041 /includes/common.inc | |
parent | 7736eb49956ec78dd7fae8891b55103e1747f99d (diff) | |
download | brdo-47b72af6129036dad48f34013f0895b144eb4583.tar.gz brdo-47b72af6129036dad48f34013f0895b144eb4583.tar.bz2 |
- Patch #6809 by TDobes: fixed the textarea hook so WYSIWYG editors are made possible again.
TODO: apply the documentation and htmlarea module patches.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index bef2aaef6..e8080e7f0 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1328,8 +1328,25 @@ 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 .'"' : ''; - module_invoke_all('textarea', $name); // eg. optionally plug in a WYSIWYG editor - return 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_form($value) .'</textarea>', $description, 'edit-'. $name, $required, _form_get_error($name)); + $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); + } + } + + $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_form($value) .'</textarea>', $description, 'edit-'. $name, $required, _form_get_error($name)); + + // 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', 'post', $name); + } + } + + return $output; } /** |