From 1c96d44d34731c35f662f622055a749947c6cf7b Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 28 Jun 2008 15:46:54 +0000 Subject: [PATCH] Font size option problem when no config file --- ChangeLog | 2 ++ libraries/Config.class.php | 12 +++++++++++- themes/darkblue_orange/css/theme_right.css.php | 2 +- themes/original/css/theme_left.css.php | 2 +- themes/original/css/theme_right.css.php | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0e576e59d..e8f2af982 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,8 @@ danbarry - bug #1989281 [export] Export fails if one table is marked as crashed - bug #2001005 [GUI] ARCHIVE cannot have indexes - bug #1989281 [export] CSV for MS Excel incorrect escaping of double quotes +- bug #1959855 [interface] Font size option problem when no config file + (todo (trunk): navi frame size does not change for theme original) 2.11.7.0 (2008-06-23) - bug #1908719 [interface] New field cannot be auto-increment and primary key diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 09f1327f1..905746628 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -535,11 +535,13 @@ class PMA_Config /** * returns a unique value to force a CSS reload if either the config * or the theme changes + * must also check the pma_fontsize cookie in case there is no + * config file * @return int Unix timestamp */ function getThemeUniqueValue() { - return intval($_SESSION['PMA_Config']->get('fontsize')) + ($this->source_mtime + $this->default_source_mtime + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info); + return intval((null !== $_SESSION['PMA_Config']->get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : $_COOKIE['pma_fontsize'])) + ($this->source_mtime + $this->default_source_mtime + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info); } /** @@ -1005,6 +1007,14 @@ class PMA_Config static protected function _getFontsizeSelection() { $current_size = $_SESSION['PMA_Config']->get('fontsize'); + // for the case when there is no config file (this is supported) + if (empty($current_size)) { + if (isset($_COOKIE['pma_fontsize'])) { + $current_size = $_COOKIE['pma_fontsize']; + } else { + $current_size = '82%'; + } + } $options = PMA_Config::_getFontsizeOptions($current_size); $return = '' . "\n"; diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index 2be6a958e..81928affd 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -16,7 +16,7 @@ if (!defined('PMA_MINIMUM_COMMON')) { /******************************************************************************/ /* general tags */ html { - font-size: get('fontsize'); ?>; + font-size: get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : $_COOKIE['pma_fontsize']); ?>; } input, select, textarea { diff --git a/themes/original/css/theme_left.css.php b/themes/original/css/theme_left.css.php index c962520d5..4b065f8f6 100644 --- a/themes/original/css/theme_left.css.php +++ b/themes/original/css/theme_left.css.php @@ -16,7 +16,7 @@ if (!defined('PMA_MINIMUM_COMMON')) { /******************************************************************************/ /* general tags */ html { - font-size: get('fontsize'); ?>; + font-size: get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : $_COOKIE['pma_fontsize']); ?>; } input, select, textarea { diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index ca16bd439..01f1cf4bd 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -16,7 +16,7 @@ if (!defined('PMA_MINIMUM_COMMON')) { /******************************************************************************/ /* general tags */ html { - font-size: get('fontsize'); ?>; + font-size: get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : $_COOKIE['pma_fontsize']);?>; } input, select, textarea {