You are here

function notifications_admin_events_form in Notifications 6.4

Same name and namespace in other branches
  1. 5 notifications.admin.inc \notifications_admin_events_form()
  2. 6 notifications.admin.inc \notifications_admin_events_form()
  3. 6.2 notifications.admin.inc \notifications_admin_events_form()
  4. 6.3 notifications.admin.inc \notifications_admin_events_form()
  5. 7 notifications.admin.inc \notifications_admin_events_form()

Event configuration administration

Will allow to define which events trigger a notification and which ones not

1 string reference to 'notifications_admin_events_form'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.admin.inc, line 395

Code

function notifications_admin_events_form() {
  $form = array();

  // Compile array from plug-ins and settings
  if ($events = notifications_event_types()) {
    $form['notifications_event_enabled']['#tree'] = TRUE;
    $form['notifications_event_template']['#tree'] = TRUE;

    // Group event types when they have a parent
    $tree = notifications_admin_events_build_tree($events);
    notifications_admin_events_tree_form($tree, $form, 0);
    $form = system_settings_form($form);
    $form['#theme'] = 'notifications_table_form';
    $form['#table_fields'] = array(
      'name',
      'notifications_event_enabled',
      'notifications_event_template',
    );
    $form['#table_header'] = array(
      t('Event type'),
      t('Enabled'),
      t('Template'),
    );
    return $form;
  }
  else {
    $form['warning'] = array(
      '#value' => t('You need to enable some plug-ins to provide notifications events.'),
    );
    return $form;
  }
}