Clear history (thanks to paranoiq)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@850 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-07-17 13:53:10 +00:00
parent 4a014a6d69
commit 5a0d809cb9
2 changed files with 8 additions and 1 deletions

View file

@ -229,4 +229,5 @@ $translations = array(
'Lists' => 'Seznamy',
'Relations' => 'Vztahy',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Clear' => 'Vyčistit',
);

View file

@ -1,6 +1,11 @@
<?php
page_header(lang('SQL command'), $error);
$history = &$_SESSION["history"][$_GET["server"]][$_GET["db"]];
if (!$error && $_POST["clear"]) {
$history = array();
redirect(remove_from_uri("history"));
}
page_header(lang('SQL command'), $error);
if (!$error && $_POST) {
$query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]);
@ -93,6 +98,7 @@ if ($history) {
//! save and display timestamp
echo '<a href="' . htmlspecialchars($SELF . "sql=&history=$key") . '">' . lang('Edit') . '</a> <code class="jush-sql">' . shorten_utf8(str_replace("\n", " ", $val), 80, "</code>") . "<br>\n";
}
echo "<input type='submit' name='clear' value='" . lang('Clear') . "'>\n";
echo "</fieldset>\n";
}
?>