function location_handler_filter_location_province::grovel_country in Location 6.3
Same name and namespace in other branches
- 7.5 handlers/location_handler_filter_location_province.inc \location_handler_filter_location_province::grovel_country()
- 7.3 handlers/location_handler_filter_location_province.inc \location_handler_filter_location_province::grovel_country()
- 7.4 handlers/location_handler_filter_location_province.inc \location_handler_filter_location_province::grovel_country()
2 calls to location_handler_filter_location_province::grovel_country()
- location_handler_filter_location_province::query in handlers/
location_handler_filter_location_province.inc - location_handler_filter_location_province::value_form in handlers/
location_handler_filter_location_province.inc - Provide a simple textfield for equality
File
- handlers/
location_handler_filter_location_province.inc, line 68
Class
- location_handler_filter_location_province
- Filter on province.
Code
function grovel_country() {
$country = variable_get('location_default_country', 'us');
if (!empty($this->view->filter)) {
foreach ($this->view->filter as $k => $v) {
if ($v->table == 'location' && $v->field == 'country' && $v->options['relationship'] == $this->options['relationship']) {
$country = $v->value;
if (!empty($v->options['expose']['identifier'])) {
if (isset($this->view->exposed_input[$v->options['expose']['identifier']])) {
$country = $this->view->exposed_input[$v->options['expose']['identifier']];
}
$this->location_country_identifier = $v->options['expose']['identifier'];
}
}
}
}
if ($country == '' || $country == 'All' || $country == ' ' || $country == 'xx') {
// It's set to something nonsensical, reset to the default to prevent malfunctions.
$country = variable_get('location_default_country', 'us');
}
$this->location_country = $country;
return $country;
}