removed unnecessary JavaScript code (due to session based history)
This commit is contained in:
@@ -219,17 +219,16 @@ function setAll( new_lang, new_collation_connection, new_server, new_db, new_tab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload_querywindow( db, table, sql_query ) {
|
function reload_querywindow(db, table, sql_query)
|
||||||
|
{
|
||||||
if ( ! querywindow.closed && querywindow.location ) {
|
if ( ! querywindow.closed && querywindow.location ) {
|
||||||
if ( ! querywindow.document.sqlform.LockFromUpdate
|
if ( ! querywindow.document.sqlform.LockFromUpdate
|
||||||
|| ! querywindow.document.sqlform.LockFromUpdate.checked ) {
|
|| ! querywindow.document.sqlform.LockFromUpdate.checked ) {
|
||||||
querywindow.document.getElementById('hiddenqueryform').db.value = db;
|
querywindow.document.getElementById('hiddenqueryform').db.value = db;
|
||||||
querywindow.document.getElementById('hiddenqueryform').query_history_latest_db.value = db;
|
|
||||||
querywindow.document.getElementById('hiddenqueryform').table.value = table;
|
querywindow.document.getElementById('hiddenqueryform').table.value = table;
|
||||||
querywindow.document.getElementById('hiddenqueryform').query_history_latest_table.value = table;
|
|
||||||
|
|
||||||
if ( sql_query ) {
|
if (sql_query) {
|
||||||
querywindow.document.getElementById('hiddenqueryform').query_history_latest.value = sql_query;
|
querywindow.document.getElementById('hiddenqueryform').sql_query.value = sql_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
querywindow.document.getElementById('hiddenqueryform').submit();
|
querywindow.document.getElementById('hiddenqueryform').submit();
|
||||||
@@ -240,7 +239,8 @@ function reload_querywindow( db, table, sql_query ) {
|
|||||||
/**
|
/**
|
||||||
* brings query window to front and inserts query to be edited
|
* brings query window to front and inserts query to be edited
|
||||||
*/
|
*/
|
||||||
function focus_querywindow( sql_query ) {
|
function focus_querywindow(sql_query)
|
||||||
|
{
|
||||||
/* if ( querywindow && !querywindow.closed && querywindow.location) { */
|
/* if ( querywindow && !querywindow.closed && querywindow.location) { */
|
||||||
if ( !querywindow || querywindow.closed || !querywindow.location) {
|
if ( !querywindow || querywindow.closed || !querywindow.location) {
|
||||||
// we need first to open the window and cannot pass the query with it
|
// we need first to open the window and cannot pass the query with it
|
||||||
@@ -253,7 +253,7 @@ function focus_querywindow( sql_query ) {
|
|||||||
//var querywindow = querywindow;
|
//var querywindow = querywindow;
|
||||||
if ( querywindow.document.getElementById('hiddenqueryform').querydisplay_tab != 'sql' ) {
|
if ( querywindow.document.getElementById('hiddenqueryform').querydisplay_tab != 'sql' ) {
|
||||||
querywindow.document.getElementById('hiddenqueryform').querydisplay_tab.value = "sql";
|
querywindow.document.getElementById('hiddenqueryform').querydisplay_tab.value = "sql";
|
||||||
querywindow.document.getElementById('hiddenqueryform').query_history_latest.value = sql_query;
|
querywindow.document.getElementById('hiddenqueryform').sql_query.value = sql_query;
|
||||||
querywindow.document.getElementById('hiddenqueryform').submit();
|
querywindow.document.getElementById('hiddenqueryform').submit();
|
||||||
querywindow.focus();
|
querywindow.focus();
|
||||||
} else {
|
} else {
|
||||||
|
@@ -133,14 +133,6 @@ if ($GLOBALS['cfg']['PropertiesIconic']) {
|
|||||||
$titles['Change'] = $GLOBALS['strChange'];
|
$titles['Change'] = $GLOBALS['strChange'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Hidden forms and query frame interaction stuff
|
|
||||||
if (PMA_isValid($_REQUEST['query_history_latest'])) {
|
|
||||||
$sql_query = $_REQUEST['query_history_latest'];
|
|
||||||
$db = PMA_ifSetOr($_REQUEST['query_history_latest_db'], '');
|
|
||||||
$table = PMA_ifSetOr($_REQUEST['query_history_latest_table'], '');
|
|
||||||
}
|
|
||||||
|
|
||||||
$url_query = PMA_generate_common_url($db, $table);
|
$url_query = PMA_generate_common_url($db, $table);
|
||||||
|
|
||||||
if (PMA_isValid($sql_query)) {
|
if (PMA_isValid($sql_query)) {
|
||||||
@@ -258,41 +250,22 @@ if (! empty($_sql_history)
|
|||||||
.'<ul>';
|
.'<ul>';
|
||||||
foreach ($_sql_history as $query) {
|
foreach ($_sql_history as $query) {
|
||||||
echo '<li>' . "\n";
|
echo '<li>' . "\n";
|
||||||
|
|
||||||
// edit link
|
// edit link
|
||||||
echo '<a href="#" onclick="';
|
$url_params = array(
|
||||||
?>
|
'querydisplay_tab' => $tab,
|
||||||
// <![CDATA[
|
'sql_query' => $query['sqlquery'],
|
||||||
var form = document.getElementById('hiddenqueryform');
|
'db' => $query['db'],
|
||||||
form.querydisplay_tab.value = '<?php echo $tab ?>';
|
'table' => $query['table'],
|
||||||
form.query_history_latest.value = '<?php
|
);
|
||||||
echo preg_replace('/(\r|\n)+/i', '\\n', PMA_jsFormat($query['sqlquery'], false)) ?>';
|
echo '<a href="querywindow.php' . PMA_generate_common_url($url_params)
|
||||||
form.auto_commit.value = 'false';
|
. '">' . $titles['Change'] . '</a>';
|
||||||
form.db.value = '<?php echo PMA_jsFormat($query['db'], false) ?>';
|
|
||||||
form.query_history_latest_db.value = '<?php echo PMA_jsFormat($query['db'], false) ?>';
|
|
||||||
form.table.value = '<?php echo PMA_jsFormat($query['table'], false) ?>';
|
|
||||||
form.query_history_latest_table.value = '<?php echo PMA_jsFormat($query['table'], false) ?>';
|
|
||||||
form.submit();
|
|
||||||
return false;
|
|
||||||
// ]]
|
|
||||||
<?php
|
|
||||||
echo '">' . $titles['Change'] . '</a>';
|
|
||||||
// execute link
|
// execute link
|
||||||
echo '<a href="#" onclick="';
|
$url_params['auto_commit'] = 'true';
|
||||||
?>
|
echo '<a href="import.php' . PMA_generate_common_url($url_params) . '"'
|
||||||
// <![CDATA[
|
. ' target="frame_content">';
|
||||||
var form = document.getElementById('hiddenqueryform');
|
|
||||||
form.querydisplay_tab.value = '<?php echo $tab ?>';
|
|
||||||
form.query_history_latest.value = '<?php
|
|
||||||
echo preg_replace('/(\r|\n)+/i', '\\r\\n', PMA_jsFormat($query['sqlquery'], false)) ?>';
|
|
||||||
form.auto_commit.value = 'true';
|
|
||||||
form.db.value = '<?php echo PMA_jsFormat($query['db'], false) ?>';
|
|
||||||
form.query_history_latest_db.value = '<?php echo PMA_jsFormat($query['db'], false) ?>';
|
|
||||||
form.table.value = '<?php echo PMA_jsFormat($query['table'], false) ?>';
|
|
||||||
form.query_history_latest_table.value = '<?php echo PMA_jsFormat($query['table'], false) ?>';
|
|
||||||
form.submit();
|
|
||||||
return false;
|
|
||||||
// ]]">
|
|
||||||
<?php
|
|
||||||
if (! empty($query['db'])) {
|
if (! empty($query['db'])) {
|
||||||
echo '[';
|
echo '[';
|
||||||
echo htmlspecialchars(PMA_backquote($query['db']));
|
echo htmlspecialchars(PMA_backquote($query['db']));
|
||||||
@@ -321,12 +294,7 @@ return false;
|
|||||||
<?php echo PMA_generate_common_hidden_inputs('', ''); ?>
|
<?php echo PMA_generate_common_hidden_inputs('', ''); ?>
|
||||||
<input type="hidden" name="db" value="<?php echo htmlspecialchars($db); ?>" />
|
<input type="hidden" name="db" value="<?php echo htmlspecialchars($db); ?>" />
|
||||||
<input type="hidden" name="table" value="<?php echo htmlspecialchars($table); ?>" />
|
<input type="hidden" name="table" value="<?php echo htmlspecialchars($table); ?>" />
|
||||||
|
<input type="hidden" name="sql_query" value="" />
|
||||||
<input type="hidden" name="query_history_latest" value="" />
|
|
||||||
<input type="hidden" name="query_history_latest_db" value="" />
|
|
||||||
<input type="hidden" name="query_history_latest_table" value="" />
|
|
||||||
|
|
||||||
<input type="hidden" name="auto_commit" value="false" />
|
|
||||||
<input type="hidden" name="querydisplay_tab" value="<?php echo $querydisplay_tab; ?>" />
|
<input type="hidden" name="querydisplay_tab" value="<?php echo $querydisplay_tab; ?>" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user