You are here

function notifications_content_form_comment_form_alter in Notifications 7

Implements hook_form_BASE_FORM_ID_alter().

Skip notifications on comment forms

File

notifications_content/notifications_content.module, line 119
Subscriptions to content events

Code

function notifications_content_form_comment_form_alter(&$form, $form_state) {
  $node = $form['#node'];

  // Do not add if content type disabled, creating and create events disabled, updating and update events disabled
  if (notifications_content_node_event_enabled('comment', $node->type)) {
    _notifications_content_add_disable_field($form);

    // If editing the comment, add values to remember
    if (!empty($form['cid']['#value']) && !empty($form['admin']['status'])) {
      $form['notifications_comment_status'] = array(
        '#type' => 'value',
        '#value' => $form['admin']['status']['#default_value'],
      );
    }
  }
}