You are here

function openlayers_ui_layers_settings in Openlayers 7.2

Same name and namespace in other branches
  1. 6.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
Implements hook_menu

File

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

Code

function openlayers_ui_layers_settings($form, &$form_state, $layer = NULL) {
  $form = array();
  foreach (openlayers_layer_types() as $name => $type_def) {
    $type = openlayers_layer_type_load($name);
    if ($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;
}