bug [display] handle NavigationBarIconic as documented for navi buttons
This commit is contained in:
@@ -12,6 +12,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
|||||||
- rfe #2726479 [core] configurable maximal length of URL
|
- rfe #2726479 [core] configurable maximal length of URL
|
||||||
+ patch #2724755 [display] Full/partial text links (big T) are back,
|
+ patch #2724755 [display] Full/partial text links (big T) are back,
|
||||||
thanks to nullbarriere - nullbarriere
|
thanks to nullbarriere - nullbarriere
|
||||||
|
- bug [display] handle NavigationBarIconic as documented for navi buttons
|
||||||
|
|
||||||
3.2.1.0 (not yet released)
|
3.2.1.0 (not yet released)
|
||||||
- bug #2799009 Login with ipv6 IP address breaks redirect
|
- bug #2799009 Login with ipv6 IP address breaks redirect
|
||||||
|
@@ -794,7 +794,7 @@ $cfg['SuggestDBName'] = true;
|
|||||||
*
|
*
|
||||||
* @global string $cfg['NavigationBarIconic']
|
* @global string $cfg['NavigationBarIconic']
|
||||||
*/
|
*/
|
||||||
$cfg['NavigationBarIconic'] = 'both';
|
$cfg['NavigationBarIconic'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows to display all the rows
|
* allows to display all the rows
|
||||||
|
@@ -186,6 +186,56 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|||||||
} // end of the 'PMA_setDisplayMode()' function
|
} // 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 . '"';
|
||||||
|
?>
|
||||||
|
<td>
|
||||||
|
<form action="sql.php" method="post" <?php echo $onsubmit; ?>>
|
||||||
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||||
|
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
||||||
|
<input type="hidden" name="pos" value="<?php echo $pos; ?>" />
|
||||||
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
||||||
|
<?php echo $input_for_real_end; ?>
|
||||||
|
<input type="submit" name="navig" value="<?php echo $caption_output; ?>"<?php echo $title_output . $onclick; ?> />
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
<?php
|
||||||
|
} // end function PMA_displayTableNavigationOneButton()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a navigation bar to browse among the results of a SQL query
|
* Displays a navigation bar to browse among the results of a SQL query
|
||||||
*
|
*
|
||||||
@@ -236,38 +286,9 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|||||||
<?php
|
<?php
|
||||||
// Move to the beginning or to the previous page
|
// Move to the beginning or to the previous page
|
||||||
if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
|
if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
|
||||||
// loic1: patch #474210 from Gosha Sakovich - part 1
|
PMA_displayTableNavigationOneButton('<<', $GLOBALS['strPos1'], 0, $html_sql_query);
|
||||||
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
PMA_displayTableNavigationOneButton('<', $GLOBALS['strPrevious'], $pos_prev, $html_sql_query);
|
||||||
$caption1 = '<<';
|
|
||||||
$caption2 = ' < ';
|
|
||||||
$title1 = ' title="' . $GLOBALS['strPos1'] . '"';
|
|
||||||
$title2 = ' title="' . $GLOBALS['strPrevious'] . '"';
|
|
||||||
} else {
|
|
||||||
$caption1 = $GLOBALS['strPos1'] . ' <<';
|
|
||||||
$caption2 = $GLOBALS['strPrevious'] . ' <';
|
|
||||||
$title1 = '';
|
|
||||||
$title2 = '';
|
|
||||||
} // end if... else...
|
|
||||||
?>
|
|
||||||
<td>
|
|
||||||
<form action="sql.php" method="post">
|
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
||||||
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
||||||
<input type="hidden" name="pos" value="0" />
|
|
||||||
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
||||||
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form action="sql.php" method="post">
|
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
||||||
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
||||||
<input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
|
|
||||||
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
||||||
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<?php
|
|
||||||
} // end move back
|
} // end move back
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
@@ -309,47 +330,31 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
|
|||||||
// Move to the next page or to the last one
|
// Move to the next page or to the last one
|
||||||
if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
|
if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
|
||||||
&& $_SESSION['userconf']['max_rows'] != 'all') {
|
&& $_SESSION['userconf']['max_rows'] != 'all') {
|
||||||
// loic1: patch #474210 from Gosha Sakovich - part 2
|
|
||||||
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
// display the Next button
|
||||||
$caption3 = ' > ';
|
PMA_displayTableNavigationOneButton('>',
|
||||||
$caption4 = '>>';
|
$GLOBALS['strNext'],
|
||||||
$title3 = ' title="' . $GLOBALS['strNext'] . '"';
|
$pos_next,
|
||||||
$title4 = ' title="' . $GLOBALS['strEnd'] . '"';
|
$html_sql_query);
|
||||||
} else {
|
|
||||||
$caption3 = '> ' . $GLOBALS['strNext'];
|
// prepare some options for the End button
|
||||||
$caption4 = '>> ' . $GLOBALS['strEnd'];
|
|
||||||
$title3 = '';
|
|
||||||
$title4 = '';
|
|
||||||
} // end if... else...
|
|
||||||
echo "\n";
|
|
||||||
?>
|
|
||||||
<td>
|
|
||||||
<form action="sql.php" method="post">
|
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
||||||
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
||||||
<input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
|
|
||||||
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
||||||
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form action="sql.php" method="post"
|
|
||||||
onsubmit="return <?php echo (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false'); ?>">
|
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
||||||
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
||||||
<input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']); ?>" />
|
|
||||||
<?php
|
|
||||||
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
|
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
|
||||||
echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
|
$input_for_real_end = '<input type="hidden" name="find_real_end" value="1" />';
|
||||||
// no backquote around this message
|
// no backquote around this message
|
||||||
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
|
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
|
||||||
|
} else {
|
||||||
|
$input_for_real_end = $onclick = '';
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
// display the End button
|
||||||
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>
|
PMA_displayTableNavigationOneButton('>>',
|
||||||
</form>
|
$GLOBALS['strEnd'],
|
||||||
</td>
|
@((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']),
|
||||||
<?php
|
$html_sql_query,
|
||||||
|
'onsubmit="return ' . (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false') . '"',
|
||||||
|
$input_for_real_end,
|
||||||
|
$onclick
|
||||||
|
);
|
||||||
} // end move toward
|
} // end move toward
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user