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$
$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>
* lang/czech: Updated.

View File

@@ -63,15 +63,22 @@ $phpmain_hash_js = time();
<?php
$logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png';
$query_frame_height = 0;
if (@file_exists($logo_image)) {
$tmp_imgsize = @getimagesize($logo_image);
$query_frame_height = ($tmp_imgsize[1] + 15 + ((!isset($_COOKIE['pma_theme']) || $_COOKIE['pma_theme']=='original') ? 25 : 0));
if ($cfg['LeftDisplayLogo'] && @file_exists($logo_image)) {
$tmp_imgsize = @getimagesize($logo_image);
$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) {
$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']) {
$query_frame_height = $query_frame_height + 40;
$query_frame_height += 40;
}
if ($server > 0) {
PMA_availableDatabases(); // this function is defined in "common.lib.php"
@@ -80,12 +87,9 @@ if ($server > 0) {
}
if ($num_dbs > 1) {
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']) {
/* Will we show list of servers? */
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/';
}
} else {
$GLOBALS['theme'] = $_COOKIE['pma_theme'];
$pmaThemeImage = './' . $cfg['ThemePath'] . '/' . $_COOKIE['pma_theme'] . '/img/';
$tmp_layout_file = './' . $cfg['ThemePath'] . '/' . PMA_securePath($_COOKIE['pma_theme']) . '/layout.inc.php';
// if we just changed theme, we must take the new one so that
// index.php takes the correct one for height computing
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)) {
include($tmp_layout_file);
}