diff --git a/ChangeLog b/ChangeLog index 63e402498..1ae969a92 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,10 @@ $Source$ 2005-07-10 Michal Čihař * libraries/auth/http.auth.lib.php: Support FastGCI in http auth (patch #1192219) + * Documentation.html, config.inc.php, left.php, queryframe.php, + libraries/common.lib.php, libraries/config_import.lib.php, + libraries/header_meta_style.inc.php, libraries/select_theme.lib.php: + User can now have different theme per server (RFE #1231599). 2005-07-10 Marc Delisle * libraries/display_tbl.lib.php: bug #1235473 display_tbl.lib.php, diff --git a/Documentation.html b/Documentation.html index dd120bc29..e9495f278 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1839,6 +1839,12 @@ Defaults to FALSE (drop-down).


+
$cfg['ThemePerServer'] boolean
+
+ Whether to allow different theme for each server. +

+
+
$cfg['DefaultQueryTable'] string
$cfg['DefaultQueryDatabase'] string
diff --git a/config.inc.php b/config.inc.php index a7d662afd..2fad48e28 100644 --- a/config.inc.php +++ b/config.inc.php @@ -577,6 +577,7 @@ $cfg['ThemeManager'] = TRUE; // if you want to use selectable th $cfg['ThemeDefault'] = 'original'; // set up default theme, if ThemePath not empty // you can set up here an valid path to themes or 'original' for // the original pma-theme +$cfg['ThemePerServer'] = FALSE; // allow diferent theme for each configured server //----------------------------------------------------------------------------- diff --git a/left.php b/left.php index 2deccdbd4..bf8f18918 100644 --- a/left.php +++ b/left.php @@ -289,11 +289,11 @@ if (($num_dbs > 1 || !empty($cfg['LeftFrameTableSeparator'])) && !$cfg['LeftFram var isServer = 0) ? 'true' : 'false'; ?>; - document.writeln(''); + document.writeln(''); //--> diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 65f54c775..a8310f536 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -142,7 +142,7 @@ if (isset($cfg['FileRevision'])) { } else { $cfg['FileRevision'] = array(1, 1); } -if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 56)) { +if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 58)) { require_once('./libraries/config_import.lib.php'); } @@ -328,8 +328,14 @@ if (strtolower($cfg['OBGzip']) == 'auto') { * and if the directory $ThemePath/$theme/img/ exists * If not, it will use default images */ +// Allow different theme per server +$theme_cookie_name = 'pma_theme'; +if ($GLOBALS['cfg']['ThemePerServer'] && isset($server)) { + $theme_cookie_name .= '-' . $server; +} +//echo $theme_cookie_name; // Theme Manager -if (!$cfg['ThemeManager'] || !isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])){ +if (!$cfg['ThemeManager'] || !isset($_COOKIE[$theme_cookie_name]) || empty($_COOKIE[$theme_cookie_name])){ $GLOBALS['theme'] = $cfg['ThemeDefault']; $ThemeDefaultOk = FALSE; if ($cfg['ThemePath']!='' && $cfg['ThemePath'] != FALSE) { @@ -352,7 +358,7 @@ if (!$cfg['ThemeManager'] || !isset($_COOKIE['pma_theme']) || empty($_COOKIE['pm if (isset($_POST['set_theme'])) { $GLOBALS['theme'] = PMA_securePath($_POST['set_theme']); } else { - $GLOBALS['theme'] = PMA_securePath($_COOKIE['pma_theme']); + $GLOBALS['theme'] = PMA_securePath($_COOKIE[$theme_cookie_name]); } } diff --git a/libraries/config_import.lib.php b/libraries/config_import.lib.php index 6679f5653..b0e4cf332 100644 --- a/libraries/config_import.lib.php +++ b/libraries/config_import.lib.php @@ -756,6 +756,9 @@ if (!isset($cfg['ThemePath'])) { $cfg['ThemeManager'] = TRUE; } } +if (!isset($cfg['ThemePerServer'])){ + $cfg['ThemePerServer'] = FALSE; +} if (!isset($cfg['DefaultQueryTable'])) { $cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; diff --git a/libraries/header_meta_style.inc.php b/libraries/header_meta_style.inc.php index 3b3a9d452..0b6b8187b 100644 --- a/libraries/header_meta_style.inc.php +++ b/libraries/header_meta_style.inc.php @@ -61,10 +61,10 @@ if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) { } } // end if... else if... } // end if - document.writeln(''); + document.writeln(''); //--> - + diff --git a/libraries/select_theme.lib.php b/libraries/select_theme.lib.php index 8659422b7..d6fd363b6 100644 --- a/libraries/select_theme.lib.php +++ b/libraries/select_theme.lib.php @@ -79,25 +79,31 @@ if ($PMA_ThemeAvailable == TRUE) { // themeManager is available asort($available_themes_choices); +// Allow different theme per server +$theme_cookie_name = 'pma_theme'; +if ($GLOBALS['cfg']['ThemePerServer']) { + $theme_cookie_name .= '-' . $server; +} + if (isset($set_theme)) { // if user submit a theme - setcookie('pma_theme', $set_theme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); + setcookie($theme_cookie_name, $set_theme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); } else { // else check if user have a theme cookie - if (!isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])) { + if (!isset($_COOKIE[$theme_cookie_name]) || empty($_COOKIE[$theme_cookie_name])) { if ($PMA_ThemeDefault == TRUE) { if (basename($PHP_SELF) == 'index.php') { - setcookie('pma_theme', $cfg['ThemeDefault'], time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); + setcookie($theme_cookie_name, $cfg['ThemeDefault'], time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); } $pmaTheme=$cfg['ThemeDefault']; }else{ if (basename($PHP_SELF) == 'index.php') { - setcookie('pma_theme', 'original', time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); + setcookie($theme_cookie_name, 'original', time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); } $pmaTheme='original'; } } else { - $pmaTheme=$_COOKIE['pma_theme']; + $pmaTheme=$_COOKIE[$theme_cookie_name]; if (basename($PHP_SELF) == 'index.php') { - setcookie('pma_theme', $pmaTheme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); + setcookie($theme_cookie_name, $pmaTheme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); } } } // end if diff --git a/queryframe.php b/queryframe.php index f3abb9250..085a8e93d 100644 --- a/queryframe.php +++ b/queryframe.php @@ -52,7 +52,7 @@ echo ""; // r phpMyAdmin /> - +