From a946c16b17b8c21ecb2832aca74f162d4b700292 Mon Sep 17 00:00:00 2001
From: seek3r <seek3r@alumni.egroupware.org>
Date: Wed, 10 Jan 2001 02:03:16 +0000
Subject: [PATCH] added templates selection

---
 phpgwapi/inc/phpgw_common.inc.php | 7 +++++--
 preferences/settings.php          | 3 +--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/phpgwapi/inc/phpgw_common.inc.php b/phpgwapi/inc/phpgw_common.inc.php
index f6cc26d6a1..006ee3947a 100644
--- a/phpgwapi/inc/phpgw_common.inc.php
+++ b/phpgwapi/inc/phpgw_common.inc.php
@@ -356,8 +356,11 @@
       if ($appname == ""){$appname = $phpgw_info["flags"]["currentapp"];}
       if ($appname == "home" || $appname == "logout" || $appname == "login"){$appname = "phpgwapi";}
 
-      if ($phpgw_info["server"]["template_set"] == "user_choice" && isset($phpgw_info["user"]["preferences"]["template_set"])){
-        $phpgw_info["server"]["template_set"] = $phpgw_info["user"]["preferences"]["template_set"];
+      // Setting this for display of template choices in user preferences
+      if ($phpgw_info["server"]["template_set"] == "user_choice" ){$phpgw_info["server"]["usrtplchoice"] = "user_choice"; }
+
+      if ($phpgw_info["server"]["template_set"] == "user_choice" && isset($phpgw_info["user"]["preferences"]["common"]["template_set"])){
+        $phpgw_info["server"]["template_set"] = $phpgw_info["user"]["preferences"]["common"]["template_set"];
       }elseif ($phpgw_info["server"]["template_set"] == "user_choice" || !isset($phpgw_info["server"]["template_set"])){
         $phpgw_info["server"]["template_set"] = "default";
       }
diff --git a/preferences/settings.php b/preferences/settings.php
index 189e8792d8..2fc648d16a 100755
--- a/preferences/settings.php
+++ b/preferences/settings.php
@@ -34,8 +34,7 @@
         </td>
        </tr>
 
-      
-       <?php if ($phpgw_info["server"]["template_set"] == "user_choice"){ ?>
+       <?php if ($phpgw_info["server"]["usrtplchoice"] == "user_choice"){ ?>
        <tr>
          <?php $selected[$phpgw_info["user"]["preferences"]["common"]["template_set"]] = " selected"; ?>
         <td>Interface/Template Selection:<br></td>