]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/theme_functions.php
More globals rewritten, see #100
[mailer.git] / inc / libs / theme_functions.php
index ebdaf6ee52ae855eb4059d4986015a9986250c49..2dfcac22cb3b7e0e562b58950458878519f64e9a 100644 (file)
@@ -81,8 +81,6 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
 
 // Get version from name
 function THEME_GET_VERSION ($name) {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -93,9 +91,9 @@ function THEME_GET_VERSION ($name) {
        $cver = "?.?";
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_ver'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_ver'][$name])) {
                // Get the version from cache
-               $cver = $cacheArray['themes']['theme_ver'][$name];
+               $cver = $GLOBALS['cache_array']['themes']['theme_ver'][$name];
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -126,8 +124,6 @@ function THEME_CHECK_EXIST ($name) {
 
 // Checks if a theme is active
 function THEME_IS_ACTIVE ($name) {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -138,9 +134,9 @@ function THEME_IS_ACTIVE ($name) {
        $active = false;
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_active'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_active'][$name])) {
                // Get the version from cache
-               $active = ($cacheArray['themes']['theme_active'][$name] == "Y");
+               $active = ($GLOBALS['cache_array']['themes']['theme_active'][$name] == "Y");
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -162,8 +158,6 @@ function THEME_IS_ACTIVE ($name) {
 
 // Gets current human-readable theme name
 function GET_CURR_THEME_NAME () {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -174,9 +168,9 @@ function GET_CURR_THEME_NAME () {
        $name = GET_CURR_THEME();
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_name'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_name'][$name])) {
                // Get the version from cache
-               $name = $cacheArray['themes']['theme_name'][$name];
+               $name = $GLOBALS['cache_array']['themes']['theme_name'][$name];
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -197,10 +191,10 @@ function GET_CURR_THEME_NAME () {
 }
 
 // Initialize variables
-$currTheme = GET_CURR_THEME();
+$GLOBALS['curr_theme'] = GET_CURR_THEME();
 
 // Check if new theme is selcted
-if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $currTheme)) {
+if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $GLOBALS['curr_theme'])) {
        // Set new theme for guests
        $newTheme = $_POST['new_theme'];
 
@@ -208,7 +202,7 @@ if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $currTheme)) {
        set_session('mxchange_theme', $newTheme);
 
        // Remove current from array and set new
-       $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $currTheme);
+       $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $GLOBALS['curr_theme']);
        unset($INC_POOL[array_search($theme, $INC_POOL)]);
        $INC_POOL[] = sprintf("%stheme/%s/theme.php", constant('PATH'), $newTheme);
 } // END - if