diff --git a/ChangeLog b/ChangeLog
index 29ad5032d..18032ffba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@ $Id$
- patch #2983960 [interface] Add javascript validation of datetime input,
thanks to Sutharshan Balachandren.
- rfe #2981999 [interface] Default sort order is now SMART.
+- rfe #2972969 [interface] Fix flipping of headers in non-IE browsers.
3.3.3.0 (not yet released)
- patch #2982480 [navi] Do not group if there would be one table in group,
diff --git a/Documentation.html b/Documentation.html
index 6805a48a9..c6ee94ffe 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -1875,20 +1875,25 @@ $cfg['TrustedProxies'] =
"Left" and "right" are parsed as "top"
and "bottom" with vertical display mode.
-
$cfg['DefaultDisplay'] string
- string
-
+ $cfg['DefaultDisplay'] string
There are 3 display modes: horizontal, horizontalflipped and vertical.
Define which one is displayed by default. The first mode displays each
row on a horizontal line, the second rotates the headers by 90
degrees, so you can use descriptive headers even though fields only
contain small values and still print them out. The vertical mode sorts
- each row on a vertical lineup.
+ each row on a vertical lineup.
+
- The HeaderFlipType can be set to 'css' or 'fake'. When using 'css'
- the rotation of the header for horizontalflipped is done via CSS. If
- set to 'fake' PHP does the transformation for you, but of course this
- does not look as good as CSS.
+
+
+ The HeaderFlipType can be set to 'auto', 'css' or 'fake'. When using
+ 'css' the rotation of the header for horizontalflipped is done via
+ CSS. The CSS transformation currently works only in Internet
+ Explorer.If set to 'fake' PHP does the transformation for you, but of
+ course this does not look as good as CSS. The 'auto' option enables
+ CSS transformation when browser supports it and use PHP based one
+ otherwise.
+
$cfg['DefaultPropDisplay']
diff --git a/libraries/config.default.php b/libraries/config.default.php
index ad07feed6..64628bb5b 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -2179,12 +2179,12 @@ $cfg['DefaultDisplay'] = 'horizontal';
$cfg['DefaultPropDisplay'] = 3;
/**
- * table-header rotation via faking or CSS? (css|fake)
+ * table-header rotation via faking or CSS? (css|fake|auto)
* NOTE: CSS only works in IE browsers!
*
* @global string $cfg['HeaderFlipType']
*/
-$cfg['HeaderFlipType'] = 'css';
+$cfg['HeaderFlipType'] = 'auto';
/**
* shows stored relation-comments in 'browse' mode.
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 4e2ccc57f..e99b97c6d 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -187,16 +187,16 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
/**
- * Displays a navigation button
+ * Displays a navigation button
*
* @uses $GLOBALS['cfg']['NavigationBarIconic']
- * @uses PMA_generate_common_hidden_inputs()
+ * @uses PMA_generate_common_hidden_inputs()
*
* @param string iconic caption for button
- * @param string text for button
- * @param integer position for next query
- * @param string query ready for display
- * @param string optional onsubmit clause
+ * @param string text for button
+ * @param integer position for next query
+ * @param string query ready for display
+ * @param string optional onsubmit clause
* @param string optional hidden field for special treatment
* @param string optional onclick clause
*
@@ -246,7 +246,7 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
* @param integer the offset for the "next" page
* @param integer the offset for the "previous" page
* @param string the URL-encoded query
- * @param string the id for the direction dropdown
+ * @param string the id for the direction dropdown
*
* @global string $db the database name
* @global string $table the table name
@@ -334,9 +334,9 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false') . '"',
$input_for_real_end,
@@ -442,7 +442,7 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '';
// prepare full/partial text button or link
- if ($_SESSION['tmp_user_values']['display_text']=='F') {
+ if ($_SESSION['tmp_user_values']['display_text']=='F') {
// currently in fulltext mode so show the opposite link
$tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_partialtext.png';
$tmp_txt = $GLOBALS['strPartialText'];
@@ -789,7 +789,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// Field name may be preceded by a space, or any number
// of characters followed by a dot (tablename.fieldname)
// so do a direct comparison for the sort expression;
- // this avoids problems with queries like
+ // this avoids problems with queries like
// "SELECT id, count(id)..." and clicking to sort
// on id or on count(id).
// Another query to test this:
@@ -852,6 +852,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_link_params['onmouseout'] = 'if(document.getElementById(\'soimg' . $i . '\')){ document.getElementById(\'soimg' . $i . '\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
}
}
+ if ($GLOBALS['cfg']['HeaderFlipType'] == 'auto') {
+ if (PMA_USR_BROWSER_AGENT == 'IE') {
+ $GLOBALS['cfg']['HeaderFlipType'] = 'css';
+ } else {
+ $GLOBALS['cfg']['HeaderFlipType'] = 'fake';
+ }
+ }
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
$order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
@@ -1141,7 +1148,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$lnk_goto = 'sql.php' . PMA_generate_common_url($_url_params, 'text');
$del_query = 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)
- . ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1');
+ . ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1');
$_url_params = array(
'db' => $db,
@@ -1154,7 +1161,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$js_conf = 'DELETE FROM ' . PMA_jsFormat($db) . '.' . PMA_jsFormat($table)
. ' WHERE ' . PMA_jsFormat($where_clause, false)
- . ($clause_is_unique ? '' : ' LIMIT 1');
+ . ($clause_is_unique ? '' : ' LIMIT 1');
$del_str = PMA_getIcon('b_drop.png', $GLOBALS['strDelete'], true);
} elseif ($is_display['del_lnk'] == 'kp') { // kill process case
@@ -1346,7 +1353,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$vertical_display['data'][$row_no][$i] = ' | ' . "\n";
}
}
- // n o t n u m e r i c a n d n o t B L O B
+ // n o t n u m e r i c a n d n o t B L O B
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' NULL | ' . "\n";
@@ -1676,8 +1683,8 @@ function PMA_displayTable_checkConfigParams()
// as this is a form value, the type is always string so we cannot
// use PMA_isValid($_REQUEST['session_max_rows'], 'integer')
- if ((PMA_isValid($_REQUEST['session_max_rows'], 'numeric')
- && (int) $_REQUEST['session_max_rows'] == $_REQUEST['session_max_rows'])
+ if ((PMA_isValid($_REQUEST['session_max_rows'], 'numeric')
+ && (int) $_REQUEST['session_max_rows'] == $_REQUEST['session_max_rows'])
|| $_REQUEST['session_max_rows'] == 'all') {
$_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows'] = $_REQUEST['session_max_rows'];
unset($_REQUEST['session_max_rows']);
@@ -1718,7 +1725,7 @@ function PMA_displayTable_checkConfigParams()
// according to low-level field flags
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary'] = true;
}
-
+
if (isset($_REQUEST['display_binary_as_hex'])) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex'] = true;
unset($_REQUEST['display_binary_as_hex']);