=== modified file 'includes/common.inc'
--- includes/common.inc 2009-03-30 05:13:45 +0000
+++ includes/common.inc 2009-03-30 09:54:26 +0000
@@ -3750,6 +3750,9 @@
'text_format_wrapper' => array(
'arguments' => array('element' => NULL),
),
+ 'vertical_tabs' => array(
+ 'arguments' => array('element' => NULL),
+ ),
);
}
=== modified file 'includes/form.inc'
--- includes/form.inc 2009-03-30 03:15:40 +0000
+++ includes/form.inc 2009-03-30 21:30:06 +0000
@@ -939,7 +939,8 @@
/**
* Walk through the structured form array, adding any required
* properties to each element and mapping the incoming $_POST
- * data to the proper elements.
+ * data to the proper elements. Also, execute any #process handlers
+ * attached to a specific element.
*
* @param $form_id
* A unique string identifying the form for validation, submission,
@@ -972,9 +973,22 @@
}
}
+ 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);
}
+ // 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, $form_state, $complete_form);
+ }
+ }
+ $form['#processed'] = TRUE;
+ }
$form['#defaults_loaded'] = TRUE;
// We start off assuming all form elements are in the correct order.
@@ -1062,8 +1076,7 @@
/**
* Populate the #value and #name properties of input elements so they
- * can be processed and rendered. Also, execute any #process handlers
- * attached to a specific element.
+ * can be processed and rendered.
*/
function _form_builder_handle_input_element($form_id, &$form, &$form_state, $complete_form) {
if (!isset($form['#name'])) {
@@ -1080,9 +1093,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';
@@ -1151,16 +1161,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);
}
@@ -1597,6 +1597,7 @@
$element['#attributes']['class'] .= ' collapsed';
}
}
+ $element['#attributes']['id'] = $element['#id'];
return '
' . $element['#children'] . drupal_render_children($element) . '
';
+}
+
+/**
* Theme a form submit button.
*
* @ingroup themeable
=== added file 'misc/vertical-tabs-rtl.css'
--- misc/vertical-tabs-rtl.css 1970-01-01 00:00:00 +0000
+++ misc/vertical-tabs-rtl.css 2009-03-30 22:49:15 +0000
@@ -0,0 +1,17 @@
+/* $Id */
+
+.vertical-tabs {
+ margin-left: 0;
+ margin-right: 15em;
+}
+
+.vertical-tabs-list {
+ margin-right: -15em;
+ right: 0;
+ float: right;
+}
+
+.vertical-tabs-list li.selected {
+ border-left-width: 0;
+ border-right-width: 1px;
+}
\ No newline at end of file
=== added file 'misc/vertical-tabs.css'
--- misc/vertical-tabs.css 1970-01-01 00:00:00 +0000
+++ misc/vertical-tabs.css 2009-03-30 22:30:10 +0000
@@ -0,0 +1,86 @@
+/* $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 -100% -1px 0;
+ left: -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-width: 0;
+ position: relative;
+}
+
+.vertical-tabs-list li.selected a:focus {
+ outline: 0;
+}
+
+
+.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-30 22:28:45 +0000
@@ -0,0 +1,147 @@
+// $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() {
+ var focusID = $(':hidden.vertical-tabs-active-tab', this).val();
+ var focus;
+ // Create the tab column.
+ 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-28 23:39:42 +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-30 05:30:39 +0000
+++ modules/path/path.module 2009-03-30 09:10:49 +0000
@@ -194,6 +194,8 @@
'#title' => t('URL path settings'),
'#collapsible' => TRUE,
'#collapsed' => empty($path),
+ '#vertical_tab' => 'additional_settings',
+ '#vertical_tab_js' => array(drupal_get_path('module', 'path') .'/path.js'),
'#access' => user_access('create url aliases'),
'#weight' => 30,
);
=== modified file 'modules/system/system.module'
--- modules/system/system.module 2009-03-25 18:40:50 +0000
+++ modules/system/system.module 2009-03-29 15:24:18 +0000
@@ -236,6 +236,7 @@
'#method' => 'post',
'#action' => request_uri(),
'#theme_wrapper' => 'form',
+ '#process' => array('form_process_form'),
);
$type['page'] = array(
@@ -381,6 +382,7 @@
'#theme' => 'file',
'#theme_wrapper' => 'form_element',
);
+
$type['tableselect'] = array(
'#input' => TRUE,
'#js_select' => TRUE,
@@ -419,10 +421,16 @@
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#value' => NULL,
- '#process' => array('form_process_ahah'),
+ '#process' => array('form_process_ahah', 'form_process_fieldset'),
'#theme_wrapper' => 'fieldset',
);
+ $type['vertical_tabs'] = array(
+ '#theme_wrapper' => 'vertical_tabs',
+ '#process' => array('form_process_vertical_tabs'),
+ '#default_tab' => '',
+ );
+
$type['token'] = array(
'#input' => TRUE,
'#theme' => array('hidden'),
=== added file 'modules/upload/upload.js'
--- modules/upload/upload.js 1970-01-01 00:00:00 +0000
+++ modules/upload/upload.js 2009-03-28 23:39:42 +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-25 16:43:02 +0000
+++ modules/upload/upload.module 2009-03-29 11:59:39 +0000
@@ -231,9 +231,9 @@
'#title' => t('File attachments'),
'#collapsible' => TRUE,
'#collapsed' => empty($node->files),
+ '#vertical_tab' => 'additional_settings',
+ '#vertical_tab_js' => array(drupal_get_path('module', 'upload') .'/upload.js'),
'#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,
);
=== 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-28 23:39:42 +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-rtl.css'
--- themes/garland/style-rtl.css 2008-12-19 15:42:26 +0000
+++ themes/garland/style-rtl.css 2009-03-30 21:56:56 +0000
@@ -199,6 +199,14 @@
}
/**
+ * Vertical tabs.
+ */
+div.vertical-tabs {
+ margin-left: 5%;
+ margin-right: 15em;
+}
+
+/**
* Syndication Block
*/
#block-node-syndicate h2 {
=== modified file 'themes/garland/style.css'
--- themes/garland/style.css 2009-03-30 03:15:40 +0000
+++ themes/garland/style.css 2009-03-30 09:36:27 +0000
@@ -827,6 +827,13 @@
background-position: 0 0;
}
+/* 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;
}
@@ -856,6 +863,39 @@
}
/**
+ * 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
*/
#block-node-syndicate h2 {