Permalink
Browse files

Separate printing databases in customization

  • Loading branch information...
1 parent 364dcfe commit beafccb8c3913702640ddc6e7b269db025923238 @vrana committed Aug 21, 2012
Showing with 35 additions and 20 deletions.
  1. +31 −20 adminer/include/adminer.inc.php
  2. +4 −0 editor/include/adminer.inc.php
@@ -771,7 +771,7 @@ function homepage() {
* @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 @@ function navigation($missing) {
<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 @@ function navigation($missing) {
}
}
+ /** 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 @@ function navigation($missing) {
</p>
</form>
<?php
+ $this->databasesPrint($missing);
if ($missing != "db" && $missing != "ns") {
$table_status = table_status();
if (!$table_status) {
@@ -564,6 +565,9 @@ function navigation($missing) {
}
}
+ function databasesPrint($missing) {
+ }
+
function tablesPrint($tables) {
echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $row) {

0 comments on commit beafccb

Please sign in to comment.