Commit 7c7da0af authored by greggles's avatar greggles

feature #264584 by greggles: Limit Comment Notify to Certain Node Types

parent 56da6988
......@@ -56,6 +56,13 @@ function comment_notify_form_alter($form_id, &$form) {
return;
}
// Only add the checkbox if this is an enabled content type
$node = node_load($form['nid']['#value']);
$enabled_types = variable_get('comment_notify_node_types', array());
if (!$enabled_types[$node->type]) {
return;
}
$op = isset($_POST['op']) ? $_POST['op'] : '';
if ($op == t('Preview comment')) {
......@@ -401,6 +408,21 @@ function comment_notify_unsubscribe_submit($form_id, $form_values) {
*/
function comment_notify_settings() {
$form['comment_notify_settings'] = array();
// Only perform comment_notify for certain node types (default, all)
foreach (node_get_types('names') as $type => $name) {
$checkboxes[$type] = check_plain($name);
$default[] = $type;
}
$form['comment_notify_settings']['comment_notify_node_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Content Types To Enable for Comment Notify'),
'#default_value' => variable_get('comment_notify_node_types', $default),
'#options' => $checkboxes,
'#description' => t('Comments on content types enabled here will have the option of comment notification.'),
);
$form['comment_notify_settings']['comment_notify_regged_checkbox'] = array(
'#type' => 'checkbox',
'#title' => t('Let registered users select notification on a node basis'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment