return $name;
}
-// Initialize variables
-$GLOBALS['curr_theme'] = getCurrentTheme();
-
+// @TODO Move this code block into a filter and register it with 'init'
// Check if new theme is selcted
-if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != $GLOBALS['curr_theme'])) {
+if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != getCurrentTheme())) {
// Set new theme for guests
$newTheme = postRequestElement('new_theme');
setTheme($newTheme);
// Remove current from array
- removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", $GLOBALS['curr_theme']));
+ removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
// Add new theme
addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));