[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16717-g5b8bb36
Michal Čihař
nijel at users.sourceforge.net
Mon Aug 22 15:02:07 CEST 2011
The branch, master has been updated
via 5b8bb36168161fd92cfb63f9dddeab3e10a23bf5 (commit)
via 00fab435332475c73126903522217f2ad559af87 (commit)
from 98112c58f2a7cec766739ed57e66b5628e1667ae (commit)
- Log -----------------------------------------------------------------
commit 5b8bb36168161fd92cfb63f9dddeab3e10a23bf5
Author: Michal Čihař <michal at cihar.com>
Date: Mon Aug 22 15:01:54 2011 +0200
Add forgotten file
commit 00fab435332475c73126903522217f2ad559af87
Author: Michal Čihař <michal at cihar.com>
Date: Mon Aug 22 14:57:12 2011 +0200
Factor out function out of themes
-----------------------------------------------------------------------
Summary of changes:
libraries/theme.lib.php | 44 +++++++++++++++++++++++++++++++
themes/original/css/theme_right.css.php | 10 +++----
themes/pmahomme/css/theme_right.css.php | 16 +++-------
3 files changed, 53 insertions(+), 17 deletions(-)
create mode 100644 libraries/theme.lib.php
diff --git a/libraries/theme.lib.php b/libraries/theme.lib.php
new file mode 100644
index 0000000..9155a6d
--- /dev/null
+++ b/libraries/theme.lib.php
@@ -0,0 +1,44 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Helper functions for themes.
+ *
+ * @package phpMyAdmin
+ */
+
+
+/**
+ * Gradient filter for IE.
+ */
+function PMA_ieFilter($start_color, $end_color)
+{
+ return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
+ ? 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . $start_color . '", endColorstr="' . $end_color . '");'
+ : '';
+}
+
+/**
+ * Remove filter for IE.
+ */
+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.
+ */
+function PMA_css_Gradied($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 . ');';
+ $result[] = PMA_ieFilter($start_color, $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 b6354d8..c69c18e 100644
--- a/themes/original/css/theme_right.css.php
+++ b/themes/original/css/theme_right.css.php
@@ -12,12 +12,10 @@ if (!defined('PMA_MINIMUM_COMMON') && !defined('TESTSUITE')) {
exit();
}
-function PMA_ieFilter($start_color, $end_color)
-{
- return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
- ? 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . $start_color . '", endColorstr="' . $end_color . '");'
- : '';
-}
+/**
+ * Theme helpers.
+ */
+require 'libraries/theme.lib.php';
?>
/******************************************************************************/
/* general tags */
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php
index a766855..996f259 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -12,17 +12,11 @@ if (!defined('PMA_MINIMUM_COMMON')) {
exit();
}
-function PMA_ieFilter($start_color, $end_color)
-{
- return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
- ? 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . $start_color . '", endColorstr="' . $end_color . '");'
- : '';
-}
-function PMA_ieClearFilter() {
- return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
- ? 'filter: none'
- : '';
-}
+/**
+ * Theme helpers.
+ */
+require 'libraries/theme.lib.php';
+
?>
/******************************************************************************/
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list