]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/theme_functions.php
Fixes for the fix
[mailer.git] / inc / libs / theme_functions.php
index 1cac6e877e81a1032208233916d35cfd88170e14..64dbda3d65b4058763a5f26b5be92403f0e144e2 100644 (file)
@@ -215,11 +215,9 @@ function getCurrentThemeName () {
        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');
 
@@ -227,7 +225,7 @@ if ((isPostRequestElementSet('new_theme')) && (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));