1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 20:31:19 +02:00

Link table names in SQL queries

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1510 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2010-05-02 21:37:05 +00:00
parent 9507f3bb19
commit 8e81039531
3 changed files with 16 additions and 1 deletions

View 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";
}

View 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');
}