You are here

function getlocations_fields_views_proximity_get_argument_options in Get Locations 7.2

Same name and namespace in other branches
  1. 7 modules/getlocations_fields/views/getlocations_fields.views.inc \getlocations_fields_views_proximity_get_argument_options()
3 calls to getlocations_fields_views_proximity_get_argument_options()
getlocations_fields_handler_field_distance::extra_options_form in modules/getlocations_fields/handlers/getlocations_fields_handler_field_distance.inc
Provide a form for setting options.
getlocations_fields_handler_filter_distance::value_form in modules/getlocations_fields/handlers/getlocations_fields_handler_filter_distance.inc
Options form subform for setting options.
getlocations_fields_handler_sort_distance::extra_options_form in modules/getlocations_fields/handlers/getlocations_fields_handler_sort_distance.inc
Provide a form for setting options.

File

modules/getlocations_fields/views/getlocations_fields.views.inc, line 476
getlocations_fields.views.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_fields_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();
  $tid_argument_options = array();
  $cid_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();
      $tid_argument_options[$id] = $handler
        ->ui_name();
    }
    elseif ($handler->field == 'nid') {
      $nid_argument_options[$id] = $handler
        ->ui_name();
    }
    elseif ($handler->field == 'uid') {
      $uid_argument_options[$id] = $handler
        ->ui_name();
    }
    elseif ($handler->field == 'tid') {
      $tid_argument_options[$id] = $handler
        ->ui_name();
    }
    elseif ($handler->field == 'cid') {
      $cid_argument_options[$id] = $handler
        ->ui_name();
    }
  }
  return array(
    $nid_argument_options,
    $uid_argument_options,
    $tid_argument_options,
    $cid_argument_options,
  );
}