diff --git a/includes/form.inc b/includes/form.inc index 0fd8cf9b1be..a907480a81d 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -523,7 +523,6 @@ function theme_fieldset($element) { } - /** * Format a radio button. * @@ -691,7 +690,6 @@ function expand_radios($element) { return $element; } - /** * Format a form item. * @@ -705,7 +703,6 @@ function theme_item($element) { return theme('form_element', $element['#title'], $element['#value'] . $element['#children'], $element['#description'], $element['#id'], $element['#required'], $element['#error']); } - /** * Format a checkbox. * @@ -765,7 +762,6 @@ function expand_checkboxes($element) { return $element; } - function theme_submit($element) { return theme('button', $element); } @@ -823,7 +819,6 @@ function theme_form($element) { return '
\n"; } - /** * Format a textarea. * @@ -861,8 +856,6 @@ function theme_markup($element) { return $element['#value'] . $element['#children']; } - - /** * Format a password field. * diff --git a/modules/block.module b/modules/block.module index 95266c9b82a..e97187483b5 100644 --- a/modules/block.module +++ b/modules/block.module @@ -458,7 +458,6 @@ function block_box_delete_confirm_submit($form_id, $form_values) { drupal_goto('admin/block'); }; - function block_box_form($edit = array()) { $form['title'] = array( '#type' => 'textfield', @@ -468,7 +467,8 @@ function block_box_form($edit = array()) { '#description' => t('The title of the block as shown to the user.'), '#weight' => -18, ); - $form['body'] = array( + $form['body_filter']['#weight'] = -17; + $form['body_filter']['body'] = array( '#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], @@ -476,7 +476,7 @@ function block_box_form($edit = array()) { '#description' => t('The content of the block as shown to the user.'), '#weight' => -17, ); - $form['format'] = filter_form($edit['format']); + $form['body_filter']['format'] = filter_form($edit['format'], -16); $form['info'] = array( '#type' => 'textfield', '#title' => t('Block description'), diff --git a/modules/block/block.module b/modules/block/block.module index 95266c9b82a..e97187483b5 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -458,7 +458,6 @@ function block_box_delete_confirm_submit($form_id, $form_values) { drupal_goto('admin/block'); }; - function block_box_form($edit = array()) { $form['title'] = array( '#type' => 'textfield', @@ -468,7 +467,8 @@ function block_box_form($edit = array()) { '#description' => t('The title of the block as shown to the user.'), '#weight' => -18, ); - $form['body'] = array( + $form['body_filter']['#weight'] = -17; + $form['body_filter']['body'] = array( '#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], @@ -476,7 +476,7 @@ function block_box_form($edit = array()) { '#description' => t('The content of the block as shown to the user.'), '#weight' => -17, ); - $form['format'] = filter_form($edit['format']); + $form['body_filter']['format'] = filter_form($edit['format'], -16); $form['info'] = array( '#type' => 'textfield', '#title' => t('Block description'), diff --git a/modules/blog.module b/modules/blog.module index 76952cddf26..1dd5df58bc3 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -229,8 +229,8 @@ function blog_form(&$node) { } $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['filter'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['filter'] = filter_form($node->format, 1); return $form; } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 76952cddf26..1dd5df58bc3 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -229,8 +229,8 @@ function blog_form(&$node) { } $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['filter'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['filter'] = filter_form($node->format, 1); return $form; } diff --git a/modules/book.module b/modules/book.module index e800b8f501a..3354c86566e 100644 --- a/modules/book.module +++ b/modules/book.module @@ -252,8 +252,8 @@ function book_form(&$node) { ); $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['format'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['format'] = filter_form($node->format, 1); $form['log'] = array( '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, diff --git a/modules/book/book.module b/modules/book/book.module index e800b8f501a..3354c86566e 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -252,8 +252,8 @@ function book_form(&$node) { ); $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['format'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['format'] = filter_form($node->format, 1); $form['log'] = array( '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, diff --git a/modules/comment.module b/modules/comment.module index c574d19fb13..18e8b304da8 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1332,10 +1332,8 @@ function comment_form($edit, $title = NULL) { $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']); } - $form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE - ); - - $form['format'] = filter_form($edit['format'], 18); + $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE); + $form['comment_filter']['format'] = filter_form($edit['format'], 1); $form['cid'] = array('#type' => 'value', '#value' => $edit['cid']); $form['pid'] = array('#type' => 'value', '#value' => $edit['pid']); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index c574d19fb13..18e8b304da8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1332,10 +1332,8 @@ function comment_form($edit, $title = NULL) { $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']); } - $form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE - ); - - $form['format'] = filter_form($edit['format'], 18); + $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE); + $form['comment_filter']['format'] = filter_form($edit['format'], 1); $form['cid'] = array('#type' => 'value', '#value' => $edit['cid']); $form['pid'] = array('#type' => 'value', '#value' => $edit['pid']); diff --git a/modules/forum.module b/modules/forum.module index 50f27baeb7d..890ff48c2e3 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -592,8 +592,8 @@ function forum_form(&$node) { $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.')); } - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['format'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['format'] = filter_form($node->format, 1); return $form; } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 50f27baeb7d..890ff48c2e3 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -592,8 +592,8 @@ function forum_form(&$node) { $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.')); } - $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); - $form['format'] = filter_form($node->format); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['format'] = filter_form($node->format, 1); return $form; } diff --git a/modules/node.module b/modules/node.module index 1fdd1e7e5ed..02e40437523 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1066,7 +1066,6 @@ function theme_node_filters(&$form) { } $output .= ''; - $output .= ''; $output .= '