public function geofieldProximityEntityURL::options_form in Geofield 7.2
Overrides geofieldProximityBase::options_form
File
- views/
proximity_plugins/ geofieldProximityEntityURL.inc, line 21 - Contains geofieldProximityEntityURL.
Class
- geofieldProximityEntityURL
- @file Contains geofieldProximityEntityURL.
Code
public function options_form(&$form, &$form_state, $views_plugin) {
$entities = entity_get_info();
$entity_options = array();
foreach ($entities as $key => $entity) {
$entity_options[$key] = $entity['label'];
}
$form['geofield_proximity_entity_url_entity_type'] = array(
'#type' => 'select',
'#title' => t('Entity Type'),
'#default_value' => $views_plugin->options['geofield_proximity_entity_url_entity_type'],
'#options' => $entity_options,
'#dependency' => array(
'edit-options-source' => array(
'entity_from_url',
),
),
);
$geofields = _geofield_get_geofield_fields();
$field_options = array();
foreach ($geofields as $key => $field) {
$field_options[$key] = $key;
}
$form['geofield_proximity_entity_url_field'] = array(
'#type' => 'select',
'#title' => t('Source Field'),
'#default_value' => $views_plugin->options['geofield_proximity_entity_url_field'],
'#options' => $field_options,
'#dependency' => array(
'edit-options-source' => array(
'entity_from_url',
),
),
);
}