You are here

function messaging_admin_template_tree in Messaging 6

Same name and namespace in other branches
  1. 6.2 messaging.admin.inc \messaging_admin_template_tree()
  2. 6.3 messaging.admin.inc \messaging_admin_template_tree()

Recursively build a table tree for fallback methods

1 call to messaging_admin_template_tree()
messaging_admin_template in ./messaging.admin.inc

File

./messaging.admin.inc, line 94
Messaging Framework - Admin UI

Code

function messaging_admin_template_tree($parents, $groups, $depth = 0) {
  $rows = array();
  foreach ($parents as $key) {
    $info = $groups[$key];
    $rows[] = array(
      theme('indentation', $depth) . l($info['name'], 'admin/messaging/template/edit/' . $key),
      !empty($info['description']) ? $info['description'] : '',
      ($parts = module_invoke_all('messaging', 'message keys', $key)) ? implode(', ', $parts) : '',
    );
    if (!empty($info['children'])) {
      $rows = array_merge($rows, messaging_admin_template_tree($info['children'], $groups, $depth + 1));
    }
  }
  return $rows;
}