Skip to content
Browse files

removed unnecessary JavaScript code (due to session based history)

  • Loading branch information...
1 parent c58cc56 commit d27b8efab94aebe3ca9a8978c244b10e67affb6a Sebastian Mendel committed Mar 26, 2007
Showing with 22 additions and 54 deletions.
  1. +7 −7 js/querywindow.js
  2. +15 −47 querywindow.php
View
14 js/querywindow.js
@@ -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
62 querywindow.php
@@ -133,14 +133,6 @@
$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 @@ function PMA_querywindowInit()
.'<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 @@ function PMA_querywindowInit()
<?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>

0 comments on commit d27b8ef

Please sign in to comment.
Something went wrong with that request. Please try again.