From 6511f56e4b62f667138b6bab184b20c53e651cee Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 2 Sep 2008 17:38:55 +0000 Subject: [PATCH] - Patch #232345 by flobruit: theme_get_registry docs and code conflict. --- includes/theme.inc | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index 554b4c80bab..81c4d7e2d30 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; } /**