bug 612117

This commit is contained in:
Marc Delisle
2002-09-20 17:05:30 +00:00
parent 485fe0efa3
commit 986135ea26
2 changed files with 23 additions and 30 deletions

View File

@@ -5,10 +5,14 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-09-20 Marc Delisle <lem9@users.sourceforge.net>
* libraries/display_tbl.lib.php3: bug 612117, vertical view and
buttons as links
2002-09-19 Marc Delisle <lem9@users.sourceforge.net> 2002-09-19 Marc Delisle <lem9@users.sourceforge.net>
* libraries/sqlparser.lib.php3, bug 608459: syntax coloring and * libraries/sqlparser.lib.php3: bug 608459: syntax coloring and
alias without AS alias without AS
* libraries/display_tbl.lib.php3, bug 574852: relation and ORDER BY * libraries/display_tbl.lib.php3: bug 574852: relation and ORDER BY
* db_details_qbe.php3: missing global $dbh * db_details_qbe.php3: missing global $dbh
2002-09-19 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-09-19 Lo<4C>c Chapeaux <lolo@phpheaven.net>

View File

@@ -707,41 +707,37 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
/** /**
* Displays a link, or a button if the link's URL is too large, to * Displays a link, or a button if the link's URL is too large, to
* accomodate some browsers' limitations * accommodate some browsers' limitations
* *
* @param string the URL * @param string the URL
* @param string the link message * @param string the link message
* @param string js confirmation * @param string js confirmation
* *
* @return boolean always true * @return string the results to be echoed or saved in an array
*/ */
function PMA_linkOrButton($url, $message, $js_conf) function PMA_linkOrButton($url, $message, $js_conf)
{ {
if (strlen($url) <= 2047) { if (strlen($url) <= 2047) {
$onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"'); $onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"');
echo ' <a href="' . $url . '"' . $onclick_url . '>' . "\n" $linkOrButton = ' <a href="' . $url . '"' . $onclick_url . '>' . "\n"
. ' ' . $message . '</a>' . "\n"; . ' ' . $message . '</a>' . "\n";
} }
else { else {
$edit_url_parts = parse_url($url); $edit_url_parts = parse_url($url);
$query_parts = explode('&', $edit_url_parts['query']); $query_parts = explode('&', $edit_url_parts['query']);
?> $linkOrButton = ' <form action="'
<form action="<?php echo $edit_url_parts['path'] ?>" method="post"> . $edit_url_parts['path']
<?php . '" method="post">' . "\n";
echo "\n";
reset ($query_parts); reset ($query_parts);
while (list(, $query_pair) = each ($query_parts)) { while (list(, $query_pair) = each ($query_parts)) {
list($eachvar, $eachval) = explode('=', $query_pair); list($eachvar, $eachval) = explode('=', $query_pair);
echo ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . urldecode($eachval) . '" />' . "\n"; $linkOrButton .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . urldecode($eachval) . '" />' . "\n";
} // end while } // end while
?> $linkOrButton .= ' <input type="submit" value="'
<input type="submit" value="<?php echo $message; ?>" /> . $message . '" />' . "\n" . '</form>' . "\n";
</form>
<?php
echo "\n";
} // end if... else... } // end if... else...
return TRUE; return $linkOrButton;
} // end of the 'PMA_linkOrButton()' function } // end of the 'PMA_linkOrButton()' function
@@ -980,12 +976,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
&& ($disp_direction == 'horizontal')) { && ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
echo ' <td bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
PMA_linkOrButton($edit_url, $edit_str, ''); echo PMA_linkOrButton($edit_url, $edit_str, '');
echo ' </td>' . "\n"; echo ' </td>' . "\n";
} }
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')); echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
echo ' </td>' . "\n"; echo ' </td>' . "\n";
} }
} // end if (1.3) } // end if (1.3)
@@ -1166,12 +1162,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
&& ($disp_direction == 'horizontal')) { && ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
echo ' <td bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
PMA_linkOrButton($edit_url, $edit_str, ''); echo PMA_linkOrButton($edit_url, $edit_str, '');
echo ' </td>' . "\n"; echo ' </td>' . "\n";
} }
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')); echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
echo ' </td>' . "\n"; echo ' </td>' . "\n";
} }
} // end if (3) } // end if (3)
@@ -1189,23 +1185,16 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['edit'][$row_no] = ''; $vertical_display['edit'][$row_no] = '';
$vertical_display['delete'][$row_no] = ''; $vertical_display['delete'][$row_no] = '';
} }
if (isset($edit_url)) { if (isset($edit_url)) {
$vertical_display['edit'][$row_no] .= ' <td bgcolor="' . $bgcolor . '">' . "\n" $vertical_display['edit'][$row_no] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
. ' <a href="' . $edit_url . '">' . "\n" . PMA_linkOrButton($edit_url, $edit_str, '')
. ' ' . $edit_str . '</a>' . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (isset($del_url)) { if (isset($del_url)) {
$vertical_display['delete'][$row_no] .= ' <td bgcolor="' . $bgcolor . '">' . "\n" $vertical_display['delete'][$row_no] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
. ' <a href="' . $del_url . '"'; . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''))
}
if (isset($js_conf)) {
$vertical_display['delete'][$row_no] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
}
if (isset($del_str)) {
$vertical_display['delete'][$row_no] .= '>' . "\n"
. ' ' . $del_str . '</a>' . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
} }