diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index cd774df8..25f0d4c6 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -101,7 +101,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute $id = "sql-" . count($_SESSION["messages"]); $sql = ""; if ($query) { - $sql = " " . lang('SQL command') . "'; + $sql = " " . lang('SQL command') . "'; $_SESSION["history"][$_GET["server"]][$_GET["db"]][] = $query; } if ($execute) { @@ -230,9 +230,9 @@ function is_utf8($val) { return (preg_match('~~u', $val) && !preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~', $val)); } -function shorten_utf8($string, $length) { +function shorten_utf8($string, $length = 80, $suffix = "") { preg_match("~^(.{0,$length})(.?)~su", $string, $match); - return htmlspecialchars($match[1]) . ($match[2] ? "..." : ""); + return htmlspecialchars($match[1]) . $suffix . ($match[2] ? "..." : ""); } function friendly_url($val) { diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 6155aee0..5e546868 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -57,7 +57,6 @@ $translations = array( 'Select' => 'Vypsat', 'New item' => 'Nová položka', 'Search' => 'Vyhledat', - 'Sort' => 'Setřídit', 'ASC' => 'vzestupně', 'DESC' => 'sestupně', 'Limit' => 'Limit', @@ -196,7 +195,6 @@ $translations = array( 'Move' => 'Přesunout', 'Engine' => 'Úložiště', 'Save and continue edit' => 'Uložit a pokračovat v editaci', - 'clone' => 'klonovat', 'original' => 'původní', '%d item(s) have been affected.' => array('Byl ovlivněn %d záznam.', 'Byly ovlivněny %d záznamy.', 'Bylo ovlivněno %d záznamů.'), 'whole result' => 'celý výsledek', @@ -215,4 +213,5 @@ $translations = array( 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.', '(anywhere)' => '(kdekoliv)', '%.3f s' => '%.3f s', + 'History' => 'Historie', ); diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 8e5b81af..1eca30b9 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -1,10 +1,14 @@ " . shorten_utf8(trim(substr($query, 0, $match[0][1])), 100) . "\n"; + echo "
" . shorten_utf8(trim(substr($query, 0, $match[0][1]))) . "
\n"; flush(); $start = explode(" ", microtime()); //! don't allow changing of character_set_results, convert encoding of displayed query @@ -79,5 +83,16 @@ if (!ini_get("file_uploads")) {

+ +" . lang('History') . "\n"; + foreach ($history as $key => $val) { + echo '' . lang('Edit') . ' ' . shorten_utf8(str_replace("\n", " ", $val), 80, "") . "
\n"; + } + echo "\n"; +} +?> + diff --git a/changes.txt b/changes.txt index 468c77fd..4af05f9b 100644 --- a/changes.txt +++ b/changes.txt @@ -4,7 +4,7 @@ Simplify export Display execution time in SQL query Relative date and time functions Version checker -Save queries to history +Save queries to history and display it on SQL page Ability to select all rows on current page of select Separate JavaScript functions Always use the default style before the external one diff --git a/todo.txt b/todo.txt index be71d5c0..37329c0f 100644 --- a/todo.txt +++ b/todo.txt @@ -5,7 +5,6 @@ MySQL 5 BIT data type Transactions in export Compress export and import Create view and routine options -Visualize SQL queries history Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.php Utilize information_schema.USER_PRIVILEGES in Privileges Highlight SQL textarea - may use external CodePress