? .DS_Store ? config-admin-page.patch ? incremental_filter_access_control_29.patch ? put-tabs-on-right.patch ? vertical-tabs.patch ? modules/.DS_Store ? sites/default/files ? sites/default/settings.php Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.297 diff -u -p -r1.297 form.inc --- includes/form.inc 15 Oct 2008 14:17:26 -0000 1.297 +++ includes/form.inc 18 Oct 2008 20:03:30 -0000 @@ -874,6 +874,19 @@ function form_builder($form_id, $form, & if (isset($form['#input']) && $form['#input']) { _form_builder_handle_input_element($form_id, $form, $form_state, $complete_form); } + if (!isset($form['#id'])) { + $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents'])); + } + // Allow for elements to expand to multiple elements, e.g., radios, + // checkboxes and files. + if (isset($form['#process']) && !$form['#processed']) { + foreach ($form['#process'] as $process) { + if (drupal_function_exists($process)) { + $form = $process($form, isset($edit) ? $edit : NULL, $form_state, $complete_form); + } + } + $form['#processed'] = TRUE; + } $form['#defaults_loaded'] = TRUE; // We start off assuming all form elements are in the correct order. @@ -970,9 +983,6 @@ function _form_builder_handle_input_elem } array_unshift($form['#parents'], $name); } - if (!isset($form['#id'])) { - $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents'])); - } unset($edit); if (!empty($form['#disabled'])) { @@ -1042,16 +1052,6 @@ function _form_builder_handle_input_elem } } } - // Allow for elements to expand to multiple elements, e.g., radios, - // checkboxes and files. - if (isset($form['#process']) && !$form['#processed']) { - foreach ($form['#process'] as $process) { - if (drupal_function_exists($process)) { - $form = $process($form, isset($edit) ? $edit : NULL, $form_state, $complete_form); - } - } - $form['#processed'] = TRUE; - } form_set_value($form, $form['#value'], $form_state); } @@ -1515,6 +1515,7 @@ function theme_fieldset($element) { $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"; } @@ -1916,6 +1917,41 @@ function form_process_ahah($element) { return $element; } +function form_process_vertical_tabs(&$element) { + static $js_added = array(); + if (isset($element['#vertical_tab']) && $element['#vertical_tab'] && (isset($element['#access']) ? $element['#access'] : TRUE)) { + // If it's not a full array, find out what it is. + if (!is_array($element['#vertical_tab'])) { + // If it's a string + if (is_string($element['#vertical_tab'])) { + $element['#vertical_tab'] = array('callback' => $element['#vertical_tab']); + } + else { + $element['#vertical_tab'] = array(); + } + } + $js_added[$element['#id']] = array( + 'name' => (isset($element['#title']) ? $element['#title'] : ''), + 'callback' => (isset($element['#vertical_tab']['callback']) ? $element['#vertical_tab']['callback'] : ''), + 'arguments' => (isset($element['#vertical_tab']['arguments']) ? $element['#vertical_tab']['arguments'] : ''), + ); + if (count($js_added) == 2) { + drupal_add_js(array('verticalTabs' => $js_added), 'setting'); + $element['#post_render'] = array('_form_post_render_vertical_tabs'); + } + elseif (count($js_added) > 2) { + drupal_add_js(array('verticalTabs' => array($element['#id'] => $js_added[$element['#id']])), 'setting'); + } + } + return $element; +} + +function _form_post_render_vertical_tabs($element) { + drupal_add_js('misc/vertical-tabs.js'); + drupal_add_css('misc/vertical-tabs.css'); + return $element; +} + /** * Format a form item. * Index: misc/drupal.js =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.js,v retrieving revision 1.46 diff -u -p -r1.46 drupal.js --- misc/drupal.js 12 Oct 2008 00:29:09 -0000 1.46 +++ misc/drupal.js 18 Oct 2008 20:03:30 -0000 @@ -1,6 +1,6 @@ // $Id: drupal.js,v 1.46 2008/10/12 00:29:09 webchick Exp $ -var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} }; +var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {}, 'verticalTabs': {} }; /** * Set the variable that indicates if JavaScript behaviors should be applied. Index: misc/vertical-tabs.css =================================================================== RCS file: misc/vertical-tabs.css diff -N misc/vertical-tabs.css --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ misc/vertical-tabs.css 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,99 @@ +.vertical-tabs-list .description { + display: block; +} + +/* Border style of tabs and content */ +div.vertical-tabs-div, +ul.vertical-tabs-list { + border: 1px solid #ccc; +} + +/* Make space for the tabs on the side */ +.vertical-tabs { + margin-left: 180px; +} + +/* Set the background image on the tabs and content */ +.vertical-tabs, +.vertical-tabs ul.vertical-tabs-list { + background: #fff; +} + +/* Position and layout of tabs container */ +.vertical-tabs ul.vertical-tabs-list { + width: 179px; + float: left; + margin: 0 0 0 -180px; + border-right: 0px; + z-index: 1; + border-bottom: 0; +} + + +/* Reset LIs which probably have awkward layout inherited from tabs */ +.vertical-tabs ul.vertical-tabs-list li { + float: none; + margin: 0; + padding: 0; + background-image: none; +} + +/* Layout of each tab */ +.vertical-tabs ul.vertical-tabs-list a { + display: block; + margin: 0; + padding: .4em .3em .1em .6em; + background: #fafafa; + text-align: left; + font-weight: normal; + border-bottom: 1px solid #ccc; +} + +.vertical-tabs ul.vertical-tabs-list a.vertical-tabs-nodescription { + padding-bottom: .4em; +} + +.vertical-tabs ul.vertical-tabs-list .description { + padding: 0; + line-height: normal; + min-height: 0; + white-space: normal; +} + +.vertical-tabs ul.vertical-tabs-list a { + border-right: 1px solid #ccc; +} + +/* Hover state of tabs */ +.vertical-tabs ul.vertical-tabs-list a:hover { + text-decoration: none; + cursor: pointer; +} + +.vertical-tabs ul.vertical-tabs-list a:focus { + outline: none; +} + +/* Selected tab */ +.vertical-tabs ul.vertical-tabs-list li.selected a { + background: transparent none; + color: black; + border-right: 0; +} + +/* Reset some important elements of each panel */ +.vertical-tabs .vertical-tabs-div { + margin: 0; + padding: .5em; + margin-top: -1px; + margin-left: -1px; + background: transparent none; +} + +.buttons { + clear: both; +} + +#edit-book-bid-wrapper .description { + clear:none; +} \ No newline at end of file Index: misc/vertical-tabs.js =================================================================== RCS file: misc/vertical-tabs.js diff -N misc/vertical-tabs.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ misc/vertical-tabs.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,54 @@ +Drupal.behaviors.verticalTabs = function() { + if (!$('.vertical-tabs-list').size()) { + var ul = $('
').find('ul'); + $.each(Drupal.settings.verticalTabs, function(k, v) { + var description = '', cssClass = 'vertical-tabs-list-' + k; + if (v.callback && Drupal.verticalTabs[v.callback]) { + description = ' '; + } + else { + cssClass += ' vertical-tabs-nodescription'; + } + ul.append($('
  • '+ v.name + description +'
  • ') + .find('a') + .bind('click', function() { + $(this).parent().addClass('selected').siblings().removeClass('selected'); + $('.vertical-tabs-' + k).show().siblings('.vertical-tabs-div').hide(); + return false; + }) + .end()) + .end() + .append($('#' + k + ' > .fieldset-wrapper') + .addClass('vertical-tabs-' + k) + .addClass('vertical-tabs-div')); + if (v.callback && Drupal.verticalTabs[v.callback]) { + ul.end() + .bind('change', function() { $('.vertical-tabs-list-' + k + ' > .description').html(Drupal.verticalTabs[v.callback].apply(this, v.args)); }) + .end() + .find('ul'); + } + $('#' + k).remove(); + }); + ul.end().insertBefore('.buttons'); + var max = $('.vertical-tabs ul').height(); + $('.vertical-tabs-div').each(function() { + max = Math.max(max, $(this).height()); + }); + $('.vertical-tabs-div').height(max).hide(); + $('.vertical-tabs-div:first').show(); + $('.vertical-tabs ul li:first').addClass('selected'); + } +} + +Drupal.behaviors.verticalTabsReload = function() { + $.each(Drupal.settings.verticalTabs, function(k, v) { + if (v.callback && Drupal.verticalTabs[v.callback]) { + $('.vertical-tabs ul.vertical-tabs-list a.vertical-tabs-list-'+ k +' span.description').html(Drupal.verticalTabs[v.callback].apply(this, v.args)); + } + }); + var max = $('.vertical-tabs ul').height(); + $('.vertical-tabs-div').each(function() { + max = Math.max(max, $(this).height()); + }); + $('.vertical-tabs-div').height(max); +} Index: modules/book/book.js =================================================================== RCS file: modules/book/book.js diff -N modules/book/book.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/book/book.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,15 @@ +Drupal.verticalTabs.nodeFormBook = function() { + var text = $('#edit-book-bid option[selected]').text(); + if (text == Drupal.t('')) { + return Drupal.t('Not in book'); + } + else if (text == Drupal.t('')) { + return Drupal.t('New book'); + } + return text; +} +if (Drupal.jsEnabled) { + $(document).ready(function() { + $('#edit-book-pick-book').css('display', 'none'); + }); +} \ No newline at end of file Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.472 diff -u -p -r1.472 book.module --- modules/book/book.module 13 Oct 2008 19:59:41 -0000 1.472 +++ modules/book/book.module 18 Oct 2008 20:03:30 -0000 @@ -387,7 +387,7 @@ function _book_parent_select($book_link) function _book_add_form_elements(&$form, $node) { // Need this for AJAX. $form['#cache'] = TRUE; - drupal_add_js("if (Drupal.jsEnabled) { $(document).ready(function() { $('#edit-book-pick-book').css('display', 'none'); }); }", 'inline'); + drupal_add_js(drupal_get_path('module', 'book') .'/book.js'); $form['book'] = array( '#type' => 'fieldset', @@ -397,6 +397,7 @@ function _book_add_form_elements(&$form, '#collapsed' => TRUE, '#tree' => TRUE, '#attributes' => array('class' => 'book-outline-form'), + '#vertical_tab' => 'nodeFormBook', ); foreach (array('menu_name', 'mlid', 'nid', 'router_path', 'has_children', 'options', 'module', 'original_bid', 'parent_depth_limit') as $key) { $form['book'][$key] = array( Index: modules/comment/comment-node-form.js =================================================================== RCS file: modules/comment/comment-node-form.js diff -N modules/comment/comment-node-form.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/comment/comment-node-form.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,11 @@ +Drupal.verticalTabs.nodeFormComment = function() { + var input = $('.vertical-tabs-edit-comment-settings input[checked]'); + console.log('hi'); + if (!input.size()) { + console.log($('.vertical-tabs-edit-comment-settings input')); + input = $('.vertical-tabs-edit-comment-settings input')[Drupal.settings.nodeForm.comment]; + } + else { + return $(input).parent().text().replace(/^\s*(.*)\s*$/, '$1'); + } +} Index: modules/comment/comment.js =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.js,v retrieving revision 1.6 diff -u -p -r1.6 comment.js --- modules/comment/comment.js 14 May 2008 13:12:40 -0000 1.6 +++ modules/comment/comment.js 18 Oct 2008 20:03:30 -0000 @@ -33,3 +33,4 @@ Drupal.comment.getCookie = function(name return returnValue; }; +z Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.659 diff -u -p -r1.659 comment.module --- modules/comment/comment.module 14 Oct 2008 20:39:42 -0000 1.659 +++ modules/comment/comment.module 18 Oct 2008 20:03:30 -0000 @@ -546,6 +546,8 @@ function comment_form_alter(&$form, $for } elseif (!empty($form['#node_edit_form'])) { $node = $form['#node']; + drupal_add_js(drupal_get_path('module', 'comment') . '/comment-node-form.js'); + drupal_add_js(array('nodeForm' => array('comment' => $node->comment)), 'setting'); $form['comment_settings'] = array( '#type' => 'fieldset', '#access' => user_access('administer comments'), @@ -553,6 +555,7 @@ function comment_form_alter(&$form, $for '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 30, + '#vertical_tab' => 'nodeFormComment', ); $form['comment_settings']['comment'] = array( '#type' => 'radios', Index: modules/menu/menu.js =================================================================== RCS file: modules/menu/menu.js diff -N modules/menu/menu.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/menu/menu.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,8 @@ +Drupal.verticalTabs.nodeFormMenu = function() { + if ($('#edit-menu-link-title').val()) { + return $('#edit-menu-link-title').val(); + } + else { + return Drupal.t('Not in menu'); + } +} \ No newline at end of file Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.172 diff -u -p -r1.172 menu.module --- modules/menu/menu.module 12 Oct 2008 04:30:06 -0000 1.172 +++ modules/menu/menu.module 18 Oct 2008 20:03:30 -0000 @@ -379,6 +379,7 @@ function _menu_parent_depth_limit($item) */ 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; @@ -389,7 +390,8 @@ function menu_form_alter(&$form, $form_s '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE, - '#weight' => -2, + '#weight' => 5, + '#vertical_tab' => 'nodeFormMenu', '#attributes' => array('class' => 'menu-item-form'), ); $item = $form['#node']->menu; Index: modules/node/node.js =================================================================== RCS file: modules/node/node.js diff -N modules/node/node.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/node/node.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,36 @@ +Drupal.verticalTabs.nodeFormRevision = function() { + var val = $('#edit-revision').attr('checked'); + if (val) { + return Drupal.t('Create new revision'); + } + else { + return Drupal.t('Don\'t create new revision'); + } +} + +Drupal.verticalTabs.nodeFormAuthoring = function() { + var name = $('#edit-name').val(), date = $('#edit-date').val(); + if (date) { + return Drupal.t('By @name on @date', { '@name': name, '@date': date }); + } + else { + return Drupal.t('By @name', { '@name': name }); + } +} + +Drupal.verticalTabs.nodeFormPublishingOptions = function() { + var vals = []; + if ($('#edit-status').attr('checked')) { + vals.push(Drupal.t('Published')); + } + if ($('#edit-promote').attr('checked')) { + vals.push(Drupal.t('Promoted to front page')); + } + if ($('#edit-sticky').attr('checked')) { + vals.push(Drupal.t('Sticky on top of lists')); + } + if (vals.join(', ') == '') { + return Drupal.t('None'); + } + return vals.join(', '); +} Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.45 diff -u -p -r1.45 node.pages.inc --- modules/node/node.pages.inc 13 Oct 2008 00:33:03 -0000 1.45 +++ modules/node/node.pages.inc 18 Oct 2008 20:03:30 -0000 @@ -96,6 +96,7 @@ function node_object_prepare(&$node) { * Generate the node add/edit form array. */ function node_form(&$form_state, $node) { + drupal_add_js(drupal_get_path('module', 'node') . '/node.js'); global $user; if (isset($form_state['node'])) { @@ -155,6 +156,7 @@ function node_form(&$form_state, $node) // Collapsed by default when "Create new revision" is unchecked '#collapsed' => !$node->revision, '#weight' => 20, + '#vertical_tab' => 'nodeFormRevision', ); $form['revision_information']['revision'] = array( '#access' => user_access('administer nodes'), @@ -178,6 +180,7 @@ function node_form(&$form_state, $node) '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 90, + '#vertical_tab' => 'nodeFormAuthoring', ); $form['author']['name'] = array( '#type' => 'textfield', @@ -207,6 +210,7 @@ function node_form(&$form_state, $node) '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 95, + '#vertical_tab' => 'nodeFormPublishingOptions', ); $form['options']['status'] = array( '#type' => 'checkbox', @@ -233,8 +237,11 @@ function node_form(&$form_state, $node) } // Add the buttons. - $form['buttons'] = array(); - $form['buttons']['#weight'] = 100; + $form['buttons'] = array( + '#weight' => 100, + '#prefix' => '
    ', + '#suffix' => '
    ', + ); $form['buttons']['submit'] = array( '#type' => 'submit', '#access' => !variable_get('node_preview', 0) || (!form_get_errors() && isset($form_state['node_preview'])), @@ -304,7 +311,7 @@ function node_body_field(&$node, $label, } /** - * Button sumit function: handle the 'Delete' button on the node form. + * Button submit function: handle the 'Delete' button on the node form. */ function node_form_delete_submit($form, &$form_state) { $destination = ''; Index: modules/path/path.js =================================================================== RCS file: modules/path/path.js diff -N modules/path/path.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/path/path.js 18 Oct 2008 20:03:30 -0000 @@ -0,0 +1,10 @@ +Drupal.verticalTabs.nodeFormPath = function() { + var path = $('#edit-path-1').val(); + + if (path) { + return Drupal.t('Alias: @alias', { '@alias': path }); + } + else { + return Drupal.t('No alias'); + } +} \ No newline at end of file Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.149 diff -u -p -r1.149 path.module --- modules/path/path.module 12 Oct 2008 04:30:06 -0000 1.149 +++ modules/path/path.module 18 Oct 2008 20:03:31 -0000 @@ -186,6 +186,7 @@ function path_nodeapi_delete(&$node, $ar */ 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( '#type' => 'fieldset', @@ -194,6 +195,7 @@ function path_form_alter(&$form, $form_s '#collapsed' => empty($path), '#access' => user_access('create url aliases'), '#weight' => 30, + '#vertical_tab' => 'nodeFormPath', ); $form['path']['path'] = array( '#type' => 'textfield', Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.632 diff -u -p -r1.632 system.module --- modules/system/system.module 14 Oct 2008 20:44:57 -0000 1.632 +++ modules/system/system.module 18 Oct 2008 20:03:31 -0000 @@ -337,7 +337,7 @@ function system_elements() { '#collapsible' => FALSE, '#collapsed' => FALSE, '#value' => NULL, - '#process' => array('form_process_ahah'), + '#process' => array('form_process_ahah', 'form_process_vertical_tabs'), ); $type['token'] = array( Index: modules/upload/upload.js =================================================================== RCS file: modules/upload/upload.js diff -N modules/upload/upload.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/upload/upload.js 18 Oct 2008 20:03:31 -0000 @@ -0,0 +1,9 @@ +Drupal.verticalTabs.nodeFormAttachments = function() { + var size = $('#upload-attachments tbody tr').size(); + if (size) { + return Drupal.formatPlural(size, '1 attachment', '@count attachments'); + } + else { + return Drupal.t('No attachments'); + } +} Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.213 diff -u -p -r1.213 upload.module --- modules/upload/upload.module 12 Oct 2008 02:42:56 -0000 1.213 +++ modules/upload/upload.module 18 Oct 2008 20:03:31 -0000 @@ -227,6 +227,8 @@ function upload_form_alter(&$form, $form 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( '#type' => 'fieldset', @@ -238,6 +240,7 @@ function upload_form_alter(&$form, $form '#prefix' => '
    ', '#suffix' => '
    ', '#weight' => 30, + '#vertical_tab' => 'nodeFormAttachments', ); // Wrapper for fieldset contents (used by ahah.js).