1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

Hide routine language if not required

This commit is contained in:
Jakub Vrana
2011-06-04 03:37:43 +02:00
parent 04127bcbf5
commit bf0c626224
3 changed files with 8 additions and 3 deletions

View File

@@ -768,7 +768,7 @@ if (!defined("DRIVER")) {
* @return array
*/
function routine_languages() {
return array("SQL");
return array(); // "SQL" not required
}
/** Begin transaction

View File

@@ -475,6 +475,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
// not supported by SQLite
}
function routine_languages() {
// not supported by SQLite
}
function begin() {
return queries("BEGIN");
}

View File

@@ -1,6 +1,7 @@
<?php
$PROCEDURE = $_GET["procedure"];
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
$routine_languages = routine_languages();
$dropped = false;
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(
"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),
lang('Routine has been dropped.'),
lang('Routine has been altered.'),
@@ -40,7 +41,7 @@ if ($_POST) {
<form action="" method="post" id="form">
<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">
<?php
edit_fields($row["fields"], $collations, $routine);