Commit 14ae2389 authored by Dries's avatar Dries

- Patch #45320 by Zen: improved usability of off-line mode.

parent 30acded3
......@@ -254,11 +254,11 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL) {
/**
* Generates a site offline message
* Generates a site off-line message
*/
function drupal_site_offline() {
drupal_set_header('HTTP/1.0 503 Service unavailable');
drupal_set_title(t('Site offline'));
drupal_set_title(t('Site off-line'));
print theme('maintenance_page', variable_get('site_offline_message',
t('%site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('%site' => variable_get('site_name', t('This Drupal site'))))));
}
......
......@@ -1312,10 +1312,10 @@ function _menu_build_local_tasks($pid) {
}
/**
* Returns TRUE if the is offline for maintenance.
* Returns TRUE if the is off-line for maintenance.
*/
function _menu_site_is_offline() {
// Check if site is set to offline mode
// Check if site is set to off-line mode
if (variable_get('site_offline', 0)) {
// Check if the user has administration privileges
if (!user_access('administer site configuration')) {
......@@ -1324,6 +1324,9 @@ function _menu_site_is_offline() {
return TRUE;
}
}
else {
drupal_set_message(t('Operating in off-line mode.'));
}
}
return FALSE;
}
......@@ -442,7 +442,7 @@ function system_view_general() {
);
// Site offline/maintenance settings
// Site off-line/maintenance settings
$form['site_status'] = array(
'#type' => 'fieldset',
'#title' => t('Site maintenance'),
......@@ -453,15 +453,15 @@ function system_view_general() {
'#type' => 'radios',
'#title' => t('Site status'),
'#default_value' => variable_get('site_offline', 0),
'#options' => array(t('Online'), t('Offline')),
'#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance, all other visitors will see the site offline message configured below.')
'#options' => array(t('Online'), t('Off-line')),
'#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Off-line", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site off-line message configured below. Authorized users can log in during "Off-line" mode directly via the <a href="%user-login">user login</a> page.', array('%user-login' => url('user'))),
);
$form['site_status']['site_offline_message'] = array(
'#type' => 'textarea',
'#title' => t('Site offline message'),
'#title' => t('Site off-line message'),
'#default_value' => variable_get('site_offline_message', t('%site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('%site' => variable_get('site_name', t('This Drupal site'))))),
'#description' => t('Message to show visitors when site is offline.')
'#description' => t('Message to show visitors when the site is in off-line mode.')
);
// String handling: report status and errors.
......
......@@ -442,7 +442,7 @@ function system_view_general() {
);
// Site offline/maintenance settings
// Site off-line/maintenance settings
$form['site_status'] = array(
'#type' => 'fieldset',
'#title' => t('Site maintenance'),
......@@ -453,15 +453,15 @@ function system_view_general() {
'#type' => 'radios',
'#title' => t('Site status'),
'#default_value' => variable_get('site_offline', 0),
'#options' => array(t('Online'), t('Offline')),
'#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance, all other visitors will see the site offline message configured below.')
'#options' => array(t('Online'), t('Off-line')),
'#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Off-line", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site off-line message configured below. Authorized users can log in during "Off-line" mode directly via the <a href="%user-login">user login</a> page.', array('%user-login' => url('user'))),
);
$form['site_status']['site_offline_message'] = array(
'#type' => 'textarea',
'#title' => t('Site offline message'),
'#title' => t('Site off-line message'),
'#default_value' => variable_get('site_offline_message', t('%site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('%site' => variable_get('site_name', t('This Drupal site'))))),
'#description' => t('Message to show visitors when site is offline.')
'#description' => t('Message to show visitors when the site is in off-line mode.')
);
// String handling: report status and errors.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment