rfe #2972969 [interface] Fix flipping of headers in non-IE browsers.

This commit is contained in:
Michal Čihař
2010-04-16 15:41:13 +02:00
parent 84d25c0c00
commit 87d19393b3
4 changed files with 45 additions and 32 deletions

View File

@@ -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,

View File

@@ -1875,20 +1875,25 @@ $cfg['TrustedProxies'] =
"Left" and "right" are parsed as "top"
and &quot;bottom&quot; with vertical display mode.</dd>
<dt id="cfg_DefaultDisplay">$cfg['DefaultDisplay'] string
<span id="cfg_HeaderFlipType">$cfg['HeaderFlipType'] </span>string
</dt>
<dt id="cfg_DefaultDisplay">$cfg['DefaultDisplay'] string</dt>
<dd>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.<br /><br />
each row on a vertical lineup.
</dd>
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.</dd>
<dt id="cfg_HeaderFlipType">$cfg['HeaderFlipType'] </span>string</dt>
<dd>
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.
</dd>
<dt id="DefaultPropDisplay">
<span id="cfg_DefaultPropDisplay">$cfg['DefaultPropDisplay']</span>

View File

@@ -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.

View File

@@ -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', '<?php echo
&& $_SESSION['tmp_user_values']['max_rows'] != 'all') {
// display the Next button
PMA_displayTableNavigationOneButton('&gt;',
$GLOBALS['strNext'],
$pos_next,
PMA_displayTableNavigationOneButton('&gt;',
$GLOBALS['strNext'],
$pos_next,
$html_sql_query);
// prepare some options for the End button
@@ -349,9 +349,9 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
}
// display the End button
PMA_displayTableNavigationOneButton('&gt;&gt;',
$GLOBALS['strEnd'],
@((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']),
PMA_displayTableNavigationOneButton('&gt;&gt;',
$GLOBALS['strEnd'],
@((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']),
$html_sql_query,
'onsubmit="return ' . (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false') . '"',
$input_for_real_end,
@@ -442,7 +442,7 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
* @param integer the total number of fields returned by the SQL query
* @param array the analyzed query
*
* @return boolean $clause_is_unique
* @return boolean $clause_is_unique
*
* @global string $db the database name
* @global string $table the table name
@@ -564,7 +564,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo '</div>';
// 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] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\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] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\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']);