mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 16:17:48 +02:00
Hide routine language if not required
This commit is contained in:
@@ -768,7 +768,7 @@ if (!defined("DRIVER")) {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function routine_languages() {
|
function routine_languages() {
|
||||||
return array("SQL");
|
return array(); // "SQL" not required
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Begin transaction
|
/** Begin transaction
|
||||||
|
@@ -475,6 +475,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
|||||||
// not supported by SQLite
|
// not supported by SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function routine_languages() {
|
||||||
|
// not supported by SQLite
|
||||||
|
}
|
||||||
|
|
||||||
function begin() {
|
function begin() {
|
||||||
return queries("BEGIN");
|
return queries("BEGIN");
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$PROCEDURE = $_GET["procedure"];
|
$PROCEDURE = $_GET["procedure"];
|
||||||
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
|
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
|
||||||
|
$routine_languages = routine_languages();
|
||||||
|
|
||||||
$dropped = false;
|
$dropped = false;
|
||||||
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) {
|
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) {
|
||||||
@@ -14,7 +15,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
|
|||||||
}
|
}
|
||||||
$dropped = drop_create(
|
$dropped = drop_create(
|
||||||
"DROP $routine " . idf_escape($PROCEDURE),
|
"DROP $routine " . idf_escape($PROCEDURE),
|
||||||
"CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . (in_array($_POST["language"], routine_languages()) ? " LANGUAGE $_POST[language]" : "") . rtrim("\n$_POST[definition]", ";") . ";",
|
"CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . (in_array($_POST["language"], $routine_languages) ? " LANGUAGE $_POST[language]" : "") . rtrim("\n$_POST[definition]", ";") . ";",
|
||||||
substr(ME, 0, -1),
|
substr(ME, 0, -1),
|
||||||
lang('Routine has been dropped.'),
|
lang('Routine has been dropped.'),
|
||||||
lang('Routine has been altered.'),
|
lang('Routine has been altered.'),
|
||||||
@@ -40,7 +41,7 @@ if ($_POST) {
|
|||||||
|
|
||||||
<form action="" method="post" id="form">
|
<form action="" method="post" id="form">
|
||||||
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
|
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
|
||||||
<?php echo lang('Language'); ?>: <?php echo html_select("language", routine_languages(), $row["language"]); ?>
|
<?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) : ""); ?>
|
||||||
<table cellspacing="0" class="nowrap">
|
<table cellspacing="0" class="nowrap">
|
||||||
<?php
|
<?php
|
||||||
edit_fields($row["fields"], $collations, $routine);
|
edit_fields($row["fields"], $collations, $routine);
|
||||||
|
Reference in New Issue
Block a user