views_handler_argument_node_language.inc

  1. 3.x modules/node/views_handler_argument_node_language.inc
  2. 2.x modules/node/views_handler_argument_node_language.inc
  3. 2.x modules/translation/views_handler_argument_node_language.inc

Definition of views_handler_argument_node_language.

File

modules/node/views_handler_argument_node_language.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_node_language.
  5. */
  6. /**
  7. * Argument handler to accept a language.
  8. */
  9. class views_handler_argument_node_language extends views_handler_argument {
  10. function construct() {
  11. parent::construct('language');
  12. }
  13. /**
  14. * Override the behavior of summary_name(). Get the user friendly version
  15. * of the language.
  16. */
  17. function summary_name($data) {
  18. return $this->node_language($data->{$this->name_alias});
  19. }
  20. /**
  21. * Override the behavior of title(). Get the user friendly version of the
  22. * node type.
  23. */
  24. function title() {
  25. return $this->node_language($this->argument);
  26. }
  27. function node_language($langcode) {
  28. $languages = views_language_list();
  29. return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
  30. }
  31. }