You are here

function overlay_form_alter in Drupal 7

Implements hook_form_alter().

File

modules/overlay/overlay.module, line 84
Displays the Drupal administration interface in an overlay.

Code

function overlay_form_alter(&$form, &$form_state) {

  // Add a hidden element to prevent dropping out of the overlay when a form is
  // submitted inside the overlay using a GET method.
  if (isset($form['#method']) && $form['#method'] == 'get' && isset($_REQUEST['render']) && $_REQUEST['render'] == 'overlay' && !isset($form['render'])) {
    $form['render'] = array(
      '#type' => 'hidden',
      '#value' => 'overlay',
    );
  }
}