From 9e8997c3f65167cea40095c5e86a1fe56b57df58 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Mon, 9 Apr 2012 14:41:49 +0200 Subject: [PATCH] Implement the new create content page design --- core/includes/form.inc | 20 ++- core/misc/collapse.js | 2 + core/misc/menu-collapsed-rtl.png | Bin 107 -> 1011 bytes core/misc/menu-collapsed.png | Bin 105 -> 1014 bytes core/misc/menu-expanded.png | Bin 106 -> 1012 bytes core/modules/node/node.admin.css | 338 +++++++++++++++++++++++++++++++++++++- core/modules/node/node.pages.inc | 75 +++++++-- 7 files changed, 410 insertions(+), 25 deletions(-) diff --git a/core/includes/form.inc b/core/includes/form.inc index bdd571d..7fc72c6 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -4249,33 +4249,37 @@ function theme_form_element($variables) { $prefix = isset($element['#field_prefix']) ? '' . $element['#field_prefix'] . ' ' : ''; $suffix = isset($element['#field_suffix']) ? ' ' . $element['#field_suffix'] . '' : ''; + $description = ''; + if (!empty($element['#description'])) { + $attributes = array('class' => 'description'); + if (!empty($element['#id'])) { + $attributes['id'] = $element['#id'] . '--description'; + } + $description .= '' . $element['#description'] . "\n"; + } + switch ($element['#title_display']) { case 'before': case 'invisible': $output .= ' ' . theme('form_element_label', $variables); + $output .= ' ' . $description; $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n"; break; case 'after': $output .= ' ' . $prefix . $element['#children'] . $suffix; $output .= ' ' . theme('form_element_label', $variables) . "\n"; + $output .= ' ' . $description; break; case 'none': case 'attribute': // Output no label and no required marker, only the children. $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n"; + $output .= ' ' . $description; break; } - if (!empty($element['#description'])) { - $attributes = array('class' => 'description'); - if (!empty($element['#id'])) { - $attributes['id'] = $element['#id'] . '--description'; - } - $output .= '' . $element['#description'] . "\n"; - } - $output .= "\n"; return $output; diff --git a/core/misc/collapse.js b/core/misc/collapse.js index 28281a1..006ae99 100644 --- a/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -9,6 +9,7 @@ Drupal.toggleFieldset = function (fieldset) { var $content = $fieldset.find('> .fieldset-wrapper').hide(); $fieldset .removeClass('collapsed') + .addClass('expanded') .trigger({ type: 'collapsed', value: false }) .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide')); $content.slideDown({ @@ -28,6 +29,7 @@ Drupal.toggleFieldset = function (fieldset) { $fieldset.trigger({ type: 'collapsed', value: true }); $fieldset.find('> .fieldset-wrapper').slideUp('fast', function () { $fieldset + .removeClass('expanded') .addClass('collapsed') .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show')); fieldset.animating = false; diff --git a/core/misc/menu-collapsed-rtl.png b/core/misc/menu-collapsed-rtl.png index dc8d0b8823a90704b3743f980108b8a7d914193c..793d425fdeb5f3909365b518822f2e80e715c67c 100644 GIT binary patch literal 1011 zcmaJ=O=#0l9M3lPL2)=l1`5g}lbzOlb!(QeIMSqb1ye>_SZ|spuWeY97n3)e?KJeV z-4rk01&`t`UOY^2DB^Gj5r(%7JPi>&c@cf-+RlSD@bcdO@%#P$pKp7)aAQ1iIYCj> zcz#JQl6{1%b7S#eUD;>Ib_r)IxP)rBWd@K^ZB&II@0xX3gr>cI=N(+2s3F=ZS8&C+ zDO<>8%oxK&u20w$wXhiZrnL$&sKUDADfG9OyEJfYgXJwl-ER z$)*>tgM~;Y0xrZRh}@bZ_DVkvY3V_#<3R;$IdQVa^}EH6n? ztRVhR@GRbc3Ww!&AF@RlqP4&xjjK(?u6$VwpovjXMyT1X;&KCF6gH3# zw9*_fOv~|NyNx#tIq!wo^emXy6`Ck8j$_N2tS;sREhDPw6whb*Op24V+J*$MW!b{_QsYNy}^ebnf8E;_0cc;3waXtysnm`&(-~dgZit%!^h9Zeo)^hCuddZ z0hleiLbpTp@V ug@GMu;?|qm+bQs3`1t>$j@3?%=}IXVGIu?6^qxc>kDAIJlF_r}R z1v5B2yO9Ru2z$CXhH%IxKS&Tt2udhQ_{ZGD!0W_Z)5_!D1C(a)boFyt=akR{086bK A?EnA( diff --git a/core/misc/menu-collapsed.png b/core/misc/menu-collapsed.png index 91f3fd40ede024798b6de5ea2675bb692a3cfa95..287bb5cfc480418f8f56f3c1556be27d4c1f745b 100644 GIT binary patch literal 1014 zcmaJ=&rj1(94|ivf)EJ@qh5TLcw_ysv6VFxwzZoqu}H=UGhEiSkF7%cYWuK-c$i+q zi!t$_e}P96PZ~UUP!mlsctmeL9y~Kh zQPgmLRwUk*aEhXOXtP+t zCH11HBa6{O3=>!mVN=x9OyFqxD#V}ytEMf{-=00EfoVweQe5R!M}{?XcGHCmn{!2d zb5&0o^vpDv3Pd7cL9BtmTC+Vdkm!c4NY3FkOM?akuS)b`P$hL9$jF5t&TtW(OK>2; zGkk195QK3M<#>+eqAVYc@PZhNiW~=;A5FZu#)?=_a!p^vlIR-7j>xjU?=yakL2i}h zlgVVL5sgL&BI0e>SPLSyH`Y>6pr^a0gH2?EP*JO(bu7^&(!&%ir!8xH%`%aKv4Q5W zJi~=4wScPnf2d`((H<_qqj>)*>=id0$QGc7)?J-6Ze=WV<%qHiHH_RMLTjxm&esq| zUJW@wUWfx#(@i_H8+cU}^R|aITZef?qKN`ynueIkDnc$Q3qm>(6Odu|2lLXb(QL$+Wv#6ZuOjq}I>iX!`+jr+vsqU>4)Z_l`-T^1`btiql-g9!|w-4_0?8je^ zvh}^QTbIs#c{=oRI`wPd{bK)(y{^k64_^!~-=%s_QU2$V?_JBE;^9loXXlhhnexp) DbjU$u literal 105 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j@3?%=}IXVGIu?6^qxc>kDAIJlF_r}R y1v5B2yO9Ru2zt6WhH%Ixhb6Q*Xr>9K@iDN~Fr3*g^XWQJlEKr}&t;ucLK6T5e;aZD diff --git a/core/misc/menu-expanded.png b/core/misc/menu-expanded.png index 46f39ecb351cff65243fa9a614a69d039e1302a5..cf3509486c44c75357377e4ccf6fa83ae4649218 100644 GIT binary patch literal 1012 zcmaJ=&rj1(94{IP5->!JiU;%3Nn#A^ugS_93XFDzC3eBF#NDK8-?lp1SK0?FL?dz$ z@ZwRudG+8wU<6I{U}C~mIguDWYP=|k7hlIVJb+DJ-}}CNKA-Q;w=t8O>g~SNO;J>D zc3RDoy@#yMu1@m*{r&y}vJK!&5znGBt{Xn2(iSQ~kadg-%tOOkUibhzwW>uxd}Q_;7Y5S1?y< zX3C<+$G~VP5djBc1BA}J8%Uu{H*_U(j;>i6G$6Pp(+5En^%Inw<6_!t> zQjvxr#0erEEW6kU<8BaZDX1_oecQt}azUhMl+YrUX%gu{3Xa#7b%SP^NWs|9@K~PV zqLf-dUH?DSaoXqr=iy7>7@$SpB#kS_B3GWI_|U+}FCaAEs^Ux)VH8x6 z2b9@ipc|&`Ms@?Q>r&PYu;H38tI9M{U~JoxR8351DIp`KlL?;B@RJEHrD!9`l%iyK zRTW!Y6`6|;ba9Jo9dfl}xzQ*%9`UR~-(G^2<|79*QkLu^VwudSq9!Qnv3gCebwn&p z?(uoBBp5bo>_3feU6JXDj_t7}Mtks~OQzi?W34^Yw#bvHX4P~d+%0|F*{PUwbDz$< z%k}KP9Rt6t6KA(qN4nP8FE{TFy!dvZzpxkU`$PS#4Q<|5zE0e^_~h}G%jvR6=9cD8*_2uN; F+Fv+JK8^qY literal 106 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j@3?%=}IXVGIu?6^qxc>kDAIJlF_r}R z1v5B2yO9Ru2zk0VhE&W+{&76uaKb@_0}N~oA{!VF-#vS9IZ&3t)78&qol`;+0EMF; ATL1t6 diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css index 5777b1f..1273798 100644 --- a/core/modules/node/node.admin.css +++ b/core/modules/node/node.admin.css @@ -1,12 +1,348 @@ - /** * @file * Styles for administration pages. */ /** + * Resets. + * + * @todo These resets should be added to Drupal's core CSS. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} +legend { + display: block; + float: left; + width: 100%; + white-space: normal; + *margin-left: -7px; +} + +/** + * Wrap clickable labels so the clickable region doesn't extend too far. + */ +label { + display: table; +} + +/** + * Labels with explicit associations are clickable. + */ +label[for] { + cursor: pointer; +} + +/** * Revisions overview screen. */ .revision-current { background: #ffc; } + +/** + * Styles for the new node add/edit form. + */ +#page { + padding-top: 0 !important; +} +.overlay #page { + padding: 0 0 0 2.5% !important; +} +#help, .edit-primary { + float: left; + width: 65.5%; +} +.overlay { + background: #f00; +} +.overlay #branding { + background: transparent; + left: 0; + padding-left: 2.5%; + padding-right: 2.5%; + position: absolute; + top: 0; + width: 60.5%; + z-index: 99; +} +.edit-primary { + margin-top: -2em; +} +.overlay .edit-primary { + margin-top: 3em; +} +.edit-secondary { + background-color: #eee; + border: 1px solid #dfdfdf; + position: relative; + margin-left: 68%; + margin-top: 2em; + width: 32%; +} +.overlay .edit-secondary { + margin-top: 0; + border: 0; +} + +/** + * Gradients on .edit-secondary look odd because they are drawn over by the + * .collapsible borders.Fix that with pseudo-elements whose z-index we can + * control. We can't use :after because it might interfere with clearfix. + */ +.overlay .edit-secondary:before, +.overlay .node-form > div:before { + bottom: 0; + content: ""; + pointer-events: none; /* Allow clicks. */ + position: absolute; + top: 0; +} +.overlay .edit-secondary:before { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -moz-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -ms-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + left: 0; + width: .75em; + z-index: 3; +} +.edit-secondary .collapsible { + box-shadow: inset 0 2px .8em rgba(0, 0, 0, .08); + -moz-box-shadow: inset 0 2px .8em rgba(0, 0, 0, .08); + -webkit-box-shadow: inset 0 2px .8em rgba(0, 0, 0, .08); + padding: 1px 0; + border: 0; + background-color: #e2e2e2; + -moz-transition: background-color .1s; + -ms-transition: background-color .1s; + -o-transition: background-color .1s; + -webkit-transition: background-color .1s; +} +.edit-secondary .collapsed { + background-color: transparent; + border-top: 1px solid #fdfdfd; + border-bottom: 1px solid #dedede; + border-left: 0px; + border-right: 0px; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + padding: 0; +} +.edit-secondary .collapsible + .collapsible { + border-top: 1px solid #eee; + padding-top: 0; +} +.edit-secondary .collapsed + .collapsible { + border-top: 1px solid #bbb; +} +.edit-secondary .collapsed + .collapsed { + border-top: 1px solid white; + padding-top: 0; +} +.edit-secondary .collapsible .fieldset-legend { + background: none !important; /* Override system. */ + display: block; + left: 0; + margin: 0; + right: 0; + padding: 0 !important; /* Override system. */ + position: relative; +} + +/** + * Toggle anchor. + */ +.edit-secondary .collapsible .fieldset-title { + background: url(../../misc/menu-expanded.png) no-repeat 95% 50%; /* LTR */ + color: #004F80; + display: block; + padding: .85em 1.25em; + font-size: 1.05em; + text-transform: none; +} +.overlay .edit-secondary .collapsible .fieldset-title { + background-position: 93% 50%; +} +.overlay .edit-secondary .collapsible.collapsed .fieldset-title { + font-weight: normal; +} + +/** + * The legend is floated to force display. We need to clear it. + */ +.edit-secondary .collapsible .fieldset-wrapper { + clear: both; + padding: 0 1.25em 1.25em !important; +} +.edit-secondary .collapsed .fieldset-title { + background-image: url(../../misc/menu-collapsed.png); + color: #0074BD; +} +.edit-secondary .node-summary { + margin: 0 1.25em 1.25em 1.25em; + padding-top: .5em; + overflow: hidden; +} +.edit-secondary .button-duplicate { + margin-left: 10px; +} +.form-actions { + clear: both; +} +.description { + font-style: italic; + font-family: serif; +} +#edit-title { + width: 100%; +} +.fieldset-legend .summary { + display: none; +} +#edit-additional-settings { + border-top: 0; + border-bottom: 1px solid #fdfdfd; + border-left: 0px; + border-right: 0px; + margin: 0; + padding: 0; + text-shadow: 0px 1px 0px rgba(255, 255, 255, .75); +} +fieldset .form-wrapper { + margin: 0; +} +#edit-additional-settings, #edit-additional-settings > div.fieldset-wrapper { + padding: 0; +} +.node-form { + color: #464646; +} +ul.tips, div.description, .form-item div.description { + color: #464646; +} +.page-node-add #overlay-content, +.page-node-edit #overlay-content { + padding: 0; +} +.page-node-edit #help { + margin-top: 0; +} +.node-summary { + margin-bottom: 10px; + margin-top: 0; + padding-top: 0; +} +.node-summary p { + margin-top: -10px; + padding-top: 0; + font-size: 90%; +} +.node-summary ul, .node-summary li { + list-style: none; + margin-left: -20px; +} +.node-form .node-actions { + background: -moz-linear-gradient(top, #f1f1f1, #fafafa); + background: -ms-linear-gradient(top, #f1f1f1, #fafafa); + background: -o-linear-gradient(top, #f1f1f1, #fafafa); + background: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#fafafa)); + background: -webkit-linear-gradient(top, #f1f1f1, #fafafa); + margin: 20px 0; + padding: 10px; +} +.node-form .node-actions input.form-submit { + background: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#e0e0e0)); + background: -moz-linear-gradient(top, #fefefe, #e0e0e0); + background: -ms-linear-gradient(top, #fefefe, #e0e0e0); + background: -o-linear-gradient(top, #fefefe, #e0e0e0); + background: -webkit-linear-gradient(top, #fefefe, #e0e0e0); + border: 1px solid #c8c8c8; + border-radius: 3px; + -moz-border-radius: 3px; + margin: 0 10px 0 0; + min-width: 135px; + padding: 6px 0; +} +.node-form .node-actions input#edit-submit { + background: -webkit-gradient(linear, left top, left bottom, from(#4fa0ea), to(#3974ae)); + background: -webkit-linear-gradient(top, #4fa0ea, #3974ae); + background: -moz-linear-gradient(top, #4fa0ea, #3974ae); + background: -ms-linear-gradient(top, #4fa0ea, #3974ae); + background: -o-linear-gradient(top, #4fa0ea, #3974ae); + border-color: #3974ae; + color: white; + text-shadow: 0px 1px 0px rgba(0, 0, 0, .25); +} +.node-form input.form-autocomplete, +.node-form input.form-text, +.node-form input.form-tel, +.node-form input.form-email, +.node-form input.form-url, +.node-form input.form-search, +.node-form textarea.form-textarea, +.node-form select.form-select { + background: -moz-linear-gradient(top, #ececec, #fafafa); + background: -ms-linear-gradient(top, #ececec, #fafafa); + background: -o-linear-gradient(top, #ececec, #fafafa); + background: -webkit-gradient(linear, left top, left bottom, from(#ececec), to(#fafafa)); + background: -webkit-linear-gradient(top, #ececec, #fafafa); + border: 1px solid #c8c8c8; + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + color: #424242; + font-family: serif; + font-size: 1.2em; + padding: 8px; + max-width: 100%; +} +.js .node-form input.form-autocomplete { + background-position: 100% 0; +} +.js .node-form input.throbbing { + background-position: 100% 0; +} +.node-form input.form-autocomplete:focus, +.node-form input.form-text:focus, +.node-form input.form-tel:focus, +.node-form input.form-email:focus, +.node-form input.form-url:focus, +.node-form input.form-search:focus, +.node-form textarea.form-textarea:focus, +.node-form select.form-select:focus { + border-color: #c8c8c8; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + outline: 2px solid #c8c8c8; + transition: none; + -moz-transition: none; + -webkit-transition: none; +} +.node-form .form-item label { + margin-bottom: 5px; + font-size: 1.2em; +} +.node-form .edit-secondary .form-item label { + font-size: 1em; +} +.node-form .edit-secondary input.form-autocomplete, +.node-form .edit-secondary input.form-text, +.node-form .edit-secondary input.form-tel, +.node-form .edit-secondary input.form-email, +.node-form .edit-secondary input.form-url, +.node-form .edit-secondary input.form-search { + width: 100%; + padding: 5px; +} +.node-form-revision-information { + border: 0; + background: none; + padding: 0; +} diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 4e94b26..8427977 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -32,6 +32,7 @@ function node_add_page() { // Bypass the node/add listing if only one content type is available. if (count($content) == 1) { $item = array_shift($content); + drupal_goto($item['href']); } return theme('node_add_list', array('content' => $content)); @@ -118,6 +119,15 @@ function node_form_validate($form, &$form_state) { function node_form($form, &$form_state, $node) { global $user; + // Wrap main form components in a div + $form['edit_primary'] = array( + '#type' => 'markup', + '#prefix' => '
', + '#suffix' => '
', + '#attached' => array( + 'css' => array(drupal_get_path('module', 'node') . '/node.admin.css'), + ), + ); // During initial form build, add the node entity to the form state for use // during form building and processing. During a rebuild, use what is in the // form state. @@ -151,6 +161,7 @@ function node_form($form, &$form_state, $node) { $form[$key] = array( '#type' => 'value', '#value' => isset($node->$key) ? $node->$key : NULL, + '#group' => 'edit_primary', ); } @@ -158,6 +169,7 @@ function node_form($form, &$form_state, $node) { $form['changed'] = array( '#type' => 'hidden', '#default_value' => isset($node->changed) ? $node->changed : NULL, + '#group' => 'edit_primary', ); // Invoke hook_form() to get the node-specific bits. Can't use node_invoke(), // because hook_form() needs to be able to receive $form_state by reference. @@ -167,6 +179,8 @@ function node_form($form, &$form_state, $node) { if (function_exists($function) && ($extra = $function($node, $form_state))) { $form = array_merge_recursive($form, $extra); } + $form['edit_primary']['title'] = $form['title']; + unset($form['title']); // If the node type has a title, and the node type form defined no special // weight for it, we default to a weight of -5 for consistency. if (isset($form['title']) && !isset($form['title']['#weight'])) { @@ -187,6 +201,7 @@ function node_form($form, &$form_state, $node) { '#default_value' => (isset($node->langcode) ? $node->langcode : ''), '#options' => $language_options, '#empty_value' => LANGUAGE_NOT_SPECIFIED, + '#group' => 'edit_primary', ); } else { @@ -195,22 +210,32 @@ function node_form($form, &$form_state, $node) { // New nodes without multilingual support get the default language, old // nodes keep their language if language.module is not available. '#value' => !isset($form['#node']->nid) ? language_default()->langcode : $node->langcode, + '#group' => 'edit_primary', ); } + if (isset($node->title)) { + if (isset($node->status) && $node->status == 1) { + $published = t('published'); + } else { + $published = t('not published'); + } - $form['additional_settings'] = array( - '#type' => 'vertical_tabs', - '#weight' => 99, - ); + $node_summary = '

