You are here

function notifications_admin_events_tree_form in Notifications 7

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

Build tree of event types

File

./notifications.admin.inc, line 315

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);
    }
  }
}