=== modified file 'includes/common.inc' --- includes/common.inc 2009-03-17 22:35:07 +0000 +++ includes/common.inc 2009-03-21 16:14:34 +0000 @@ -3717,6 +3717,9 @@ 'form_element' => array( 'arguments' => array('element' => NULL), ), + 'vertical_tabs_panes' => array( + 'arguments' => array('element' => NULL), + ), ); } === modified file 'includes/form.inc' --- includes/form.inc 2009-03-14 20:13:26 +0000 +++ includes/form.inc 2009-03-21 16:19:31 +0000 @@ -969,6 +969,9 @@ } } + if (!isset($form['#id'])) { + $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents'])); + } if (isset($form['#input']) && $form['#input']) { _form_builder_handle_input_element($form_id, $form, $form_state, $complete_form); } @@ -1077,9 +1080,6 @@ } array_unshift($form['#parents'], $name); } - if (!isset($form['#id'])) { - $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents'])); - } if (!empty($form['#disabled'])) { $form['#attributes']['disabled'] = 'disabled'; @@ -1594,6 +1594,7 @@ $element['#attributes']['class'] .= ' collapsed'; } } + $element['#attributes']['id'] = $element['#id']; return '' . ($element['#title'] ? '' . $element['#title'] . '' : '') . (isset($element['#description']) && $element['#description'] ? '
' . $element['#description'] . '
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') . "\n"; } @@ -2488,6 +2489,16 @@ } /** + * Makes the element's children fieldsets be vertical tabs. + */ +function theme_vertical_tabs_panes($element) { + // Add required JavaScript and Stylesheet. It's + drupal_add_js('misc/vertical-tabs.js', array('weight' => JS_DEFAULT - 1)); + drupal_add_css('misc/vertical-tabs.css'); + return '
' . drupal_render_children($element) . '
'; +} + +/** * Sets a form element's class attribute. * * Adds 'required' and 'error' classes as needed. === added file 'misc/vertical-tabs.css' --- misc/vertical-tabs.css 1970-01-01 00:00:00 +0000 +++ misc/vertical-tabs.css 2009-03-21 16:14:34 +0000 @@ -0,0 +1,80 @@ +/* $Id */ + +.vertical-tabs { + margin: 1em 0 1em 15em; + border: 1px solid #ccc; +} + +.vertical-tabs-list { + width: 15em; + list-style: none; + list-style-image: none; /* IE6 */ + border-top: 1px solid #ccc; + padding: 0; + position: relative; /* IE6 */ + margin: -1px 0 -1px -15em; + float: left; +} + +.vertical-tabs .vertical-tabs-panes fieldset.vertical-tabs-pane { + margin: 0 !important; + padding: 0 1em; + border: 0; +} + +.vertical-tabs .vertical-tabs-panes fieldset.vertical-tabs-pane legend { + display: none; +} + + + +/* Layout of each tab */ +.vertical-tabs-list li { + background: #eee; + border: 1px solid #ccc; + border-top: 0; + padding: 0; + margin: 0; + height: 1%; +} + +.vertical-tabs-list li a { + display: block; + text-decoration: none; + padding: 0.5em 0.6em; + line-height: 1.3em; + height: 1%; +} + +.vertical-tabs-list li a:focus { + position:relative; + z-index: 5; +} + +.vertical-tabs-list li a:hover { + text-decoration: none; +} + +.vertical-tabs-list li strong { + font-weight:normal; +} + +.vertical-tabs-list li.selected { + background: #fff; + border-right: 0; + position: relative; +} + +.vertical-tabs-list li.selected strong { + font-weight: bold; + color: #000; +} + +.vertical-tabs-list .description { + display: block; +} + +.vertical-tabs ul.vertical-tabs-list .description { + line-height: normal; + margin-bottom: 0; +} === added file 'misc/vertical-tabs.js' --- misc/vertical-tabs.js 1970-01-01 00:00:00 +0000 +++ misc/vertical-tabs.js 2009-03-21 16:30:37 +0000 @@ -0,0 +1,142 @@ +// $Id$ + +(function($) { + +/** + * Vertical Tabs. + * + * This script transforms a set of fieldsets into a stack of vertical + * tabs. Another tab pane can be selected by clicking on the respective + * tab. + * + * Each tab may have a description which can be updated by another + * script. For that to work, each fieldset has an associated + * 'verticalTabCallback' (with jQuery.data() attached to the fieldset), + * which is called every time the user performs an update to a form + * element inside the tab pane. + */ +Drupal.behaviors.verticalTabs = { + attach: function(context) { + $('.vertical-tabs-panes:not(.vertical-tabs-processed)', context).each(function() { + // Create the tab column. + var list = $(''); + $(this).wrap('
').before(list); + + // Transform each fieldset into a tab. + $('> fieldset', this).each(function(i) { + var tab = new Drupal.verticalTab({ title: $('> legend', this).text(), fieldset: $(this) }); + list.append(tab.item); + $(this) + .addClass('vertical-tabs-pane') + .data('verticalTab', tab) + .find('input, textarea, select') + .bind('change click blur keyup', function() { + tab.updateDescription(); + }); + }); + + $('> li:first', list).addClass('first'); + $('> li:last', list).addClass('last'); + + $('> fieldset:first', this).data('verticalTab').focus(); + }).addClass('vertical-tabs-processed'); + } +}; + +Drupal.behaviors.verticalTabsDescriptions = { + attach: function(context) { + $.each(Drupal.verticalTab.descriptors, function() { + var pane = $('fieldset#' + this.id + '.vertical-tabs-pane'); + + // Add the description callback if the tab is not yet initialized. + pane.filter(':not(.vertical-tabs-processed)') + .data('verticalTabCallback', this.callback) + .addClass('vertical-tabs-processed') + .end(); + + // Always try to update the tab description; even if the tab + // was already initialized. + var data = pane.data('verticalTab'); + if (data) { + data.updateDescription(); + } + }); + } +}; + +/** + * Vertical Tab + * + * @param settings + * An object with the following keys: + * - title: The name of the tab. + * - fieldset: The jQuery object of the fieldset that is the tab pane. + */ +Drupal.verticalTab = function(settings) { + var that = this; + $.extend(this, settings, Drupal.theme('verticalTab', settings)); + + this.link.click(function() { + that.focus(); + return false; + }); + + this.updateDescription(); +}; + +// All description callbacks are stored here so that they can be applied +// to other tabs later when new HTML is inserted into the page. +Drupal.verticalTab.descriptors = []; + +Drupal.verticalTab.addDescription = function(id, callback) { + Drupal.verticalTab.descriptors.push({ id: id, callback: callback }); +}; + + +Drupal.verticalTab.prototype = { + // Displays the tab's content pane. + focus: function() { + this.fieldset.siblings().each(function() { + var tab = $(this).data('verticalTab'); + tab.fieldset.hide(); + tab.item.removeClass('selected'); + }); + + this.fieldset.show(); + this.item.addClass('selected'); + }, + + // Updates the tab's description + updateDescription: function() { + var callback = this.fieldset.data('verticalTabCallback'); + if (callback) { + this.description.html(callback(this.fieldset)); + } + } +}; + +/** + * Theme function for a vertical tab. + * + * @param settings + * An object with the following keys: + * - title: The name of the tab. + * @return + * This function has to return an object with at least these keys: + * - item: The root tab jQuery element + * - link: The anchor tag that acts as the clickable area of the tab + * (jQuery version) + * - description: The jQuery element that contains the tab description + */ +Drupal.theme.prototype.verticalTab = function(settings) { + var tab = {}; + tab.item = $('
  • ') + .append(tab.link = $('') + .append(tab.title = $('').text(settings.title)) + .append(tab.description = $('') + ) + ); + return tab; +}; + +})(jQuery); === modified file 'modules/book/book.css' --- modules/book/book.css 2008-12-19 15:42:26 +0000 +++ modules/book/book.css 2009-03-21 16:14:34 +0000 @@ -35,6 +35,9 @@ margin-top: 0; margin-bottom: 0; } +html.js #edit-book-pick-book { + display: none; +} #edit-book-bid-wrapper .description { clear: both; } === added file 'modules/book/book.js' --- modules/book/book.js 1970-01-01 00:00:00 +0000 +++ modules/book/book.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,16 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-book', function (context) { + var val = $('#edit-book-bid').val(); + + if (val === '0') + return Drupal.t('Not in book'); + else if (val === 'new') + return Drupal.t('New book'); + else + return Drupal.checkPlain($('#edit-book-bid :selected').text()); +}); + +})(jQuery); === modified file 'modules/book/book.module' --- modules/book/book.module 2009-03-08 04:25:03 +0000 +++ modules/book/book.module 2009-03-21 16:14:34 +0000 @@ -349,7 +349,7 @@ if ($access) { _book_add_form_elements($form, $node); - $form['book']['pick-book'] = array( + $form['miscellaneous']['book']['pick-book'] = array( '#type' => 'submit', '#value' => t('Change book (update list of parents)'), // Submit the node form so the parent select options get updated. @@ -415,27 +415,25 @@ function _book_add_form_elements(&$form, $node) { // Need this for AJAX. $form['#cache'] = TRUE; - drupal_add_js("if (Drupal.jsEnabled) { jQuery(function() { jQuery('#edit-book-pick-book').css('display', 'none'); }); }", 'inline'); + drupal_add_js(drupal_get_path('module', 'book') .'/book.js'); - $form['book'] = array( + $form['miscellaneous']['book'] = array( '#type' => 'fieldset', '#title' => t('Book outline'), '#weight' => 10, - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#tree' => TRUE, '#attributes' => array('class' => 'book-outline-form'), ); foreach (array('menu_name', 'mlid', 'nid', 'router_path', 'has_children', 'options', 'module', 'original_bid', 'parent_depth_limit') as $key) { - $form['book'][$key] = array( + $form['miscellaneous']['book'][$key] = array( '#type' => 'value', '#value' => $node->book[$key], ); } - $form['book']['plid'] = _book_parent_select($node->book); + $form['miscellaneous']['book']['plid'] = _book_parent_select($node->book); - $form['book']['weight'] = array( + $form['miscellaneous']['book']['weight'] = array( '#type' => 'weight', '#title' => t('Weight'), '#default_value' => $node->book['weight'], @@ -466,7 +464,7 @@ } // Add a drop-down to select the destination book. - $form['book']['bid'] = array( + $form['miscellaneous']['book']['bid'] = array( '#type' => 'select', '#title' => t('Book'), '#default_value' => $node->book['bid'], === added file 'modules/comment/comment-node-form.js' --- modules/comment/comment-node-form.js 1970-01-01 00:00:00 +0000 +++ modules/comment/comment-node-form.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,9 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-comment-settings', function (context) { + return $('input:checked', context).parent().text(); +}); + +})(jQuery); === modified file 'modules/comment/comment.module' --- modules/comment/comment.module 2009-03-17 12:41:54 +0000 +++ modules/comment/comment.module 2009-03-21 16:14:34 +0000 @@ -574,17 +574,16 @@ function comment_form_alter(&$form, $form_state, $form_id) { if (!empty($form['#node_edit_form'])) { $node = $form['#node']; - $form['comment_settings'] = array( + drupal_add_js(drupal_get_path('module', 'comment') . '/comment-node-form.js'); + $form['miscellaneous']['comment_settings'] = array( '#type' => 'fieldset', '#access' => user_access('administer comments'), '#title' => t('Comment settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#weight' => 30, ); $comment_count = isset($node->nid) ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() : 0; $comment_settings = ($node->comment == COMMENT_NODE_HIDDEN && empty($comment_count)) ? COMMENT_NODE_CLOSED : $node->comment; - $form['comment_settings']['comment'] = array( + $form['miscellaneous']['comment_settings']['comment'] = array( '#type' => 'radios', '#parents' => array('comment'), '#default_value' => $comment_settings, @@ -624,9 +623,9 @@ // If the node doesn't have any comments, the "hidden" option makes no // sense, so don't even bother presenting it to the user. if (empty($comment_count)) { - unset($form['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]); - unset($form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]); - $form['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = theme('indentation') . t('Users cannot post comments.'); + unset($form['miscellaneous']['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]); + unset($form['miscellaneous']['comment_settings']['comment'][COMMENT_NODE_HIDDEN]); + $form['miscellaneous']['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = theme('indentation') . t('Users cannot post comments.'); } } } === added file 'modules/menu/menu.js' --- modules/menu/menu.js 1970-01-01 00:00:00 +0000 +++ modules/menu/menu.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,9 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-menu', function (context) { + return $('#edit-menu-link-title', context).val() || Drupal.t('Not in menu'); +}); + +})(jQuery); === modified file 'modules/menu/menu.module' --- modules/menu/menu.module 2009-03-20 19:18:09 +0000 +++ modules/menu/menu.module 2009-03-21 16:14:34 +0000 @@ -383,38 +383,37 @@ */ function menu_form_alter(&$form, $form_state, $form_id) { if (!empty($form['#node_edit_form'])) { + drupal_add_js(drupal_get_path('module', 'menu') . '/menu.js'); // Note - doing this to make sure the delete checkbox stays in the form. $form['#cache'] = TRUE; - $form['menu'] = array( + $form['miscellaneous']['menu'] = array( '#type' => 'fieldset', '#title' => t('Menu settings'), '#access' => user_access('administer menu'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, '#tree' => TRUE, - '#weight' => -2, + '#weight' => 5, '#attributes' => array('class' => 'menu-item-form'), ); $item = $form['#node']->menu; if ($item['mlid']) { // There is an existing link. - $form['menu']['delete'] = array( + $form['miscellaneous']['menu']['delete'] = array( '#type' => 'checkbox', '#title' => t('Delete this menu item.'), ); } if (!$item['link_title']) { - $form['menu']['#collapsed'] = TRUE; + $form['miscellaneous']['menu']['#collapsed'] = TRUE; } foreach (array('mlid', 'module', 'hidden', 'has_children', 'customized', 'options', 'expanded', 'hidden', 'parent_depth_limit') as $key) { - $form['menu'][$key] = array('#type' => 'value', '#value' => $item[$key]); + $form['miscellaneous']['menu'][$key] = array('#type' => 'value', '#value' => $item[$key]); } - $form['menu']['#item'] = $item; + $form['miscellaneous']['menu']['#item'] = $item; - $form['menu']['link_title'] = array('#type' => 'textfield', + $form['miscellaneous']['menu']['link_title'] = array('#type' => 'textfield', '#title' => t('Menu link title'), '#default_value' => $item['link_title'], '#description' => t('The link text corresponding to this item that should appear in the menu. Leave blank if you do not wish to add this post to the menu.'), @@ -426,7 +425,7 @@ if (!isset($options[$default])) { $default = 'main-menu:0'; } - $form['menu']['parent'] = array( + $form['miscellaneous']['menu']['parent'] = array( '#type' => 'select', '#title' => t('Parent item'), '#default_value' => $default, @@ -436,7 +435,7 @@ ); $form['#submit'][] = 'menu_node_form_submit'; - $form['menu']['weight'] = array( + $form['miscellaneous']['menu']['weight'] = array( '#type' => 'weight', '#title' => t('Weight'), '#delta' => 50, === added file 'modules/node/node.js' --- modules/node/node.js 1970-01-01 00:00:00 +0000 +++ modules/node/node.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,28 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-revision-information', function (context) { + return $('#edit-revision', context).is(':checked') ? + Drupal.t('Create new revision') : + Drupal.t('Don\'t create new revision'); +}); + +Drupal.verticalTab.addDescription('edit-author', function (context) { + var name = $('#edit-name').val(), date = $('#edit-date').val(); + return date ? + Drupal.t('By @name on @date', { '@name': name, '@date': date }) : + Drupal.t('By @name', { '@name': name }); +}); + +Drupal.verticalTab.addDescription('edit-options', function (context) { + var vals = []; + + $('input:checked', context).parent().each(function() { + vals.push($(this).text()); + }); + + return vals.join(', ') || Drupal.t('None'); +}); + +})(jQuery); === modified file 'modules/node/node.pages.inc' --- modules/node/node.pages.inc 2009-03-14 23:01:36 +0000 +++ modules/node/node.pages.inc 2009-03-21 16:14:34 +0000 @@ -99,6 +99,8 @@ function node_form(&$form_state, $node) { global $user; + drupal_add_js(drupal_get_path('module', 'node') . '/node.js'); + if (isset($form_state['node'])) { $node = $form_state['node'] + (array)$node; } @@ -146,41 +148,40 @@ $form['#node'] = $node; + $form['miscellaneous'] = array( + '#theme' => 'vertical_tabs_panes', + ); + // Add a log field if the "Create new revision" option is checked, or if the // current user has the ability to check that option. if (!empty($node->revision) || user_access('administer nodes')) { - $form['revision_information'] = array( + $form['miscellaneous']['revision_information'] = array( '#type' => 'fieldset', '#title' => t('Revision information'), - '#collapsible' => TRUE, - // Collapsed by default when "Create new revision" is unchecked - '#collapsed' => !$node->revision, '#weight' => 20, ); - $form['revision_information']['revision'] = array( + $form['miscellaneous']['revision_information']['revision'] = array( '#access' => user_access('administer nodes'), '#type' => 'checkbox', '#title' => t('Create new revision'), '#default_value' => $node->revision, ); - $form['revision_information']['log'] = array( + $form['miscellaneous']['revision_information']['log'] = array( '#type' => 'textarea', '#title' => t('Revision log message'), - '#rows' => 2, + '#rows' => 4, '#description' => t('Provide an explanation of the changes you are making. This will help other authors understand your motivations.'), ); } // Node author information for administrators - $form['author'] = array( + $form['miscellaneous']['author'] = array( '#type' => 'fieldset', '#access' => user_access('administer nodes'), '#title' => t('Authoring information'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#weight' => 90, ); - $form['author']['name'] = array( + $form['miscellaneous']['author']['name'] = array( '#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, @@ -189,7 +190,7 @@ '#weight' => -1, '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))), ); - $form['author']['date'] = array( + $form['miscellaneous']['author']['date'] = array( '#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, @@ -197,29 +198,27 @@ ); if (isset($node->date)) { - $form['author']['date']['#default_value'] = $node->date; + $form['miscellaneous']['author']['date']['#default_value'] = $node->date; } // Node options for administrators - $form['options'] = array( + $form['miscellaneous']['options'] = array( '#type' => 'fieldset', '#access' => user_access('administer nodes'), '#title' => t('Publishing options'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#weight' => 95, ); - $form['options']['status'] = array( + $form['miscellaneous']['options']['status'] = array( '#type' => 'checkbox', '#title' => t('Published'), '#default_value' => $node->status, ); - $form['options']['promote'] = array( + $form['miscellaneous']['options']['promote'] = array( '#type' => 'checkbox', '#title' => t('Promoted to front page'), '#default_value' => $node->promote, ); - $form['options']['sticky'] = array( + $form['miscellaneous']['options']['sticky'] = array( '#type' => 'checkbox', '#title' => t('Sticky at top of lists'), '#default_value' => $node->sticky, @@ -277,7 +276,7 @@ $form = array( '#after_build' => array('node_teaser_js', 'node_teaser_include_verify')); - $form['#prefix'] = '
    '; + $form['#prefix'] = '
    '; $form['#suffix'] = '
    '; $form['teaser_js'] = array( === added file 'modules/path/path.js' --- modules/path/path.js 1970-01-01 00:00:00 +0000 +++ modules/path/path.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,13 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-path', function (context) { + var path = $('#edit-path-1').val(); + + return path ? + Drupal.t('Alias: @alias', { '@alias': path }) : + Drupal.t('No alias'); +}); + +})(jQuery); === modified file 'modules/path/path.module' --- modules/path/path.module 2009-03-08 04:25:03 +0000 +++ modules/path/path.module 2009-03-21 16:14:34 +0000 @@ -188,16 +188,15 @@ */ function path_form_alter(&$form, $form_state, $form_id) { if (!empty($form['#node_edit_form'])) { + drupal_add_js(drupal_get_path('module', 'path') .'/path.js'); $path = isset($form['#node']->path) ? $form['#node']->path : NULL; - $form['path'] = array( + $form['miscellaneous']['path'] = array( '#type' => 'fieldset', '#title' => t('URL path settings'), - '#collapsible' => TRUE, - '#collapsed' => empty($path), '#access' => user_access('create url aliases'), '#weight' => 30, ); - $form['path']['path'] = array( + $form['miscellaneous']['path']['path'] = array( '#type' => 'textfield', '#default_value' => $path, '#maxlength' => 128, @@ -206,7 +205,7 @@ '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'), ); if ($path) { - $form['path']['pid'] = array( + $form['miscellaneous']['path']['pid'] = array( '#type' => 'value', '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s' AND language = '%s'", $path, $form['#node']->language)) ); === added file 'modules/upload/upload.js' --- modules/upload/upload.js 1970-01-01 00:00:00 +0000 +++ modules/upload/upload.js 2009-03-21 16:14:34 +0000 @@ -0,0 +1,10 @@ +// $Id$ + +(function($) { + +Drupal.verticalTab.addDescription('edit-attachments', function (context) { + var size = $('#upload-attachments tbody tr').size(); + return Drupal.formatPlural(size, '1 attachment', '@count attachments'); +}); + +})(jQuery); === modified file 'modules/upload/upload.module' --- modules/upload/upload.module 2009-03-14 20:13:26 +0000 +++ modules/upload/upload.module 2009-03-21 16:14:34 +0000 @@ -224,21 +224,19 @@ if (!empty($form['#node_edit_form'])) { $node = $form['#node']; if (variable_get("upload_$node->type", TRUE)) { + drupal_add_js(drupal_get_path('module', 'upload') .'/upload.js'); + // Attachments fieldset - $form['attachments'] = array( + $form['miscellaneous']['attachments'] = array( '#type' => 'fieldset', '#access' => user_access('upload files'), '#title' => t('File attachments'), - '#collapsible' => TRUE, - '#collapsed' => empty($node->files), '#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' => '
    ', - '#suffix' => '
    ', '#weight' => 30, ); // Wrapper for fieldset contents (used by ahah.js). - $form['attachments']['wrapper'] = array( + $form['miscellaneous']['attachments']['wrapper'] = array( '#prefix' => '
    ', '#suffix' => '
    ', ); @@ -249,16 +247,16 @@ $temp = file_directory_temp(); // Note: pass by reference if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) { - $form['attachments']['#description'] = t('File attachments are disabled. The file directories have not been properly configured.'); + $form['miscellaneous']['attachments']['#description'] = t('File attachments are disabled. The file directories have not been properly configured.'); if (user_access('administer site configuration')) { - $form['attachments']['#description'] .= ' ' . t('Please visit the file system configuration page.', array('@admin-file-system' => url('admin/settings/file-system'))); + $form['miscellaneous']['attachments']['#description'] .= ' ' . t('Please visit the file system configuration page.', array('@admin-file-system' => url('admin/settings/file-system'))); } else { - $form['attachments']['#description'] .= ' ' . t('Please contact the site administrator.'); + $form['miscellaneous']['attachments']['#description'] .= ' ' . t('Please contact the site administrator.'); } } else { - $form['attachments']['wrapper'] += _upload_form($node); + $form['miscellaneous']['attachments']['wrapper'] += _upload_form($node); $form['#attributes']['enctype'] = 'multipart/form-data'; } $form['#submit'][] = 'upload_node_form_submit'; @@ -645,7 +643,7 @@ $files = array(); // Load the form from the Form API cache. - if (!($cached_form = form_get_cache($_POST['form_build_id'], $cached_form_state)) || !isset($cached_form['#node']) || !isset($cached_form['attachments'])) { + if (!($cached_form = form_get_cache($_POST['form_build_id'], $cached_form_state)) || !isset($cached_form['#node']) || !isset($cached_form['miscellaneous']['attachments'])) { form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.')); $output = theme('status_messages'); print drupal_to_js(array('status' => TRUE, 'data' => $output)); @@ -671,10 +669,10 @@ $form = _upload_form($node); - unset($cached_form['attachments']['wrapper']['new']); - $cached_form['attachments']['wrapper'] = array_merge($cached_form['attachments']['wrapper'], $form); + unset($cached_form['miscellaneous']['attachments']['wrapper']['new']); + $cached_form['miscellaneous']['attachments']['wrapper'] = array_merge($cached_form['miscellaneous']['attachments']['wrapper'], $form); - $cached_form['attachments']['#collapsed'] = FALSE; + $cached_form['miscellaneous']['attachments']['#collapsed'] = FALSE; form_set_cache($_POST['form_build_id'], $cached_form, $cached_form_state); === modified file 'themes/garland/fix-ie.css' --- themes/garland/fix-ie.css 2008-03-13 20:02:18 +0000 +++ themes/garland/fix-ie.css 2009-03-21 16:14:34 +0000 @@ -25,6 +25,10 @@ background: none; } +div.vertical-tabs ul.vertical-tabs-list li.first { + background-image: none; +} + ul.primary { /* Fix missing top margin */ position: relative; /* LTR */ === modified file 'themes/garland/style.css' --- themes/garland/style.css 2009-02-18 14:28:21 +0000 +++ themes/garland/style.css 2009-03-21 16:14:34 +0000 @@ -823,6 +823,13 @@ background-color: transparent; } +/* Keep the background position at 0 for filters and vertical tabs. */ +*:first-child+html fieldset.filter-wrapper, +*:first-child+html fieldset.vertical-tabs-pane { + background-position: 0 0; +} + + *:first-child+html fieldset > .description, *:first-child+html fieldset .fieldset-wrapper .description { padding-top: 1em; } @@ -851,6 +858,39 @@ background: url(images/menu-collapsed.gif) no-repeat 0% 50%; /* LTR */ } + /** + * Vertical tabs. + */ +div.vertical-tabs { + margin-right: 5%; + border-color: #d9eaf5; +} + +div.vertical-tabs .vertical-tabs-panes fieldset.vertical-tabs-pane { + padding: 0.5em 1em; +} + +div.vertical-tabs ul.vertical-tabs-list { + border-color: #d9eaf5; +} + +div.vertical-tabs ul.vertical-tabs-list li { + background-color: #edf5fa; + border-color: #d9eaf5; +} + +div.vertical-tabs ul.vertical-tabs-list li.selected { + background: #fff repeat-x 0 0; +} + +div.vertical-tabs ul.vertical-tabs-list li.selected.first { + background-image: url(images/gradient-inner.png); +} + +div.vertical-tabs ul.vertical-tabs-list li.selected a strong { + color: #494949; +} + /** * Syndication icons and block */