You are here

function notifications_tags_form_alter in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications_tags/notifications_tags.module \notifications_tags_form_alter()
  2. 6 notifications_tags/notifications_tags.module \notifications_tags_form_alter()
  3. 6.2 notifications_tags/notifications_tags.module \notifications_tags_form_alter()
  4. 6.3 notifications_tags/notifications_tags.module \notifications_tags_form_alter()

Implementation of hook_form_alter().

Admin settings form. Omitted taxonomy vocabularies.

File

notifications_tags/notifications_tags.module, line 84
Subscriptions to taxonomy terms

Code

function notifications_tags_form_alter($form_id, &$form) {
  if ($form_id == 'notifications_content_settings_form') {
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $vocabulary) {
      $select[$vocabulary->vid] = $vocabulary->name;
    }
    $form['tags'] = array(
      '#type' => 'fieldset',
      '#title' => t('Tag subscriptions'),
      '#collapsible' => TRUE,
      '#weight' => 0,
    );
    $form['tags']['notifications_tags_vocabularies'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Allowed vocabularies'),
      '#default_value' => notifications_tags_vocabularies('vid'),
      '#options' => $select,
      '#description' => t('Select vocabularies to which subscriptions should be <em>allowed</em>.'),
      '#multiple' => TRUE,
    );
  }
}