diff --git a/usercomment.module b/usercomment.module index 7a8f4e0..3f1ce47 100644 --- a/usercomment.module +++ b/usercomment.module @@ -240,7 +240,7 @@ function usercomment_user($op, &$edit, &$account, $category = NULL) { $form['usercomment_settings']['usercomment_approve_'. $node->type] = array( '#type' => 'checkbox', '#title' => t('Skip '. $node->name .' approvals'), - '#default_value' => isset($edit['usercomment_approve_'. $node->type]) ? $edit['usercomment_approve_'. $node->type] : 1, + '#default_value' => isset($edit['usercomment_approve_'. $node->type]) ? $edit['usercomment_approve_'. $node->type] : variable_get('usercomment_approval_default', 1), '#description' => t('Check this to allow other users to comment on your content without approval. Note: Admin users can always comment without approval.'), ); } @@ -259,7 +259,7 @@ function usercomment_user($op, &$edit, &$account, $category = NULL) { $form['usercomment_settings']['usercomment_get_notifications'] = array( '#type' => 'checkbox', '#title' => t('Receive e-mail notifications'), - '#default_value' => isset($edit['usercomment_get_notifications']) ? $edit['usercomment_get_notifications'] : 1, + '#default_value' => isset($edit['usercomment_get_notifications']) ? $edit['usercomment_get_notifications'] : variable_get('usercomment_mail_default', 0), '#description' => t('Check this to receive e-mail notifications when new comments need your approval.'), ); } @@ -444,6 +444,20 @@ function usercomment_admin_settings() { '#type' => 'fieldset', '#title' => t('General settings'), ); + $form['general']['usercomment_approval_default'] = array( + '#type' => 'radios', + '#title' => t('Require comment approval by default'), + '#options' => array(1 => t('Disabled'), 0 => t('Enabled')), + '#description' => t('This sets the default on the user account form. When disabled your node authors will skip comment approvals by default. Enabling this may lead to legitimate comments not getting published, if your node authors are not aware of this feature.'), + '#default_value' => variable_get('usercomment_approval_default', 1), + ); + $form['general']['usercomment_mail_default'] = array( + '#type' => 'radios', + '#title' => t('Send e-mail approval notices by default'), + '#options' => array(0 => t('Disabled'), 1 => t('Enabled')), + '#description' => t('This sets the default on the user account form. When disabled node authors must opt-in to receive an e-mail when comments need approval. Warning: Enabling this may upset users who are not aware of this setting.'), + '#default_value' => variable_get('usercomment_mail_default', 0), + ); $form['general']['usercomment_approval_form_weight'] = array( '#type' => 'weight', '#title' => t('Approval form'),