Edit default values directly in table creation

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@993 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-08-21 16:54:10 +00:00
parent 79ed61b363
commit 4cead5602f
21 changed files with 47 additions and 90 deletions

View file

@ -36,7 +36,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$fields[] = "\n" . (strlen($_GET["create"]) ? (strlen($field["orig"]) ? "CHANGE " . idf_escape($field["orig"]) . " " : "ADD ") : " ") $fields[] = "\n" . (strlen($_GET["create"]) ? (strlen($field["orig"]) ? "CHANGE " . idf_escape($field["orig"]) . " " : "ADD ") : " ")
. idf_escape($field["field"]) . process_type($type_field) . idf_escape($field["field"]) . process_type($type_field)
. ($field["null"] ? " NULL" : " NOT NULL") // NULL for timestamp . ($field["null"] ? " NULL" : " NOT NULL") // NULL for timestamp
. (strlen($_GET["create"]) && strlen($field["orig"]) && isset($orig_fields[$field["orig"]]["default"]) && $field["type"] != "timestamp" ? " DEFAULT " . $dbh->quote($orig_fields[$field["orig"]]["default"]) : "") //! timestamp . (!$field["has_default"] || $field["auto_increment"] || ereg('text|blob', $field["type"]) ? "" : " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP( on update CURRENT_TIMESTAMP)?$", $field["default"]) ? $field["default"] : $dbh->quote($field["default"])))
. ($key == $_POST["auto_increment_col"] ? " AUTO_INCREMENT$auto_increment_index" : "") . ($key == $_POST["auto_increment_col"] ? " AUTO_INCREMENT$auto_increment_index" : "")
. " COMMENT " . $dbh->quote($field["comment"]) . " COMMENT " . $dbh->quote($field["comment"])
. (strlen($_GET["create"]) ? " $after" : "") . (strlen($_GET["create"]) ? " $after" : "")
@ -105,7 +105,14 @@ if ($_POST) {
$row = table_status($_GET["create"]); $row = table_status($_GET["create"]);
table_comment($row); table_comment($row);
$row["name"] = $_GET["create"]; $row["name"] = $_GET["create"];
$row["fields"] = array_values($orig_fields); $row["fields"] = array();
foreach ($orig_fields as $field) {
$field["has_default"] = isset($field["default"]);
if ($field["on_update"]) {
$field["default"] .= " ON UPDATE $field[on_update]"; // CURRENT_TIMESTAMP
}
$row["fields"][] = $field;
}
if ($dbh->server_info >= 5.1) { if ($dbh->server_info >= 5.1) {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . $dbh->quote($_GET["db"]) . " AND TABLE_NAME = " . $dbh->quote($_GET["create"]); $from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . $dbh->quote($_GET["db"]) . " AND TABLE_NAME = " . $dbh->quote($_GET["create"]);
$result = $dbh->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1"); $result = $dbh->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
@ -124,7 +131,7 @@ if ($_POST) {
} }
$collations = collations(); $collations = collations();
$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 8 : 0); $suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 10 : 0); // 10 - number of fields per row, 13 - number of other fields
if ($suhosin && count($row["fields"]) > $suhosin) { if ($suhosin && count($row["fields"]) > $suhosin) {
echo "<p class='error'>" . h(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n"; echo "<p class='error'>" . h(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n";
} }
@ -143,7 +150,8 @@ if ($suhosin && count($row["fields"]) > $suhosin) {
<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo intval($row["Auto_increment"]); ?>"> <?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo intval($row["Auto_increment"]); ?>">
<?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo h($row["Comment"]); ?>" maxlength="60"> <?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo h($row["Comment"]); ?>" maxlength="60">
<script type="text/javascript"> <script type="text/javascript">
document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked<?php } ?> onclick="column_comments_click(this.checked);"><?php echo lang('Show column comments'); ?><\/label>'); document.write('<label><input type="checkbox" onclick="column_show(this.checked, 5);"><?php echo lang('Default values'); ?><\/label>');
document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked<?php } ?> onclick="column_show(this.checked, 6);"><?php echo lang('Show column comments'); ?><\/label>');
</script> </script>
<p> <p>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">

