You are here

function geofield_handler_field::options_form in Geofield 7.2

Default options form provides the label widget that all fields should have.

Overrides views_handler_field_numeric::options_form

File

views/handlers/geofield_handler_field.inc, line 48
Distance field implementation.

Class

geofield_handler_field
@file Distance field implementation.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['source'] = array(
    '#type' => 'select',
    '#title' => t('Source of Origin Point'),
    '#description' => t('How do you want to enter your origin point?'),
    '#options' => array(),
    '#default_value' => $this->options['source'],
    '#attached' => array(
      'js' => array(
        drupal_get_path('module', 'geofield') . '/js/viewsProximityValue.js',
      ),
    ),
  );
  $proximityHandlers = module_invoke_all('proximity_views_handlers');
  foreach ($proximityHandlers as $key => $handler) {
    $form['source']['#options'][$key] = $handler['name'];
    if (class_exists($handler['class'])) {
      $proximityPlugin = new $handler['class']();
      $proximityPlugin
        ->options_form($form, $form_state, $this);
    }
  }
  $form['radius_of_earth'] = array(
    '#type' => 'select',
    '#title' => t('Unit of Measure'),
    '#description' => '',
    '#options' => geofield_radius_options(),
    '#default_value' => $this->options['radius_of_earth'],
  );
}