You are here

function openlayers_presets_ui_presets_manage in Openlayers 6

Menu Callback for Preset Routing

Takes general arguments from menu and routed to appropriate place.

Parameters

$preset_id: Preset ID passed in from URL

Action to do with preset:

1 string reference to 'openlayers_presets_ui_presets_manage'
openlayers_presets_ui_menu in modules/openlayers_presets_ui/openlayers_presets_ui.module
Implementation of hook_menu().

File

modules/openlayers_presets_ui/includes/openlayers_presets_ui.ui.inc, line 63
This file holds the functions for the openlayers presets ui

Code

function openlayers_presets_ui_presets_manage($preset = array(), $action = 'edit') {
  $output = '';

  // Switch action
  switch ($action) {
    case 'delete':
      $output = drupal_get_form('openlayers_presets_ui_presets_manage_delete', $preset);
      break;
    case 'export':
      drupal_set_title(t('Export: %title', array(
        '%title' => $preset['preset_title'],
      )));
      $output = drupal_get_form('openlayers_presets_ui_presets_manage_export', $preset);
      break;
    case 'edit':
    default:
      drupal_set_title(t('Edit: %title', array(
        '%title' => $preset['preset_title'],
      )));
      $output = drupal_get_form('openlayers_presets_ui_presets_manage_add', $preset, TRUE);
      break;
  }
  return $output;
}