From 044bf36a3e7cf2c271c10c9df06e79281c71e369 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 7 Dec 2002 12:15:30 +0000 Subject: [PATCH] bug 633422 --- ChangeLog | 4 ++++ db_search.php3 | 31 +++++++++++++++--------------- libraries/common.lib.php3 | 35 ++++++++++++++++++++++++++++++++++ libraries/display_tbl.lib.php3 | 35 ---------------------------------- 4 files changed, 55 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index df8c620ec..c5b2a96ff 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-12-07 Marc Delisle + * 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 * pdf_pages.php3,pdf_schema.php3,db_details_structure.php3: Choose between Landscape and Portrait for the diff --git a/db_search.php3 b/db_search.php3 index 8f56d7412..c6707b873 100644 --- a/db_search.php3 +++ b/db_search.php3 @@ -221,18 +221,19 @@ if (isset($submit_search)) { echo ' ' . "\n" . '
' . "\n" - . ' ' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($onetable)) . "\n"; + . ' \n"; if ($res_cnt > 0) { - echo '   ' . $strBrowse . '' . "\n"; + echo '\n"; - echo '   ' . $strDelete . '' . "\n"; + echo '\n"; } // end if + echo '
' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($onetable)) . "' . PMA_linkOrButton('sql.php3?' . $url_sql_query + . '&sql_query=' .urlencode($newsearchsqls['select_fields']), + $strBrowse, '') . "' . PMA_linkOrButton('sql.php3?' . $url_sql_query + . '&sql_query=' .urlencode($newsearchsqls['delete']), + $strDelete, $newsearchsqls['delete']) . "
' . "\n"; } // end only one table // Several tables defined in the array $table_select @@ -259,20 +260,20 @@ if (isset($submit_search)) { echo ' ' . "\n" . '
  • ' . "\n" - . ' ' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($table_select[$i])) . "\n"; + . ' \n"; if ($res_cnt > 0) { - echo '   ' . $strBrowse . '' . "\n"; + echo '\n"; - echo '   ' . $strDelete . '' . "\n"; + echo '\n"; } // end if - echo ' ' . "\n"; + echo '
    ' . sprintf($strNumSearchResultsInTable, $res_cnt, htmlspecialchars($table_select[$i])) . "' . PMA_linkOrButton('sql.php3?' . $url_sql_query + . '&sql_query=' .urlencode($newsearchsqls['select_fields']), + $strBrowse, '') . "' . PMA_linkOrButton('sql.php3?' . $url_sql_query + . '&sql_query=' .urlencode($newsearchsqls['delete']), + $strDelete, $newsearchsqls['delete']) . "
  • ' . "\n"; } // end for echo ' ' . "\n"; diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index ec75cff7e..59a57aed1 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -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 = ' ' . "\n" + . ' ' . $message . '' . "\n"; + } + else { + $edit_url_parts = parse_url($url); + $query_parts = explode('&', $edit_url_parts['query']); + $link_or_button = '
    ' . "\n"; + reset ($query_parts); + while (list(, $query_pair) = each($query_parts)) { + list($eachvar, $eachval) = explode('=', $query_pair); + $link_or_button .= ' ' . "\n"; + } // end while + $link_or_button .= ' ' . "\n" . '
    ' . "\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 diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 677e66742..7456a2b50 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -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 = ' ' . "\n" - . ' ' . $message . '' . "\n"; - } - else { - $edit_url_parts = parse_url($url); - $query_parts = explode('&', $edit_url_parts['query']); - $link_or_button = '
    ' . "\n"; - reset ($query_parts); - while (list(, $query_pair) = each($query_parts)) { - list($eachvar, $eachval) = explode('=', $query_pair); - $link_or_button .= ' ' . "\n"; - } // end while - $link_or_button .= ' ' . "\n" . '
    ' . "\n"; - } // end if... else... - - return $link_or_button; - } // end of the 'PMA_linkOrButton()' function - /** * Displays the body of the results table