function getlocations_fields_handler_field_distance::click_sort in Get Locations 7.2
Same name and namespace in other branches
- 7 modules/getlocations_fields/handlers/getlocations_fields_handler_field_distance.inc \getlocations_fields_handler_field_distance::click_sort()
Called to determine what to tell the clicksorter.
Overrides views_handler_field::click_sort
File
- modules/
getlocations_fields/ handlers/ getlocations_fields_handler_field_distance.inc, line 73 - getlocations_fields_handler_field_distance.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Class
- getlocations_fields_handler_field_distance
- @file getlocations_fields_handler_field_distance.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function click_sort($order) {
$location = getlocations_fields_views_proximity_get_reference_location($this->view, $this->options);
if ($location) {
$this->query
->add_orderby(NULL, getlocations_earth_distance_sql($location['latitude'], $location['longitude'], $this->table_alias), $order, $this->field_alias);
}
}