- Patch #45349 by Morbus Iff: input filters aren't sorting correctly infForms API.

4.7.x
Dries Buytaert 2006-01-19 08:54:41 +00:00
parent ecd26ac8ae
commit e84a98a22b
17 changed files with 30 additions and 59 deletions

View File

@ -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 '<form '. $action . ' method="'. $element['#method'] .'" '. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
}
/**
* Format a textarea.
*
@ -861,8 +856,6 @@ function theme_markup($element) {
return $element['#value'] . $element['#children'];
}
/**
* Format a password field.
*

View File

@ -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'),

View File

@ -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'),

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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']);

View File

@ -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']);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1066,7 +1066,6 @@ function theme_node_filters(&$form) {
}
$output .= '</dd>';
$output .= '</dl>';
$output .= '<div class="container-inline" id="node-admin-buttons">'. form_render($form['buttons']) .'</div>';
$output .= '</li></ul><br class="clear" />';
@ -1074,7 +1073,6 @@ function theme_node_filters(&$form) {
return $output;
}
function node_filter_form_submit() {
global $form_values;
$op = $_POST['op'];
@ -1171,7 +1169,6 @@ function node_admin_nodes() {
return $output;
}
function theme_node_admin_nodes($form) {
// Overview table:
$header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
@ -1221,7 +1218,6 @@ function node_multiple_delete_confirm() {
t('Delete all'), t('Cancel'));
}
function node_multiple_delete_confirm_submit($form_id, $edit) {
if ($edit['confirm']) {
foreach ($edit['nodes'] as $nid => $value) {
@ -1568,7 +1564,6 @@ function node_validate($node) {
node_invoke_nodeapi($node, 'validate');
}
/**
* Validate the title of a node
*/
@ -1665,7 +1660,6 @@ function node_form_array($node) {
$form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#required' => TRUE, '#default_value' => $node->name ? $node->name : variable_get('anonymous', 'Anonymous'), '#weight' => -1);
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#required' => TRUE, '#default_value' => $node->date);
// Node options for administrators
$form['options'] = array('#type' => 'fieldset', '#title' => t('Publishing options'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 25);
$form['options']['status'] = array('#type' => 'checkbox', '#title' => t('Published'), '#default_value' => $node->status);
@ -1980,7 +1974,6 @@ function node_revisions() {
drupal_not_found();
}
/**
* Generate a listing of promoted nodes.
*/

View File

@ -1066,7 +1066,6 @@ function theme_node_filters(&$form) {
}
$output .= '</dd>';
$output .= '</dl>';
$output .= '<div class="container-inline" id="node-admin-buttons">'. form_render($form['buttons']) .'</div>';
$output .= '</li></ul><br class="clear" />';
@ -1074,7 +1073,6 @@ function theme_node_filters(&$form) {
return $output;
}
function node_filter_form_submit() {
global $form_values;
$op = $_POST['op'];
@ -1171,7 +1169,6 @@ function node_admin_nodes() {
return $output;
}
function theme_node_admin_nodes($form) {
// Overview table:
$header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
@ -1221,7 +1218,6 @@ function node_multiple_delete_confirm() {
t('Delete all'), t('Cancel'));
}
function node_multiple_delete_confirm_submit($form_id, $edit) {
if ($edit['confirm']) {
foreach ($edit['nodes'] as $nid => $value) {
@ -1568,7 +1564,6 @@ function node_validate($node) {
node_invoke_nodeapi($node, 'validate');
}
/**
* Validate the title of a node
*/
@ -1665,7 +1660,6 @@ function node_form_array($node) {
$form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#required' => TRUE, '#default_value' => $node->name ? $node->name : variable_get('anonymous', 'Anonymous'), '#weight' => -1);
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#required' => TRUE, '#default_value' => $node->date);
// Node options for administrators
$form['options'] = array('#type' => 'fieldset', '#title' => t('Publishing options'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 25);
$form['options']['status'] = array('#type' => 'checkbox', '#title' => t('Published'), '#default_value' => $node->status);
@ -1980,7 +1974,6 @@ function node_revisions() {
drupal_not_found();
}
/**
* Generate a listing of promoted nodes.
*/

View File

@ -93,10 +93,8 @@ function page_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,

View File

@ -93,10 +93,8 @@ function page_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,

View File

@ -86,8 +86,8 @@ function story_validate($node) {
*/
function story_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);
return $form;
}

View File

@ -86,8 +86,8 @@ function story_validate($node) {
*/
function story_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);
return $form;
}