bug 989581 and display problems if left panel when switching themes

This commit is contained in:
Marc Delisle
2004-07-14 13:16:03 +00:00
parent b58856067c
commit 6f97956b60
3 changed files with 25 additions and 11 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-07-14 Marc Delisle <lem9@users.sourceforge.net>
* index.php, libraries/common.lib.php: bug 989581 and left panel
display problems when switching themes
2004-07-13 Michal Čihař <michal@cihar.com> 2004-07-13 Michal Čihař <michal@cihar.com>
* lang/czech: Updated. * lang/czech: Updated.

View File

@@ -63,15 +63,22 @@ $phpmain_hash_js = time();
<?php <?php
$logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png'; $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png';
$query_frame_height = 0; $query_frame_height = 0;
if (@file_exists($logo_image)) { if ($cfg['LeftDisplayLogo'] && @file_exists($logo_image)) {
$tmp_imgsize = @getimagesize($logo_image); $tmp_imgsize = @getimagesize($logo_image);
$query_frame_height = ($tmp_imgsize[1] + 15 + ((!isset($_COOKIE['pma_theme']) || $_COOKIE['pma_theme']=='original') ? 25 : 0)); $query_frame_height = ($tmp_imgsize[1] + 60);
// increase the height to take into account font size differences in
// theme 'original'? (TODO: improve with a parameter in layout.inc.php)
$query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 25 : 0);
} }
if ($query_frame_height == 0) { if ($query_frame_height == 0) {
$query_frame_height = 60; $query_frame_height = 60;
} }
// increase the height to take into account font size differences in
// theme 'original'? (TODO: improve with a parameter in layout.inc.php)
$query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 15 : 0);
if ($cfg['LeftDisplayServers'] && !$cfg['DisplayServersList']) { if ($cfg['LeftDisplayServers'] && !$cfg['DisplayServersList']) {
$query_frame_height = $query_frame_height + 40; $query_frame_height += 40;
} }
if ($server > 0) { if ($server > 0) {
PMA_availableDatabases(); // this function is defined in "common.lib.php" PMA_availableDatabases(); // this function is defined in "common.lib.php"
@@ -80,12 +87,9 @@ if ($server > 0) {
} }
if ($num_dbs > 1) { if ($num_dbs > 1) {
if ($cfg['LeftFrameLight']) { if ($cfg['LeftFrameLight']) {
$query_frame_height = $query_frame_height + 40; $query_frame_height += 20;
} }
} }
if ($cfg['LeftDisplayLogo']) {
$query_frame_height = $query_frame_height + 50;
}
if ($cfg['QueryFrame']) { if ($cfg['QueryFrame']) {
/* Will we show list of servers? */ /* Will we show list of servers? */
if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) { if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) {

View File

@@ -321,9 +321,15 @@ if (!isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])){
$pmaThemeImage = './' . $cfg['ThemePath'] . '/original/img/'; $pmaThemeImage = './' . $cfg['ThemePath'] . '/original/img/';
} }
} else { } else {
$GLOBALS['theme'] = $_COOKIE['pma_theme']; // if we just changed theme, we must take the new one so that
$pmaThemeImage = './' . $cfg['ThemePath'] . '/' . $_COOKIE['pma_theme'] . '/img/'; // index.php takes the correct one for height computing
$tmp_layout_file = './' . $cfg['ThemePath'] . '/' . PMA_securePath($_COOKIE['pma_theme']) . '/layout.inc.php'; if (isset($_POST['set_theme'])) {
$GLOBALS['theme'] = $_POST['set_theme'];
} else {
$GLOBALS['theme'] = $_COOKIE['pma_theme'];
}
$pmaThemeImage = './' . $cfg['ThemePath'] . '/' . $_GLOBALS['theme'] . '/img/';
$tmp_layout_file = './' . $cfg['ThemePath'] . '/' . PMA_securePath($_GLOBALS['theme']) . '/layout.inc.php';
if (@file_exists($tmp_layout_file)) { if (@file_exists($tmp_layout_file)) {
include($tmp_layout_file); include($tmp_layout_file);
} }