You are here

image_gallery_handler_field_gallery_count.inc in Image 6

File

contrib/image_gallery/views/image_gallery_handler_field_gallery_count.inc
View source
<?php

/**
 * Views handler for Image gallery count field. This counts all the nodes in
 * the gallery, including descendant galleries, using taxonomy.module's
 * taxonomy_term_count_nodes.
 */
class image_gallery_handler_field_gallery_count extends views_handler_field_taxonomy {

  /**
   * Override query() so we don't query: fake field.
   */
  function query() {
    $this
      ->ensure_my_table();
    $this
      ->add_additional_fields();
  }

  /**
   * Return field html.
   */
  function render($values) {
    $count = taxonomy_term_count_nodes($values->tid, 'image');
    $output = theme('image_gallery_count', $count);
    return $this
      ->render_link($output, $values);
  }

}

Classes

Namesort descending Description
image_gallery_handler_field_gallery_count Views handler for Image gallery count field. This counts all the nodes in the gallery, including descendant galleries, using taxonomy.module's taxonomy_term_count_nodes.