You are here

function messaging_template_format_tree in Messaging 6.4

Format template tree small tree

1 call to messaging_template_format_tree()
messaging_template_admin_info in messaging_template/messaging_template.admin.inc
Build template description for admin pages

File

messaging_template/messaging_template.admin.inc, line 83
Messaging Framework - Admin UI

Code

function messaging_template_format_tree($tree, $depth = 0) {
  $items = array();
  foreach ($tree as $key => $template) {
    $item = array();
    $options['attributes'] = !empty($template['description']) ? array(
      'title' => $template['description'],
    ) : array();
    $item['data'] = l($template['name'], 'admin/messaging/template/edit/' . $key, $options);
    if (!empty($template['children'])) {
      $item['children'] = messaging_template_format_tree($template['children'], $depth + 1);
    }
    $items[] = $item;
  }
  return $depth ? $items : theme('item_list', $items);
}