diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-12-15 16:24:40 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-12-15 16:24:40 +0000 |
commit | 922a46d28159737a61602876b961147f46428267 (patch) | |
tree | 395569ef52362721e2975658ca8a7362475d73c6 | |
parent | 5accfa08f52a31da74715c38a1d7a12793fa33c7 (diff) | |
download | brdo-922a46d28159737a61602876b961147f46428267.tar.gz brdo-922a46d28159737a61602876b961147f46428267.tar.bz2 |
- Patch #34920 by Morbus/webchick/tangent: fixed order of form fields.
-rw-r--r-- | modules/book.module | 9 | ||||
-rw-r--r-- | modules/book/book.module | 9 | ||||
-rw-r--r-- | modules/comment.module | 3 | ||||
-rw-r--r-- | modules/comment/comment.module | 3 | ||||
-rw-r--r-- | modules/filter.module | 2 | ||||
-rw-r--r-- | modules/filter/filter.module | 2 | ||||
-rw-r--r-- | modules/menu.module | 3 | ||||
-rw-r--r-- | modules/menu/menu.module | 3 | ||||
-rw-r--r-- | modules/node.module | 15 | ||||
-rw-r--r-- | modules/node/node.module | 15 | ||||
-rw-r--r-- | modules/page.module | 5 | ||||
-rw-r--r-- | modules/page/page.module | 5 | ||||
-rw-r--r-- | modules/path.module | 3 | ||||
-rw-r--r-- | modules/path/path.module | 3 | ||||
-rw-r--r-- | modules/story.module | 4 | ||||
-rw-r--r-- | modules/story/story.module | 4 | ||||
-rw-r--r-- | modules/taxonomy.module | 7 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 7 | ||||
-rw-r--r-- | modules/upload.module | 1 | ||||
-rw-r--r-- | modules/upload/upload.module | 1 |
20 files changed, 44 insertions, 60 deletions
diff --git a/modules/book.module b/modules/book.module index 63e80b38c..d23801ef3 100644 --- a/modules/book.module +++ b/modules/book.module @@ -247,7 +247,7 @@ function book_validate($node) { */ function book_form(&$node) { $form['parent'] = array( - '#type' => 'select', '#title' => t('Parent'), '#default_value' => ($node->parent ? $node->parent : arg(4)), '#options' => book_toc($node->nid), '#weight' => -15, + '#type' => 'select', '#title' => t('Parent'), '#default_value' => ($node->parent ? $node->parent : arg(4)), '#options' => book_toc($node->nid), '#weight' => -4, '#description' => t('The parent that this page belongs in. Note that pages whose parent is <top-level> are regarded as independent, top-level books.') ); @@ -258,16 +258,13 @@ function book_form(&$node) { $form['format'] = filter_form($node->format); $form['log'] = array( - '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE - ); - $form['log']['message'] = array( - '#type' => 'textarea', '#default_value' => $node->log, '#weight' => 18, + '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') ); if (user_access('administer nodes')) { $form['weight'] = array( - '#type' => 'weight', '#title' => t('Weight'), '#default_value' => $node->weight, '#delta' => 15, '#weight' => -14, + '#type' => 'weight', '#title' => t('Weight'), '#default_value' => $node->weight, '#delta' => 15, '#weight' => 5, '#description' => t('Pages at a given level are ordered first by weight and then by title.') ); } diff --git a/modules/book/book.module b/modules/book/book.module index 63e80b38c..d23801ef3 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -247,7 +247,7 @@ function book_validate($node) { */ function book_form(&$node) { $form['parent'] = array( - '#type' => 'select', '#title' => t('Parent'), '#default_value' => ($node->parent ? $node->parent : arg(4)), '#options' => book_toc($node->nid), '#weight' => -15, + '#type' => 'select', '#title' => t('Parent'), '#default_value' => ($node->parent ? $node->parent : arg(4)), '#options' => book_toc($node->nid), '#weight' => -4, '#description' => t('The parent that this page belongs in. Note that pages whose parent is <top-level> are regarded as independent, top-level books.') ); @@ -258,16 +258,13 @@ function book_form(&$node) { $form['format'] = filter_form($node->format); $form['log'] = array( - '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE - ); - $form['log']['message'] = array( - '#type' => 'textarea', '#default_value' => $node->log, '#weight' => 18, + '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') ); if (user_access('administer nodes')) { $form['weight'] = array( - '#type' => 'weight', '#title' => t('Weight'), '#default_value' => $node->weight, '#delta' => 15, '#weight' => -14, + '#type' => 'weight', '#title' => t('Weight'), '#default_value' => $node->weight, '#delta' => 15, '#weight' => 5, '#description' => t('Pages at a given level are ordered first by weight and then by title.') ); } diff --git a/modules/comment.module b/modules/comment.module index b4a5cdbd4..5b62a852e 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -241,9 +241,10 @@ function comment_form_alter($form_id, &$form) { $selected = isset($node->comment) ? $node->comment : variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE); $form['user_comments'] = array( '#type' => 'fieldset', - '#title' => t('User Comments'), + '#title' => t('User comments'), '#collapsible' => TRUE, '#collapsed' => TRUE, + '#weight' => 30, ); $form['user_comments']['comment'] = array( '#type' => 'radios', diff --git a/modules/comment/comment.module b/modules/comment/comment.module index b4a5cdbd4..5b62a852e 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -241,9 +241,10 @@ function comment_form_alter($form_id, &$form) { $selected = isset($node->comment) ? $node->comment : variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE); $form['user_comments'] = array( '#type' => 'fieldset', - '#title' => t('User Comments'), + '#title' => t('User comments'), '#collapsible' => TRUE, '#collapsed' => TRUE, + '#weight' => 30, ); $form['user_comments']['comment'] = array( '#type' => 'radios', diff --git a/modules/filter.module b/modules/filter.module index 30fcbae96..88cb98801 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -750,7 +750,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { * @return * HTML for the form element. */ -function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = -16, $parents = array('format')) { +function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = array('format')) { if ($value == FILTER_FORMAT_DEFAULT) { $value = variable_get('filter_default_format', 1); } diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 30fcbae96..88cb98801 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -750,7 +750,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { * @return * HTML for the form element. */ -function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = -16, $parents = array('format')) { +function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = array('format')) { if ($value == FILTER_FORMAT_DEFAULT) { $value = variable_get('filter_default_format', 1); } diff --git a/modules/menu.module b/modules/menu.module index 997ddf2ab..019591cc9 100644 --- a/modules/menu.module +++ b/modules/menu.module @@ -658,8 +658,9 @@ function menu_form_alter($form_id, &$form) { '#type' => 'fieldset', '#title' => t('Menu settings'), '#collapsible' => TRUE, - '#collapsed' => TRUE, + '#collapsed' => empty($item['title']), '#tree' => TRUE, + '#weight' => 30, ); $form['menu']['title'] = array( diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 997ddf2ab..019591cc9 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -658,8 +658,9 @@ function menu_form_alter($form_id, &$form) { '#type' => 'fieldset', '#title' => t('Menu settings'), '#collapsible' => TRUE, - '#collapsed' => TRUE, + '#collapsed' => empty($item['title']), '#tree' => TRUE, + '#weight' => 30, ); $form['menu']['title'] = array( diff --git a/modules/node.module b/modules/node.module index 37317c522..1eb05e96c 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1614,10 +1614,10 @@ function node_form($node) { // Get the node-specific bits. $form = array_merge($form, node_invoke($node, 'form')); if (!isset($form['title']['#weight'])) { - $form['title']['#weight'] = -18; + $form['title']['#weight'] = -5; } if (!isset($form['body']['#weight'])) { - $form['body']['#weight'] = -17; + $form['body']['#weight'] = 0; } // If this is a new node, fill in the default values. @@ -1640,13 +1640,13 @@ function node_form($node) { if (user_access('administer nodes')) { // Node author information - $form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -5); + $form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 20); $form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#required' => TRUE, '#default_value' => $node->name, '#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' => -5); + $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); $form['options']['moderate'] = array('#type' => 'checkbox', '#title' => t('In moderation queue'), '#default_value' => $node->moderate); $form['options']['promote'] = array('#type' => 'checkbox', '#title' => t('Promoted to front page'), '#default_value' => $node->promote); @@ -1663,11 +1663,10 @@ function node_form($node) { } // Add the buttons. - $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 19); - - $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 20); + $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 40); + $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 45); if ($node->nid && node_access('delete', $node)) { - $form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 21); + $form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 50); } if ($op == t('Preview')) { diff --git a/modules/node/node.module b/modules/node/node.module index 37317c522..1eb05e96c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1614,10 +1614,10 @@ function node_form($node) { // Get the node-specific bits. $form = array_merge($form, node_invoke($node, 'form')); if (!isset($form['title']['#weight'])) { - $form['title']['#weight'] = -18; + $form['title']['#weight'] = -5; } if (!isset($form['body']['#weight'])) { - $form['body']['#weight'] = -17; + $form['body']['#weight'] = 0; } // If this is a new node, fill in the default values. @@ -1640,13 +1640,13 @@ function node_form($node) { if (user_access('administer nodes')) { // Node author information - $form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -5); + $form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 20); $form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#required' => TRUE, '#default_value' => $node->name, '#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' => -5); + $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); $form['options']['moderate'] = array('#type' => 'checkbox', '#title' => t('In moderation queue'), '#default_value' => $node->moderate); $form['options']['promote'] = array('#type' => 'checkbox', '#title' => t('Promoted to front page'), '#default_value' => $node->promote); @@ -1663,11 +1663,10 @@ function node_form($node) { } // Add the buttons. - $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 19); - - $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 20); + $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 40); + $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 45); if ($node->nid && node_access('delete', $node)) { - $form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 21); + $form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 50); } if ($op == t('Preview')) { diff --git a/modules/page.module b/modules/page.module index b012c9aaf..39c5bff27 100644 --- a/modules/page.module +++ b/modules/page.module @@ -99,10 +99,7 @@ function page_form(&$node) { $form['format'] = filter_form($node->format); $form['log'] = array( - '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE - ); - $form['log']['message'] = array( - '#type' => 'textarea', '#default_value' => $node->log, + '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') ); diff --git a/modules/page/page.module b/modules/page/page.module index b012c9aaf..39c5bff27 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -99,10 +99,7 @@ function page_form(&$node) { $form['format'] = filter_form($node->format); $form['log'] = array( - '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE - ); - $form['log']['message'] = array( - '#type' => 'textarea', '#default_value' => $node->log, + '#type' => 'textarea', '#title' => t('Log message'), '#default_value' => $node->log, '#weight' => 5, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') ); diff --git a/modules/path.module b/modules/path.module index 1a7f7b9a4..3bcd9dadf 100644 --- a/modules/path.module +++ b/modules/path.module @@ -225,7 +225,8 @@ function path_form_alter($form_id, &$form) { '#type' => 'fieldset', '#title' => t('URL path settings'), '#collapsible' => TRUE, - '#collapsed' => TRUE, + '#collapsed' => empty($path), + '#weight' => 30, ); $form['path']['path'] = array( '#type' => 'textfield', diff --git a/modules/path/path.module b/modules/path/path.module index 1a7f7b9a4..3bcd9dadf 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -225,7 +225,8 @@ function path_form_alter($form_id, &$form) { '#type' => 'fieldset', '#title' => t('URL path settings'), '#collapsible' => TRUE, - '#collapsed' => TRUE, + '#collapsed' => empty($path), + '#weight' => 30, ); $form['path']['path'] = array( '#type' => 'textfield', diff --git a/modules/story.module b/modules/story.module index cd7d3c5bc..86abac2ae 100644 --- a/modules/story.module +++ b/modules/story.module @@ -91,10 +91,6 @@ function story_form(&$node) { $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); $form['format'] = filter_form($node->format); - $form['log'] = array('#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $form['log']['message'] = array('#type' => 'textarea', '#default_value' => $node->log, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') - ); - return $form; } diff --git a/modules/story/story.module b/modules/story/story.module index cd7d3c5bc..86abac2ae 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -91,10 +91,6 @@ function story_form(&$node) { $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); $form['format'] = filter_form($node->format); - $form['log'] = array('#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $form['log']['message'] = array('#type' => 'textarea', '#default_value' => $node->log, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.') - ); - return $form; } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index eda75a7b1..f2e07199f 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -131,7 +131,7 @@ function taxonomy_form_vocabulary($edit = array()) { $extra = module_invoke_all('taxonomy', 'form', 'vocabulary'); if (is_array($extra)) { foreach ($extra as $key => $element) { - $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $nodeapi[$key]['#weight'] : -18; + $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $extra[$key]['#weight'] : -18; } $form = array_merge($form, $extra); } @@ -242,7 +242,7 @@ function taxonomy_form_term($edit = array()) { $extra = module_invoke_all('taxonomy', 'term', 'vocabulary'); if (is_array($extra)) { foreach ($extra as $key => $element) { - $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $nodeapi[$key]['#weight'] : -18; + $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $extra[$key]['#weight'] : -18; } $form = array_merge($form, $extra); } @@ -532,13 +532,12 @@ function taxonomy_form_alter($form_id, &$form) { } else { $ntterms = isset($node->taxonomy) ? $terms : array_keys($terms); - $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy'); } } if (isset($form['taxonomy'])) { $form['taxonomy']['#tree'] = TRUE; - $form['taxonomy']['#weight'] = -15; + $form['taxonomy']['#weight'] = $vocabulary->weight; } } } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index eda75a7b1..f2e07199f 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -131,7 +131,7 @@ function taxonomy_form_vocabulary($edit = array()) { $extra = module_invoke_all('taxonomy', 'form', 'vocabulary'); if (is_array($extra)) { foreach ($extra as $key => $element) { - $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $nodeapi[$key]['#weight'] : -18; + $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $extra[$key]['#weight'] : -18; } $form = array_merge($form, $extra); } @@ -242,7 +242,7 @@ function taxonomy_form_term($edit = array()) { $extra = module_invoke_all('taxonomy', 'term', 'vocabulary'); if (is_array($extra)) { foreach ($extra as $key => $element) { - $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $nodeapi[$key]['#weight'] : -18; + $extra[$key]['#weight'] = isset($extra[$key]['#weight']) ? $extra[$key]['#weight'] : -18; } $form = array_merge($form, $extra); } @@ -532,13 +532,12 @@ function taxonomy_form_alter($form_id, &$form) { } else { $ntterms = isset($node->taxonomy) ? $terms : array_keys($terms); - $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy'); } } if (isset($form['taxonomy'])) { $form['taxonomy']['#tree'] = TRUE; - $form['taxonomy']['#weight'] = -15; + $form['taxonomy']['#weight'] = $vocabulary->weight; } } } diff --git a/modules/upload.module b/modules/upload.module index 6c2b05a47..1da1bc128 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -172,6 +172,7 @@ function upload_form_alter($form_id, &$form) { '#description' => t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.'), '#prefix' => '<div class="attachments">', '#suffix' => '</div>', + '#weight' => 30, ); $form['attachments'] += _upload_form($node); $form['#attributes'] = array('enctype' => 'multipart/form-data'); diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 6c2b05a47..1da1bc128 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -172,6 +172,7 @@ function upload_form_alter($form_id, &$form) { '#description' => t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.'), '#prefix' => '<div class="attachments">', '#suffix' => '</div>', + '#weight' => 30, ); $form['attachments'] += _upload_form($node); $form['#attributes'] = array('enctype' => 'multipart/form-data'); |