From db61b2603918d582afad82b8036fac7f5240a627 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 21 Aug 2009 00:21:48 +0000 Subject: #439798 by Rob Loach: Added Vertical Tabs to the Node Type Form. --- modules/comment/comment-node-form.js | 19 +++++++++++++++++++ modules/comment/comment.module | 2 ++ 2 files changed, 21 insertions(+) (limited to 'modules/comment') diff --git a/modules/comment/comment-node-form.js b/modules/comment/comment-node-form.js index 20d8729f4..0f51884a2 100644 --- a/modules/comment/comment-node-form.js +++ b/modules/comment/comment-node-form.js @@ -7,6 +7,25 @@ Drupal.behaviors.commentFieldsetSummaries = { $('fieldset#edit-comment-settings', context).setSummary(function (context) { return Drupal.checkPlain($('input:checked', context).parent().text()); }); + // Provide the summary for the node type form. + $('fieldset#edit-comment', context).setSummary(function(context) { + var vals = []; + + // Default comment setting. + vals.push($("select[name='comment'] option:selected", context).text()); + + // Threading. + var threading = $("input[name='comment_default_mode']:checked", context).parent().text(); + if (threading) { + vals.push(threading); + } + + // Comments per page. + var number = $("select[name='comment_default_per_page'] option:selected", context).val(); + vals.push(Drupal.t('@number comments per page', {'@number': number})); + + return Drupal.checkPlain(vals.join(', ')); + }); } }; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 18653611c..b06b186a4 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -932,6 +932,8 @@ function comment_form_node_type_form_alter(&$form, $form_state) { '#title' => t('Comment settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'), ); $form['comment']['comment_default_mode'] = array( '#type' => 'checkbox', -- cgit v1.2.3