function openlayers_layer_type_openlayers_views_vector::options_form in Openlayers 7.2
Same name and namespace in other branches
- 6.2 modules/openlayers_views/includes/layer_types/openlayers_views_vector.inc \openlayers_layer_type_openlayers_views_vector::options_form()
Options form which generates layers
Overrides openlayers_layer_type::options_form
File
- modules/
openlayers_views/ plugins/ layer_types/ openlayers_views_vector.inc, line 49 - OpenLayers Views Vector Layer Type
Class
Code
function options_form($defaults = array()) {
$form = array();
$views = views_get_all_views();
$options = array(
'' => '<none>',
);
foreach ($views as $view) {
foreach ($view->display as $display => $data) {
$view
->set_display($display);
if ($data->display_plugin == 'openlayers' && $view->display_handler
->get_option('style_plugin') == 'openlayers_data') {
$options[$view->name . '::' . $display] = $view->human_name . ': ' . $display;
}
}
}
$default = NULL;
if (isset($this->data['views']['view']) && isset($this->data['views']['display'])) {
$default = $this->data['views']['view'] . '::' . $this->data['views']['display'];
}
$form['views']['composite'] = array(
'#type' => 'select',
'#options' => $options,
'#title' => 'View name',
'#default_value' => isset($default) ? $default : '',
);
return $form;
}