The branch, master has been updated via e898b1ec1918cd2734b69fd8253dd7013f368cd5 (commit) from 85e778ffc8c784cdd860515d20173f63d66afb43 (commit)
- Log ----------------------------------------------------------------- commit e898b1ec1918cd2734b69fd8253dd7013f368cd5 Author: Michal Čihař michal@cihar.com Date: Mon Aug 22 15:42:37 2011 +0200
Move theme helpers to theme class
-----------------------------------------------------------------------
Summary of changes: libraries/Theme.class.php | 33 ++++++++++++++++++++++++ libraries/theme.lib.php | 42 ------------------------------- themes/original/css/theme_right.css.php | 7 +---- themes/pmahomme/css/theme_left.css.php | 9 +----- themes/pmahomme/css/theme_right.css.php | 32 +++++++++-------------- 5 files changed, 49 insertions(+), 74 deletions(-) delete mode 100644 libraries/theme.lib.php
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index 87f6a3e..155d34d 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -344,5 +344,38 @@ class PMA_Theme .'</p>' .'</div>'; } + + /** + * Remove filter for IE. + * + * @return string CSS code. + */ + function getCssIEClearFilter() { + return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8 + ? 'filter: none' + : ''; + } + + /** + * Generates code for CSS gradient using various browser extensions. + * + * @param string $start_color Color of gradient start, hex value without # + * @param string $end_color Color of gradient end, hex value without # + * + * @return string CSS code. + */ + function getCssGradient($start_color, $end_color) + { + $result = array(); + $result[] = 'background-image: url(./themes/svg_gradient.php?from=' . $start_color . '&to=' . $end_color . ');'; + $result[] = 'background-size: 100% 100%;'; + $result[] = 'background: -webkit-gradient(linear, left top, left bottom, from(#' . $start_color . '), to(#' . $end_color . '));'; + $result[] = 'background: -moz-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');'; + $result[] = 'background: -o-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');'; + if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8) { + $result[] = 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#' . $start_color . '", endColorstr="#' . $end_color . '");'; + } + return implode("\n", $result); + } } ?> diff --git a/libraries/theme.lib.php b/libraries/theme.lib.php deleted file mode 100644 index 1030d80..0000000 --- a/libraries/theme.lib.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * Helper functions for themes. - * - * @package phpMyAdmin - */ - -/** - * Remove filter for IE. - * - * @return string CSS code. - */ -function PMA_ieClearFilter() { - return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8 - ? 'filter: none' - : ''; -} - -/** - * Generates code for CSS gradient using various browser extensions. - * - * @param string $start_color Color of gradient start, hex value without # - * @param string $end_color Color of gradient end, hex value without # - * - * @return string CSS code. - */ -function PMA_css_gradient($start_color, $end_color) -{ - $result = array(); - $result[] = 'background-image: url(./themes/svg_gradient.php?from=' . $start_color . '&to=' . $end_color . ');'; - $result[] = 'background-size: 100% 100%;'; - $result[] = 'background: -webkit-gradient(linear, left top, left bottom, from(#' . $start_color . '), to(#' . $end_color . '));'; - $result[] = 'background: -moz-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');'; - $result[] = 'background: -o-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');'; - if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8) { - $result[] = 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#' . $start_color . '", endColorstr="#' . $end_color . '");'; - } - return implode("\n", $result); -} - -?> diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 69d01c1..64b4b00 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -11,11 +11,6 @@ if (!defined('PMA_MINIMUM_COMMON') && !defined('TESTSUITE')) { exit(); } - -/** - * Theme helpers. - */ -require 'libraries/theme.lib.php'; ?> /******************************************************************************/ /* general tags */ @@ -1671,7 +1666,7 @@ table#serverconnection_trg_local { -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; - <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> border: 1px solid #444444; cursor: pointer; } diff --git a/themes/pmahomme/css/theme_left.css.php b/themes/pmahomme/css/theme_left.css.php index 65df208..461329d 100644 --- a/themes/pmahomme/css/theme_left.css.php +++ b/themes/pmahomme/css/theme_left.css.php @@ -11,11 +11,6 @@ if (!defined('PMA_MINIMUM_COMMON')) { exit(); } - -/** - * Theme helpers. - */ -require 'libraries/theme.lib.php'; ?> /******************************************************************************/ /* general tags */ @@ -245,7 +240,7 @@ div#left_tableList li { #newtable a { display: block; padding: 1px; - <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> border: 1px solid #aaa; -moz-border-radius: 20px; -webkit-border-radius: 20px; @@ -257,7 +252,7 @@ div#left_tableList li { }
#newtable a:hover { - <?php echo PMA_css_gradient('cccccc', 'dddddd'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('cccccc', 'dddddd'); ?> }
#newtable li a:hover { diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 9e25638..fdfa404 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -11,12 +11,6 @@ if (!defined('PMA_MINIMUM_COMMON')) { exit(); } - -/** - * Theme helpers. - */ -require 'libraries/theme.lib.php'; - ?> /******************************************************************************/
@@ -105,7 +99,7 @@ a:hover { -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; - <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> }
dfn { @@ -121,7 +115,7 @@ th { font-weight: bold; color: <?php echo $GLOBALS['cfg']['ThColor']; ?>; background: #f3f3f3; - <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> }
a img { @@ -190,11 +184,11 @@ input[type=submit]{
text-shadow: 0 1px 0 #fff;
- <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> }
input[type=submit]:hover{position: relative; - <?php echo PMA_css_gradient('cccccc', 'dddddd'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('cccccc', 'dddddd'); ?> cursor:pointer; }
@@ -289,7 +283,7 @@ select{ }
select[multiple] { - <?php echo PMA_css_gradient('ffffff', 'f2f2f2'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'f2f2f2'); ?> }
/* Icon sprites */ @@ -503,14 +497,14 @@ button.mult_submit { table tr.odd th, .odd { background: #fff; - <?php echo PMA_ieClearFilter(); ?> + <?php echo $_SESSION['PMA_Theme']->getCssIEClearFilter(); ?> }
/* even items 2,4,6,8,... */ table tr.even th, .even { background: #f3f3f3; - <?php echo PMA_ieClearFilter(); ?> + <?php echo $_SESSION['PMA_Theme']->getCssIEClearFilter(); ?> }
/* odd table rows 1,3,5,7,... */ @@ -1598,10 +1592,10 @@ div#profilingchart { -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5); text-shadow: #fff 0 1px 0; */ - <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> } #sectionlinks a:hover, .buttonlinks a:hover, a.button:hover { - <?php echo PMA_css_gradient('cccccc', 'dddddd'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('cccccc', 'dddddd'); ?> }
div#sqlquerycontainer { @@ -2018,11 +2012,11 @@ input[type=text].invalid_value,
text-shadow: 0 1px 0 #fff;
- <?php echo PMA_css_gradient('ffffff', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'cccccc'); ?> cursor: pointer; } #buttonGo:hover{ - <?php echo PMA_css_gradient('cccccc', 'dddddd'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('cccccc', 'dddddd'); ?> }
.format_specific_options h3 { @@ -2857,7 +2851,7 @@ span.cm-number { -webkit-border-radius: 5px; -moz-border-radius: 5px;
- <?php echo PMA_css_gradient('eeeeee', 'cccccc'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('eeeeee', 'cccccc'); ?> }
.navigation td { @@ -2894,7 +2888,7 @@ span.cm-number { cursor: pointer; text-shadow: none;
- <?php echo PMA_css_gradient('333333', '555555'); ?> + <?php echo $_SESSION['PMA_Theme']->getCssGradient('333333', '555555'); ?> }
.navigation select {
hooks/post-receive