You are here

function overlay_form_user_profile_form_alter in Drupal 7

Implements hook_form_FORM_ID_alter().

File

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

Code

function overlay_form_user_profile_form_alter(&$form, &$form_state) {
  if ($form['#user_category'] == 'account') {
    $account = $form['#user'];
    if (user_access('access overlay', $account)) {
      $form['overlay_control'] = array(
        '#type' => 'fieldset',
        '#title' => t('Administrative overlay'),
        '#weight' => 4,
        '#collapsible' => TRUE,
      );
      $form['overlay_control']['overlay'] = array(
        '#type' => 'checkbox',
        '#title' => t('Use the overlay for administrative pages.'),
        '#description' => t('Show administrative pages on top of the page you started from.'),
        '#default_value' => isset($account->data['overlay']) ? $account->data['overlay'] : 1,
      );
    }
  }
}