location_handler_argument_location_country.inc 481 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Argument handler to accept a country code or name.
  4. */
  5. class location_handler_argument_location_country extends views_handler_argument {
  6. /**
  7. * Override the behavior of title(). Get the country name.
  8. */
  9. function title() {
  10. return location_country_name($this->argument);
  11. }
  12. function summary_name($data) {
  13. $value = $data->{$this->name_alias};
  14. if (empty($value)) {
  15. return t('Unknown');
  16. }
  17. return location_country_name($value);
  18. }
  19. }