function openlayers_control_form_start in Openlayers 7.3
Control base config form handler.
1 string reference to 'openlayers_control_form_start'
- openlayers_ui_OpenlayersControls_ctools_export_ui in modules/
openlayers_ui/ src/ Plugin/ export_ui/ OpenlayersControls.inc - CTools Export UI plugin definition.
File
- modules/
openlayers_ui/ src/ Plugin/ export_ui/ OpenlayersControls.inc, line 73 - CTools Export UI plugin definition for controls.
Code
function openlayers_control_form_start($form, &$form_state) {
$class = new Drupal\openlayers_ui\UI\OpenlayersControls();
$class
->init($form_state['plugin']);
$class
->edit_form($form, $form_state);
$options = array();
foreach (\Drupal\openlayers\Openlayers::loadAllExportable('Map') as $machine_name => $map) {
if (!is_object($map) || property_exists($map, 'disabled') && ($map->disabled == 1 || $map->disabled == TRUE)) {
continue;
}
$options[$machine_name] = $map->name;
}
$form['attachToMap'] = array(
'#type' => 'select',
'#title' => 'Add this to a map ?',
'#empty_option' => t('- Do no attach -'),
'#description' => 'Select the map to add this object to.',
'#options' => $options,
'#default_value' => isset($form_state['item']->attachToMap) ? $form_state['item']->attachToMap : '',
);
return $form;
}