Commit b2e725c0 authored by Dries's avatar Dries

- Patch #296918 by JBrauer: clean up CSS/HTML of node form.

parent c15bcc06
...@@ -176,7 +176,7 @@ function node_form(&$form_state, $node) { ...@@ -176,7 +176,7 @@ function node_form(&$form_state, $node) {
'#title' => t('Authoring information'), '#title' => t('Authoring information'),
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => TRUE, '#collapsed' => TRUE,
'#weight' => 20, '#weight' => 90,
); );
$form['author']['name'] = array( $form['author']['name'] = array(
'#type' => 'textfield', '#type' => 'textfield',
...@@ -205,7 +205,7 @@ function node_form(&$form_state, $node) { ...@@ -205,7 +205,7 @@ function node_form(&$form_state, $node) {
'#title' => t('Publishing options'), '#title' => t('Publishing options'),
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => TRUE, '#collapsed' => TRUE,
'#weight' => 25, '#weight' => 95,
); );
$form['options']['status'] = array( $form['options']['status'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
...@@ -233,6 +233,7 @@ function node_form(&$form_state, $node) { ...@@ -233,6 +233,7 @@ function node_form(&$form_state, $node) {
// Add the buttons. // Add the buttons.
$form['buttons'] = array(); $form['buttons'] = array();
$form['buttons']['#weight'] = 100;
$form['buttons']['submit'] = array( $form['buttons']['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Save'), '#value' => t('Save'),
...@@ -328,34 +329,10 @@ function node_form_build_preview($form, &$form_state) { ...@@ -328,34 +329,10 @@ function node_form_build_preview($form, &$form_state) {
function theme_node_form($form) { function theme_node_form($form) {
$output = "\n<div class=\"node-form\">\n"; $output = "\n<div class=\"node-form\">\n";
// Admin form fields and submit buttons must be rendered first, because
// they need to go to the bottom of the form, and so should not be part of
// the catch-all call to drupal_render().
$admin = '';
if (isset($form['author'])) {
$admin .= " <div class=\"authored\">\n";
$admin .= drupal_render($form['author']);
$admin .= " </div>\n";
}
if (isset($form['options'])) {
$admin .= " <div class=\"options\">\n";
$admin .= drupal_render($form['options']);
$admin .= " </div>\n";
}
$buttons = drupal_render($form['buttons']);
// Everything else gets rendered here, and is displayed before the admin form
// field and the submit buttons.
$output .= " <div class=\"standard\">\n"; $output .= " <div class=\"standard\">\n";
$output .= drupal_render($form); $output .= drupal_render($form);
$output .= " </div>\n"; $output .= " </div>\n";
if (!empty($admin)) {
$output .= " <div class=\"admin\">\n";
$output .= $admin;
$output .= " </div>\n";
}
$output .= $buttons;
$output .= "</div>\n"; $output .= "</div>\n";
return $output; return $output;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment