diff --git a/js/sql.js b/js/sql.js index 43b3af732..e83cee8d4 100644 --- a/js/sql.js +++ b/js/sql.js @@ -172,11 +172,11 @@ $(document).ready(function() { /** * Trigger the appendAnchor event to prepare the first table for inline edit - * + * (see $GLOBALS['cfg']['AjaxEnable']) * @memberOf jQuery * @name sqlqueryresults_trigger */ - $("#sqlqueryresults").trigger('appendAnchor'); + $("#sqlqueryresults.ajax").trigger('appendAnchor'); /** * Append the "Show/Hide query box" message to the query input form @@ -264,11 +264,12 @@ $(document).ready(function() { /** * Paginate when we click any of the navigation buttons + * (only if the element has the ajax class, see $cfg['AjaxEnable']) * @memberOf jQuery * @name paginate_nav_button_click * @uses PMA_ajaxShowMessage() */ - $("input[name=navig]").live('click', function(event) { + $("input[name=navig].ajax").live('click', function(event) { /** @lends jQuery */ event.preventDefault(); @@ -293,15 +294,22 @@ $(document).ready(function() { * @name paginate_dropdown_change */ $("#pageselector").live('change', function(event) { - event.preventDefault(); - - PMA_ajaxShowMessage(); var $the_form = $(this).parent("form"); - $.post($the_form.attr('action'), $the_form.serialize() + '&ajax_request=true', function(data) { - $("#sqlqueryresults").html(data); - $("#sqlqueryresults").trigger('appendAnchor'); - }) // end $.post() + // see $cfg['AjaxEnable'] + if ($(this).hasClass('ajax')) { + event.preventDefault(); + + PMA_ajaxShowMessage(); + + $.post($the_form.attr('action'), $the_form.serialize() + '&ajax_request=true', function(data) { + $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); + }) // end $.post() + } else { + $the_form.submit(); + } + })// end Paginate results with Page Selector /** diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 39764316f..711627f42 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2201,8 +2201,11 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1, $pageNowMinusRange = ($pageNow - $range); $pageNowPlusRange = ($pageNow + $range); - $gotopage = $prompt - . ' - /> + value="" /> - + value=" :" /> diff --git a/sql.php b/sql.php index fa0739841..8a0529878 100644 --- a/sql.php +++ b/sql.php @@ -730,7 +730,7 @@ if (0 == $num_rows || $is_affected) { else { //If we are retrieving the full value of a truncated field or the original // value of a transformed field, show it here and exit - if( $GLOBALS['inline_edit'] == true) { + if( $GLOBALS['inline_edit'] == true && $GLOBALS['cfg']['AjaxEnable']) { $row = PMA_DBI_fetch_row($result); $extra_data = array(); $extra_data['value'] = $row[0]; @@ -750,7 +750,7 @@ else { unset($message); - if( $GLOBALS['is_ajax_request'] != true) { + if( ! $GLOBALS['is_ajax_request'] || ! $GLOBALS['cfg']['AjaxEnable']) { if (strlen($table)) { require './libraries/tbl_common.php'; $url_query .= '&goto=tbl_sql.php&back=tbl_sql.php'; @@ -781,9 +781,13 @@ else { $fields_cnt = count($fields_meta); } - if( $GLOBALS['is_ajax_request'] != true ) { + if( ! $GLOBALS['is_ajax_request']) { //begin the sqlqueryresults div here. container div - echo '
'; + echo '
'; } // Display previous update query (from tbl_replace)