bug 633422

This commit is contained in:
Marc Delisle
2002-12-07 12:15:30 +00:00
parent 869d17ded8
commit 044bf36a3e
4 changed files with 55 additions and 50 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-12-07 Marc Delisle <lem9@users.sourceforge.net>
* db_search.php3, libraries/display_tbl.lib.php3, libraries/common.lib.php3
bug 633422, use a button if search result would generate a too big URL
2002-12-06 Mike Beck <mikebeck@users.sourceforge.net>
* pdf_pages.php3,pdf_schema.php3,db_details_structure.php3:
Choose between Landscape and Portrait for the

View File

@@ -221,18 +221,19 @@ if (isset($submit_search)) {
echo ' <!-- Search results in table ' . $onetable . ' (' . $res_cnt . ') -->' . "\n"
. ' <br />' . "\n"
. ' ' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($onetable)) . "\n";
. ' <table><tr><td>' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($onetable)) . "</td>\n";
if ($res_cnt > 0) {
echo ' &nbsp;&nbsp;<a href="sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['select_fields'])
. '">' . $strBrowse . '</a>' . "\n";
echo '<td>' . PMA_linkOrButton('sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['select_fields']),
$strBrowse, '') . "</td>\n";
echo ' &nbsp;&nbsp;<a href="sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['delete'])
. '">' . $strDelete . '</a>' . "\n";
echo '<td>' . PMA_linkOrButton('sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['delete']),
$strDelete, $newsearchsqls['delete']) . "</td>\n";
} // end if
echo '</tr></table>' . "\n";
} // end only one table
// Several tables defined in the array $table_select
@@ -259,20 +260,20 @@ if (isset($submit_search)) {
echo ' <!-- Search results in table ' . $table_select[$i] . ' (' . $res_cnt . ') -->' . "\n"
. ' <li>' . "\n"
. ' ' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($table_select[$i])) . "\n";
. ' <table><tr><td>' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($table_select[$i])) . "</td>\n";
if ($res_cnt > 0) {
echo ' &nbsp;&nbsp;<a href="sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['select_fields'])
. '">' . $strBrowse . '</a>' . "\n";
echo '<td>' . PMA_linkOrButton('sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['select_fields']),
$strBrowse, '') . "</td>\n";
echo ' &nbsp;&nbsp;<a href="sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['delete'])
. '">' . $strDelete . '</a>' . "\n";
echo '<td>' . PMA_linkOrButton('sql.php3?' . $url_sql_query
. '&amp;sql_query=' .urlencode($newsearchsqls['delete']),
$strDelete, $newsearchsqls['delete']) . "</td>\n";
} // end if
echo ' </li>' . "\n";
echo ' </tr></table></li>' . "\n";
} // end for
echo ' </ul>' . "\n";

View File

@@ -1494,6 +1494,41 @@ if (typeof(document.getElementById) != 'undefined'
} // end of the 'PMA_printTab()' function
/**
* Displays a link, or a button if the link's URL is too large, to
* accommodate some browsers' limitations
*
* @param string the URL
* @param string the link message
* @param string js confirmation
*
* @return string the results to be echoed or saved in an array
*/
function PMA_linkOrButton($url, $message, $js_conf)
{
if (strlen($url) <= 2047) {
$onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"');
$link_or_button = ' <a href="' . $url . '"' . $onclick_url . '>' . "\n"
. ' ' . $message . '</a>' . "\n";
}
else {
$edit_url_parts = parse_url($url);
$query_parts = explode('&', $edit_url_parts['query']);
$link_or_button = ' <form action="'
. $edit_url_parts['path']
. '" method="post">' . "\n";
reset ($query_parts);
while (list(, $query_pair) = each($query_parts)) {
list($eachvar, $eachval) = explode('=', $query_pair);
$link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n";
} // end while
$link_or_button .= ' <input type="submit" value="'
. htmlspecialchars($message) . '" />' . "\n" . '</form>' . "\n";
} // end if... else...
return $link_or_button;
} // end of the 'PMA_linkOrButton()' function
// Kanji encoding convert feature appended by Y.Kawada (2002/2/20)
if (PMA_PHP_INT_VERSION >= 40006

View File

@@ -730,41 +730,6 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} // end of the 'PMA_displayTableHeaders()' function
/**
* Displays a link, or a button if the link's URL is too large, to
* accommodate some browsers' limitations
*
* @param string the URL
* @param string the link message
* @param string js confirmation
*
* @return string the results to be echoed or saved in an array
*/
function PMA_linkOrButton($url, $message, $js_conf)
{
if (strlen($url) <= 2047) {
$onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"');
$link_or_button = ' <a href="' . $url . '"' . $onclick_url . '>' . "\n"
. ' ' . $message . '</a>' . "\n";
}
else {
$edit_url_parts = parse_url($url);
$query_parts = explode('&', $edit_url_parts['query']);
$link_or_button = ' <form action="'
. $edit_url_parts['path']
. '" method="post">' . "\n";
reset ($query_parts);
while (list(, $query_pair) = each($query_parts)) {
list($eachvar, $eachval) = explode('=', $query_pair);
$link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n";
} // end while
$link_or_button .= ' <input type="submit" value="'
. htmlspecialchars($message) . '" />' . "\n" . '</form>' . "\n";
} // end if... else...
return $link_or_button;
} // end of the 'PMA_linkOrButton()' function
/**
* Displays the body of the results table