views_handler_argument_vocabulary_machine_name.inc

Definition of views_handler_argument_vocabulary_machine_name.

File

modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_vocabulary_machine_name.
  5. */
  6. /**
  7. * Argument handler to accept a vocabulary machine name.
  8. *
  9. * @ingroup views_argument_handlers
  10. */
  11. class views_handler_argument_vocabulary_machine_name extends views_handler_argument_string {
  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.machine_name = :machine_name", array(':machine_name' => $this->argument))->fetchField();
  17. if (empty($title)) {
  18. return t('No vocabulary');
  19. }
  20. return check_plain($title);
  21. }
  22. }