add themes support to plugins using SM_PATH
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 7 Oct 2002 00:58:18 +0000 (00:58 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 7 Oct 2002 00:58:18 +0000 (00:58 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3784 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/load_prefs.php

index e96d042b8dad99cd624fcbb302cdecb2d044b1dc..c18cae319f385d359259e2c04832d5d088dd00c6 100644 (file)
@@ -27,6 +27,10 @@ $color = ( !isset($color) ? array() : $color );
 
 $chosen_theme = getPref($data_dir, $username, 'chosen_theme');
 $found_theme = false;
+
+/* need to adjust $chosen_theme path with SM_PATH */
+$chosen_theme = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme);
+
 for ($i = 0; $i < count($theme); ++$i){
     if ($theme[$i]['PATH'] == $chosen_theme) {
         $found_theme = true;
@@ -63,6 +67,8 @@ if (isset($chosen_theme) && $found_theme && (file_exists($chosen_theme))) {
     }
 }
 
+sqsession_register($color, 'color');
+
 if (!defined('download_php')) { 
     session_register('theme_css'); 
 }