summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-21 00:21:48 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-21 00:21:48 +0000
commitdb61b2603918d582afad82b8036fac7f5240a627 (patch)
tree7d5cc8f01eb970dc80e65fc4fdf9bfa9c1c59cd5 /modules/node
parentbf49ab721394036a9e3396236cab76ae6db0594f (diff)
downloadbrdo-db61b2603918d582afad82b8036fac7f5240a627.tar.gz
brdo-db61b2603918d582afad82b8036fac7f5240a627.tar.bz2
#439798 by Rob Loach: Added Vertical Tabs to the Node Type Form.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/content_types.inc9
-rw-r--r--modules/node/content_types.js35
2 files changed, 40 insertions, 4 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index af6cbbcb4..bd68d05e3 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -108,12 +108,17 @@ function node_type_form(&$form_state, $type = NULL) {
'#title' => t('Description'),
'#type' => 'textarea',
'#default_value' => $type->description,
- );
+ );
+
+ $form['additional_settings'] = array(
+ '#type' => 'vertical_tabs',
+ );
$form['submission'] = array(
'#type' => 'fieldset',
'#title' => t('Submission form settings'),
'#collapsible' => TRUE,
+ '#group' => 'additional_settings',
);
$form['submission']['title_label'] = array(
'#title' => t('Title field label'),
@@ -155,6 +160,7 @@ function node_type_form(&$form_state, $type = NULL) {
'#title' => t('Publishing options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#group' => 'additional_settings',
);
$form['workflow']['node_options'] = array('#type' => 'checkboxes',
'#title' => t('Default options'),
@@ -172,6 +178,7 @@ function node_type_form(&$form_state, $type = NULL) {
'#title' => t('Display settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#group' => 'additional_settings',
);
$form['display']['node_submitted'] = array(
'#type' => 'checkbox',
diff --git a/modules/node/content_types.js b/modules/node/content_types.js
index e182d3452..98a0baed1 100644
--- a/modules/node/content_types.js
+++ b/modules/node/content_types.js
@@ -2,15 +2,44 @@
(function ($) {
Drupal.behaviors.contentTypes = {
- attach: function () {
+ attach: function (context) {
+ // Provide the vertical tab summaries.
+ $('fieldset#edit-submission', context).setSummary(function(context) {
+ var vals = [];
+ vals.push(Drupal.checkPlain($('#edit-title-label', context).val()) || Drupal.t('Requires a title'));
+ vals.push(Drupal.checkPlain($('#edit-body-label', context).val()) || Drupal.t('No body'));
+ return vals.join(', ');
+ });
+ $('fieldset#edit-workflow', context).setSummary(function(context) {
+ var vals = [];
+ $("input[name^='node_options']:checked", context).parent().each(function() {
+ vals.push(Drupal.checkPlain($(this).text()));
+ });
+ if (!$('#edit-node-options-status', context).is(':checked')) {
+ vals.unshift(Drupal.t('Not published'));
+ }
+ return vals.join(', ');
+ });
+ $('fieldset#edit-display', context).setSummary(function(context) {
+ var vals = [];
+ $('input:checked', context).parent().each(function() {
+ vals.push(Drupal.checkPlain($(this).text()));
+ });
+ if (!$('#edit-node-submitted', context).is(':checked')) {
+ vals.unshift(Drupal.t("Don't display post information"));
+ }
+ return vals.join(', ');
+ });
+
+ // Process the machine name.
if ($('#edit-type').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-type').val() == '') {
- $('.form-item-type-wrapper').hide();
+ $('.form-item.type-wrapper').hide();
$('#edit-name').keyup(function () {
var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_');
if (machine != '_' && machine != '') {
$('#edit-type').val(machine);
$('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function () {
- $('.form-item-type-wrapper').show();
+ $('.form-item-textfield.type-wrapper').show();
$('#node-type-name-suffix').hide();
$('#edit-name').unbind('keyup');
return false;