You are here

function location_handler_filter_eq in Location 5

Same name and namespace in other branches
  1. 5.3 contrib/location_views/location_views.module \location_handler_filter_eq()
1 string reference to 'location_handler_filter_eq'
location_views_tables in contrib/location_views/location_views.module
For operation with the views.module.

File

contrib/location_views/location_views.module, line 832
Views-enables the location module.

Code

function location_handler_filter_eq($op, $filter, $filterinfo, &$query) {
  switch ($filter[value]) {
    case '':
      return;
      break;
  }
  switch ($filter['operator']) {
    case '':
      return;
      break;
  }
  switch ($filterinfo['field']) {
    case 'province':
      $filter['value'] = location_form2api(array(
        'province' => $filter['value'],
      ));
      $filter['value'] = $filter['value']['province'];
      break;
  }
  $query
    ->ensure_table($filterinfo[table]);
  $query
    ->add_where("{$filterinfo['table']}.{$filterinfo['field']} {$filter['operator']} '{$filter['value']}'");
}