From 0311083b49e6a94bac2eef4553679874a27a167b Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 13:28:43 +0200 Subject: [PATCH 01/61] Comment --- adminer/static/editing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/static/editing.js b/adminer/static/editing.js index b03a414c..a3464248 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -48,7 +48,7 @@ function selectValue(select) { * @return HTMLElement */ function formField(form, name) { - // required in old IE, maybe can be rewritten as form.elements[name] + // required in IE < 8, form.elements[name] doesn't work for (var i=0; i < form.length; i++) { if (form[i].name == name) { return form[i]; From 84d9ecf0c9e32bee27a6c07cb2f77ecb62bc1f07 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 16:54:48 +0200 Subject: [PATCH 02/61] Highlight and edit SQL command in processlist --- adminer/processlist.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adminer/processlist.inc.php b/adminer/processlist.inc.php index 7cde43ce..7f773d34 100644 --- a/adminer/processlist.inc.php +++ b/adminer/processlist.inc.php @@ -19,7 +19,11 @@ foreach (get_rows("SHOW FULL PROCESSLIST") as $i => $row) { if (!$i) { echo " " . implode("", array_keys($row)) . "\n"; } - echo "" . checkbox("kill[]", $row["Id"], 0) . "" . implode("", array_map('nbsp', $row)) . "\n"; + echo "" . checkbox("kill[]", $row["Id"], 0); + foreach ($row as $key => $val) { + echo "" . ($key == "Info" ? "" . nbsp($val) . ' ' . lang('Edit') . '' : nbsp($val)); + } + echo "\n"; } ?> From 9d47d1e64d873537859715d3bf42509dba9e9471 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 17:29:27 +0200 Subject: [PATCH 03/61] Whitespace --- adminer/include/adminer.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index c0c0a011..ce13b8ca 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -524,13 +524,13 @@ document.getElementById('username').focus();

" . bold(lang('SQL command'), isset($_GET["sql"])) . "\n"; - if (support("dump")) { - echo "" . bold(lang('Dump'), isset($_GET["dump"])) . "\n"; - } -} -?> + if (DB == "" || !$missing) { + echo "" . bold(lang('SQL command'), isset($_GET["sql"])) . "\n"; + if (support("dump")) { + echo "" . bold(lang('Dump'), isset($_GET["dump"])) . "\n"; + } + } + ?>

From 8e02d5dfd36ceab69b6352e29e1612c13c1d2cf3 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 17:46:28 +0200 Subject: [PATCH 04/61] Update TODO --- todo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.txt b/todo.txt index 611ed1b4..c3db91c7 100644 --- a/todo.txt +++ b/todo.txt @@ -13,7 +13,7 @@ Double click in select - Esc to abort editation XML export ? Filter by value in row under in select ? Column and table names auto-completition in SQL textarea -? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB +? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query can save 24 B, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB ? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB Editor: From 97344335e7155b317fb6dca6f61313a5dfe1f34a Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 10:19:11 +0200 Subject: [PATCH 05/61] Improve favicon (thanks to tiso) --- adminer/static/favicon.ico | Bin 318 -> 318 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/adminer/static/favicon.ico b/adminer/static/favicon.ico index ab736cafd0ca9b3d2216b63a1f265197c2f4f971..5d60d20807115abcbea04283382c6c5c618c6a88 100644 GIT binary patch delta 76 zcmdnTw2x`Rer981E2sZ*TP#*w8h9r;x From cb153ac0d1212c561ccfe30e7908910b6f5f4c49 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 12:40:27 +0200 Subject: [PATCH 06/61] Auto-focus database name --- adminer/database.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adminer/database.inc.php b/adminer/database.inc.php index 83e7ffb3..e0d91003 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -57,10 +57,11 @@ if ($_POST) {

' . h($name) . '
' - : '' + ? '
' + : '' ) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : ""); ?> + Date: Wed, 20 Oct 2010 22:27:51 +0200 Subject: [PATCH 07/61] Uses own XSS protection --- adminer/include/adminer.inc.php | 1 + editor/include/adminer.inc.php | 1 + 2 files changed, 2 insertions(+) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index ce13b8ca..e314b593 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -37,6 +37,7 @@ class Adminer { */ function headers() { header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin + header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page } /** Print login form diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 71209989..501fb935 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -28,6 +28,7 @@ class Adminer { function headers() { header("X-Frame-Options: deny"); + header("X-XSS-Protection: 0"); } function loginForm() { From c1363a6ae4de1817a0c008008cdf51cab3f38414 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 22:44:06 +0200 Subject: [PATCH 08/61] Update translation --- adminer/lang/ca.inc.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/adminer/lang/ca.inc.php b/adminer/lang/ca.inc.php index 6ba91fd4..6a961552 100644 --- a/adminer/lang/ca.inc.php +++ b/adminer/lang/ca.inc.php @@ -9,8 +9,8 @@ $translations = array( 'Select database' => 'Selecciona base de dades', 'Invalid database.' => 'Base de dades invàlida.', 'Create new database' => 'Crea una nova base de dades', - 'Table has been dropped.' => 'S\'ha creat la taula.', - 'Table has been altered.' => 'S\'ha creat la taula.', + 'Table has been dropped.' => 'S\'ha suprimit la taula.', + 'Table has been altered.' => 'S\'ha modificat la taula.', 'Table has been created.' => 'S\'ha creat la taula.', 'Alter table' => 'Modifica la taula', 'Create table' => 'Crea una taula', @@ -35,8 +35,8 @@ $translations = array( 'Logout' => 'Desconnecta', 'database' => 'base de dades', 'Use' => 'Utilitza', - 'No tables.' => 'Cap taula.', - 'select' => 'escull', + 'No tables.' => 'No hi ha cap taula.', + 'select' => 'registres', 'Create new table' => 'Crea una nova taula', 'Item has been deleted.' => 'S\'ha suprmit l\'element.', 'Item has been updated.' => 'S\'ha actualitzat l\'element.', @@ -52,7 +52,7 @@ $translations = array( 'Alter indexes' => 'Modifica els índexs', 'Add next' => 'Afegeix el següent', 'Language' => 'Idioma', - 'Select' => 'Escull', + 'Select' => 'Selecciona', 'New item' => 'Nou element', 'Search' => 'Cerca', 'Sort' => 'Ordena', @@ -129,7 +129,7 @@ $translations = array( 'Event' => 'Event', '%s version: %s through PHP extension %s' => 'Versió %s: %s amb l\'extensió de PHP %s', '%d row(s)' => array('%d fila', '%d files'), - 'Remove' => 'Esborra', + 'Remove' => 'Suprimeix', 'Are you sure?' => 'Estàs segur?', 'Privileges' => 'Privilegis', 'Create user' => 'Crea un usuari', @@ -198,13 +198,13 @@ $translations = array( 'CSV Import' => 'Importa CSV', 'Import' => 'Importa', 'Show structure' => 'Mostra l\'estructura', - 'Select data' => 'Escull dades', + 'Select data' => 'Selecciona dades', 'Stop on error' => 'Atura en trobar un error', 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'S\'ha assolit el nombre màxim de camps. Incrementa %s i %s.', 'anywhere' => 'a qualsevol lloc', '%.3f s' => '%.3f s', '$1-$3-$5' => '$5/$3/$1', - '[yyyy]-mm-dd' => 'dd-mm-[aaaa]', + '[yyyy]-mm-dd' => 'dd/mm/[aaaa]', 'History' => 'Història', 'Variables' => 'Variables', 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les columnes origen i destí han de ser del mateix tipus, la columna destí ha d\'estar indexada i les dades referenciades han d\'existir.', @@ -215,13 +215,13 @@ $translations = array( '%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'), 'Run file' => 'Executa el fitxer', 'Numbers' => 'Nombres', - 'Date and time' => 'Data i temps', + 'Date and time' => 'Data i hora', 'Strings' => 'Cadenes', 'Binary' => 'Binari', 'Lists' => 'Llistes', 'Relations' => 'Relacions', 'Maximum allowed file size is %sB.' => 'La mida màxima permesa del fitxer és de %sB.', - 'Clear' => 'Esborra', + 'Clear' => 'Suprimeix', 'Editor' => 'Editor', 'Webserver file %s' => 'Fitxer %s del servidor web', 'File does not exist.' => 'El fitxer no existeix.', From 1ee0e69b7b1e928b083431434c1c4fb6d3cc7362 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 22:47:15 +0200 Subject: [PATCH 09/61] Comments --- adminer/lang/cs.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 4c91e62a..ffc92cf2 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -183,7 +183,10 @@ $translations = array( 'Truncate' => 'Vyprázdnit', 'Tables have been truncated.' => 'Tabulky byly vyprázdněny.', 'Rows' => 'Řádků', + + // thousands separator - must contain single byte ',' => ' ', + 'Tables have been moved.' => 'Tabulky byly přesunuty.', 'Move to other database' => 'Přesunout do jiné databáze', 'Move' => 'Přesunout', @@ -206,9 +209,16 @@ $translations = array( 'Stop on error' => 'Zastavit při chybě', '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', + + // sprintf() format for time of the command '%.3f s' => '%.3f s', + + // date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d '$1-$3-$5' => '$6.$4.$1', + + // hint for date format - use language equivalents for day, month and year shortcuts '[yyyy]-mm-dd' => 'd.m.[rrrr]', + 'History' => 'Historie', 'Variables' => 'Proměnné', 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.', From 07df8c63c95e5a92683b206e3d0aab0ef6e2efa4 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 22:53:15 +0200 Subject: [PATCH 10/61] Fix translation --- adminer/lang/hu.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/lang/hu.inc.php b/adminer/lang/hu.inc.php index 88291d2b..fddd51dd 100644 --- a/adminer/lang/hu.inc.php +++ b/adminer/lang/hu.inc.php @@ -204,7 +204,7 @@ $translations = array( 'anywhere' => 'bárhol', '%.3f s' => '%.3f másodperc', '$1-$3-$5' => '$6.$4.$1', - '[yyyy]-mm-dd' => '[yyyy].mm.dd', + '[yyyy]-mm-dd' => '[yyyy].m.d', 'History' => 'Történet', 'Variables' => 'Változók', 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'A forrás és cél oszlopoknak azonos típusúak legyenek, a cél oszlopok indexeltek legyenek, és a hivatkozott adatnak léteznie kell.', From b12756643f961823622caaafd1ccf5a1923f47aa Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 14:25:56 +0200 Subject: [PATCH 11/61] Comment --- adminer/include/adminer.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index e314b593..56c55538 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -36,7 +36,7 @@ class Adminer { * @return null */ function headers() { - header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin + header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9 header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page } From 18e158fcdf704725d9e20c1eeee04017f315c5ca Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 14:31:46 +0200 Subject: [PATCH 12/61] Option to show only errors in SQL command --- adminer/lang/cs.inc.php | 3 ++ adminer/lang/en.inc.php | 1 + adminer/sql.inc.php | 62 +++++++++++++++++++++++------------------ 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index ffc92cf2..6c7ce148 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -300,4 +300,7 @@ $translations = array( // function translation used in Editor 'now' => 'teď', + + '%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'), + 'Show only errors' => 'Zobrazit pouze chyby', ); diff --git a/adminer/lang/en.inc.php b/adminer/lang/en.inc.php index 3b0fca1e..1c2bdd75 100644 --- a/adminer/lang/en.inc.php +++ b/adminer/lang/en.inc.php @@ -9,4 +9,5 @@ $translations = array( '%d row(s) have been imported.' => array('%d row has been imported.', '%d rows have been imported.'), '%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.'), '%d in total' => '%d in total', + '%d query(s) executed OK.' => array('%d query executed OK.', '%d queries executed OK.'), ); diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index c4f74574..160b1323 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -40,7 +40,7 @@ if (!$error && $_POST) { $connection2->select_db(DB); } $commands = 0; - $errors = ""; + $errors = array(); while ($query != "") { if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) { $delimiter = $match[1]; @@ -55,18 +55,32 @@ if (!$error && $_POST) { if (!$found && rtrim($query) == "") { break; } - if (!$found || $found == $delimiter) { // end of a query + if ($found && $found != $delimiter) { // find matching quote or comment end + while (preg_match('~' . ($found == '/*' ? '\\*/' : (ereg('-- |#', $found) ? "\n" : "$found|\\\\.")) . '|$~s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES + $s = $match[0][0]; + $offset = $match[0][1] + strlen($s); + if (!$s && $fp && !feof($fp)) { + $query .= fread($fp, 1e6); + } elseif ($s[0] != "\\") { + break; + } + } + } else { // end of a query $empty = false; $q = substr($query, 0, $match[0][1]); $commands++; - echo "

" . shorten_utf8(trim($q), 1000) . "
\n"; - ob_flush(); - flush(); // can take a long time - show the running query + $print = "
" . shorten_utf8(trim($q), 1000) . "
\n"; + if (!$_POST["only_errors"]) { + echo $print; + ob_flush(); + flush(); // can take a long time - show the running query + } $start = explode(" ", microtime()); // microtime(true) is available since PHP 5 //! don't allow changing of character_set_results, convert encoding of displayed query if (!$connection->multi_query($q)) { + echo ($_POST["only_errors"] ? $print : ""); echo "

" . lang('Error in query') . ": " . error() . "\n"; - $errors .= " $commands"; + $errors[] = " $commands"; if ($_POST["error_stops"]) { break; } @@ -78,7 +92,16 @@ if (!$error && $_POST) { $result = $connection->store_result(); $end = explode(" ", microtime()); $time = " (" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")"; - if (is_object($result)) { + if (!is_object($result)) { + if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) { + restart_session(); + set_session("dbs", null); // clear cache + session_write_close(); + } + if (!$_POST["only_errors"]) { + echo "

" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n"; + } + } elseif (!$_POST["only_errors"]) { select($result, $connection2); echo "

" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time; if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) { @@ -88,38 +111,22 @@ if (!$error && $_POST) { select(explain($connection2, $q)); echo "\n"; } - } else { - if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) { - restart_session(); - set_session("dbs", null); // clear cache - session_write_close(); - } - echo "

" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n"; } $start = $end; } while ($connection->next_result()); } $query = substr($query, $offset); $offset = 0; - } else { // find matching quote or comment end - while (preg_match('~' . ($found == '/*' ? '\\*/' : (ereg('-- |#', $found) ? "\n" : "$found|\\\\.")) . '|$~s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES - $s = $match[0][0]; - $offset = $match[0][1] + strlen($s); - if (!$s && $fp && !feof($fp)) { - $query .= fread($fp, 1e6); - } elseif ($s[0] != "\\") { - break; - } - } } } } } - if ($errors && $commands > 1) { - echo "

" . lang('Error in query') . ": $errors\n"; - } if ($empty) { echo "

" . lang('No commands to execute.') . "\n"; + } elseif ($_POST["only_errors"]) { + echo "

" . lang('%d query(s) executed OK.', $commands - count($errors)) . "\n"; + } elseif ($errors && $commands > 1) { + echo "

" . lang('Error in query') . ": " . implode("", $errors) . "\n"; } //! MS SQL - SET SHOWPLAN_ALL OFF } else { @@ -146,6 +153,7 @@ echo "

" . (ini_bool("file_uploads") ? lang('File upload') . ': Date: Fri, 22 Oct 2010 14:31:47 +0200 Subject: [PATCH 13/61] Update changes --- changes.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changes.txt b/changes.txt index da1290c0..239efc47 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,10 @@ +Adminer 3.0.2-dev: +Option to show only errors in SQL command +Highlight and edit SQL command in processlist +Disable XSS "protection" of IE8 +Immunity against zend.ze1_compatibility_mode +Fix last page with empty result set + Adminer 3.0.1 (released 2010-10-18): Send the form by Ctrl+Enter in all textareas Disable creating SQLite databases with extension other than db, sdb, sqlite From 178e23dfe2c3295ace0d36ee1819cc45f2369f00 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 16:26:31 +0200 Subject: [PATCH 14/61] Categorize translations --- adminer/lang/cs.inc.php | 424 ++++++++++++++++++++-------------------- 1 file changed, 212 insertions(+), 212 deletions(-) diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 6c7ce148..3c9ed513 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -1,140 +1,24 @@ 'Přihlásit se', - 'Logout successful.' => 'Odhlášení proběhlo v pořádku.', - 'Invalid credentials.' => 'Neplatné přihlašovací údaje.', + // label for database system selection (MySQL, SQLite, ...) + 'System' => 'Systém', 'Server' => 'Server', 'Username' => 'Uživatel', 'Password' => 'Heslo', - 'Select database' => 'Vybrat databázi', - 'Invalid database.' => 'Nesprávná databáze.', - 'Create new database' => 'Vytvořit novou databázi', - 'Table has been dropped.' => 'Tabulka byla odstraněna.', - 'Table has been altered.' => 'Tabulka byla změněna.', - 'Table has been created.' => 'Tabulka byla vytvořena.', - 'Alter table' => 'Pozměnit tabulku', - 'Create table' => 'Vytvořit tabulku', - 'Table name' => 'Název tabulky', - 'engine' => 'úložiště', - 'collation' => 'porovnávání', - 'Column name' => 'Název sloupce', - 'Type' => 'Typ', - 'Length' => 'Délka', - 'Auto Increment' => 'Auto Increment', - 'Options' => 'Volby', - 'Save' => 'Uložit', - 'Drop' => 'Odstranit', - 'Database has been dropped.' => 'Databáze byla odstraněna.', - 'Databases have been dropped.' => 'Databáze byly odstraněny.', - 'Database has been created.' => 'Databáze byla vytvořena.', - 'Database has been renamed.' => 'Databáze byla přejmenována.', - 'Database has been altered.' => 'Databáze byla změněna.', - 'Alter database' => 'Pozměnit databázi', - 'Create database' => 'Vytvořit databázi', - 'SQL command' => 'SQL příkaz', - 'Dump' => 'Export', + 'Permanent login' => 'Trvalé přihlášení', + 'Login' => 'Přihlásit se', 'Logout' => 'Odhlásit', - 'database' => 'databáze', - 'Use' => 'Vybrat', - '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.', - - // %s can contain auto-increment value - 'Item%s has been inserted.' => 'Položka%s byla vložena.', - - 'Edit' => 'Upravit', - 'Insert' => 'Vložit', - 'Save and insert next' => 'Uložit a vložit další', - 'Delete' => 'Smazat', - 'Database' => 'Databáze', - 'Routines' => 'Procedury a funkce', - 'Indexes have been altered.' => 'Indexy byly změněny.', - 'Indexes' => 'Indexy', - 'Alter indexes' => 'Pozměnit indexy', - 'Add next' => 'Přidat další', + 'Logged as: %s' => 'Přihlášen jako: %s', + 'Logout successful.' => 'Odhlášení proběhlo v pořádku.', + 'Invalid credentials.' => 'Neplatné přihlašovací údaje.', 'Language' => 'Jazyk', - 'Select' => 'Vypsat', - 'New item' => 'Nová položka', - 'Search' => 'Vyhledat', - 'Sort' => 'Seřadit', - 'descending' => 'sestupně', - 'Limit' => 'Limit', - 'No rows.' => 'Žádné řádky.', - 'Action' => 'Akce', - 'edit' => 'upravit', - 'Page' => 'Stránka', - 'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'), - 'Error in query' => 'Chyba v dotazu', - 'Execute' => 'Provést', - 'Table' => 'Tabulka', - 'Foreign keys' => 'Cizí klíče', - 'Triggers' => 'Triggery', - 'View' => 'Pohled', - 'Unable to select the table' => 'Nepodařilo se vypsat tabulku', 'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.', - 'Comment' => 'Komentář', - 'Default values' => 'Výchozí hodnoty', - '%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'), - 'No commands to execute.' => 'Žádné příkazy k vykonání.', - 'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.', - 'File upload' => 'Nahrání souboru', - 'File uploads are disabled.' => 'Nahrávání souborů není povoleno.', - 'Routine has been called, %d row(s) affected.' => array('Procedura byla zavolána, byl změněn %d záznam.', 'Procedura byla zavolána, byly změněny %d záznamy.', 'Procedura byla zavolána, bylo změněno %d záznamů.'), - 'Call' => 'Zavolat', 'No extension' => 'Žádná extenze', 'None of the supported PHP extensions (%s) are available.' => 'Není dostupná žádná z podporovaných PHP extenzí (%s).', 'Session support must be enabled.' => 'Session proměnné musí být povolené.', 'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.', - 'Text length' => 'Délka textů', - 'Foreign key has been dropped.' => 'Cizí klíč byl odstraněn.', - 'Foreign key has been altered.' => 'Cizí klíč byl změněn.', - 'Foreign key has been created.' => 'Cizí klíč byl vytvořen.', - 'Foreign key' => 'Cizí klíč', - 'Target table' => 'Cílová tabulka', - 'Change' => 'Změnit', - 'Source' => 'Zdroj', - 'Target' => 'Cíl', - 'Add column' => 'Přidat sloupec', - 'Alter' => 'Změnit', - 'Add foreign key' => 'Přidat cizí klíč', - 'ON DELETE' => 'Při smazání', - 'ON UPDATE' => 'Při změně', - 'Index Type' => 'Typ indexu', - 'Column (length)' => 'Sloupec (délka)', - 'View has been dropped.' => 'Pohled byl odstraněn.', - 'View has been altered.' => 'Pohled byl změněn.', - 'View has been created.' => 'Pohled byl vytvořen.', - 'Alter view' => 'Pozměnit pohled', - 'Create view' => 'Vytvořit pohled', - 'Name' => 'Název', - 'Process list' => 'Seznam procesů', - '%d process(es) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'), - 'Kill' => 'Ukončit', - 'Parameter name' => 'Název parametru', - 'Database schema' => 'Schéma databáze', - 'Create procedure' => 'Vytvořit proceduru', - 'Create function' => 'Vytvořit funkci', - 'Routine has been dropped.' => 'Procedura byla odstraněna.', - 'Routine has been altered.' => 'Procedura byla změněna.', - 'Routine has been created.' => 'Procedura byla vytvořena.', - 'Alter function' => 'Změnit funkci', - 'Alter procedure' => 'Změnit proceduru', - 'Return type' => 'Návratový typ', - 'Add trigger' => 'Přidat trigger', - 'Trigger has been dropped.' => 'Trigger byl odstraněn.', - 'Trigger has been altered.' => 'Trigger byl změněn.', - 'Trigger has been created.' => 'Trigger byl vytvořen.', - 'Alter trigger' => 'Změnit trigger', - 'Create trigger' => 'Vytvořit trigger', - 'Time' => 'Čas', - 'Event' => 'Událost', '%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP extenzi %s', - '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'), - 'Remove' => 'Odebrat', - 'Are you sure?' => 'Opravdu?', + 'Privileges' => 'Oprávnění', 'Create user' => 'Vytvořit uživatele', 'User has been dropped.' => 'Uživatel byl odstraněn.', @@ -145,19 +29,93 @@ $translations = array( 'Routine' => 'Procedura', 'Grant' => 'Povolit', 'Revoke' => 'Zakázat', + + 'Process list' => 'Seznam procesů', + '%d process(es) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'), + 'Kill' => 'Ukončit', + + 'Variables' => 'Proměnné', + 'Status' => 'Stav', + + 'SQL command' => 'SQL příkaz', + '%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'), + 'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'), + 'No commands to execute.' => 'Žádné příkazy k vykonání.', + 'Error in query' => 'Chyba v dotazu', + 'Execute' => 'Provést', + 'Stop on error' => 'Zastavit při chybě', + 'Show only errors' => 'Zobrazit pouze chyby', + // sprintf() format for time of the command + '%.3f s' => '%.3f s', + 'History' => 'Historie', + 'Clear' => 'Vyčistit', + + 'File upload' => 'Nahrání souboru', + 'From server' => 'Ze serveru', + 'Webserver file %s' => 'Soubor %s na webovém serveru', + 'Run file' => 'Spustit soubor', + 'File does not exist.' => 'Soubor neexistuje.', + 'File uploads are disabled.' => 'Nahrávání souborů není povoleno.', + 'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.', + 'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy %s.', - 'Logged as: %s' => 'Přihlášen jako: %s', - 'Move up' => 'Přesunout nahoru', - 'Move down' => 'Přesunout dolů', - 'Functions' => 'Funkce', - 'Aggregation' => 'Agregace', + 'Export' => 'Export', + 'Dump' => 'Export', 'Output' => 'Výstup', 'open' => 'otevřít', 'save' => 'uložit', 'Format' => 'Formát', - 'Tables' => 'Tabulky', 'Data' => 'Data', + + 'Database' => 'Databáze', + 'database' => 'databáze', + 'Use' => 'Vybrat', + 'Select database' => 'Vybrat databázi', + 'Invalid database.' => 'Nesprávná databáze.', + 'Create new database' => 'Vytvořit novou databázi', + 'Database has been dropped.' => 'Databáze byla odstraněna.', + 'Databases have been dropped.' => 'Databáze byly odstraněny.', + 'Database has been created.' => 'Databáze byla vytvořena.', + 'Database has been renamed.' => 'Databáze byla přejmenována.', + 'Database has been altered.' => 'Databáze byla změněna.', + 'Alter database' => 'Pozměnit databázi', + 'Create database' => 'Vytvořit databázi', + 'Database schema' => 'Schéma databáze', + + // thousands separator - must contain single byte + ',' => ' ', + 'Engine' => 'Úložiště', + 'Collation' => 'Porovnávání', + 'Data Length' => 'Velikost dat', + 'Index Length' => 'Velikost indexů', + 'Data Free' => 'Volné místo', + 'Rows' => 'Řádků', + '%d in total' => '%d celkem', + 'Analyze' => 'Analyzovat', + 'Optimize' => 'Optimalizovat', + 'Check' => 'Zkontrolovat', + 'Repair' => 'Opravit', + 'Truncate' => 'Vyprázdnit', + 'Tables have been truncated.' => 'Tabulky byly vyprázdněny.', + 'Move to other database' => 'Přesunout do jiné databáze', + 'Move' => 'Přesunout', + 'Tables have been moved.' => 'Tabulky byly přesunuty.', + + 'Routines' => 'Procedury a funkce', + 'Routine has been called, %d row(s) affected.' => array('Procedura byla zavolána, byl změněn %d záznam.', 'Procedura byla zavolána, byly změněny %d záznamy.', 'Procedura byla zavolána, bylo změněno %d záznamů.'), + 'Call' => 'Zavolat', + 'Parameter name' => 'Název parametru', + 'Create procedure' => 'Vytvořit proceduru', + 'Create function' => 'Vytvořit funkci', + 'Routine has been dropped.' => 'Procedura byla odstraněna.', + 'Routine has been altered.' => 'Procedura byla změněna.', + 'Routine has been created.' => 'Procedura byla vytvořena.', + 'Alter function' => 'Změnit funkci', + 'Alter procedure' => 'Změnit proceduru', + 'Return type' => 'Návratový typ', + + 'Events' => 'Události', 'Event has been dropped.' => 'Událost byla odstraněna.', 'Event has been altered.' => 'Událost byla změněna.', 'Event has been created.' => 'Událost byla vytvořena.', @@ -165,105 +123,162 @@ $translations = array( 'Create event' => 'Vytvořit událost', 'At given time' => 'V daný čas', 'Every' => 'Každých', - 'Events' => 'Události', 'Schedule' => 'Plán', 'Start' => 'Začátek', 'End' => 'Konec', - 'Status' => 'Stav', 'On completion preserve' => 'Po dokončení zachovat', + + 'Tables' => 'Tabulky', 'Tables and views' => 'Tabulky a pohledy', - 'Data Length' => 'Velikost dat', - 'Index Length' => 'Velikost indexů', - 'Data Free' => 'Volné místo', - 'Collation' => 'Porovnávání', - 'Analyze' => 'Analyzovat', - 'Optimize' => 'Optimalizovat', - 'Check' => 'Zkontrolovat', - 'Repair' => 'Opravit', - 'Truncate' => 'Vyprázdnit', - 'Tables have been truncated.' => 'Tabulky byly vyprázdněny.', - 'Rows' => 'Řádků', - - // thousands separator - must contain single byte - ',' => ' ', - - 'Tables have been moved.' => 'Tabulky byly přesunuty.', - 'Move to other database' => 'Přesunout do jiné databáze', - 'Move' => 'Přesunout', - 'Engine' => 'Úložiště', - 'Save and continue edit' => 'Uložit a pokračovat v editaci', - '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', + 'Table' => 'Tabulka', + 'No tables.' => 'Žádné tabulky.', + 'Alter table' => 'Pozměnit tabulku', + 'Create table' => 'Vytvořit tabulku', + 'Create new table' => 'Vytvořit novou tabulku', + 'Table has been dropped.' => 'Tabulka byla odstraněna.', 'Tables have been dropped.' => 'Tabulky byly odstraněny.', - 'Clone' => 'Klonovat', + 'Table has been altered.' => 'Tabulka byla změněna.', + 'Table has been created.' => 'Tabulka byla vytvořena.', + 'Table name' => 'Název tabulky', + 'Show structure' => 'Zobrazit strukturu', + 'engine' => 'úložiště', + 'collation' => 'porovnávání', + 'Column name' => 'Název sloupce', + 'Type' => 'Typ', + 'Length' => 'Délka', + 'Auto Increment' => 'Auto Increment', + 'Options' => 'Volby', + 'Comment' => 'Komentář', + 'Default values' => 'Výchozí hodnoty', + 'Drop' => 'Odstranit', + 'Are you sure?' => 'Opravdu?', + 'Move up' => 'Přesunout nahoru', + 'Move down' => 'Přesunout dolů', + 'Remove' => 'Odebrat', + '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.', + 'Partition by' => 'Rozdělit podle', 'Partitions' => 'Oddíly', 'Partition name' => 'Název oddílu', 'Values' => 'Hodnoty', - '%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'), + + 'View' => 'Pohled', + 'View has been dropped.' => 'Pohled byl odstraněn.', + 'View has been altered.' => 'Pohled byl změněn.', + 'View has been created.' => 'Pohled byl vytvořen.', + 'Alter view' => 'Pozměnit pohled', + 'Create view' => 'Vytvořit pohled', + + 'Indexes' => 'Indexy', + 'Indexes have been altered.' => 'Indexy byly změněny.', + 'Alter indexes' => 'Pozměnit indexy', + 'Add next' => 'Přidat další', + 'Index Type' => 'Typ indexu', + 'Column (length)' => 'Sloupec (délka)', + + 'Foreign keys' => 'Cizí klíče', + 'Foreign key' => 'Cizí klíč', + 'Foreign key has been dropped.' => 'Cizí klíč byl odstraněn.', + 'Foreign key has been altered.' => 'Cizí klíč byl změněn.', + 'Foreign key has been created.' => 'Cizí klíč byl vytvořen.', + 'Target table' => 'Cílová tabulka', + 'Change' => 'Změnit', + 'Source' => 'Zdroj', + 'Target' => 'Cíl', + 'Add column' => 'Přidat sloupec', + 'Alter' => 'Změnit', + 'Add foreign key' => 'Přidat cizí klíč', + 'ON DELETE' => 'Při smazání', + 'ON UPDATE' => 'Při změně', + 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.', + + 'Triggers' => 'Triggery', + 'Add trigger' => 'Přidat trigger', + 'Trigger has been dropped.' => 'Trigger byl odstraněn.', + 'Trigger has been altered.' => 'Trigger byl změněn.', + 'Trigger has been created.' => 'Trigger byl vytvořen.', + 'Alter trigger' => 'Změnit trigger', + 'Create trigger' => 'Vytvořit trigger', + 'Time' => 'Čas', + 'Event' => 'Událost', + 'Name' => 'Název', + + 'select' => 'vypsat', + 'Select' => 'Vypsat', + 'Select data' => 'Vypsat data', + 'Functions' => 'Funkce', + 'Aggregation' => 'Agregace', + 'Search' => 'Vyhledat', + 'anywhere' => 'kdekoliv', + 'Search data in tables' => 'Vyhledat data v tabulkách', + 'Sort' => 'Seřadit', + 'descending' => 'sestupně', + 'Limit' => 'Limit', + 'Text length' => 'Délka textů', + 'Action' => 'Akce', + 'Unable to select the table' => 'Nepodařilo se vypsat tabulku', + 'No rows.' => 'Žádné řádky.', + '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'), + 'Page' => 'Stránka', + 'last' => 'poslední', + 'whole result' => 'celý výsledek', + '%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'), + 'CSV Import' => 'Import CSV', 'Import' => 'Import', - 'Show structure' => 'Zobrazit strukturu', - 'Select data' => 'Vypsat data', - 'Stop on error' => 'Zastavit při chybě', - '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', + '%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'), - // sprintf() format for time of the command - '%.3f s' => '%.3f s', + // in-place editing in select + 'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.', + 'Increase Text length to modify this value.' => 'Ke změně této hodnoty zvyšte Délku textů.', + 'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.', - // date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d - '$1-$3-$5' => '$6.$4.$1', + // %s can contain auto-increment value + 'Item%s has been inserted.' => 'Položka%s byla vložena.', + 'Item has been deleted.' => 'Položka byla smazána.', + 'Item has been updated.' => 'Položka byla aktualizována.', + '%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ů.'), + 'New item' => 'Nová položka', + 'original' => 'původní', + // label for value '' in enum data type + 'empty' => 'prázdné', + 'edit' => 'upravit', + 'Edit' => 'Upravit', + 'Insert' => 'Vložit', + 'Save' => 'Uložit', + 'Save and continue edit' => 'Uložit a pokračovat v editaci', + 'Save and insert next' => 'Uložit a vložit další', + 'Clone' => 'Klonovat', + 'Delete' => 'Smazat', - // hint for date format - use language equivalents for day, month and year shortcuts - '[yyyy]-mm-dd' => 'd.m.[rrrr]', - - 'History' => 'Historie', - 'Variables' => 'Proměnné', - 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.', 'E-mail' => 'E-mail', 'From' => 'Odesílatel', 'Subject' => 'Předmět', + 'Attachments' => 'Přílohy', 'Send' => 'Odeslat', '%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'), - 'Run file' => 'Spustit soubor', + + // data type descriptions 'Numbers' => 'Čísla', 'Date and time' => 'Datum a čas', 'Strings' => 'Řetězce', 'Binary' => 'Binární', 'Lists' => 'Seznamy', - 'Relations' => 'Vztahy', - 'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.', - 'Clear' => 'Vyčistit', - 'Editor' => 'Editor', - 'Webserver file %s' => 'Soubor %s na webovém serveru', - 'File does not exist.' => 'Soubor neexistuje.', - 'Permanent login' => 'Trvalé přihlášení', - '%d in total' => '%d celkem', - - // label for e-mail attachments in Adminer Editor - 'Attachments' => 'Přílohy', - - // label for database system selection (MySQL, SQLite, ...) - 'System' => 'Systém', - - // link to last page if exact number is unknown - 'last' => 'poslední', - - // new data type categories 'Network' => 'Síť', 'Geometry' => 'Geometrie', + 'Relations' => 'Vztahy', + + 'Editor' => 'Editor', + // date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d + '$1-$3-$5' => '$6.$4.$1', + // hint for date format - use language equivalents for day, month and year shortcuts + '[yyyy]-mm-dd' => 'd.m.[rrrr]', + 'now' => 'teď', // general SQLite error in create, drop or rename database 'File exists.' => 'Soubor existuje.', 'Please use one of the extensions %s.' => 'Prosím použijte jednu z koncovek %s.', - // selects now support in-place editing - 'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.', - 'Increase Text length to modify this value.' => 'Ke změně této hodnoty zvyšte Délku textů.', - 'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.', - // PostgreSQL and MS SQL schema support 'Alter schema' => 'Pozměnit schéma', 'Create schema' => 'Vytvořit schéma', @@ -288,19 +303,4 @@ $translations = array( 'Type has been dropped.' => 'Typ byl odstraněn.', 'Type has been created.' => 'Typ byl vytvořen.', 'Alter type' => 'Pozměnit typ', - - // label for search in whole database - 'Search data in tables' => 'Vyhledat data v tabulkách', - - // label for box with "Run webserver file adminer.sql" - 'From server' => 'Ze serveru', - - // label for value '' in enum data type - 'empty' => 'prázdné', - - // function translation used in Editor - 'now' => 'teď', - - '%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'), - 'Show only errors' => 'Zobrazit pouze chyby', ); From 6775ac1296d246277538c1b72b7c75eeebefc290 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 16:27:16 +0200 Subject: [PATCH 15/61] Whitespace --- lang.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lang.php b/lang.php index a2f2bb5d..8c9649d8 100644 --- a/lang.php +++ b/lang.php @@ -40,12 +40,15 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS $s .= "$match[1]// $match[2],\n"; } } - foreach($messages as $idf => $val) { - // add new messages - if ($val == "," && strpos($idf, "%d")) { - $s .= "\t$idf => array(),\n"; - } elseif (basename($filename) != "en.inc.php") { - $s .= "\t$idf => null,\n"; + if ($messages) { + $s .= "\n"; + foreach ($messages as $idf => $val) { + // add new messages + if ($val == "," && strpos($idf, "%d")) { + $s .= "\t$idf => array(),\n"; + } elseif (basename($filename) != "en.inc.php") { + $s .= "\t$idf => null,\n"; + } } } $s = " Date: Fri, 22 Oct 2010 21:27:38 +0200 Subject: [PATCH 16/61] Print data in only_errors mode (important for ALTER export) --- adminer/sql.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 160b1323..459ecb28 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -101,7 +101,11 @@ if (!$error && $_POST) { if (!$_POST["only_errors"]) { echo "

" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n"; } - } elseif (!$_POST["only_errors"]) { + } else { + if ($_POST["only_errors"]) { + echo $print; + $print = ""; + } select($result, $connection2); echo "

" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time; if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) { @@ -152,8 +156,8 @@ echo "

" . (ini_bool("file_uploads") ? lang('File upload') . ': Date: Fri, 22 Oct 2010 21:27:53 +0200 Subject: [PATCH 17/61] Timestamp in export --- adminer/dump.inc.php | 20 ++++++++++++-------- changes.txt | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index b813f87a..c288fb0b 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -8,7 +8,8 @@ if ($_POST) { } cookie("adminer_export", substr($cookie, 1)); $ext = dump_headers(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1)); - if ($_POST["format"] == "sql") { + $is_sql = ($_POST["format"] == "sql"); + if ($is_sql) { echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump " . ($jush != "sql" ? "" : "SET NAMES utf8; @@ -29,13 +30,13 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; } foreach ((array) $databases as $db) { if ($connection->select_db($db)) { - if ($_POST["format"] == "sql" && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) { + if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) { if ($style == "DROP+CREATE") { echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n"; } echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n"; } - if ($_POST["format"] == "sql") { + if ($is_sql) { if ($style) { echo use_sql($db) . ";\n\n"; } @@ -76,7 +77,7 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; if ($data) { dump_data($row["Name"], $_POST["data_style"]); } - if ($_POST["format"] == "sql" && $_POST["triggers"]) { + if ($is_sql && $_POST["triggers"]) { $triggers = trigger_sql($row["Name"], $_POST["table_style"]); if ($triggers) { echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n"; @@ -84,10 +85,10 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; } if ($ext == "tar") { echo tar_file((DB != "" ? "" : "$db/") . "$row[Name].csv", ob_get_clean()); - } elseif ($_POST["format"] == "sql") { + } elseif ($is_sql) { echo "\n"; } - } elseif ($_POST["format"] == "sql") { + } elseif ($is_sql) { $views[] = $row["Name"]; } } @@ -100,7 +101,7 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; } } - if ($style == "CREATE+ALTER" && $_POST["format"] == "sql") { + if ($style == "CREATE+ALTER" && $is_sql) { // drop old tables $query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()"; echo "DELIMITER ;; @@ -136,11 +137,14 @@ CALL adminer_alter(@adminer_alter); DROP PROCEDURE adminer_alter; "; } - if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $_POST["format"] == "sql") { + if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $is_sql) { echo "SELECT @adminer_alter;\n"; } } } + if ($is_sql) { + echo "-- " . $connection->result("SELECT NOW()") . "\n"; + } exit; } diff --git a/changes.txt b/changes.txt index 239efc47..bbd8541f 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer 3.0.2-dev: Option to show only errors in SQL command Highlight and edit SQL command in processlist Disable XSS "protection" of IE8 +Timestamp in export Immunity against zend.ze1_compatibility_mode Fix last page with empty result set From 7d601c07fcea27bab3a3f6bc0639c46ad2a5a7b9 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 22:42:40 +0200 Subject: [PATCH 18/61] Allow only apostrophes in enums Use possessive quantifier in enum to fit in backtrack limit --- adminer/index.php | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/index.php b/adminer/index.php index 40c849a7..d1568c0a 100644 --- a/adminer/index.php +++ b/adminer/index.php @@ -8,7 +8,7 @@ include "./include/bootstrap.inc.php"; -$enum_length = '\'(?:\'\'|[^\'\\\\]|\\\\.)*\'|"(?:""|[^"\\\\]|\\\\.)*"'; +$enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'"; $inout = array("IN", "OUT", "INOUT"); if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) { diff --git a/readme.txt b/readme.txt index 02f0c70a..07ef7e31 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Adminer Editor - Data manipulation for end-users http://www.adminer.org/ Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle -Requirements: PHP 4.3.2+ or PHP 5+ +Requirements: PHP 4.3.3+ or PHP 5+ Apache License, Version 2.0 adminer/index.php - Run development version of Adminer From 28f21aaa6cb23b5486ffa0b2361ff456d793d206 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 22 Oct 2010 23:07:30 +0200 Subject: [PATCH 19/61] Escape JavaScript strings (bug #3093243) --- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 10 +++++++++- adminer/schema.inc.php | 2 +- adminer/script.inc.php | 8 ++++---- adminer/trigger.inc.php | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 56c55538..2b15cfd3 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -560,7 +560,7 @@ document.getElementById('username').focus(); $links[] = preg_quote($table, '/'); } echo " diff --git a/adminer/lang/ar.inc.php b/adminer/lang/ar.inc.php index d46f9b8f..e87fd6a9 100644 --- a/adminer/lang/ar.inc.php +++ b/adminer/lang/ar.inc.php @@ -259,4 +259,5 @@ $translations = array( 'Attachments' => 'ملفات مرفقة.', 'Item%s has been inserted.' => 'تم إدراج العنصر.', 'now' => 'الآن', + 'ltr' => 'rtl', ); diff --git a/adminer/static/default.css b/adminer/static/default.css index 0ccbb81a..5badf8b4 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -47,6 +47,12 @@ pre { margin: 1em 0 0; } #schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; } #schema .references { position: absolute; } +.rtl h2 { margin: 0 -18px 20px 0; } +.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; } +.rtl #content { margin: 2em 21em 0 0; padding: 10px 0 20px 20px; } +.rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; } +.rtl #lang, .rtl #menu { left: auto; right: 0; } + @media print { #lang, #menu { display: none; } #content { margin-left: 1em; } diff --git a/adminer/static/functions.js b/adminer/static/functions.js index fa0c7b4f..065626f0 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -1,5 +1,5 @@ // to hide elements displayed by JavaScript -document.body.className = 'js'; +document.body.className += ' js'; /** Toggle visibility * @param string diff --git a/changes.txt b/changes.txt index 0ca4729d..c3c7d7c3 100644 --- a/changes.txt +++ b/changes.txt @@ -12,6 +12,7 @@ Support for virtual foreign keys Disable XSS "protection" of IE8 Immunity against zend.ze1_compatibility_mode (bug #3089645) Fix last page with empty result set +Arabic translation and RTL support Dual licensing: Apache or GPL Adminer 3.0.1 (released 2010-10-18): From f4256013a919b68fdbaeb7cd170997c2480a110c Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 11 Nov 2010 10:47:32 +0100 Subject: [PATCH 59/61] Hide hidden columns in PostgreSQL (thanks to Pavel Stehule) --- adminer/drivers/mssql.inc.php | 2 +- adminer/drivers/mysql.inc.php | 3 +-- adminer/drivers/oracle.inc.php | 2 +- adminer/drivers/pgsql.inc.php | 6 +++--- adminer/drivers/sqlite.inc.php | 2 +- adminer/select.inc.php | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index a604fcfa..e3bd6f31 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -306,7 +306,7 @@ if (isset($_GET["mssql"])) { return true; } - function fields($table, $hidden = false) { + function fields($table) { $return = array(); foreach (get_rows("SELECT c.*, t.name type, d.definition [default] FROM sys.all_columns c diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 565e57ab..24967642 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -393,10 +393,9 @@ if (!defined("DRIVER")) { /** Get information about fields * @param string - * @param bool display hidden table columns * @return array array($name => array("field" => , "full_type" => , "type" => , "length" => , "unsigned" => , "default" => , "null" => , "auto_increment" => , "on_update" => , "collation" => , "privileges" => , "comment" => , "primary" => )) */ - function fields($table, $hidden = false) { + function fields($table) { $return = array(); foreach (get_rows("SHOW FULL COLUMNS FROM " . table($table)) as $row) { preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match); diff --git a/adminer/drivers/oracle.inc.php b/adminer/drivers/oracle.inc.php index 5d2488b0..1b001f0a 100644 --- a/adminer/drivers/oracle.inc.php +++ b/adminer/drivers/oracle.inc.php @@ -203,7 +203,7 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na return true; } - function fields($table, $hidden = false) { + function fields($table) { $return = array(); foreach (get_rows("SELECT * FROM all_tab_columns WHERE table_name = " . q($table) . " ORDER BY column_id") as $row) { $type = $row["DATA_TYPE"]; diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 4fb10c6f..6f3211b4 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -215,7 +215,7 @@ AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema( return true; } - function fields($table, $hidden = false) { + function fields($table) { $return = array(); foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment FROM pg_class c @@ -225,8 +225,8 @@ LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum WHERE c.relname = " . q($table) . " AND n.nspname = current_schema() AND NOT a.attisdropped -" . ($hidden ? "" : "AND a.attnum > 0") . " -ORDER BY a.attnum < 0, a.attnum" +AND a.attnum > 0 +ORDER BY a.attnum" ) as $row) { //! collation, primary ereg('(.*)(\\((.*)\\))?', $row["full_type"], $match); diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index 03221e91..87498ae1 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -263,7 +263,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')"); } - function fields($table, $hidden = false) { + function fields($table) { $return = array(); foreach (get_rows("PRAGMA table_info(" . table($table) . ")") as $row) { $type = strtolower($row["type"]); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index c2c6229d..be717b72 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -2,7 +2,7 @@ $TABLE = $_GET["select"]; $table_status = table_status($TABLE); $indexes = indexes($TABLE); -$fields = fields($TABLE, 1); // 1 - hidden +$fields = fields($TABLE); $foreign_keys = column_foreign_keys($TABLE); $rights = array(); // privilege => 0 From 620df3c44a1733e8cd9d1b3d2189ceabac7efacc Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 11 Nov 2010 13:40:04 +0100 Subject: [PATCH 60/61] Move up create table link (thanks to Filip Prochazka) --- adminer/include/adminer.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index f53d65da..d25cd1cd 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -741,6 +741,7 @@ DROP PROCEDURE adminer_alter; } } if ($_GET["ns"] !== "" && !$missing) { + echo '

' . bold(lang('Create new table'), $_GET["create"] === "") . "\n"; $tables = tables_list(); if (!$tables) { echo "

" . lang('No tables.') . "\n"; @@ -757,7 +758,6 @@ DROP PROCEDURE adminer_alter; } echo "\n"; } - echo '

' . bold(lang('Create new table'), $_GET["create"] === "") . "\n"; } } echo (isset($_GET["sql"]) ? '' From af0cacba905bfa160f1e9c374afa1141a0e4af44 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 14:05:02 +0100 Subject: [PATCH 61/61] Update translations --- adminer/lang/ar.inc.php | 6 ++++++ adminer/lang/hu.inc.php | 6 ++++++ adminer/lang/nl.inc.php | 7 +++++++ adminer/lang/sk.inc.php | 7 +++++++ 4 files changed, 26 insertions(+) diff --git a/adminer/lang/ar.inc.php b/adminer/lang/ar.inc.php index e87fd6a9..0d413e2f 100644 --- a/adminer/lang/ar.inc.php +++ b/adminer/lang/ar.inc.php @@ -259,5 +259,11 @@ $translations = array( 'Attachments' => 'ملفات مرفقة.', 'Item%s has been inserted.' => 'تم إدراج العنصر.', 'now' => 'الآن', + '%d query(s) executed OK.' => array('تم تنفيذ الإستعلام %d بنجاح.', 'تم تنفيذ الإستعلامات %d بنجاح.'), + 'Show only errors' => 'إعرض الأخطاء فقط', + 'Last page' => 'الصفحة السابقة', + 'Refresh' => 'تحديث', + 'Invalid schema.' => 'مخطط خاطئ.', + 'Please use one of the extensions %s.' => 'من فضلك إستعمل إحدى الغمتدادات: %s.', 'ltr' => 'rtl', ); diff --git a/adminer/lang/hu.inc.php b/adminer/lang/hu.inc.php index fddd51dd..ed5d444a 100644 --- a/adminer/lang/hu.inc.php +++ b/adminer/lang/hu.inc.php @@ -259,4 +259,10 @@ $translations = array( 'From server' => 'Szerverről', 'empty' => 'üres', 'now' => 'most', + '%d query(s) executed OK.' => '%d sikeres lekérdezés.', + 'Show only errors' => 'Csak a hibák mutatása', + 'Last page' => 'Utolsó oldal', + 'Refresh' => 'Frissítés', + 'Invalid schema.' => 'Érvénytelen séma.', + 'Please use one of the extensions %s.' => 'Használja a(z) %s kiterjesztést.', ); diff --git a/adminer/lang/nl.inc.php b/adminer/lang/nl.inc.php index c5864edc..01afa05b 100644 --- a/adminer/lang/nl.inc.php +++ b/adminer/lang/nl.inc.php @@ -258,4 +258,11 @@ $translations = array( 'Geometry' => 'Geometrie', 'File exists.' => 'Bestand bestaat reeds.', 'Attachments' => 'Bijlagen', + '%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd'), + 'Show only errors' => 'Enkel fouten tonen', + 'Last page' => 'Laatste pagina', + 'Refresh' => 'Vernieuwen', + 'Invalid schema.' => 'Ongeldig schema.', + 'Please use one of the extensions %s.' => 'Gebruik 1 van volgende extensies: %s.', + 'now' => 'nu', ); diff --git a/adminer/lang/sk.inc.php b/adminer/lang/sk.inc.php index 33f5cc34..2d515d93 100644 --- a/adminer/lang/sk.inc.php +++ b/adminer/lang/sk.inc.php @@ -258,4 +258,11 @@ $translations = array( 'Geometry' => 'Geometria', 'File exists.' => 'Súbor existuje.', 'Attachments' => 'Prílohy', + '%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'), + 'Show only errors' => 'Zobraziť iba chyby', + 'Last page' => 'Posledná stránka', + 'Refresh' => 'Obnoviť', + 'Invalid schema.' => 'Neplatné schéma.', + 'Please use one of the extensions %s.' => 'Prosím vyberte jednu z koncoviek %s.', + 'now' => 'teraz', );