You are here

function system_site_maintenance_mode in Drupal 7

Form builder; Configure the site's maintenance status.

See also

system_settings_form()

Related topics

1 string reference to 'system_site_maintenance_mode'
system_menu in modules/system/system.module
Implements hook_menu().

File

modules/system/system.admin.inc, line 2221
Admin page callbacks for the system module.

Code

function system_site_maintenance_mode() {
  $form['maintenance_mode'] = array(
    '#type' => 'checkbox',
    '#title' => t('Put site into maintenance mode'),
    '#default_value' => variable_get('maintenance_mode', 0),
    '#description' => t('When enabled, only users with the "Use the site in maintenance mode" <a href="@permissions-url">permission</a> are able to access your site to perform maintenance; all other visitors see the maintenance mode message configured below. Authorized users can log in directly via the <a href="@user-login">user login</a> page.', array(
      '@permissions-url' => url('admin/people/permissions'),
      '@user-login' => url('user'),
    )),
  );
  $form['maintenance_mode_message'] = array(
    '#type' => 'textarea',
    '#title' => t('Maintenance mode message'),
    '#default_value' => variable_get('maintenance_mode_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array(
      '@site' => variable_get('site_name', 'Drupal'),
    ))),
    '#description' => t('Message to show visitors when the site is in maintenance mode.'),
  );
  return system_settings_form($form);
}