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

File

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