You are here

function openlayers_ui_layers_settings in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 modules/openlayers_ui/includes/openlayers_ui.layers.inc \openlayers_ui_layers_settings()

Layer-wide-settings form

1 string reference to 'openlayers_ui_layers_settings'
openlayers_ui_menu in modules/openlayers_ui/openlayers_ui.module
Implementation of hook_menu

File

modules/openlayers_ui/includes/openlayers_ui.layers.inc, line 74
This file holds the functions handling layers in the Openlayers UI.

Code

function openlayers_ui_layers_settings(&$form_state, $layer = NULL) {
  $form = array();
  $layer_types = openlayers_layer_types();
  foreach ($layer_types as $name => $type_def) {
    $type = openlayers_layer_type_load($name);
    if (method_exists($type, 'settings_form')) {
      $form[$name] = array(
        '#type' => 'fieldset',
        '#tree' => TRUE,
        '#title' => $type_def['title'],
      );
      $form[$name]['settings'] = $type
        ->settings_form();
    }
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}