nicola's fixes for sql window and topbar
authorchriskl <chriskl>
Wed, 17 Sep 2003 09:03:15 +0000 (09:03 +0000)
committerchriskl <chriskl>
Wed, 17 Sep 2003 09:03:15 +0000 (09:03 +0000)
sqledit.php
topbar.php

index e617ebc206a573eb9cf78f6277cd1e1a7fcadcc4..52e6f698fe966d7d6788fb9c3bc0d984bd68ca81 100644 (file)
@@ -1,44 +1,44 @@
-<?php\r
-\r
-       /**\r
-        * Alternative SQL editing window\r
-        *\r
-        * $Id: sqledit.php,v 1.4 2003/09/11 03:27:44 chriskl Exp $\r
-        */\r
-\r
-       // Include application functions\r
-       include_once('libraries/lib.inc.php');\r
-\r
-       $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';\r
-       if (!isset($msg)) $msg = '';\r
-       $PHP_SELF = $_SERVER['PHP_SELF'];\r
-\r
-       /**\r
-        * Private function to display list of databases\r
-        */\r
-       function _printDatabases() {\r
-               global $data, $lang, $conf;\r
-               \r
-               // Get the list of all databases\r
-               $databases = &$data->getDatabases();\r
-\r
-               if ($databases->recordCount() > 0) {\r
-                       echo "<p>{$lang['strdatabase']}: <select name=\"database\">\n";\r
-                       while (!$databases->EOF) {\r
-                               $dbname = $databases->f[$data->dbFields['dbname']];\r
-                               echo "<option value=\"", htmlspecialchars($dbname), "\"",\r
-                               (isset($_REQUEST['database']) && $dbname == $_REQUEST['database']) ? ' selected="selected"' : '', ">",\r
-                                       htmlspecialchars($dbname), "</option>\n";\r
-                               $databases->moveNext();\r
-                       }\r
-                       echo "</select>\n";\r
-               }\r
-               else {\r
-                       echo "<input type=\"hidden\" name=\"database\" value=\"", \r
-                               htmlspecialchars($conf['servers'][$_SESSION['webdbServerID']]['defaultdb']), "\" />\n";\r
-               }               \r
-       }       \r
-\r
+<?php
+
+       /**
+        * Alternative SQL editing window
+        *
+        * $Id: sqledit.php,v 1.5 2003/09/17 09:03:15 chriskl Exp $
+        */
+
+       // Include application functions
+       include_once('libraries/lib.inc.php');
+
+       $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
+       if (!isset($msg)) $msg = '';
+       $PHP_SELF = $_SERVER['PHP_SELF'];
+
+       /**
+        * Private function to display list of databases
+        */
+       function _printDatabases() {
+               global $data, $lang, $conf;
+               
+               // Get the list of all databases
+               $databases = &$data->getDatabases();
+
+               if ($databases->recordCount() > 0) {
+                       echo "<p>{$lang['strdatabase']}: <select name=\"database\">\n";
+                       while (!$databases->EOF) {
+                               $dbname = $databases->f[$data->dbFields['dbname']];
+                               echo "<option value=\"", htmlspecialchars($dbname), "\"",
+                               (isset($_REQUEST['database']) && $dbname == $_REQUEST['database']) ? ' selected="selected"' : '', ">",
+                                       htmlspecialchars($dbname), "</option>\n";
+                               $databases->moveNext();
+                       }
+                       echo "</select></p>\n";
+               }
+               else {
+                       echo "<input type=\"hidden\" name=\"database\" value=\"", 
+                               htmlspecialchars($conf['servers'][$_SESSION['webdbServerID']]['defaultdb']), "\" />\n";
+               }               
+       }       
+
        /**
         * Searches for a named database object
         */
                echo "<h2>{$lang['strfind']}</h2>\n";
                
                echo "<form action=\"database.php\" method=\"get\" target=\"detail\">\n";
-               _printDatabases();\r
+               _printDatabases();
                echo "<p><input name=\"term\" value=\"", htmlspecialchars($_GET['term']), 
                        "\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" />\n";
                echo "<input type=\"submit\" value=\"{$lang['strfind']}\" />\n";
                echo $misc->form;
                echo "<input type=\"hidden\" name=\"action\" value=\"find\" />\n";
                echo "</form>\n";
