Activate JUSH before loading databases
This commit is contained in:
parent
adae922f36
commit
147957cef7
|
@ -761,7 +761,7 @@ username.form['auth[driver]'].onchange();
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function navigation($missing) {
|
function navigation($missing) {
|
||||||
global $VERSION, $jush, $drivers;
|
global $VERSION, $jush, $drivers, $connection;
|
||||||
?>
|
?>
|
||||||
<h1>
|
<h1>
|
||||||
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span>
|
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span>
|
||||||
|
@ -787,12 +787,31 @@ username.form['auth[driver]'].onchange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
||||||
|
$connection->select_db(DB);
|
||||||
|
$tables = table_status('', true);
|
||||||
|
}
|
||||||
if (support("sql")) {
|
if (support("sql")) {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
|
<script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
|
||||||
<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
|
<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
|
||||||
<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
|
<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
|
||||||
<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
|
<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<?php
|
||||||
|
if ($tables) {
|
||||||
|
$links = array();
|
||||||
|
foreach ($tables as $table => $type) {
|
||||||
|
$links[] = preg_quote($table, '/');
|
||||||
|
}
|
||||||
|
echo "var jushLinks = { $jush: [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
|
||||||
|
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
|
||||||
|
echo "jushLinks.$val = jushLinks.$jush;\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
$this->databasesPrint($missing);
|
$this->databasesPrint($missing);
|
||||||
|
@ -804,23 +823,10 @@ username.form['auth[driver]'].onchange();
|
||||||
}
|
}
|
||||||
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
||||||
echo '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
|
echo '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
|
||||||
$tables = table_status('', true);
|
|
||||||
if (!$tables) {
|
if (!$tables) {
|
||||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||||
} else {
|
} else {
|
||||||
$this->tablesPrint($tables);
|
$this->tablesPrint($tables);
|
||||||
if (support("sql")) {
|
|
||||||
$links = array();
|
|
||||||
foreach ($tables as $table => $type) {
|
|
||||||
$links[] = preg_quote($table, '/');
|
|
||||||
}
|
|
||||||
echo "<script type='text/javascript'>\n";
|
|
||||||
echo "var jushLinks = { $jush: [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
|
|
||||||
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
|
|
||||||
echo "jushLinks.$val = jushLinks.$jush;\n";
|
|
||||||
}
|
|
||||||
echo "</script>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||||
global $LANG, $VERSION, $adminer, $connection, $drivers, $jush;
|
global $LANG, $VERSION, $adminer, $drivers, $jush;
|
||||||
page_headers();
|
page_headers();
|
||||||
$title_all = $title . ($title2 != "" ? ": $title2" : "");
|
$title_all = $title . ($title2 != "" ? ": $title2" : "");
|
||||||
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
|
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
|
||||||
|
@ -29,7 +29,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$VERSION');"); ?>">
|
<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('$VERSION');\""); ?>>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
function bodyLoad(version) {
|
function bodyLoad(version) {
|
||||||
if (window.jush) {
|
if (window.jush) {
|
||||||
jush.create_links = ' target="_blank" rel="noreferrer"';
|
jush.create_links = ' target="_blank" rel="noreferrer"';
|
||||||
|
if (version) {
|
||||||
for (var key in jush.urls) {
|
for (var key in jush.urls) {
|
||||||
var obj = jush.urls;
|
var obj = jush.urls;
|
||||||
if (typeof obj[key] != 'string') {
|
if (typeof obj[key] != 'string') {
|
||||||
|
@ -17,6 +18,7 @@ function bodyLoad(version) {
|
||||||
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
|
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (window.jushLinks) {
|
if (window.jushLinks) {
|
||||||
jush.custom_links = jushLinks;
|
jush.custom_links = jushLinks;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Editor specific functions
|
// Editor specific functions
|
||||||
|
|
||||||
function bodyLoad(version) {
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectFieldChange(form) {
|
function selectFieldChange(form) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue