_drupal_maintenance_theme
includes/theme.maintenance.inc, строка 16
- Версии
- 6
_drupal_maintenance_theme()
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.
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
$conf
variable in order to change the maintenance theme.
Код
<?php
function _drupal_maintenance_theme() {
global $theme, $theme_key;
// If $theme is already set, assume the others are set too, and do nothing.
if (isset($theme)) {
return;
}
require_once './includes/path.inc';
require_once './includes/theme.inc';
require_once './includes/common.inc';
require_once './includes/unicode.inc';
require_once './includes/file.inc';
require_once './includes/module.inc';
require_once './includes/database.inc';
unicode_check();
// Install and update pages are treated differently to prevent theming overrides.
if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install' || MAINTENANCE_MODE == 'update')) {
$theme = 'minnelli';
}
else {
// Load module basics (needed for hook invokes).
$module_list['system']['filename'] = 'modules/system/system.module';
$module_list['filter']['filename'] = 'modules/filter/filter.module';
module_list(TRUE, FALSE, FALSE, $module_list);
drupal_load('module', 'system');
drupal_load('module', 'filter');
$theme = variable_get('maintenance_theme', 'minnelli');
}
$themes = list_themes();
// Store the identifier for retrieving theme settings with.
$theme_key = $theme;
// Find all our ancestor themes and put them in an array.
$base_theme = array();
$ancestor = $theme;
while ($ancestor && isset($themes[$ancestor]->base_theme)) {
$base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme];
$ancestor = $themes[$ancestor]->base_theme;
}
_init_theme($themes[$theme], array_reverse($base_theme), '_theme_load_offline_registry');
// These are usually added from system_init() -except maintenance.css.
// When the database is inactive it's not called so we add it here.
drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') .'/maintenance.css', 'module');
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии