fix konstantin baryshnikov's bug report in the sql window
authorchriskl <chriskl>
Wed, 30 Jun 2004 10:09:48 +0000 (10:09 +0000)
committerchriskl <chriskl>
Wed, 30 Jun 2004 10:09:48 +0000 (10:09 +0000)
sqledit.php

index c3f8658d8e056d83b5e9757b7d58cbc75e258a4c..93dc64f2dc71e25849e82fb7f90e03459cd40ec3 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Alternative SQL editing window
         *
-        * $Id: sqledit.php,v 1.13 2004/05/08 13:06:09 chriskl Exp $
+        * $Id: sqledit.php,v 1.14 2004/06/30 10:09:48 chriskl Exp $
         */
 
        // Include application functions
@@ -17,7 +17,7 @@
         * Private function to display list of databases
         */
        function _printDatabases() {
-               global $data, $lang, $conf;
+               global $data, $lang, $conf, $action;
 
                // Get the list of all databases
                $databases = &$data->getDatabases();
                        // The javascript action on the select box reloads the popup whenever the database is changed.
                        // This ensures that the correct page encoding is used.  The exact URL to reload to is different
                        // between SQL and Find mode, however.
-                       if (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'sql')
+                       if ($action == 'sql')
                                echo "<p>{$lang['strdatabase']}: <select name=\"database\" onChange=\"location.href='sqledit.php?action=" . 
-                                               urlencode($_REQUEST['action']) . "&database=' + encodeURI(options[selectedIndex].value) + '&query=' + encodeURI(query.value) + (paginate.checked ? '&paginate=on' : '')  + '&" . 
+                                               urlencode($action) . "&database=' + encodeURI(options[selectedIndex].value) + '&query=' + encodeURI(query.value) + (paginate.checked ? '&paginate=on' : '')  + '&" . 
                                                SID . "'\">\n";
                        else
                                echo "<p>{$lang['strdatabase']}: <select name=\"database\" onChange=\"location.href='sqledit.php?action=" . 
-                                               urlencode($_REQUEST['action']) . "&database=' + encodeURI(options[selectedIndex].value) + '&term=' + encodeURI(term.value) + '&" . SID . "'\">\n";
+                                               urlencode($action) . "&database=' + encodeURI(options[selectedIndex].value) + '&term=' + encodeURI(term.value) + '&" . SID . "'\">\n";
                        
                        while (!$databases->EOF) {
                                $dbname = $databases->f[$data->dbFields['dbname']];