]> git.joonet.de Git - adminer.git/commitdiff
Link table names in SQL queries
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sun, 2 May 2010 21:37:05 +0000 (21:37 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sun, 2 May 2010 21:37:05 +0000 (21:37 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1510 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/adminer.inc.php
adminer/static/editing.js
changes.txt

index 2437ee6612c4f1ef51880792bd9d190ba4785781..49a85fdade0e7c14d404a2b5a776c569ab1ea1c8 100644 (file)
@@ -483,7 +483,7 @@ document.getElementById('username').focus();
        * @return null
        */
        function navigation($missing) {
-               global $VERSION, $connection, $token;
+               global $VERSION, $connection, $token, $driver;
                ?>
 <h1>
 <a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
@@ -519,6 +519,17 @@ document.getElementById('username').focus();
                                        echo "<p class='message'>" . lang('No tables.') . "\n";
                                } else {
                                        $this->tablesPrint($tables);
+                                       $links = array();
+                                       foreach ($tables as $table => $type) {
+                                               $links[] = preg_quote($table, '/');
+                                       }
+                                       echo "<script type='text/javascript'>\n";
+                                       echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+                                       echo "jushLinks.bac = jushLinks.$driver;\n";
+                                       echo "jushLinks.bra = jushLinks.$driver;\n";
+                                       echo "jushLinks.mssql_bra = jushLinks.$driver;\n";
+                                       echo "jushLinks.sqlite_quo = jushLinks.$driver;\n";
+                                       echo "</script>\n";
                                }
                                echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
                        }
index 189d9bfbca6acd0ee56f58d79ef958295fa35082..d6673896f4a810218f7c0f707dd26389d7b10e32 100644 (file)
@@ -15,6 +15,9 @@ function bodyLoad(version) {
                        jush.urls.sqlset[0] = jush.urls.sql[0];
                        jush.urls.sqlstatus[0] = jush.urls.sql[0];
                        jush.style(jushRoot + 'jush.css');
+                       if (window.jushLinks) {
+                               jush.custom_links = jushLinks;
+                       }
                        jush.highlight_tag('pre', 0);
                        jush.highlight_tag('code');
                }
index 4d0ef62f50b1623dfd25a7102f01878a593684a1..0df572fd082f1cad9ea4f713b8c4126187d3f47b 100644 (file)
@@ -9,6 +9,7 @@ Allow semicolon as CSV separator
 Autofocus username in login form
 Disable spellchecking in SQL textareas
 Japanese translation
+Link table names in SQL queries
 Defer table information in database overview to JavaScript (performance)
 Big tables optimizations (performance)