Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8e0d6b46
Commit
8e0d6b46
authored
Feb 20, 2008
by
Dries
Browse files
- Patch
#224142
by jvandyk: tiny performance improvement for theme().
parent
7b699125
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/theme.inc
View file @
8e0d6b46
...
...
@@ -576,7 +576,7 @@ function theme() {
global
$theme_path
;
$temp
=
$theme_path
;
// point path_to_theme() to the currently used theme path:
$theme_path
=
$
hooks
[
$hook
]
[
'theme path'
];
$theme_path
=
$
info
[
'theme path'
];
// Include a file if the theme function or preprocess function is held elsewhere.
if
(
!
empty
(
$info
[
'file'
]))
{
...
...
@@ -612,7 +612,7 @@ function theme() {
if
(
isset
(
$theme_engine
))
{
// If theme or theme engine is implementing this, it may have
// a different extension and a different renderer.
if
(
$
hooks
[
$hook
]
[
'type'
]
!=
'module'
)
{
if
(
$
info
[
'type'
]
!=
'module'
)
{
if
(
function_exists
(
$theme_engine
.
'_render_template'
))
{
$render_function
=
$theme_engine
.
'_render_template'
;
}
...
...
@@ -652,9 +652,9 @@ function theme() {
}
if
(
empty
(
$template_file
))
{
$template_file
=
$
hooks
[
$hook
]
[
'template'
]
.
$extension
;
if
(
isset
(
$
hooks
[
$hook
]
[
'path'
]))
{
$template_file
=
$
hooks
[
$hook
]
[
'path'
]
.
'/'
.
$template_file
;
$template_file
=
$
info
[
'template'
]
.
$extension
;
if
(
isset
(
$
info
[
'path'
]))
{
$template_file
=
$
info
[
'path'
]
.
'/'
.
$template_file
;
}
}
$output
=
$render_function
(
$template_file
,
$variables
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment