mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 16:44:17 +02:00
Separate printing databases in customization
This commit is contained in:
@@ -771,7 +771,7 @@ DROP PROCEDURE adminer_alter;
|
||||
* @return null
|
||||
*/
|
||||
function navigation($missing) {
|
||||
global $VERSION, $connection, $token, $jush, $drivers;
|
||||
global $VERSION, $token, $jush, $drivers;
|
||||
?>
|
||||
<h1>
|
||||
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span>
|
||||
@@ -809,26 +809,8 @@ DROP PROCEDURE adminer_alter;
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</p>
|
||||
</form>
|
||||
<?php $databases = $this->databases(); ?>
|
||||
<form action="">
|
||||
<p id="dbs">
|
||||
<?php hidden_fields_get(); ?>
|
||||
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
|
||||
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
|
||||
<?php
|
||||
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
if (support("scheme")) {
|
||||
echo "<br>" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();");
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
|
||||
: (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">'
|
||||
: (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
|
||||
: "")));
|
||||
echo "</p></form>\n";
|
||||
$this->databasesPrint($missing);
|
||||
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
||||
echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
|
||||
$tables = tables_list();
|
||||
@@ -851,6 +833,35 @@ DROP PROCEDURE adminer_alter;
|
||||
}
|
||||
}
|
||||
|
||||
/** Prints databases list in menu
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function databasesPrint($missing) {
|
||||
global $connection;
|
||||
$databases = $this->databases();
|
||||
?>
|
||||
<form action="">
|
||||
<p id="dbs">
|
||||
<?php hidden_fields_get(); ?>
|
||||
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
|
||||
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
|
||||
<?php
|
||||
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
if (support("scheme")) {
|
||||
echo "<br>" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();");
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
|
||||
: (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">'
|
||||
: (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
|
||||
: "")));
|
||||
echo "</p></form>\n";
|
||||
}
|
||||
|
||||
/** Prints table list in menu
|
||||
* @param array
|
||||
* @return null
|
||||
|
@@ -553,6 +553,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
$this->databasesPrint($missing);
|
||||
if ($missing != "db" && $missing != "ns") {
|
||||
$table_status = table_status();
|
||||
if (!$table_status) {
|
||||
@@ -564,6 +565,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||
}
|
||||
}
|
||||
|
||||
function databasesPrint($missing) {
|
||||
}
|
||||
|
||||
function tablesPrint($tables) {
|
||||
echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
||||
foreach ($tables as $row) {
|
||||
|
Reference in New Issue
Block a user