You are here

function theme_tagclouds_weighted in TagCloud 7

Theme function that renders the HTML for the tags.

3 theme calls to theme_tagclouds_weighted()
tagclouds_block_view in ./tagclouds.module
Implements hook_block_view().
tagclouds_page_chunk in ./tagclouds.module
Menu callback renders a tagclouds page.
theme_tagclouds_list_box in ./tagclouds.module
Theme function that renders an entry in tagclouds/list/ views.

File

./tagclouds.module, line 396

Code

function theme_tagclouds_weighted(array $vars) {
  $terms = $vars['terms'];
  $output = '';
  $display = variable_get('tagclouds_display_type', 'style');
  if (module_exists('i18n_taxonomy')) {
    $language = i18n_language();
  }
  if ($display == 'style') {
    foreach ($terms as $term) {
      if (module_exists('i18n_taxonomy')) {
        $term_name = i18n_taxonomy_term_name($term, $language->language);
        $term_desc = i18n_taxonomy_term_description($term, $language->language);
      }
      else {
        $term_name = $term->name;
        $term_desc = $term->description;
      }
      if ($term->count == 1 && variable_get("tagclouds_display_node_link", false)) {
        $output .= tagclouds_display_node_link_weight($term_name, $term->tid, $term->nid, $term->weight, $term_desc);
      }
      else {
        $output .= tagclouds_display_term_link_weight($term_name, $term->tid, $term->weight, $term_desc);
      }
    }
  }
  else {
    foreach ($terms as $term) {
      if (module_exists('i18n_taxonomy')) {
        $term_name = i18n_taxonomy_term_name($term, $language->language);
        $term_desc = i18n_taxonomy_term_description($term, $language->language);
      }
      else {
        $term_name = $term->name;
        $term_desc = $term->description;
      }
      if ($term->count == 1 && variable_get("tagclouds_display_node_link", false)) {
        $output .= tagclouds_display_node_link_count($term_name, $term->tid, $term->nid, $term->count, $term_desc);
      }
      else {
        $output .= tagclouds_display_term_link_count($term_name, $term->tid, $term->count, $term_desc);
      }
    }
  }
  return $output;
}