Commit bb232c72 authored by Dries's avatar Dries

- Patch #277073 by threexk: improve consistency of offline vs off-line and online vs on-line.

parent fae9063c
......@@ -41,7 +41,7 @@ Let's begin!
in step #10 if you are unable to log on as user ID 1. Do not close your
browser until the final step is complete.
3. Place the site in "Off-line" mode, to let the database updates run without
3. Place the site in "Offline" mode, to let the database updates run without
interruption and avoid displaying errors to end users of the site. This
option is at http://www.example.com/?q=admin/settings/site-maintenance
(replace www.example.com with your installation's domain name and path).
......
......@@ -1064,7 +1064,7 @@ function _drupal_bootstrap($phase) {
* Enables use of the theme system without requiring database access.
*
* Loads and initializes the theme system for site installs, updates and when
* the site is in off-line mode. This also applies when the database fails.
* the site is in offline mode. This also applies when the database fails.
*
* @see _drupal_maintenance_theme()
*/
......
......@@ -325,12 +325,12 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
}
/**
* Generates a site off-line message.
* Generates a site offline message.
*/
function drupal_site_offline() {
drupal_maintenance_theme();
drupal_set_header('HTTP/1.1 503 Service unavailable');
drupal_set_title(t('Site off-line'));
drupal_set_title(t('Site offline'));
print theme('maintenance_page', filter_xss_admin(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', 'Drupal'))))));
}
......
......@@ -169,7 +169,7 @@ function db_set_active($name = 'default') {
/**
* Helper function to show fatal database errors.
*
* Prints a themed maintenance page with the 'Site off-line' text,
* Prints a themed maintenance page with the 'Site offline' text,
* adding the provided error message in the case of 'display_errors'
* set to on. Ends the page request; no return.
*
......@@ -180,7 +180,7 @@ function _db_error_page($error = '') {
global $db_type;
drupal_maintenance_theme();
drupal_set_header('HTTP/1.1 503 Service Unavailable');
drupal_set_title('Site off-line');
drupal_set_title('Site offline');
$message = '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>';
$message .= '<hr /><p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file and ensure that your hosting provider\'s database server is running. For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>';
......
......@@ -2413,26 +2413,26 @@ function menu_path_is_external($path) {
}
/**
* Checks whether the site is off-line for maintenance.
* Checks whether the site is offline for maintenance.
*
* This function will log the current user out and redirect to front page
* if the current user has no 'administer site configuration' permission.
*
* @return
* FALSE if the site is not off-line or its the login page or the user has
* FALSE if the site is not offline or its the login page or the user has
* 'administer site configuration' permission.
* TRUE for anonymous users not on the login page if the site is off-line.
* TRUE for anonymous users not on the login page if the site is offline.
*/
function _menu_site_is_offline() {
// Check if site is set to off-line mode.
// Check if site is set to offline mode.
if (variable_get('site_offline', 0)) {
// Check if the user has administration privileges.
if (user_access('administer site configuration')) {
// Ensure that the off-line message is displayed only once [allowing for
// Ensure that the offline message is displayed only once [allowing for
// page redirects], and specifically suppress its display on the site
// maintenance page.
if (drupal_get_normal_path($_GET['q']) != 'admin/settings/site-maintenance') {
drupal_set_message(t('Operating in off-line mode.'), 'status', FALSE);
drupal_set_message(t('Operating in offline mode.'), 'status', FALSE);
}
}
else {
......
......@@ -8,7 +8,7 @@
/**
* Sets up the theming system for site installs, updates and when the site is
* in off-line mode. It also applies when the database is unavailable.
* in offline mode. It also applies when the database is unavailable.
*
* Minnelli is always used for the initial install and update operations. In
* other cases, "settings.php" must have a "maintenance_theme" key set for the
......
......@@ -703,7 +703,7 @@ function install_tasks($profile, $task) {
$settings_dir = './' . conf_path();
$settings_file = $settings_dir . '/settings.php';
if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($settings_dir, FILE_NOT_WRITABLE, 'dir')) {
drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, please consult the <a href="@handbook_url">on-line handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/getting-started')), 'error');
drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, please consult the <a href="@handbook_url">online handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/getting-started')), 'error');
}
else {
drupal_set_message(st('All necessary changes to %dir and %file have been made. They have been set to read-only for security.', array('%dir' => $settings_dir, '%file' => $settings_file)));
......@@ -887,7 +887,7 @@ function install_check_requirements($profile, $verify) {
}
if (!$writable) {
drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">online handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
}
}
......
......@@ -60,13 +60,13 @@ function locale_help($path, $arg) {
$output .= '<p>' . t('Review the <a href="@languages">languages page</a> for more information on adding support for additional languages.', array('@languages' => url('admin/settings/language'))) . '</p>';
return $output;
case 'admin/build/translate/import':
$output = '<p>' . t('This page imports the translated strings contained in an individual Gettext Portable Object (<em>.po</em>) file. Normally distributed as part of a translation package (each translation package may contain several <em>.po</em> files), a <em>.po</em> file may need to be imported after off-line editing in a Gettext translation editor. Importing an individual <em>.po</em> file may be a lengthy process.') . '</p>';
$output = '<p>' . t('This page imports the translated strings contained in an individual Gettext Portable Object (<em>.po</em>) file. Normally distributed as part of a translation package (each translation package may contain several <em>.po</em> files), a <em>.po</em> file may need to be imported after offline editing in a Gettext translation editor. Importing an individual <em>.po</em> file may be a lengthy process.') . '</p>';
$output .= '<p>' . t('Note that the <em>.po</em> files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one <em>.po</em> file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and <a href="@language-add">add the language</a> (which automatically imports all <em>.po</em> files within the package). Translation packages are available for download on the <a href="@translations">Drupal translation page</a>.', array('@language-add' => url('admin/settings/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
return $output;
case 'admin/build/translate/export':
return '<p>' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '</p>';
case 'admin/build/translate/search':
return '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for off-line editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/build/translate/export'))) . '</p>';
return '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/build/translate/export'))) . '</p>';
case 'admin/build/block/configure':
if ($arg[4] == 'locale' && $arg[5] == 0) {
return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/settings/language'), '@configuration' => url('admin/settings/language/configure'))) . '</p>';
......
......@@ -4,7 +4,7 @@
/**
* @file maintenance-page.tpl.php
*
* Theme implementation to display a single Drupal page while off-line.
* Theme implementation to display a single Drupal page while offline.
*
* All the available variables are mirrored in page.tpl.php. Some may be left
* blank but they are provided for consistency.
......
......@@ -1699,15 +1699,15 @@ function system_site_maintenance_settings() {
'#type' => 'radios',
'#title' => t('Site status'),
'#default_value' => variable_get('site_offline', 0),
'#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'))),
'#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. Authorized users can log in during "Offline" mode directly via the <a href="@user-login">user login</a> page.', array('@user-login' => url('user'))),
);
$form['site_offline_message'] = array(
'#type' => 'textarea',
'#title' => t('Site off-line message'),
'#title' => t('Site offline 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', 'Drupal')))),
'#description' => t('Message to show visitors when the site is in off-line mode.')
'#description' => t('Message to show visitors when the site is in offline mode.')
);
return system_settings_form($form);
......
......@@ -210,7 +210,7 @@ function system_requirements($phase) {
elseif ($phase == 'install') {
// For the installer UI, we need different wording. 'value' will
// be treated as version, so provide none there.
$description = $error . ' ' . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the <a href="@handbook_url">on-line handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
$description = $error . ' ' . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the <a href="@handbook_url">online handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
$requirements['file system']['value'] = '';
}
if (!empty($description)) {
......
......@@ -55,7 +55,7 @@ function system_help($path, $arg) {
$output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '</li>';
$output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) . '</li>';
$output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
$output .= '<li>' . t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily off-line.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) . '</li></ul>';
$output .= '<li>' . t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily offline.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) . '</li></ul>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
return $output;
case 'admin':
......@@ -580,7 +580,7 @@ function system_menu() {
);
$items['admin/settings/site-maintenance'] = array(
'title' => 'Site maintenance',
'description' => 'Take the site off-line for maintenance or bring it back online.',
'description' => 'Take the site offline for maintenance or bring it back online.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_site_maintenance_settings'),
'access arguments' => array('administer site configuration'),
......
......@@ -175,8 +175,8 @@
# 'theme_default' => 'minnelli',
# 'anonymous' => 'Visitor',
/**
* A custom theme can be set for the off-line page. This applies when the site
* is explicitly set to off-line mode through the administration page or when
* A custom theme can be set for the offline page. This applies when the site
* is explicitly set to offline mode through the administration page or when
* the database is inactive due to an error. It can be set through the
* 'maintenance_theme' key. The template file should also be copied into the
* theme. It is located inside 'modules/system/maintenance-page.tpl.php'.
......
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