From 9d886eca53d9987e6b249e2b24576d6fa8eef2a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jan 2013 11:19:46 +0100 Subject: [PATCH] Fix: Scan of correct dir when them dir is forced --- htdocs/core/lib/usergroups.lib.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 5cfff43e63c..5a2cb951ec3 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -223,12 +223,17 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { global $conf,$langs,$bc; - $forcethemedir=(! empty($conf->global->MAIN_FORCETHEMEDIR) ? $conf->global->MAIN_FORCETHEMEDIR : ''); - $dirthemes=array($forcethemedir.'/theme'); - if (! empty($conf->modules_parts['theme'])) { - $dirthemes=array_merge(array($forcethemedir.'/theme'),(array) $conf->modules_parts['theme']); + //$conf->global->MAIN_FORCETHEMEDIR=''; + $dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme'); + if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application + { + foreach($conf->modules_parts['theme'] as $reldir) + { + $dirthemes=array_merge($dirthemes,(array) ($reldir.'theme')); + } } - + $dirthemes=array_unique($dirthemes); + $selected_theme=''; if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME; else $selected_theme=empty($fuser->conf->MAIN_THEME)?'':$fuser->conf->MAIN_THEME;