Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
47182dfb
Commit
47182dfb
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#421062
follow-up by JohnAlbin: Respect maintenance theme overrides in settings.php.
parent
ba72e2f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/theme.maintenance.inc
+32
-16
32 additions, 16 deletions
includes/theme.maintenance.inc
with
32 additions
and
16 deletions
includes/theme.maintenance.inc
+
32
−
16
View file @
47182dfb
...
...
@@ -11,11 +11,11 @@
* in maintenance mode. It also applies when the database is unavailable.
*
* Seven is always used for the initial install and update operations. In
* other cases,
Minnelli
is used, but this can be overridden by setting a
* other cases,
Garland
is used, but this can be overridden by setting a
* "maintenance_theme" key in the $conf variable in settings.php.
*/
function
_drupal_maintenance_theme
()
{
global
$theme
,
$theme_key
;
global
$theme
,
$theme_key
,
$conf
;
// If $theme is already set, assume the others are set too, and do nothing.
if
(
isset
(
$theme
))
{
...
...
@@ -33,7 +33,7 @@ function _drupal_maintenance_theme() {
// Install and update pages are treated differently to prevent theming overrides.
if
(
defined
(
'MAINTENANCE_MODE'
)
&&
(
MAINTENANCE_MODE
==
'install'
||
MAINTENANCE_MODE
==
'update'
))
{
$custom_theme
=
'seven'
;
$custom_theme
=
(
isset
(
$conf
[
'maintenance_theme'
])
?
$conf
[
'maintenance_theme'
]
:
'seven'
)
;
}
else
{
if
(
!
db_is_active
())
{
...
...
@@ -44,7 +44,9 @@ function _drupal_maintenance_theme() {
drupal_load
(
'module'
,
'system'
);
}
$custom_theme
=
variable_get
(
'maintenance_theme'
,
'garland'
);
// We use the default theme as the maintenance theme. If a default theme
// isn't specified in the database or in settings.php, we use Garland.
$custom_theme
=
variable_get
(
'maintenance_theme'
,
variable_get
(
'theme_default'
,
'garland'
));
}
$themes
=
list_themes
();
...
...
@@ -159,13 +161,20 @@ function theme_install_page($variables) {
$variables
[
'messages'
]
.
=
theme
(
'status_messages'
,
array
(
'display'
=>
'status'
));
}
// This was called as a theme hook (not template), so we need to
// fix path_to_theme() for the template, to point at the actual
// theme rather than system module as owner of the hook.
global
$theme_path
;
$theme_path
=
'themes/seven'
;
// This was called as a theme hook (not template), so we need to fix
// path_to_theme() for the template, to point at the actual theme rather than
// system module as owner of the hook. Additionally, figure out the
// maintenance page template to use.
global
$theme_path
,
$theme_info
,
$base_theme_info
;
$theme_path
=
dirname
(
$theme_info
->
uri
);
$base_themes
=
$base_theme_info
;
// Make sure a maintenance-page.tpl.php is always found.
$base_themes
[]
=
'modules/system'
;
while
(
!
file_exists
(
$theme_path
.
'/maintenance-page.tpl.php'
)
&&
$base_theme
=
array_shift
(
$base_themes
))
{
$theme_path
=
dirname
(
$base_theme
->
uri
);
}
return
theme_render_template
(
'
theme
s/seven
/maintenance-page.tpl.php'
,
$variables
);
return
theme_render_template
(
$
theme
_path
.
'
/maintenance-page.tpl.php'
,
$variables
);
}
/**
...
...
@@ -197,13 +206,20 @@ function theme_update_page($variables) {
$variables
[
'messages'
]
.
=
theme
(
'status_messages'
,
array
(
'display'
=>
'warning'
));
}
// This was called as a theme hook (not template), so we need to
// fix path_to_theme() for the template, to point at the actual
// theme rather than system module as owner of the hook.
global
$theme_path
;
$theme_path
=
'themes/seven'
;
// This was called as a theme hook (not template), so we need to fix
// path_to_theme() for the template, to point at the actual theme rather than
// system module as owner of the hook. Additionally, figure out the
// maintenance page template to use.
global
$theme_path
,
$theme_info
,
$base_theme_info
;
$theme_path
=
dirname
(
$theme_info
->
uri
);
$base_themes
=
$base_theme_info
;
// Make sure a maintenance-page.tpl.php is always found.
$base_themes
[]
=
'modules/system'
;
while
(
!
file_exists
(
$theme_path
.
'/maintenance-page.tpl.php'
)
&&
$base_theme
=
array_shift
(
$base_themes
))
{
$theme_path
=
dirname
(
$base_theme
->
uri
);
}
return
theme_render_template
(
'
theme
s/seven
/maintenance-page.tpl.php'
,
$variables
);
return
theme_render_template
(
$
theme
_path
.
'
/maintenance-page.tpl.php'
,
$variables
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment