You are here

function location_views_proximity_get_argument_options in Location 7.3

Same name and namespace in other branches
  1. 6.3 location.views.inc \location_views_proximity_get_argument_options()
  2. 7.5 location.views.inc \location_views_proximity_get_argument_options()
  3. 7.4 location.views.inc \location_views_proximity_get_argument_options()

Helper function for proximity handlers.

Gets available arguments for argument related handler options.

Parameters

object $view: The view object.

Return value

array An array containing arrays of the nid arguments and the uid arguments.

3 calls to location_views_proximity_get_argument_options()
location_handler_field_location_distance::extra_options_form in handlers/location_handler_field_location_distance.inc
Provide a form for setting options.
location_handler_sort_location_distance::extra_options_form in handlers/location_handler_sort_location_distance.inc
Provide a form for setting options.
location_views_handler_filter_proximity::value_form in handlers/location_views_handler_filter_proximity.inc
Options form subform for setting options.

File

./location.views.inc, line 358
Views 3 support for Location.

Code

function location_views_proximity_get_argument_options($view) {

  // Get the arguments for this view so we can use nid, uid or Global: Null arguments.
  $uid_argument_options = array();
  $nid_argument_options = array();
  $arguments = $view->display_handler
    ->get_handlers('argument');
  foreach ($arguments as $id => $handler) {
    if ($handler->field == 'null') {
      $uid_argument_options[$id] = $handler
        ->ui_name();
      $nid_argument_options[$id] = $handler
        ->ui_name();
    }
    else {
      if ($handler->field == 'nid') {
        $nid_argument_options[$id] = $handler
          ->ui_name();
      }
      else {
        if ($handler->field == 'uid') {
          $uid_argument_options[$id] = $handler
            ->ui_name();
        }
      }
    }
  }
  return array(
    $nid_argument_options,
    $uid_argument_options,
  );
}