function advanced_help_get_tree

cis7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)
cle7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)
elmsmedia7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)
icor7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)
meedjum_blog7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)
mooc7 advanced_help.module advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0)

Build a tree of advanced help topics.

Parameters

array $topics:

array $topic_ids:

int $max_depth:

int $depth:

Return value

array

2 calls to advanced_help_get_tree()
advanced_help_index_page in sites/all/modules/ulmus/advanced_help/advanced_help.module
Page callback to view the advanced help topic index.
advanced_help_view_topic in sites/all/modules/ulmus/advanced_help/advanced_help.module
Load and render a help topic.

File

sites/all/modules/ulmus/advanced_help/advanced_help.module, line 259
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0) {
  uasort($topic_ids, 'advanced_help_uasort');
  $items = array();
  foreach ($topic_ids as $info) {
    list($module, $topic) = $info;
    $item = advanced_help_l($topics[$module][$topic]['title'], "help/$module/$topic");
    if (!empty($topics[$module][$topic]['children']) && ($max_depth == -1 || $depth < $max_depth)) {
      $item .= theme('item_list', array(
        'items' => advanced_help_get_tree($topics, $topics[$module][$topic]['children'], $max_depth, $depth + 1),
      ));
    }

    $items[] = $item;
  }

  return $items;
}