-       }\r
-\r
-       /**\r
-        * Allow execution of arbitrary SQL statements on a database\r
-        */\r
-       function doDefault() {\r
-               global $PHP_SELF, $data, $localData, $misc;\r
-               global $lang, $conf;\r
-\r
-               if (!isset($_POST['query'])) $_POST['query'] = '';\r
-\r
-               $misc->printPopUpNav();\r
-               echo "<h2>{$lang['strsql']}</h2>\n";\r
-\r
-               echo "<form action=\"sql.php\" method=\"post\" target=\"detail\">\n";\r
-               _printDatabases();\r
-               echo "<input type=\"submit\" value=\"{$lang['strgo']}\" />\n";\r
-               echo "<input type=\"submit\" name=\"explain\" value=\"{$lang['strexplain']}\" />\n";\r
-               echo "<input type=\"reset\" value=\"{$lang['strreset']}\" />\n";\r
-               echo "<input type=\"button\" value=\"{$lang['strtaller']}\" onclick=\"document.forms[0].query.rows += 2;\" />\n";\r
-               echo "<input type=\"button\" value=\"{$lang['strshorter']}\" onclick=\"document.forms[0].query.rows -= 2;\" />\n";\r
-\r
-               $rows = isset($_REQUEST['rows']) ? $_REQUEST['rows'] : 17;\r
-\r
-               echo "<textarea style=\"width:100%\" rows=\"{$rows}\" cols=\"50\" name=\"query\" id=\"query\">",\r
-                       htmlspecialchars($_POST['query']), "</textarea></p>\n";\r
-\r
-               echo $misc->form;\r
-\r
-               echo "</form>\n";\r
-       }\r
-\r
-       $misc->printHeader($lang['strsql']);\r
-\r
-       // Bring to the front always\r
-       echo "<body onLoad=\"window.focus();\">\n";\r
-       \r
-       switch ($action) {\r
-               case 'find':\r
-                       doFind();\r
-                       break;\r
-               case 'sql':\r
-               default:\r
-                       doDefault();\r
-                       break;\r
-       }\r
-       \r
-       $misc->printFooter();\r
-       \r
-?>\r
+       }
+
+       /**
+        * Allow execution of arbitrary SQL statements on a database
+        */
+       function doDefault() {
+               global $PHP_SELF, $data, $localData, $misc;
+               global $lang, $conf;
+
+               if (!isset($_POST['query'])) $_POST['query'] = '';
+
+               $misc->printPopUpNav();
+               echo "<h2>{$lang['strsql']}</h2>\n";
+
+               echo "<form action=\"sql.php\" method=\"post\" target=\"detail\">\n";
+               _printDatabases();
+
+               $rows = isset($_REQUEST['rows']) ? $_REQUEST['rows'] : 10;
+
+               echo "<textarea rows=\"{$rows}\" cols=\"50\" name=\"query\">",
+                       htmlspecialchars($_POST['query']), "</textarea>\n";
+               echo "<p><input type=\"submit\" value=\"{$lang['strgo']}\" />\n";
+               echo "<input type=\"submit\" name=\"explain\" value=\"{$lang['strexplain']}\" />\n";
+               echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n";
+
+               echo $misc->form;
+
+               echo "</form>\n";
+       }
+
+       $misc->printHeader($lang['strsql']);
+
+       // Bring to the front always
+       echo "<body onLoad=\"window.focus();\">\n";
+       
+       switch ($action) {
+               case 'find':
+                       doFind();
+                       break;
+               case 'sql':
+               default:
+                       doDefault();
+                       break;
+       }
+       
+       $misc->printFooter();
+       
+?>
index 4f480cd23218bfabd2f05315f7827c3f31cbdf97..4510790701883989eb257fe8df6e8fd41320e344 100755 (executable)
@@ -3,7 +3,7 @@
        /**
         * Top menu for phpPgAdmin
         *
-        * $Id: topbar.php,v 1.17 2003/09/10 02:39:09 chriskl Exp $
+        * $Id: topbar.php,v 1.18 2003/09/17 09:03:15 chriskl Exp $
         */
 
        // Include application functions
@@ -14,7 +14,7 @@
 ?>
 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="topbar">
        <tr>
-               <td width="211" rowspan="2"><img src="images/themes/<?php echo $conf['theme'] ?>/title.png" width="211" height="50" alt="<?php echo htmlspecialchars($appName) ?>" /></td>
+               <td width="211" rowspan="2"><a href="intro.php" target="detail"><img style="border: none" src="images/themes/<?php echo $conf['theme'] ?>/title.png" width="211" height="50" alt="<?php echo htmlspecialchars($appName) ?>" title="<?php echo htmlspecialchars($appName) ?>" /></a></td>
                <td class="topbar" width="5" rowspan="2">&nbsp;</td>
                <td class="topbar">
                <?php echo sprintf($lang['strtopbar'], htmlspecialchars($conf['description']),
 <?php if ($conf['show_reports']) : ?>
                        <a class="toplink" href="reports.php" target="detail"><?php echo $lang['strreports'] ?></a> |
 <?php endif; ?>
-                       <a class="toplink" href="sqledit" target="sqledit"
-                                               onclick="window.open('sqledit.php?action=sql&<?php echo SID ?>','sqledit','toolbar=no,width=600,height=400,resizable=yes,scrollbars=no').focus(); return false;"><?php echo $lang['strsql'] ?></a> |
-                       <a class="toplink" href="sqledit" target="sqledit"
-                                               onclick="window.open('sqledit.php?action=find&<?php echo SID ?>','sqledit','toolbar=no,width=600,height=400,resizable=yes,scrollbars=no').focus(); return false;"><?php echo $lang['strfind'] ?></a> |
+                       <a class="toplink" href="sqledit.php" target="sqledit" onclick="window.open('sqledit.php?action=sql&<?php echo SID ?>','sqledit','toolbar=no,width=600,height=400,resizable=yes,scrollbars=no').focus(); return false;"><?php echo $lang['strsql'] ?></a> |
+                       <a class="toplink" href="sqledit.php" target="sqledit" onclick="window.open('sqledit.php?action=find&<?php echo SID ?>','sqledit','toolbar=no,width=600,height=400,resizable=yes,scrollbars=no').focus(); return false;"><?php echo $lang['strfind'] ?></a> |
                        <a class="toplink" href="logout.php" target="_parent"><?php echo $lang['strlogout'] ?></a>
                </td>
        </tr>