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
4a42062b
Commit
4a42062b
authored
Jan 09, 2010
by
Dries
Browse files
- Patch
#667038
by effulgentsia: optimize template_process().
parent
1f6a553c
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/theme.inc
View file @
4a42062b
...
@@ -2288,9 +2288,12 @@ function template_process(&$variables, $hook) {
...
@@ -2288,9 +2288,12 @@ function template_process(&$variables, $hook) {
$variables
[
'classes'
]
=
implode
(
' '
,
$variables
[
'classes_array'
]);
$variables
[
'classes'
]
=
implode
(
' '
,
$variables
[
'classes_array'
]);
// Flatten out attributes, title_attributes, and content_attributes.
// Flatten out attributes, title_attributes, and content_attributes.
$variables
[
'attributes'
]
=
drupal_attributes
(
$variables
[
'attributes_array'
]);
// Because this function can be called very often, and often with empty
$variables
[
'title_attributes'
]
=
drupal_attributes
(
$variables
[
'title_attributes_array'
]);
// attributes, optimize performance by only calling drupal_attributes() if
$variables
[
'content_attributes'
]
=
drupal_attributes
(
$variables
[
'content_attributes_array'
]);
// necessary.
$variables
[
'attributes'
]
=
$variables
[
'attributes_array'
]
?
drupal_attributes
(
$variables
[
'attributes_array'
])
:
''
;
$variables
[
'title_attributes'
]
=
$variables
[
'title_attributes_array'
]
?
drupal_attributes
(
$variables
[
'title_attributes_array'
])
:
''
;
$variables
[
'content_attributes'
]
=
$variables
[
'content_attributes_array'
]
?
drupal_attributes
(
$variables
[
'content_attributes_array'
])
:
''
;
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
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