You are here

function openlayers_ui_admin_settings in Openlayers 6.2

Same name and namespace in other branches
  1. 7.3 modules/openlayers_ui/includes/openlayers_ui.admin.inc \openlayers_ui_admin_settings()
  2. 7.2 modules/openlayers_ui/includes/openlayers_ui.admin.inc \openlayers_ui_admin_settings()

Menu callback; displays the openlayers module settings page.

See also

system_settings_form()

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

File

modules/openlayers_ui/includes/openlayers_ui.admin.inc, line 15
This file holds the functions for the main openlayers Admin settings.

Code

function openlayers_ui_admin_settings() {
  $source_description = '<p>' . t('By default the your site will point to a hosted version of
    the OpenLayers library, at <code>@ol_api_url.</code>', array(
    '@ol_api_url' => 'http://openlayers.org/api/2.9/OpenLayers.js',
  )) . t('Alternately, you can <a href="!ol_url">download OpenLayers</a>,
    add it to your Drupal installation, and use a relative path like
    <code>@suggested_path</code> . You can also use a double backslash
    before the domain name (eg. //www.example.com/OpenLayers.js) which
    then respects the use of both HTTPS and HTTP protocols.', array(
    '!ol_url' => 'http://openlayers.org/',
    '@suggested_path' => drupal_get_path('module', 'openlayers') . '/OpenLayers-2.7/OpenLayers.js',
  )) . '</li></ul>';

  // Define Form
  $form['openlayers_source'] = array(
    '#type' => 'textfield',
    '#title' => t('OpenLayers Source'),
    '#description' => $source_description,
    '#default_value' => variable_get('openlayers_source', 'http://openlayers.org/api/2.9/OpenLayers.js'),
  );
  $form['openlayers_default_preset'] = array(
    '#type' => 'select',
    '#title' => t('OpenLayers Default Preset'),
    '#description' => t('This is the default preset that will be used
      in cases where one is not defined.  It will also be used as the default when creating new presets.'),
    '#options' => openlayers_preset_options(),
    '#default_value' => variable_get('openlayers_default_preset', 'default'),
  );

  // Make a system setting form and return
  return system_settings_form($form);
}