views_handler_argument_vocabulary_vid.inc

  1. 3.x modules/taxonomy/views_handler_argument_vocabulary_vid.inc
  2. 2.x modules/taxonomy/views_handler_argument_vocabulary_vid.inc

Definition of views_handler_argument_vocabulary_vid.

File

modules/taxonomy/views_handler_argument_vocabulary_vid.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_vocabulary_vid.
  5. */
  6. /**
  7. * Argument handler to accept a vocabulary id.
  8. *
  9. * @ingroup views_argument_handlers
  10. */
  11. class views_handler_argument_vocabulary_vid extends views_handler_argument_numeric {
  12. /**
  13. * Override the behavior of title(). Get the name of the vocabulary.
  14. */
  15. function title() {
  16. $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.vid = :vid", array(':vid' => $this->argument))->fetchField();
  17. if (empty($title)) {
  18. return t('No vocabulary');
  19. }
  20. return check_plain($title);
  21. }
  22. }