diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-02 17:38:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-02 17:38:55 +0000 |
commit | 6511f56e4b62f667138b6bab184b20c53e651cee (patch) | |
tree | 937333e37b40d922fd77b72e4a1aa9ac034f2b1c | |
parent | 32981b119b076014d3f5774020f115b4811d795f (diff) | |
download | brdo-6511f56e4b62f667138b6bab184b20c53e651cee.tar.gz brdo-6511f56e4b62f667138b6bab184b20c53e651cee.tar.bz2 |
- Patch #232345 by flobruit: theme_get_registry docs and code conflict.
-rw-r--r-- | includes/theme.inc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 554b4c80b..81c4d7e2d 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -196,26 +196,29 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme } /** - * Retrieve the stored theme registry. If the theme registry is already - * in memory it will be returned; otherwise it will attempt to load the - * registry from cache. If this fails, it will construct the registry and - * cache it. + * Get the theme registry. + * @return + * The theme registry array if it has been stored in memory, NULL otherwise. */ -function theme_get_registry($registry = NULL) { - static $theme_registry = NULL; - if (isset($registry)) { - $theme_registry = $registry; - } - - return $theme_registry; +function theme_get_registry() { + return _theme_set_registry(); } /** * Store the theme registry in memory. + * @param $registry + * A registry array as returned by _theme_build_registry() + * @return + * The theme registry array stored in memory */ -function _theme_set_registry($registry) { - // Pass through for setting of static variable. - return theme_get_registry($registry); +function _theme_set_registry($registry = NULL) { + static $theme_registry = NULL; + + if (isset($registry)) { + $theme_registry = $registry; + } + + return $theme_registry; } /** |