You are here

class geofieldProximityManual in Geofield 7.2

@file Contains geofieldProximityManual.

Hierarchy

Expanded class hierarchy of geofieldProximityManual

1 string reference to 'geofieldProximityManual'
geofield_proximity_views_handlers in views/geofield.views.inc
Implements hook proximity_views_handlers().

File

views/proximity_plugins/geofieldProximityManual.inc, line 8
Contains geofieldProximityManual.

View source
class geofieldProximityManual extends geofieldProximityBase implements geofieldProximityPluginInterface {
  public function option_definition(&$options, $views_plugin) {
    $options['geofield_proximity_manual'] = array(
      'default' => array(
        'lat' => 0,
        'lon' => 0,
      ),
    );
  }
  public function options_form(&$form, &$form_state, $views_plugin) {
    $form['geofield_proximity_manual'] = array(
      '#type' => 'geofield_latlon',
      '#title' => t('Source'),
      '#default_value' => $views_plugin->options['geofield_proximity_manual'],
      '#proximity_plugin_value_element' => TRUE,
      '#states' => array(
        'visible' => array(
          ':input[name*="options[source]"]' => array(
            'value' => 'manual',
          ),
        ),
      ),
    );
  }
  public function value_form(&$form, &$form_state, $views_plugin) {
    $form['value']['#origin_element'] = 'geofield_latlon';
  }
  public function getSourceValue($views_plugin) {
    return array(
      'latitude' => isset($views_plugin->value) ? $views_plugin->value['origin']['lat'] : $views_plugin->options['geofield_proximity_manual']['lat'],
      'longitude' => isset($views_plugin->value) ? $views_plugin->value['origin']['lon'] : $views_plugin->options['geofield_proximity_manual']['lon'],
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
geofieldProximityBase::options_validate public function Overrides geofieldProximityPluginInterface::options_validate 2
geofieldProximityBase::value_validate public function Overrides geofieldProximityPluginInterface::value_validate
geofieldProximityManual::getSourceValue public function Overrides geofieldProximityBase::getSourceValue
geofieldProximityManual::options_form public function Overrides geofieldProximityBase::options_form
geofieldProximityManual::option_definition public function All methods in geofieldProximityPluginInterface maps directly to a method in a views_handler class, expect for 'getSourceValue,' which is primarily called in the 'query' method, but also in other instances. Overrides geofieldProximityBase::option_definition
geofieldProximityManual::value_form public function Overrides geofieldProximityBase::value_form