Permalink
Browse files

Add Delete button to Edit page (revert r887)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1265 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent d545dad commit 75f99584346cedaeb60664a19bf08673f55c97cb jakubvrana committed Dec 14, 2009
View
@@ -19,22 +19,26 @@
}
}
}
- $set = array();
- foreach ($fields as $name => $field) {
- $val = process_input($field);
- if (!$update) {
- $set[idf_escape($name)] = ($val !== false ? $val : "''");
- } elseif ($val !== false) {
- $set[] = "\n" . idf_escape($name) . " = $val";
- }
- }
- if (!$set) {
- redirect($location);
- }
- if ($update) {
- query_redirect("UPDATE " . idf_escape($TABLE) . " SET" . implode(",", $set) . "\nWHERE $where\nLIMIT 1", $location, lang('Item has been updated.'));
+ if (isset($_POST["delete"])) {
+ query_redirect("DELETE FROM " . idf_escape($_GET["edit"]) . " WHERE $where LIMIT 1", $location, lang('Item has been deleted.'));
} else {
- query_redirect("INSERT INTO " . idf_escape($TABLE) . " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")", $location, lang('Item has been inserted.'));
+ $set = array();
+ foreach ($fields as $name => $field) {
+ $val = process_input($field);
+ if (!$update) {
+ $set[idf_escape($name)] = ($val !== false ? $val : "''");
+ } elseif ($val !== false) {
+ $set[] = "\n" . idf_escape($name) . " = $val";
+ }
+ }
+ if (!$set) {
+ redirect($location);
+ }
+ if ($update) {
+ query_redirect("UPDATE " . idf_escape($TABLE) . " SET" . implode(",", $set) . "\nWHERE $where\nLIMIT 1", $location, lang('Item has been updated.'));
+ } else {
+ query_redirect("INSERT INTO " . idf_escape($TABLE) . " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")", $location, lang('Item has been inserted.'));
+ }
}
}
@@ -103,5 +107,8 @@
echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n";
}
}
+if ($update) {
+ echo "<input type='submit' name='delete' value='" . lang('Delete') . "'$confirm>\n";
+}
?>
</form>
View
@@ -37,6 +37,7 @@
'No tables.' => 'Žádné tabulky.',
'select' => 'vypsat',
'Create new table' => 'Vytvořit novou tabulku',
+ 'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
'Item has been inserted.' => 'Položka byla vložena.',
'Edit' => 'Upravit',
View
@@ -37,6 +37,7 @@
'No tables.' => 'Keine Tabellen.',
'select' => 'zeigen',
'Create new table' => 'Neue Tabelle',
+ 'Item has been deleted.' => 'Datensatz gelöscht.',
'Item has been updated.' => 'Datensatz geändert.',
'Item has been inserted.' => 'Datensatz hinzugefügt.',
'Edit' => 'Ändern',
View
@@ -37,6 +37,7 @@
'No tables.' => 'No existen tablas.',
'select' => 'registros',
'Create new table' => 'Nueva tabla',
+ 'Item has been deleted.' => 'Registro eliminado.',
'Item has been updated.' => 'Registro modificado.',
'Item has been inserted.' => 'Registro insertado.',
'Edit' => 'Modificar',
View
@@ -37,6 +37,7 @@
'No tables.' => 'Tabeleid ei leitud.',
'select' => 'kuva',
'Create new table' => 'Loo uus tabel',
+ 'Item has been deleted.' => 'Kustutamine õnnestus.',
'Item has been updated.' => 'Uuendamine õnnestus.',
'Item has been inserted.' => 'Lisamine õnnestus.',
'Edit' => 'Muuda',
View
@@ -37,6 +37,7 @@
'No tables.' => 'Aucunes tables.',
'select' => 'select',
'Create new table' => 'Créer une table',
+ 'Item has been deleted.' => 'Élément supprimé.',
'Item has been updated.' => 'Élément modifié.',
'Item has been inserted.' => 'Élément inseré.',
'Edit' => 'Modifier',
View
@@ -37,6 +37,7 @@
'No tables.' => 'No tabelle.',
'select' => 'seleziona',
'Create new table' => 'Crea nuova tabella',
+ 'Item has been deleted.' => 'Elemento eliminato.',
'Item has been updated.' => 'Elemento aggiornato.',
'Item has been inserted.' => 'Elemento inserito.',
'Edit' => 'Modifica',
View
@@ -37,6 +37,7 @@
'No tables.' => 'Geen tabellen.',
'select' => 'kies',
'Create new table' => 'Nieuwe tabel',
+ 'Item has been deleted.' => 'Item verwijderd.',
'Item has been updated.' => 'Item aangepast.',
'Item has been inserted.' => 'Item toegevoegd.',
'Edit' => 'Bewerk',
View
@@ -37,6 +37,7 @@
'No tables.' => 'В базе данных нет таблиц.',
'select' => 'выбрать',
'Create new table' => 'Создать новую таблицу',
+ 'Item has been deleted.' => 'Запись удалена.',
'Item has been updated.' => 'Запись обновлена.',
'Item has been inserted.' => 'Запись вставлена.',
'Edit' => 'Редактировать',
View
@@ -37,6 +37,7 @@
'No tables.' => 'Žiadne tabuľky.',
'select' => 'vypísať',
'Create new table' => 'Vytvoriť novú tabuľku',
+ 'Item has been deleted.' => 'Položka bola vymazaná.',
'Item has been updated.' => 'Položka bola aktualizovaná.',
'Item has been inserted.' => 'Položka bola vložená.',
'Edit' => 'Upraviť',
View
@@ -37,6 +37,7 @@
'No tables.' => '没有表。',
'select' => '选择',
'Create new table' => '创建新表',
+ 'Item has been deleted.' => '已删除项目。',
'Item has been updated.' => '已更新项目。',
'Item has been inserted.' => '已插入项目。',
'Edit' => '编辑',
View
@@ -1,3 +1,6 @@
+Adminer 2.2.2-dev:
+Add Delete button to Edit page (regression from 2.0.0)
+
Adminer 2.2.1 (released 2009-11-26):
Highlight current links
Improve concurrency

0 comments on commit 75f9958

Please sign in to comment.