View file

@ -3,14 +3,14 @@ $where = (isset($_GET["select"]) ? "" : where($_GET));
$update = ($where || $_POST["edit"]); $update = ($where || $_POST["edit"]);
$fields = fields($_GET["edit"]); $fields = fields($_GET["edit"]);
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
if ((isset($_GET["default"]) ? $field["auto_increment"] || ereg('text|blob', $field["type"]) : !isset($field["privileges"][$update ? "update" : "insert"])) || !strlen($adminer->fieldName($field))) { if (!isset($field["privileges"][$update ? "update" : "insert"]) || !strlen($adminer->fieldName($field))) {
unset($fields[$name]); unset($fields[$name]);
} }
} }
if ($_POST && !$error && !isset($_GET["select"])) { if ($_POST && !$error && !isset($_GET["select"])) {
$location = $_SERVER["REQUEST_URI"]; // continue edit or insert $location = $_SERVER["REQUEST_URI"]; // continue edit or insert
if (!$_POST["insert"]) { if (!$_POST["insert"]) {
$location = ME . (isset($_GET["default"]) ? "table=" : "select=") . urlencode($_GET["edit"]); $location = ME . "select=" . urlencode($_GET["edit"]);
$i = 0; // append &set converted to &where $i = 0; // append &set converted to &where
foreach ((array) $_GET["set"] as $key => $val) { foreach ((array) $_GET["set"] as $key => $val) {
if ($val == $_POST["fields"][$key]) { if ($val == $_POST["fields"][$key]) {
@ -21,24 +21,14 @@ if ($_POST && !$error && !isset($_GET["select"])) {
$set = array(); $set = array();
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
$val = process_input($field); $val = process_input($field);
if (!isset($_GET["default"])) { if ($val !== false || !$update) {
if ($val !== false || !$update) { $set[] = "\n" . idf_escape($name) . " = " . ($val !== false ? $val : "''");
$set[] = "\n" . idf_escape($name) . " = " . ($val !== false ? $val : "''");
}
} elseif ($val !== false) {
if ($field["type"] == "timestamp" && $val != "NULL") { //! doesn't allow DEFAULT NULL and no ON UPDATE
$set[] = "\nMODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val" . ($_POST["on_update"][bracket_escape($name)] ? " ON UPDATE CURRENT_TIMESTAMP" : "");
} else {
$set[] = "\nALTER " . idf_escape($name) . ($val == "NULL" ? " DROP DEFAULT" : " SET DEFAULT $val");
}
} }
} }
if (!$set) { if (!$set) {
redirect($location); redirect($location);
} }
if (isset($_GET["default"])) { if ($update) {
query_redirect("ALTER TABLE " . idf_escape($_GET["edit"]) . implode(",", $set), $location, lang('Default values have been set.'));
} elseif ($update) {
query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set) . "\nWHERE $where\nLIMIT 1", $location, lang('Item has been updated.')); query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set) . "\nWHERE $where\nLIMIT 1", $location, lang('Item has been updated.'));
} else { } else {
query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set), $location, lang('Item has been inserted.')); query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set), $location, lang('Item has been inserted.'));
@ -47,9 +37,9 @@ if ($_POST && !$error && !isset($_GET["select"])) {
$table_name = $adminer->tableName(table_status($_GET["edit"])); $table_name = $adminer->tableName(table_status($_GET["edit"]));
page_header( page_header(
(isset($_GET["default"]) ? lang('Default values') : ($update ? lang('Edit') : lang('Insert'))), ($update ? lang('Edit') : lang('Insert')),
$error, $error,
array((isset($_GET["default"]) ? "table" : "select") => array($_GET["edit"], $table_name)), array("select" => array($_GET["edit"], $table_name)),
$table_name $table_name
); );
@ -89,14 +79,6 @@ if ($fields) {
} }
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL')))); $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
input($field, $value, $function); input($field, $value, $function);
if (isset($_GET["default"]) && $field["type"] == "timestamp") {
if (!isset($create) && !$_POST) {
//! disable sql_mode NO_FIELD_OPTIONS
$create = $dbh->result($dbh->query("SHOW CREATE TABLE " . idf_escape($_GET["edit"])), 1);
}
$checked = ($_POST ? $_POST["on_update"][bracket_escape($name)] : preg_match("~\n\\s*" . preg_quote(idf_escape($name), '~') . " timestamp.* on update CURRENT_TIMESTAMP~i", $create));
echo '<label><input type="checkbox" name="on_update[' . h(bracket_escape($name)) . ']" value="1"' . ($checked ? ' checked' : '') . '>' . lang('ON UPDATE CURRENT_TIMESTAMP') . '</label>';
}
echo "\n"; echo "\n";
} }
echo "</table>\n"; echo "</table>\n";
@ -111,7 +93,7 @@ if (isset($_GET["select"])) {
} }
if ($fields) { if ($fields) {
echo "<input type='submit' value='" . lang('Save') . "'>\n"; echo "<input type='submit' value='" . lang('Save') . "'>\n";
if (!isset($_GET["default"]) && !isset($_GET["select"])) { if (!isset($_GET["select"])) {
echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n"; echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n";
} }
} }

