You are here

function tagadelic_page_list in Tagadelic 6

Same name and namespace in other branches
  1. 5 tagadelic.module \tagadelic_page_list()
  2. 7 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 182

Code

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

      // 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', $vocabulary, $tags);
    }
  }
  if (empty($output)) {
    return drupal_not_found();
  }
  $stylesheet = drupal_get_path('module', 'tagadelic') . '/tagadelic.css';
  drupal_add_css($stylesheet, 'all');
  $output = "<div class=\"wrapper tagadelic\">{$output}</div>";
  return $output;
}