Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.182
diff -u -F^f -r1.182 form.inc
--- includes/form.inc 17 Mar 2007 18:30:14 -0000 1.182
+++ includes/form.inc 25 Mar 2007 20:16:09 -0000
@@ -1259,6 +1259,16 @@ function weight_value(&$form) {
}
/**
+ * Add input format selection to textareas with #format.
+ */
+function expand_textarea($element) {
+ if ($element['#format'] !== FALSE) {
+ $element['format'] = filter_form($element['#format']);
+ }
+ return $element;
+}
+
+/**
* Roll out a single radios element to a list of radios,
* using the options array as index.
*/
@@ -1453,7 +1463,7 @@ function theme_textarea($element) {
$cols = $element['#cols'] ? ' cols="'. $element['#cols'] .'"' : '';
_form_set_class($element, $class);
- return theme('form_element', $element, '');
+ return theme('form_element', $element, '') . (!empty($element['#children']) ? $element['#children'] : '');
}
/**
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.251
diff -u -F^f -r1.251 block.module
--- modules/block/block.module 31 Jan 2007 15:49:22 -0000 1.251
+++ modules/block/block.module 25 Mar 2007 20:16:10 -0000
@@ -576,19 +576,18 @@ function block_box_form($edit = array())
'#required' => TRUE,
'#weight' => -19,
);
- $form['body_filter']['#weight'] = -17;
- $form['body_filter']['body'] = array(
+ if (!isset($edit['format'])) {
+ $edit['format'] = FILTER_FORMAT_DEFAULT;
+ }
+ $form['body'] = array(
'#type' => 'textarea',
'#title' => t('Block body'),
'#default_value' => $edit['body'],
'#rows' => 15,
'#description' => t('The content of the block as shown to the user.'),
'#weight' => -17,
+ '#format' => $edit['format'],
);
- if (!isset($edit['format'])) {
- $edit['format'] = FILTER_FORMAT_DEFAULT;
- }
- $form['body_filter']['format'] = filter_form($edit['format'], -16);
return $form;
}
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.791
diff -u -F^f -r1.791 node.module
--- modules/node/node.module 17 Mar 2007 18:30:14 -0000 1.791
+++ modules/node/node.module 25 Mar 2007 20:16:11 -0000
@@ -2934,13 +2934,14 @@ function node_content_form($node) {
}
if ($type->has_body) {
- $form['body_filter']['body'] = array(
+ $form['body'] = array(
'#type' => 'textarea',
'#title' => check_plain($type->body_label),
'#default_value' => $node->body,
'#rows' => 20,
- '#required' => ($type->min_word_count > 0));
- $form['body_filter']['format'] = filter_form($node->format);
+ '#required' => ($type->min_word_count > 0),
+ '#format' => $node->format,
+ );
}
return $form;
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.529
diff -u -F^f -r1.529 comment.module
--- modules/comment/comment.module 12 Mar 2007 13:08:02 -0000 1.529
+++ modules/comment/comment.module 25 Mar 2007 20:16:12 -0000
@@ -1538,11 +1538,17 @@ function comment_form($edit, $title = NU
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : '');
}
- $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => !empty($edit['comment']) ? $edit['comment'] : $user->signature, '#required' => TRUE);
if (!isset($edit['format'])) {
$edit['format'] = FILTER_FORMAT_DEFAULT;
}
- $form['comment_filter']['format'] = filter_form($edit['format']);
+ $form['comment'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Comment'),
+ '#rows' => 15,
+ '#default_value' => !empty($edit['comment']) ? $edit['comment'] : $user->signature,
+ '#required' => TRUE,
+ '#format' => $edit['format'],
+ );
$form['cid'] = array('#type' => 'value', '#value' => !empty($edit['cid']) ? $edit['cid'] : NULL);
$form['pid'] = array('#type' => 'value', '#value' => $edit['pid']);
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.457
diff -u -F^f -r1.457 system.module
--- modules/system/system.module 17 Mar 2007 18:30:14 -0000 1.457
+++ modules/system/system.module 25 Mar 2007 20:16:13 -0000
@@ -64,7 +64,7 @@ function system_elements() {
$type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE);
$type['password'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128);
$type['password_confirm'] = array('#input' => TRUE, '#process' => array('expand_password_confirm' => array()));
- $type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5, '#resizable' => TRUE);
+ $type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5, '#resizable' => TRUE, '#format' => FALSE, '#process' => array('expand_textarea' => array()));
$type['radios'] = array('#input' => TRUE, '#process' => array('expand_radios' => array()));
$type['radio'] = array('#input' => TRUE, '#default_value' => NULL);
$type['checkboxes'] = array('#input' => TRUE, '#process' => array('expand_checkboxes' => array()), '#tree' => TRUE);