From 8cf79472193dc34f566e753153b0ecec84f03914 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 30 Aug 2006 21:55:59 +0000 Subject: [PATCH] bug #1542865, themes not switching --- ChangeLog | 4 ++++ libraries/common.lib.php | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd2c996c7..1b4e09fe7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-08-30 Marc Delisle + * libraries/common.lib.php: bug #1542865, themes not switching + when ThemePerServer is true + 2006-08-30 Michal Čihař * libraries/common.lib.php, lang/*: Internationalise link to MySQL documentation when translation exists, this needs to be defined in diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0b20e9bd1..685a1583b 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -3074,8 +3074,18 @@ if (! isset($_SESSION['PMA_Theme_Manager'])) { $_SESSION['PMA_Theme_Manager']->checkConfig(); } +// for the theme per server feature +if (isset($_REQUEST['server']) && !isset($_REQUEST['set_theme'])) { + $GLOBALS['server'] = $_REQUEST['server']; + $tmp = $_SESSION['PMA_Theme_Manager']->getThemeCookie(); + if (empty($tmp)) { + $tmp = $_SESSION['PMA_Theme_Manager']->theme_default; + } + $_SESSION['PMA_Theme_Manager']->setActiveTheme($tmp); + unset($tmp); +} if (isset($_REQUEST['set_theme'])) { - // if user submit a theme + // if user selected a theme $_SESSION['PMA_Theme_Manager']->setActiveTheme($_REQUEST['set_theme']); } @@ -3362,7 +3372,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { PMA_setCookie('pma_collation_connection', $GLOBALS['collation_connection']); $_SESSION['PMA_Theme_Manager']->setThemeCookie(); - } // end if !defined('PMA_MINIMUM_COMMON') if (!empty($__redirect) && in_array($__redirect, $goto_whitelist)) {