View file

@ -125,10 +125,10 @@ function editing_type_change(type) {
} }
} }
function column_comments_click(checked) { function column_show(checked, column) {
var trs = document.getElementById('edit-fields').getElementsByTagName('tr'); var trs = document.getElementById('edit-fields').getElementsByTagName('tr');
for (var i=0; i < trs.length; i++) { for (var i=0; i < trs.length; i++) {
trs[i].getElementsByTagName('td')[5].className = (checked ? '' : 'hidden'); trs[i].getElementsByTagName('td')[column].className = (checked ? 'nowrap' : 'hidden');
} }
} }

View file

@ -346,26 +346,24 @@ class Adminer {
*/ */
function editFunctions($field) { function editFunctions($field) {
$return = array(""); $return = array("");
if (!isset($_GET["default"])) { if (ereg('char|date|time', $field["type"])) {
if (ereg('char|date|time', $field["type"])) { $return = (ereg('char', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now")); //! JavaScript for disabling maxlength
$return = (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"])) {
$return = array("", "+", "-");
} }
if (!isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) { if (ereg('date', $field["type"])) {
// relative functions $return[] = "+ interval";
if (ereg('int|float|double|decimal', $field["type"])) { $return[] = "- interval";
$return = array("", "+", "-"); }
} if (ereg('time', $field["type"])) {
if (ereg('date', $field["type"])) { $return[] = "addtime";
$return[] = "+ interval"; $return[] = "subtime";
$return[] = "- interval";
}
if (ereg('time', $field["type"])) {
$return[] = "addtime";
$return[] = "subtime";
}
} }
} }
if ($field["null"] || isset($_GET["default"])) { if ($field["null"]) {
array_unshift($return, "NULL"); array_unshift($return, "NULL");
} }
return $return; return $return;

View file

@ -73,6 +73,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
<?php if ($type == "TABLE") { ?> <?php if ($type == "TABLE") { ?>
<td><?php echo lang('NULL'); ?> <td><?php echo lang('NULL'); ?>
<td><input type="radio" name="auto_increment_col" value=""><?php echo lang('Auto Increment'); ?> <td><input type="radio" name="auto_increment_col" value=""><?php echo lang('Auto Increment'); ?>
<td class="hidden"><?php echo lang('Default values'); ?>
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?> <td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?>
<?php } ?> <?php } ?>
<td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script> <td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
@ -89,6 +90,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
<?php if ($type == "TABLE") { ?> <?php if ($type == "TABLE") { ?>
<td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked<?php } ?>> <td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked<?php } ?>>
<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?>> <td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?>>
<td class="nowrap hidden"><input type="checkbox" name="fields[<?php echo $i; ?>][has_default]" value="1"<?php echo ($field["has_default"] ? " checked" : ""); ?>><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="this.previousSibling.checked = true;">
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo h($field["comment"]); ?>" maxlength="255"> <td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo h($field["comment"]); ?>" maxlength="255">
<?php } ?> <?php } ?>
<?php <?php

View file

@ -287,17 +287,15 @@ function input($field, $value, $function) {
echo "<td class='function'>"; echo "<td class='function'>";
if ($field["type"] == "enum") { if ($field["type"] == "enum") {
echo "&nbsp;<td>" . (isset($_GET["select"]) ? " <label><input type='radio' name='fields[$name]' value='-1' checked><em>" . lang('original') . "</em></label>" : ""); echo "&nbsp;<td>" . (isset($_GET["select"]) ? " <label><input type='radio' name='fields[$name]' value='-1' checked><em>" . lang('original') . "</em></label>" : "");
if ($field["null"] || isset($_GET["default"])) { if ($field["null"]) {
echo " <label><input type='radio' name='fields[$name]' value=''" . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked') . '>' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>'; echo " <label><input type='radio' name='fields[$name]' value=''" . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked') . '>' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
} }
if (!isset($_GET["default"])) { echo "<input type='radio' name='fields[$name]' value='0'" . ($value === 0 ? ' checked' : '') . '>';
echo "<input type='radio' name='fields[$name]' value='0'" . ($value === 0 ? ' checked' : '') . '>';
}
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches); preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) { foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val)); $val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : $value === $val); $checked = (is_int($value) ? $value == $i+1 : $value === $val);
echo " <label><input type='radio' name='fields[$name]' value='" . (isset($_GET["default"]) ? (strlen($val) ? h($val) : " ") : $i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>'; echo " <label><input type='radio' name='fields[$name]' value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
} }
} else { } else {
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field); $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
@ -312,7 +310,7 @@ function input($field, $value, $function) {
foreach ($matches[1] as $i => $val) { foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val)); $val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true)); $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (isset($_GET["default"]) ? h($val) : 1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>'; echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
} }
} elseif (strpos($field["type"], "text") !== false) { } elseif (strpos($field["type"], "text") !== false) {
echo "<textarea name='fields[$name]' cols='50' rows='12'$onchange>" . h($value) . '</textarea>'; echo "<textarea name='fields[$name]' cols='50' rows='12'$onchange>" . h($value) . '</textarea>';
@ -336,9 +334,9 @@ function process_input($field) {
} elseif ($field["type"] == "enum" || $field["auto_increment"] ? !strlen($value) : $function == "NULL") { } elseif ($field["type"] == "enum" || $field["auto_increment"] ? !strlen($value) : $function == "NULL") {
return "NULL"; return "NULL";
} elseif ($field["type"] == "enum") { } elseif ($field["type"] == "enum") {
return (isset($_GET["default"]) ? $dbh->quote($value) : intval($value)); return intval($value);
} elseif ($field["type"] == "set") { } elseif ($field["type"] == "set") {
return (isset($_GET["default"]) ? $dbh->quote(implode(",", (array) $value)) : array_sum((array) $value)); return array_sum((array) $value);
} elseif (ereg('binary|blob', $field["type"])) { } elseif (ereg('binary|blob', $field["type"])) {
$file = get_file($idf); $file = get_file($idf);
if (!is_string($file)) { if (!is_string($file)) {

View file

@ -22,10 +22,6 @@ if (isset($_GET["download"])) {
} elseif (isset($_GET["privileges"])) { } elseif (isset($_GET["privileges"])) {
include "./privileges.inc.php"; include "./privileges.inc.php";
} else { } else {
if (isset($_GET["default"])) {
// edit form is used for default values and distinguished by checking isset($_GET["default"]) in edit.inc.php
$_GET["edit"] = $_GET["default"];
}
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) { if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
$_GET["edit"] = $_GET["select"]; $_GET["edit"] = $_GET["select"];
} }

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Nepodařilo se vypsat tabulku', 'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.', 'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
'Comment' => 'Komentář', 'Comment' => 'Komentář',
'Default values have been set.' => 'Výchozí hodnoty byly nastaveny.',
'Default values' => 'Výchozí hodnoty', 'Default values' => 'Výchozí hodnoty',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Zobrazit komentáře sloupců', 'Show column comments' => 'Zobrazit komentáře sloupců',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s', 'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'), '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas',
'Remove' => 'Odebrat', 'Remove' => 'Odebrat',
'Are you sure?' => 'Opravdu?', 'Are you sure?' => 'Opravdu?',
'Privileges' => 'Oprávnění', 'Privileges' => 'Oprávnění',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Auswahl der Tabelle fehlgeschlagen', 'Unable to select the table' => 'Auswahl der Tabelle fehlgeschlagen',
'Invalid CSRF token. Send the form again.' => 'CSRF Token ungültig. Bitte die Formulardaten erneut abschicken.', 'Invalid CSRF token. Send the form again.' => 'CSRF Token ungültig. Bitte die Formulardaten erneut abschicken.',
'Comment' => 'Kommentar', 'Comment' => 'Kommentar',
'Default values have been set.' => 'Standard Vorgabewerte sind erstellt worden.',
'Default values' => 'Vorgabewerte festlegen', 'Default values' => 'Vorgabewerte festlegen',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Spaltenkommentare zeigen', 'Show column comments' => 'Spaltenkommentare zeigen',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s', 'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s',
'%d row(s)' => array('%d Datensatz', '%d Datensätze'), '%d row(s)' => array('%d Datensatz', '%d Datensätze'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Entfernen', 'Remove' => 'Entfernen',
'Are you sure?' => 'Sind Sie sicher ?', 'Are you sure?' => 'Sind Sie sicher ?',
'Privileges' => 'Rechte', 'Privileges' => 'Rechte',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'No posible seleccionar la tabla', 'Unable to select the table' => 'No posible seleccionar la tabla',
'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Vuelva a enviar los datos del formulario.', 'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Vuelva a enviar los datos del formulario.',
'Comment' => 'Comentario', 'Comment' => 'Comentario',
'Default values have been set.' => 'Valores predeterminados establecidos.',
'Default values' => 'Valores predeterminados', 'Default values' => 'Valores predeterminados',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Mostrar comentario de columnas', 'Show column comments' => 'Mostrar comentario de columnas',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s', 'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s',
'%d row(s)' => array('%d registro', '%d registros'), '%d row(s)' => array('%d registro', '%d registros'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Eliminar', 'Remove' => 'Eliminar',
'Are you sure?' => 'Está seguro?', 'Are you sure?' => 'Está seguro?',
'Privileges' => 'Privilegios', 'Privileges' => 'Privilegios',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Tabeli valimine ebaõnnestus', 'Unable to select the table' => 'Tabeli valimine ebaõnnestus',
'Invalid CSRF token. Send the form again.' => 'Sobimatu CSRF, palun postitage vorm uuesti.', 'Invalid CSRF token. Send the form again.' => 'Sobimatu CSRF, palun postitage vorm uuesti.',
'Comment' => 'Kommentaar', 'Comment' => 'Kommentaar',
'Default values have been set.' => 'Vaimimisi väärtused on edukalt määratud.',
'Default values' => 'Vaikimisi väärtused', 'Default values' => 'Vaikimisi väärtused',
'BOOL' => 'Jah/Ei (BOOL)', 'BOOL' => 'Jah/Ei (BOOL)',
'Show column comments' => 'Kuva veeru kommentaarid', 'Show column comments' => 'Kuva veeru kommentaarid',
@ -133,7 +132,6 @@ $translations = array(
'Event' => 'Sündmus', 'Event' => 'Sündmus',
'%d row(s)' => array('%d rida', '%d rida'), '%d row(s)' => array('%d rida', '%d rida'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Eemalda', 'Remove' => 'Eemalda',
'Are you sure?' => 'Kas oled kindel?', 'Are you sure?' => 'Kas oled kindel?',
'Privileges' => 'Õigused', 'Privileges' => 'Õigused',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Impossible de sélectionner la table', 'Unable to select the table' => 'Impossible de sélectionner la table',
'Invalid CSRF token. Send the form again.' => 'Token CSRF invalide. Veuillez réenvoyer le formulaire.', 'Invalid CSRF token. Send the form again.' => 'Token CSRF invalide. Veuillez réenvoyer le formulaire.',
'Comment' => 'Commentaire', 'Comment' => 'Commentaire',
'Default values have been set.' => 'Valeur par défaut établie .',
'Default values' => 'Valeurs par défaut', 'Default values' => 'Valeurs par défaut',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Voir les commentaires sur les colonnes', 'Show column comments' => 'Voir les commentaires sur les colonnes',
@ -133,7 +132,6 @@ $translations = array(
'Event' => 'Évènement', 'Event' => 'Évènement',
'%d row(s)' => array('%d ligne', '%d lignes'), '%d row(s)' => array('%d ligne', '%d lignes'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Effacer', 'Remove' => 'Effacer',
'Are you sure?' => 'Êtes-vous certain?', 'Are you sure?' => 'Êtes-vous certain?',
'Privileges' => 'Privilège', 'Privileges' => 'Privilège',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Selezione della tabella non riuscita', 'Unable to select the table' => 'Selezione della tabella non riuscita',
'Invalid CSRF token. Send the form again.' => 'Token CSRF non valido. Reinvia la richiesta.', 'Invalid CSRF token. Send the form again.' => 'Token CSRF non valido. Reinvia la richiesta.',
'Comment' => 'Commento', 'Comment' => 'Commento',
'Default values have been set.' => 'Valore predefinito impostato.',
'Default values' => 'Valori predefiniti', 'Default values' => 'Valori predefiniti',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Mostra i commenti delle colonne', 'Show column comments' => 'Mostra i commenti delle colonne',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s', 'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s',
'%d row(s)' => array('%d riga', '%d righe'), '%d row(s)' => array('%d riga', '%d righe'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Rimuovi', 'Remove' => 'Rimuovi',
'Are you sure?' => 'Sicuro?', 'Are you sure?' => 'Sicuro?',
'Privileges' => 'Privilegi', 'Privileges' => 'Privilegi',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Onmogelijk tabel te selecteren', 'Unable to select the table' => 'Onmogelijk tabel te selecteren',
'Invalid CSRF token. Send the form again.' => 'Ongeldig CSRF token. Verstuur het formulier opnieuw.', 'Invalid CSRF token. Send the form again.' => 'Ongeldig CSRF token. Verstuur het formulier opnieuw.',
'Comment' => 'Commentaar', 'Comment' => 'Commentaar',
'Default values have been set.' => 'Standaard waarde ingesteld.',
'Default values' => 'Standaard waarden', 'Default values' => 'Standaard waarden',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Kolomcommentaar weergeven', 'Show column comments' => 'Kolomcommentaar weergeven',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s', 'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s',
'%d row(s)' => array('%d rij', '%d rijen'), '%d row(s)' => array('%d rij', '%d rijen'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Verwijderen', 'Remove' => 'Verwijderen',
'Are you sure?' => 'Weet u het zeker?', 'Are you sure?' => 'Weet u het zeker?',
'Privileges' => 'Rechten', 'Privileges' => 'Rechten',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Не удалось получить данные из таблицы', 'Unable to select the table' => 'Не удалось получить данные из таблицы',
'Invalid CSRF token. Send the form again.' => 'Недействительный CSRF токен. Отправите форму ещё раз.', 'Invalid CSRF token. Send the form again.' => 'Недействительный CSRF токен. Отправите форму ещё раз.',
'Comment' => 'Комментарий', 'Comment' => 'Комментарий',
'Default values have been set.' => 'Были установлены значения по умолчанию.',
'Default values' => 'Значения по умолчанию', 'Default values' => 'Значения по умолчанию',
'BOOL' => 'Булев тип', 'BOOL' => 'Булев тип',
'Show column comments' => 'Показать комментарии к колонке', 'Show column comments' => 'Показать комментарии к колонке',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Версия MySQL: %s с PHP-расширением %s', 'MySQL version: %s through PHP extension %s' => 'Версия MySQL: %s с PHP-расширением %s',
'%d row(s)' => array('%d строка', '%d строки', '%d строк'), '%d row(s)' => array('%d строка', '%d строки', '%d строк'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ПРИ ИЗМЕНЕНИИ ТЕКУЩЕГО TIMESTAMP',
'Remove' => 'Удалить', 'Remove' => 'Удалить',
'Are you sure?' => 'Вы уверены?', 'Are you sure?' => 'Вы уверены?',
'Privileges' => 'Полномочия', 'Privileges' => 'Полномочия',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => 'Tabuľku sa nepodarilo vypísať', 'Unable to select the table' => 'Tabuľku sa nepodarilo vypísať',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odošlite formulár znova.', 'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odošlite formulár znova.',
'Comment' => 'Komentár', 'Comment' => 'Komentár',
'Default values have been set.' => 'Východzie hodnoty boli nastavené.',
'Default values' => 'Východzie hodnoty', 'Default values' => 'Východzie hodnoty',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => 'Zobraziť komentáre stĺpcov', 'Show column comments' => 'Zobraziť komentáre stĺpcov',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s', 'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s',
'%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'), '%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'),
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'Pri zmene aktuálny čas',
'Remove' => 'Odobrať', 'Remove' => 'Odobrať',
'Are you sure?' => 'Naozaj?', 'Are you sure?' => 'Naozaj?',
'Privileges' => 'Oprávnenia', 'Privileges' => 'Oprávnenia',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => '無法選擇該資料表', 'Unable to select the table' => '無法選擇該資料表',
'Invalid CSRF token. Send the form again.' => '無效的 CSRF token。請重新發送表單。', 'Invalid CSRF token. Send the form again.' => '無效的 CSRF token。請重新發送表單。',
'Comment' => '註解', 'Comment' => '註解',
'Default values have been set.' => '預設值已設置。',
'Default values' => '預設值', 'Default values' => '預設值',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => '顯示列註解', 'Show column comments' => '顯示列註解',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'MySQL版本%s 透過PHP擴充模組 %s', 'MySQL version: %s through PHP extension %s' => 'MySQL版本%s 透過PHP擴充模組 %s',
'%d row(s)' => '%d行', '%d row(s)' => '%d行',
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => '移除', 'Remove' => '移除',
'Are you sure?' => '你確定嗎?', 'Are you sure?' => '你確定嗎?',
'Privileges' => '權限', 'Privileges' => '權限',

View file

@ -72,7 +72,6 @@ $translations = array(
'Unable to select the table' => '不能选择该表', 'Unable to select the table' => '不能选择该表',
'Invalid CSRF token. Send the form again.' => '无效 CSRF 令牌。重新发送表单。', 'Invalid CSRF token. Send the form again.' => '无效 CSRF 令牌。重新发送表单。',
'Comment' => '注释', 'Comment' => '注释',
'Default values have been set.' => '默认值已设置。',
'Default values' => '默认值', 'Default values' => '默认值',
'BOOL' => 'BOOL', 'BOOL' => 'BOOL',
'Show column comments' => '显示列注释', 'Show column comments' => '显示列注释',
@ -134,7 +133,6 @@ $translations = array(
'MySQL version: %s through PHP extension %s' => 'MySQL 版本:%s 通过 PHP 扩展 %s', 'MySQL version: %s through PHP extension %s' => 'MySQL 版本:%s 通过 PHP 扩展 %s',
'%d row(s)' => '%d 行', '%d row(s)' => '%d 行',
'~ %s' => '~ %s', '~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => '移除', 'Remove' => '移除',
'Are you sure?' => '你确定吗?', 'Are you sure?' => '你确定吗?',
'Privileges' => '权限', 'Privileges' => '权限',

View file

@ -9,13 +9,9 @@ $is_view = !isset($table_status["Rows"]);
page_header(($result && $is_view ? lang('View') : lang('Table')) . ": " . h($_GET["table"]), $error); page_header(($result && $is_view ? lang('View') : lang('Table')) . ": " . h($_GET["table"]), $error);
if ($result) { if ($result) {
$auto_increment_only = true;
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . "<td>" . lang('Comment') . "</thead>\n"; echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . "<td>" . lang('Comment') . "</thead>\n";
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
if (!$row["auto_increment"]) {
$auto_increment_only = false;
}
echo "<tr><th>" . h($row["Field"]); echo "<tr><th>" . h($row["Field"]);
echo "<td>" . h($row["Type"]) . ($row["Null"] == "YES" ? " <i>NULL</i>" : ""); echo "<td>" . h($row["Type"]) . ($row["Null"] == "YES" ? " <i>NULL</i>" : "");
echo "<td>" . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : "&nbsp;"); echo "<td>" . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : "&nbsp;");
@ -29,7 +25,6 @@ if ($result) {
echo '<a href="' . h(ME) . 'view=' . urlencode($_GET["table"]) . '">' . lang('Alter view') . '</a>'; echo '<a href="' . h(ME) . 'view=' . urlencode($_GET["table"]) . '">' . lang('Alter view') . '</a>';
} else { } else {
echo '<a href="' . h(ME) . 'create=' . urlencode($_GET["table"]) . '">' . lang('Alter table') . '</a>'; echo '<a href="' . h(ME) . 'create=' . urlencode($_GET["table"]) . '">' . lang('Alter table') . '</a>';
echo ($auto_increment_only ? '' : ' <a href="' . h(ME) . 'default=' . urlencode($_GET["table"]) . '">' . lang('Default values') . '</a>');
} }
echo ' <a href="' . h(ME) . 'select=' . urlencode($_GET["table"]) . '">' . lang('Select table') . '</a>'; echo ' <a href="' . h(ME) . 'select=' . urlencode($_GET["table"]) . '">' . lang('Select table') . '</a>';
echo ' <a href="' . h(ME) . 'edit=' . urlencode($_GET["table"]) . '">' . lang('New item') . '</a>'; echo ' <a href="' . h(ME) . 'edit=' . urlencode($_GET["table"]) . '">' . lang('New item') . '</a>';

View file

@ -1,4 +1,5 @@
Adminer 2.0.1: Adminer 2.1.0:
Edit default values directly in table creation
Display column comments in table overview Display column comments in table overview
Respect max_allowed_packet in CSV import Respect max_allowed_packet in CSV import
Fix Editor date format Fix Editor date format

View file

@ -9,7 +9,6 @@ Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.ph
Highlight SQL textarea - may use external CodePress Highlight SQL textarea - may use external CodePress
Mass editation of individual rows Mass editation of individual rows
IE6 - <label for> IE6 - <label for>
Edit default values directly in table creation
Offer enum and set items in search - whisperer Offer enum and set items in search - whisperer
Use event $intervals + microseconds in relative date functions Use event $intervals + microseconds in relative date functions
Table status cache - SHOW TABLE STATUS is slow with big InnoDB tables Table status cache - SHOW TABLE STATUS is slow with big InnoDB tables