From 986135ea262b03b29da89f85fdc479e3d4241f0e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 20 Sep 2002 17:05:30 +0000 Subject: [PATCH] bug 612117 --- ChangeLog | 8 ++++-- libraries/display_tbl.lib.php3 | 45 +++++++++++++--------------------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 393f41167..8d3af87ca 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,10 +5,14 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-09-20 Marc Delisle + * libraries/display_tbl.lib.php3: bug 612117, vertical view and + buttons as links + 2002-09-19 Marc Delisle - * libraries/sqlparser.lib.php3, bug 608459: syntax coloring and + * libraries/sqlparser.lib.php3: bug 608459: syntax coloring and 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 2002-09-19 Loïc Chapeaux diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 1978deb9a..81558de63 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -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 - * accomodate some browsers' limitations + * accommodate some browsers' limitations * * @param string the URL * @param string the link message * @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) { if (strlen($url) <= 2047) { $onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"'); - echo ' ' . "\n" + $linkOrButton = ' ' . "\n" . ' ' . $message . '' . "\n"; } else { $edit_url_parts = parse_url($url); $query_parts = explode('&', $edit_url_parts['query']); - ?> -
- ' . "\n"; reset ($query_parts); while (list(, $query_pair) = each ($query_parts)) { list($eachvar, $eachval) = explode('=', $query_pair); - echo ' ' . "\n"; + $linkOrButton .= ' ' . "\n"; } // end while - ?> - -
- ' . "\n" . '' . "\n"; } // end if... else... - return TRUE; + return $linkOrButton; } // end of the 'PMA_linkOrButton()' function @@ -980,12 +976,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ && ($disp_direction == 'horizontal')) { if (!empty($edit_url)) { echo ' ' . "\n"; - PMA_linkOrButton($edit_url, $edit_str, ''); + echo PMA_linkOrButton($edit_url, $edit_str, ''); echo ' ' . "\n"; } if (!empty($del_url)) { echo ' ' . "\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 ' ' . "\n"; } } // end if (1.3) @@ -1166,12 +1162,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ && ($disp_direction == 'horizontal')) { if (!empty($edit_url)) { echo ' ' . "\n"; - PMA_linkOrButton($edit_url, $edit_str, ''); + echo PMA_linkOrButton($edit_url, $edit_str, ''); echo ' ' . "\n"; } if (!empty($del_url)) { echo ' ' . "\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 ' ' . "\n"; } } // end if (3) @@ -1189,23 +1185,16 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ $vertical_display['edit'][$row_no] = ''; $vertical_display['delete'][$row_no] = ''; } + if (isset($edit_url)) { $vertical_display['edit'][$row_no] .= ' ' . "\n" - . ' ' . "\n" - . ' ' . $edit_str . '' . "\n" + . PMA_linkOrButton($edit_url, $edit_str, '') . ' ' . "\n"; } if (isset($del_url)) { $vertical_display['delete'][$row_no] .= ' ' . "\n" - . ' ' . "\n" + . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')) . ' ' . "\n"; }