Pārlūkot izejas kodu

add themes support to plugins using SM_PATH

jmunro 23 gadi atpakaļ
vecāks
revīzija
a566b2c5af
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      include/load_prefs.php

+ 6 - 0
include/load_prefs.php

@@ -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'); 
 }