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

Hide edit functions in Editor

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@881 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-23 11:31:08 +00:00
parent 61778f5790
commit 492123506b
3 changed files with 36 additions and 23 deletions

View File

@@ -286,29 +286,7 @@ function input($name, $field, $value, $function) {
} else {
$first = ($field["null"] || isset($_GET["default"])) + isset($_GET["select"]);
$onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : '');
$options = array("");
if (!isset($_GET["default"])) {
if (ereg('char|date|time', $field["type"])) {
$options = (ereg('char', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now")); //! JavaScript for disabling maxlength
}
if (!isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) {
// relative functions
if (ereg('int|float|double|decimal', $field["type"])) {
$options = array("", "+", "-");
}
if (ereg('date', $field["type"])) {
$options[] = "+ interval";
$options[] = "- interval";
}
if (ereg('time', $field["type"])) {
$options[] = "addtime";
$options[] = "subtime";
}
}
}
if ($field["null"] || isset($_GET["default"])) {
array_unshift($options, "NULL");
}
$options = adminer_edit_functions($field);
echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') : '') . optionlist($options, $function) . '</select>' : "&nbsp;") . '<td>';
if ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);