Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
c409a47f
Commit
c409a47f
authored
Nov 01, 2009
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#592008
follow-up by chx and moshe weitzman: All theme() function calls in hook_init().
parent
45c7f0c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
includes/module.inc
includes/module.inc
+17
-3
includes/theme.inc
includes/theme.inc
+1
-1
No files found.
includes/module.inc
View file @
c409a47f
...
...
@@ -6,16 +6,30 @@
* API for loading and interacting with Drupal modules.
*/
/**
* Load all the modules that have been enabled in the system table.
*
* @param $bootstrap
* Whether to load only the reduced set of modules loaded in "bootstrap mode"
* for cached pages. See bootstrap.inc.
* @return
* If $bootstrap is NULL, return a boolean indicating whether all modules
* have been loaded.
*/
function
module_load_all
(
$bootstrap
=
FALSE
)
{
foreach
(
module_list
(
TRUE
,
$bootstrap
)
as
$module
)
{
drupal_load
(
'module'
,
$module
);
static
$has_run
=
FALSE
;
if
(
isset
(
$bootstrap
))
{
foreach
(
module_list
(
TRUE
,
$bootstrap
)
as
$module
)
{
drupal_load
(
'module'
,
$module
);
}
// $has_run will be TRUE if $bootstrap is FALSE.
$has_run
=
!
$bootstrap
;
}
return
$has_run
;
}
/**
* Collect a list of all loaded modules. During the bootstrap, return only
* vital modules. See bootstrap.inc
...
...
includes/theme.inc
View file @
c409a47f
...
...
@@ -258,7 +258,7 @@ function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL)
$registry
=
_theme_build_registry
(
$theme
,
$base_theme
,
$theme_engine
);
// Only persist this registry if all modules are loaded. This assures a
// complete set of theme hooks.
if
(
drupal_get_bootstrap_phase
()
==
DRUPAL_BOOTSTRAP_F
ULL
)
{
if
(
module_load_all
(
N
ULL
)
)
{
_theme_save_registry
(
$theme
,
$registry
);
_theme_set_registry
(
$registry
);
}
...
...
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