]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/theme_functions.php
ext was missing, fixed error message
[mailer.git] / inc / libs / theme_functions.php
index 1cac6e877e81a1032208233916d35cfd88170e14..70a219910271e1932314abd0a53475009f0059a1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 12/03/2004 *
- * ===============                              Last change: 12/13/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 12/03/2004 *
+ * ===================                          Last change: 12/13/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : theme-manager.php                                *
@@ -72,7 +72,7 @@ function generateThemeSelectionBox () {
        // Load all themes
        while ($content = SQL_FETCHARRAY($result)) {
                // Construct relative include file name
-               $inc = sprintf("theme/%s/theme.php", SQL_ESCAPE($content['theme_path']));
+               $inc = sprintf("theme/%s/theme.php", secureString($content['theme_path']));
 
                // Load it's theme.php file if found
                if (isIncludeReadable($inc)) {
@@ -215,23 +215,23 @@ function getCurrentThemeName () {
        return $name;
 }
 
-// Initialize variables
-$GLOBALS['curr_theme'] = getCurrentTheme();
+// Filter for generic handling of theme change
+function FILTER_HANDLE_THEME_CHANGE () {
+       // Check if new theme is selcted
+       if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != getCurrentTheme())) {
+               // Set new theme for guests
+               $newTheme = postRequestElement('new_theme');
 
-// Check if new theme is selcted
-if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != $GLOBALS['curr_theme'])) {
-       // Set new theme for guests
-       $newTheme = postRequestElement('new_theme');
+               // Change to new theme
+               setTheme($newTheme);
 
-       // Change to new theme
-       setTheme($newTheme);
+               // Remove current from array
+               removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
 
-       // Remove current from array
-       removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", $GLOBALS['curr_theme']));
-
-       // Add new theme
-       addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
-} // END - if
+               // Add new theme
+               addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
+       } // END - if
+}
 
 // [EOF]
 ?>