You are here

function _notifications_content_add_disable_field in Notifications 7

Same name and namespace in other branches
  1. 6.4 notifications_content/notifications_content.module \_notifications_content_add_disable_field()
  2. 6.2 notifications_content/notifications_content.module \_notifications_content_add_disable_field()
  3. 6.3 notifications_content/notifications_content.module \_notifications_content_add_disable_field()

Add disable (skip notifications) field set

2 calls to _notifications_content_add_disable_field()
notifications_content_form_comment_form_alter in notifications_content/notifications_content.module
Implements hook_form_BASE_FORM_ID_alter().
notifications_content_form_node_form_alter in notifications_content/notifications_content.module
Implements hook_form_BASE_FORM_ID_alter().

File

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

Code

function _notifications_content_add_disable_field(&$form, $default = 0) {
  if (user_access('skip notifications')) {

    // Add fieldset without affecting any other elements there
    $form['notifications']['#type'] = 'fieldset';
    $form['notifications']['#title'] = t('Notifications');
    $form['notifications']['#collapsible'] = TRUE;
    $form['notifications']['notifications_content_disable'] = array(
      '#type' => 'checkbox',
      '#title' => t('Do not send notifications for this update.'),
      '#default_value' => $default,
    );
  }
}