Abstract schemas()
This commit is contained in:
parent
8d9ef7afd2
commit
f503d8130b
|
@ -125,7 +125,7 @@ if ($adminer->homepage()) {
|
|||
: "")))
|
||||
. (support("table") ? "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm() . on_help($jush == "sqlite" ? "'DELETE'" : "'TRUNCATE" . ($jush == "pgsql" ? "'" : " TABLE'")) . "> " : "")
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . on_help("'DROP TABLE'") . ">\n";
|
||||
$databases = (support("scheme") ? schemas() : $adminer->databases());
|
||||
$databases = (support("scheme") ? $adminer->schemas() : $adminer->databases());
|
||||
if (count($databases) != 1 && $jush != "sqlite") {
|
||||
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
|
||||
echo "<p>" . lang('Move to other database') . ": ";
|
||||
|
|
|
@ -43,6 +43,13 @@ class Adminer {
|
|||
return get_databases($flush);
|
||||
}
|
||||
|
||||
/** Get list of schemas
|
||||
* @return array
|
||||
*/
|
||||
function schemas() {
|
||||
return schemas();
|
||||
}
|
||||
|
||||
/** Specify limit for waiting on some slow queries like DB list
|
||||
* @return float number of seconds
|
||||
*/
|
||||
|
@ -806,7 +813,7 @@ username.form['auth[driver]'].onchange();
|
|||
* @return null
|
||||
*/
|
||||
function databasesPrint($missing) {
|
||||
global $connection;
|
||||
global $adminer, $connection;
|
||||
$databases = $this->databases();
|
||||
?>
|
||||
<form action="">
|
||||
|
@ -821,7 +828,7 @@ username.form['auth[driver]'].onchange();
|
|||
echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
|
||||
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
if (support("scheme")) {
|
||||
echo "<br><select name='ns'$db_events>" . optionlist(array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"]) . "</select>";
|
||||
echo "<br><select name='ns'$db_events>" . optionlist(array("" => "(" . lang('schema') . ")") + $adminer->schemas(), $_GET["ns"]) . "</select>";
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ SQLite: Allow editing primary key
|
|||
SQLite: Allow editing foreign keys
|
||||
PostgreSQL: Fix handling of nextval() default values
|
||||
PostgreSQL: Support creating array columns
|
||||
Customization: Provide schemas()
|
||||
Thai translation
|
||||
|
||||
Adminer 3.7.1 (released 2013-06-29):
|
||||
|
|
|
@ -28,6 +28,10 @@ class Adminer {
|
|||
}
|
||||
}
|
||||
|
||||
function schemas() {
|
||||
return schemas();
|
||||
}
|
||||
|
||||
function databases($flush = true) {
|
||||
return get_databases($flush);
|
||||
}
|
||||
|
|
|
@ -107,6 +107,11 @@ class AdminerPlugin extends Adminer {
|
|||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function schemas() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function databases() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
|
|
Loading…
Reference in a new issue