You are here

function tagadelic_page_list in Tagadelic 7

Same name and namespace in other branches
  1. 5 tagadelic.module \tagadelic_page_list()
  2. 6 tagadelic.module \tagadelic_page_list()

Menu callback renders a tagadelic page with listed items: each vocabulary.

1 string reference to 'tagadelic_page_list'
tagadelic_menu in ./tagadelic.module
Implements hook_menu().

File

./tagadelic.module, line 129

Code

function tagadelic_page_list($vocs) {
  if ($vocs == NULL) {
    return drupal_not_found();
  }
  $output = '';
  foreach ($vocs as $vid) {
    $vocabulary = taxonomy_vocabulary_load($vid);

    // Clean out vocabulary, so that we don't have to leave security to our
    // theme layer.
    $vocabulary->description = filter_xss_admin($vocabulary->description);
    $vocabulary->name = filter_xss_admin($vocabulary->name);
    $tags = tagadelic_get_weighted_tags(array(
      $vocabulary->vid,
    ), variable_get('tagadelic_levels', 6), variable_get('tagadelic_page_amount', '60'));
    $tags = tagadelic_sort_tags($tags);
    $output .= theme('tagadelic_list_box', array(
      'vocabulary' => $vocabulary,
      'tags' => $tags,
    ));
  }
  if (!$output) {
    return drupal_not_found();
  }
  $output = "<div class=\"wrapper tagadelic\">{$output}</div>";
  return $output;
}