You are here

function recipe_index in Recipe 5

Constructs the recipe index page, using theme functions.

Return value

a string containing the output ready for display.

1 call to recipe_index()
recipe_page in ./recipe.module
Menu Callback - created output for the main recipe page.

File

./recipe.module, line 1185
recipe.module - share recipes for drupal 5.x

Code

function recipe_index($tid = 0) {
  $output = "";
  $vocabularies = recipe_get_vocabularies();
  foreach ($vocabularies as $vocab) {
    $max_depth = variable_get('recipe_index_depth', 0);
    $vocab_tree = module_invoke('taxonomy', 'get_tree', $vocab->vid, $tid, -1, $max_depth <= 0 ? NULL : $max_depth);
    $content = '';
    while (current($vocab_tree) != NULL) {
      $content .= recipe_build_index($vocab_tree, recipe_get_current_url());
    }
    if ($content != '') {
      $output .= theme('recipe_index', $vocab->name, $content);
    }
  }
  return $output;
}