Permalink
Browse files

Single place to process font size

  • Loading branch information...
1 parent cff9d9d commit e16d803e78ed806447e5bccb027df3790c07d899 @nijel nijel committed May 29, 2012
Showing with 20 additions and 5 deletions.
  1. +17 −0 libraries/Theme.class.php
  2. +2 −3 themes/original/css/common.css.php
  3. +1 −2 themes/pmahomme/css/common.css.php
View
@@ -451,6 +451,23 @@ function getCssIEClearFilter()
: '';
}
+ /**
+ * Gets currently configured font size.
+ *
+ * @return String with font size.
+ */
+ function getFontSize()
+ {
+ $fs = $GLOBALS['PMA_Config']->get('fontsize');
+ if (!is_null($fs)) {
+ return $fs;
+ }
+ if (isset($_COOKIE['pma_fontsize'])) {
+ return $_COOKIE['pma_fontsize'];
+ }
+ return '82%';
+ }
+
/**
* Generates code for CSS gradient using various browser extensions.
*
@@ -16,8 +16,7 @@
/* general tags */
html {
- font-size: <?php echo (null !== $GLOBALS['PMA_Config']->get('fontsize') ? $GLOBALS['PMA_Config']->get('fontsize') : (
- isset($_COOKIE['pma_fontsize']) ? $_COOKIE['pma_fontsize'] : '82%'));?>;
+ font-size: <?php echo $_SESSION['PMA_Theme']->getFontSize(); ?>
}
input,
@@ -2614,7 +2613,7 @@
font-size: 0.75em;
z-index: 2;
}
-
+
td.jqplot-cursor-legend-swatch {
vertical-align: middle;
text-align: center;
@@ -16,8 +16,7 @@
/* general tags */
html {
- font-size: <?php echo (null !== $GLOBALS['PMA_Config']->get('fontsize') ? $GLOBALS['PMA_Config']->get('fontsize') : (
- isset($_COOKIE['pma_fontsize']) ? $_COOKIE['pma_fontsize'] : '82%'));?>;
+ font-size: <?php echo $_SESSION['PMA_Theme']->getFontSize(); ?>
}
input,

0 comments on commit e16d803

Please sign in to comment.