=== modified file 'includes/common.inc'
--- includes/common.inc 2009-03-17 22:35:07 +0000
+++ includes/common.inc 2009-03-21 12:11:47 +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 12:58:38 +0000
@@ -972,6 +972,19 @@
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.
@@ -1077,9 +1090,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';
@@ -1148,16 +1158,6 @@
}
}
}
- // 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);
}
@@ -1594,6 +1594,7 @@
$element['#attributes']['class'] .= ' collapsed';
}
}
+ $element['#attributes']['id'] = $element['#id'];
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-20 16:19:12 +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 14:05:57 +0000
@@ -0,0 +1,100 @@
+// $Id$
+
+(function($) {
+
+Drupal.behaviors.verticalTabs = {
+ attach: function(context) {
+ $('.vertical-tabs-panes:not(.vertical-tabs-processed)', context).each(function() {
+ // create the tabs
+ var list = $('';
+ $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 13:47:56 +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-20 16:12:31 +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 13:48:01 +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-20 16:12:31 +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-20 16:12:31 +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 13:25:35 +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
*/