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

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