diff --git a/ChangeLog b/ChangeLog index d939629e5c..6f56742cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ phpMyAdmin - ChangeLog - bug #4495 Comment lines in multiquery - bug #4535 Loads of Warnings/Notices in PMA_getServerSlaveStatus on replication slave - bug #4585 Multi query results not shown +- rfe #1556 Disabling Show all 4.2.12.0 (not yet released) - bug #4574 Blank/white page when JavaScript disabled diff --git a/js/messages.php b/js/messages.php index 7dd4c35c3a..58c0abe566 100644 --- a/js/messages.php +++ b/js/messages.php @@ -430,6 +430,7 @@ $js_messages['strColVisibHint'] = __( $js_messages['strShowAllCol'] = __('Show all'); $js_messages['strAlertNonUnique'] = __('This table does not contain a unique column. Features related to the grid edit, checkbox, Edit, Copy and Delete links may not work after saving.'); $js_messages['strEnterValidHex'] = __('Please enter a valid hexadecimal string. Valid characters are 0-9, A-F.'); +$js_messages['strShowAllRowsWarning'] = __('Do you really want to see all rows? For a big table this could crash the browser.'); /** Drag & Drop sql import messages */ $js_messages['dropImportMessageCancel'] = __('cancel'); diff --git a/js/sql.js b/js/sql.js index 394984a8a5..bd50a3ea3d 100644 --- a/js/sql.js +++ b/js/sql.js @@ -100,6 +100,7 @@ AJAX.registerTeardown('sql.js', function () { $('th.column_heading.marker').die('click'); $(window).unbind('scroll'); $(".filter_rows").die("keyup"); + $('body').off('click', '.navigation .showAllRows'); $('body').off('click','a.browse_foreign'); $('body').off('click', '#simulate_dml'); $('body').off('keyup', '#sqlqueryform'); @@ -441,6 +442,26 @@ AJAX.registerOnload('sql.js', function () { }); // Filter row handling. --ENDS-- + // Prompt to confirm on Show All + $('body').on('click', '.navigation .showAllRows', function (e) { + e.preventDefault(); + $form = $(this).parents('form'); + + if (! $(this).is(':checked')) { // already showing all rows + submitShowAllForm(); + } else { + $form.PMA_confirm(PMA_messages.strShowAllRowsWarning, $form.attr('action'), function (url) { + submitShowAllForm(); + }); + } + + function submitShowAllForm() { + var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true'; + PMA_ajaxShowMessage(); + $.post($form.attr('action'), submitData, AJAX.responseHandler); + } + }); + $('body').on('keyup', '#sqlqueryform', function () { PMA_handleSimulateQueryButton(); }); diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index b3040d28d7..759e1b8f7e 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -703,17 +703,10 @@ class PMA_DisplayResults } //_if2 } //_if1 - // Display the "Show all" button if allowed - if (($this->__get('num_rows') < $this->__get('unlim_num_rows')) - && ($GLOBALS['cfg']['ShowAll'] - || ($this->__get('unlim_num_rows') <= 500)) - ) { - - $table_navigation_html .= $this->_getShowAllButtonForTableNavigation( - $html_sql_query - ); - - } // end show all + $showing_all = false; + if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) { + $showing_all = true; + } // Move to the next page or to the last one $endpos = $_SESSION['tmpval']['pos'] @@ -731,8 +724,17 @@ class PMA_DisplayResults } // end move toward + // Display the "Show all" button if allowed + if ($GLOBALS['cfg']['ShowAll'] || ($this->__get('unlim_num_rows') <= 500) ) { + + $table_navigation_html .= $this->_getShowAllCheckboxForTableNavigation( + $showing_all, $html_sql_query + ); + + } // end show all + // show separator if pagination happen - if ($nbTotalPage > 1) { + if ($nbTotalPage > 1 || $showing_all) { $table_navigation_html .= '