Skip to content

Commit

Permalink
can be done only once
Browse files Browse the repository at this point in the history
  • Loading branch information
scnakandala committed Jul 9, 2013
1 parent 4c912a6 commit bc055fe
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions sql.php
Expand Up @@ -236,19 +236,24 @@
PMA_sendResponseForGridEdit($result);
}

if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_maintenance'])) {
// Gets the list of fields properties
if (isset($result) && $result) {
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
$fields_cnt = count($fields_meta);
}

// Should be initialized these parameters before parsing
$showtable = isset($showtable) ? $showtable : null;
$printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
$url_query = isset($url_query) ? $url_query : null;

if (isset($_REQUEST['table_maintenance'])) {
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');

// Gets the list of fields properties
if (isset($result) && $result) {
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
$fields_cnt = count($fields_meta);
}

if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in
// libraries/DisplayResults.class.php
Expand All @@ -267,11 +272,6 @@
);
}

// Should be initialized these parameters before parsing
$showtable = isset($showtable) ? $showtable : null;
$printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
$url_query = isset($url_query) ? $url_query : null;

if (!empty($sql_data) && ($sql_data['valid_queries'] > 1)) {

$_SESSION['is_multi_query'] = true;
Expand Down Expand Up @@ -343,12 +343,6 @@
$cfgRelation = PMA_getRelationsParam();
}

// Gets the list of fields properties
if (isset($result) && $result) {
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
$fields_cnt = count($fields_meta);
}

//begin the sqlqueryresults div here. container div
$html_output .= '<div id="sqlqueryresults"';
$html_output .= ' class="ajax"';
Expand Down Expand Up @@ -408,11 +402,6 @@
$html_output .= $msg->getDisplay();
}

// Should be initialized these parameters before parsing
$showtable = isset($showtable) ? $showtable : null;
$printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
$url_query = isset($url_query) ? $url_query : null;

if (! empty($sql_data) && ($sql_data['valid_queries'] > 1) || $is_procedure) {

$_SESSION['is_multi_query'] = true;
Expand Down

0 comments on commit bc055fe

Please sign in to comment.