You are here

function notifications_admin_events_tree_form in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications.admin.inc \notifications_admin_events_tree_form()

Build tree of event types

1 call to notifications_admin_events_tree_form()
notifications_admin_events_form in ./notifications.admin.inc
Event configuration administration

File

./notifications.admin.inc, line 434

Code

function notifications_admin_events_tree_form($tree, &$form, $depth = 0) {
  foreach ($tree as $key => $event) {
    $form['name'][$key] = array(
      '#value' => theme('indentation', $depth) . $event['description'],
    );
    $form['notifications_event_enabled'][$key] = array(
      '#type' => 'checkbox',
      '#default_value' => notifications_event_enabled($key),
    );
    $form['notifications_event_template'][$key] = array(
      '#type' => 'select',
      '#default_value' => Notifications_Event::template_map($key),
      '#options' => notifications_template_list(),
    );
    if (!empty($event['children'])) {
      notifications_admin_events_tree_form($event['children'], $form, $depth + 1);
    }
  }
}