removed unnecessary JavaScript code (due to session based history)

This commit is contained in:
Sebastian Mendel
2007-03-26 14:50:14 +00:00
parent c58cc56041
commit d27b8efab9
2 changed files with 22 additions and 54 deletions

View File

@@ -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.document.sqlform.LockFromUpdate
|| ! querywindow.document.sqlform.LockFromUpdate.checked ) {
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').query_history_latest_table.value = table;
if ( sql_query ) {
querywindow.document.getElementById('hiddenqueryform').query_history_latest.value = sql_query;
if (sql_query) {
querywindow.document.getElementById('hiddenqueryform').sql_query.value = sql_query;
}
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
*/
function focus_querywindow( sql_query ) {
function focus_querywindow(sql_query)
{
/* 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
@@ -253,7 +253,7 @@ function focus_querywindow( sql_query ) {
//var querywindow = querywindow;
if ( querywindow.document.getElementById('hiddenqueryform').querydisplay_tab != '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.focus();
} else {

View File

@@ -133,14 +133,6 @@ if ($GLOBALS['cfg']['PropertiesIconic']) {
$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);
if (PMA_isValid($sql_query)) {
@@ -258,41 +250,22 @@ if (! empty($_sql_history)
.'<ul>';
foreach ($_sql_history as $query) {
echo '<li>' . "\n";
// edit link
echo '<a href="#" onclick="';
?>
// <![CDATA[
var form = document.getElementById('hiddenqueryform');
form.querydisplay_tab.value = '<?php echo $tab ?>';
form.query_history_latest.value = '<?php
echo preg_replace('/(\r|\n)+/i', '\\n', PMA_jsFormat($query['sqlquery'], false)) ?>';
form.auto_commit.value = 'false';
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>';
$url_params = array(
'querydisplay_tab' => $tab,
'sql_query' => $query['sqlquery'],
'db' => $query['db'],
'table' => $query['table'],
);
echo '<a href="querywindow.php' . PMA_generate_common_url($url_params)
. '">' . $titles['Change'] . '</a>';
// execute link
echo '<a href="#" onclick="';
?>
// <![CDATA[
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
$url_params['auto_commit'] = 'true';
echo '<a href="import.php' . PMA_generate_common_url($url_params) . '"'
. ' target="frame_content">';
if (! empty($query['db'])) {
echo '[';
echo htmlspecialchars(PMA_backquote($query['db']));
@@ -321,12 +294,7 @@ return false;
<?php echo PMA_generate_common_hidden_inputs('', ''); ?>
<input type="hidden" name="db" value="<?php echo htmlspecialchars($db); ?>" />
<input type="hidden" name="table" value="<?php echo htmlspecialchars($table); ?>" />
<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="sql_query" value="" />
<input type="hidden" name="querydisplay_tab" value="<?php echo $querydisplay_tab; ?>" />
</form>
</div>