overlay_form_user_profile_form_alter

7 overlay.module overlay_form_user_profile_form_alter(&$form, &$form_state)
8 overlay.module overlay_form_user_profile_form_alter(&$form, &$form_state)

Implements hook_form_FORM_ID_alter().

File

modules/overlay/overlay.module, line 84
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,
      );
    }
  }
}
Login or register to post comments