From a422f9a129cdd23ddbf7704c68207f49d8607aaf Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 6 Jun 2009 16:01:05 +0000 Subject: [PATCH] bug [display] handle NavigationBarIconic as documented for navi buttons --- ChangeLog | 1 + libraries/config.default.php | 2 +- libraries/display_tbl.lib.php | 143 ++++++++++++++++++---------------- 3 files changed, 76 insertions(+), 70 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75e96cd3c..f27915e0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - rfe #2726479 [core] configurable maximal length of URL + patch #2724755 [display] Full/partial text links (big T) are back, thanks to nullbarriere - nullbarriere +- bug [display] handle NavigationBarIconic as documented for navi buttons 3.2.1.0 (not yet released) - bug #2799009 Login with ipv6 IP address breaks redirect diff --git a/libraries/config.default.php b/libraries/config.default.php index 2caafbd89..b75fda2b8 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -794,7 +794,7 @@ $cfg['SuggestDBName'] = true; * * @global string $cfg['NavigationBarIconic'] */ -$cfg['NavigationBarIconic'] = 'both'; +$cfg['NavigationBarIconic'] = true; /** * allows to display all the rows diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 7bd9a8926..546d014eb 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -186,6 +186,56 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) } // end of the 'PMA_setDisplayMode()' function +/** + * Displays a navigation button + * + * @uses $GLOBALS['cfg']['NavigationBarIconic'] + * @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 optional hidden field for special treatment + * @param string optional onclick clause + * + * @global string $db the database name + * @global string $table the table name + * @global string $goto the URL to go back in case of errors + * + * @access private + * + * @see PMA_displayTableNavigation() + */ +function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') { + + global $db, $table, $goto; + + $caption_output = ''; + // for true or 'both' + if ($GLOBALS['cfg']['NavigationBarIconic']) { + $caption_output .= $caption; + } + // for false or 'both' + if (false === $GLOBALS['cfg']['NavigationBarIconic'] || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) { + $caption_output .= ' ' . $title; + } + $title_output = ' title="' . $title . '"'; + ?> + +
> + + + + + + /> +
+ + - -
- - - - - /> -
- - -
- - - - - /> -
- - @@ -309,47 +330,31 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '= $_SESSION['userconf']['max_rows'] && $_SESSION['userconf']['max_rows'] != 'all') { - // loic1: patch #474210 from Gosha Sakovich - part 2 - if ($GLOBALS['cfg']['NavigationBarIconic']) { - $caption3 = ' > '; - $caption4 = '>>'; - $title3 = ' title="' . $GLOBALS['strNext'] . '"'; - $title4 = ' title="' . $GLOBALS['strEnd'] . '"'; - } else { - $caption3 = '> ' . $GLOBALS['strNext']; - $caption4 = '>> ' . $GLOBALS['strEnd']; - $title3 = ''; - $title4 = ''; - } // end if... else... - echo "\n"; - ?> - -
- - - - - /> -
- - -
- - - - $GLOBALS['cfg']['MaxExactCount']) { - echo '' . "\n"; + $input_for_real_end = ''; // no backquote around this message $onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"'; + } else { + $input_for_real_end = $onclick = ''; } - ?> - - /> -
- - = $_SESSION['userconf']['max_rows']) ? 'true' : 'false') . '"', + $input_for_real_end, + $onclick + ); } // end move toward