On this page
function system_site_maintenance_mode
system_site_maintenance_mode()
Form builder; Configure the site's maintenance status.
See also
Related topics
File
- modules/system/system.admin.inc, line 2220
- 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);
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.admin.inc/function/system_site_maintenance_mode/7.x