|
@@ -510,18 +510,41 @@ $oTemplate = Template::construct_template($sTemplateID);
|
|
// need to adjust $chosen_theme path with SM_PATH
|
|
// need to adjust $chosen_theme path with SM_PATH
|
|
$chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
|
|
$chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
|
|
$found_theme = false;
|
|
$found_theme = false;
|
|
-while (!$found_theme && (list($index, $data) = each($user_themes))) {
|
|
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+while (!$found_theme && (list($index, $data) = @each($user_themes))) {
|
|
if ($data['PATH'] == $chosen_theme_path)
|
|
if ($data['PATH'] == $chosen_theme_path)
|
|
$found_theme = true;
|
|
$found_theme = true;
|
|
}
|
|
}
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+foreach ($user_themes as $index => $data) {
|
|
|
|
+ if ($data['PATH'] == $chosen_theme_path) {
|
|
|
|
+ $found_theme = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
+/*
|
|
if (!$found_theme) {
|
|
if (!$found_theme) {
|
|
$template_themes = $oTemplate->get_alternative_stylesheets(true);
|
|
$template_themes = $oTemplate->get_alternative_stylesheets(true);
|
|
- while (!$found_theme && (list($path, $name) = each($template_themes))) {
|
|
|
|
|
|
+ while (!$found_theme && (list($path, $name) = @each($template_themes))) {
|
|
if ($path == $chosen_theme_path)
|
|
if ($path == $chosen_theme_path)
|
|
$found_theme = true;
|
|
$found_theme = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+if (!$found_theme) {
|
|
|
|
+ $template_themes = $oTemplate->get_alternative_stylesheets(true);
|
|
|
|
+ foreach ($template_themes as $path => $name) {
|
|
|
|
+ if ($path == $chosen_theme_path) {
|
|
|
|
+ $found_theme = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
if (!$found_theme || $chosen_theme == 'none') {
|
|
if (!$found_theme || $chosen_theme == 'none') {
|
|
$chosen_theme_path = NULL;
|
|
$chosen_theme_path = NULL;
|