From 129c8eb18c47bf7b0e0fe35ac6bc1b7ee38d177f Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Sun, 6 Aug 2006 23:00:42 +0000 Subject: #62340 by chx, webchick, Jaza, Eaton, mathieu, and myself. Configurable node types. --- modules/comment/comment.module | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'modules/comment') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index fed6e19d3..f135e27cb 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -265,10 +265,16 @@ function comment_link($type, $node = NULL, $teaser = FALSE) { } function comment_form_alter($form_id, &$form) { - if (isset($form['type'])) { - if ($form['type']['#value'] .'_node_settings' == $form_id) { - $form['workflow']['comment_'. $form['type']['#value']] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $form['type']['#value'], COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the administer comments permission will be able to override this setting.')); - } + if ($form_id == 'node_type_form' && isset($form['identity']['type'])) { + $form['workflow']['comment'] = array( + '#type' => 'radios', + '#title' => t('Default comment setting'), + '#default_value' => variable_get('comment_'. $form['identity']['type']['#default_value'], COMMENT_NODE_READ_WRITE), + '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), + '#description' => t('Users with the administer comments permission will be able to override this setting.'), + ); + } + elseif (isset($form['type'])) { if ($form['type']['#value'] .'_node_form' == $form_id) { $node = $form['#node']; if (user_access('administer comments')) { -- cgit v1.2.3