You are here

function openlayers_ui_preset_ahah in Openlayers 6.2

OpenLayers AHAH

Function to handle the AHAH request of the openlayers form

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

File

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

Code

function openlayers_ui_preset_ahah() {
  $form_state = array(
    'storage' => NULL,
    'submitted' => FALSE,
  );
  $form_build_id = $_POST['form_build_id'];
  $form = form_get_cache($form_build_id, $form_state);

  // Get variables
  $args = $form['#parameters'];
  $form_id = array_shift($args);
  $form_state['post'] = $form['#post'] = $_POST;
  $form['#programmed'] = $form['#redirect'] = FALSE;

  // Reprocess form with new form state
  drupal_process_form($form_id, $form, $form_state);

  // Rebuild form and remove any submit handlers
  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);

  // Unset wrapper and create output
  $output = theme('status_messages') . drupal_render($form['layerstyles']);

  // Final rendering callback.
  drupal_json(array(
    'status' => TRUE,
    'data' => $output,
  ));
}