' . $published . '

'; + $node_summary .= '

Last saved ' . format_date($node->changed) . '

'; + $node_summary .= '
  • Author ' . $node->name . '
  • '; + $node_summary .= '
  • URL ' . drupal_get_path_alias('node/' . $node->nid) . '
  • '; + + $node_summary .= '
'; + } else { + $node_summary = ''; + } // Add a log field if the "Create new revision" option is checked, or if the // current user has the ability to check that option. $form['revision_information'] = array( '#type' => 'fieldset', - '#title' => t('Revision information'), - '#collapsible' => TRUE, - // Collapsed by default when "Create new revision" is unchecked - '#collapsed' => !$node->revision, + '#collapsible' => FALSE, + '#collapsed' => FALSE, '#group' => 'additional_settings', '#attributes' => array( 'class' => array('node-form-revision-information'), @@ -218,8 +243,8 @@ function node_form($form, &$form_state, $node) { '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), - '#weight' => 20, - '#access' => $node->revision || user_access('administer nodes'), + '#weight' => -99, + '#access' => (isset($node->title)) && ($node->revision || user_access('administer nodes')), ); $form['revision_information']['revision'] = array( '#type' => 'checkbox', @@ -243,6 +268,21 @@ function node_form($form, &$form_state, $node) { '#rows' => 4, '#default_value' => !empty($node->log) ? $node->log : '', '#description' => t('Briefly describe the changes you have made.'), + '#attributes' => array( + 'name' => 'log', + ), + '#states' => array( + 'visible' => array( + ':input[name="revision"]' => array('checked' => TRUE), + ), + ), + ); + + $form['additional_settings'] = array( + '#type' => 'fieldset', + '#weight' => 99, + '#prefix' => '
' . $node_summary, + '#suffix' => '
', ); // Node author information for administrators @@ -271,6 +311,7 @@ function node_form($form, &$form_state, $node) { '#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, + '#size' => 40, '#autocomplete_path' => 'user/autocomplete', '#default_value' => !empty($node->name) ? $node->name : '', '#weight' => -1, @@ -280,6 +321,7 @@ function node_form($form, &$form_state, $node) { '#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, + '#size' => 40, '#description' => t('Format: %time. The date format is YYYY-MM-DD and %timezone is the time zone offset from UTC. Leave blank to use the time of form submission.', array('%time' => !empty($node->date) ? date_format(date_create($node->date), 'Y-m-d H:i:s O') : format_date($node->created, 'custom', 'Y-m-d H:i:s O'), '%timezone' => !empty($node->date) ? date_format(date_create($node->date), 'O') : format_date($node->created, 'custom', 'O'))), '#default_value' => !empty($node->date) ? $node->date : '', ); @@ -298,7 +340,7 @@ function node_form($form, &$form_state, $node) { '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), - '#weight' => 95, + '#weight' => -95, ); $form['options']['status'] = array( '#type' => 'checkbox', @@ -317,15 +359,16 @@ function node_form($form, &$form_state, $node) { ); // Add the buttons. - $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array( + $form['edit_primary']['actions'] = array('#type' => 'actions',); + $form['edit_primary']['actions']['#attributes']['class'][] = 'node-actions'; + $form['edit_primary']['actions']['submit'] = array( '#type' => 'submit', '#access' => variable_get('node_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || (!form_get_errors() && isset($form_state['node_preview'])), '#value' => t('Save'), '#weight' => 5, '#submit' => array('node_form_submit'), ); - $form['actions']['preview'] = array( + $form['edit_primary']['actions']['preview'] = array( '#access' => variable_get('node_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED, '#type' => 'submit', '#value' => t('Preview'), @@ -333,7 +376,7 @@ function node_form($form, &$form_state, $node) { '#submit' => array('node_form_build_preview'), ); if (!empty($node->nid) && node_access('delete', $node)) { - $form['actions']['delete'] = array( + $form['edit_primary']['actions']['delete'] = array( '#type' => 'submit', '#value' => t('Delete'), '#weight' => 15, @@ -352,7 +395,7 @@ function node_form($form, &$form_state, $node) { } $form += array('#submit' => array()); - field_attach_form('node', $node, $form, $form_state, $node->langcode); + field_attach_form('node', $node, $form['edit_primary'], $form_state, $node->langcode); return $form; } -- 1.7.4.4