You are here

function location_handler_argument_location_province::summary_name in Location 7.5

Same name and namespace in other branches
  1. 6.3 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province::summary_name()
  2. 7.3 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province::summary_name()
  3. 7.4 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province::summary_name()

Provides the name to use for the summary.

By default this is just the name field.

Parameters

object $data: The query results for the row.

Return value

string The summary.

Overrides views_handler_argument::summary_name

File

handlers/location_handler_argument_location_province.inc, line 20

Class

location_handler_argument_location_province
Argument handler to accept a province code or name.

Code

function summary_name($data) {
  $value = $data->{$this->name_alias};
  if (empty($value)) {
    return t('Unknown');
  }
  if (isset($this->view->argument['country'])) {
    $country = $this->view->argument['country']->argument;
  }
  else {
    $country = variable_get('location_default_country', 'us');
  }
  return location_province_name($country, $value);
}