You are here

class image_gallery_handler_field_gallery_count in Image 6

Same name and namespace in other branches
  1. 7 contrib/image_gallery/views/image_gallery_handler_field_gallery_count.inc \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.

Hierarchy

Expanded class hierarchy of image_gallery_handler_field_gallery_count

1 string reference to 'image_gallery_handler_field_gallery_count'
image_gallery_views_data_alter in contrib/image_gallery/views/image_gallery.views.inc
Implementation of hook_views_data_alter(). Add fields for image gallery (ie vocabulary terms) to the term_data table.

File

contrib/image_gallery/views/image_gallery_handler_field_gallery_count.inc, line 8

View source
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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
image_gallery_handler_field_gallery_count::query function Override query() so we don't query: fake field.
image_gallery_handler_field_gallery_count::render function Return field html.