From 7eb85a75f8823faf9dc2b7bb6f4b0e4b8c6a2b8e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 01:51:56 +0200 Subject: [PATCH 01/26] Use AJAX in select --- adminer/file.inc.php | 1 + adminer/include/adminer.inc.php | 2 +- adminer/include/design.inc.php | 56 ++++++++++++++++-------------- adminer/select.inc.php | 4 +-- adminer/static/editing.js | 8 ----- adminer/static/functions.js | 59 ++++++++++++++++++++++++++++++++ adminer/static/loader.gif | Bin 0 -> 673 bytes compile.php | 1 + editor/include/adminer.inc.php | 1 + 9 files changed, 96 insertions(+), 36 deletions(-) create mode 100644 adminer/static/loader.gif diff --git a/adminer/file.inc.php b/adminer/file.inc.php index 0b3e8e7d..c89feb46 100644 --- a/adminer/file.inc.php +++ b/adminer/file.inc.php @@ -18,6 +18,7 @@ if ($_GET["file"] == "favicon.ico") { case "up.gif": echo base64_decode("compile_file('../adminer/static/up.gif', 'base64_encode');"); break; case "down.gif": echo base64_decode("compile_file('../adminer/static/down.gif', 'base64_encode');"); break; case "arrow.gif": echo base64_decode("compile_file('../adminer/static/arrow.gif', 'base64_encode');"); break; + case "loader.gif": echo base64_decode("compile_file('../adminer/static/loader.gif', 'base64_encode');"); break; } } exit; diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index d9692133..c47519f3 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -123,7 +123,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . " #\n"; } /** Description of a row in a table diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 621ec5bc..21301985 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -10,9 +10,10 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { global $LANG, $HTTPS, $adminer, $connection, $drivers; header("Content-Type: text/html; charset=utf-8"); header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin - $title_all = $title . ($title2 != "" ? ": " . h($title2) : ""); - $protocol = ($HTTPS ? "https" : "http"); - ?> + if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + $title_all = $title . ($title2 != "" ? ": " . h($title2) : ""); + $protocol = ($HTTPS ? "https" : "http"); + ?> @@ -31,33 +32,35 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {

' . $drivers[DRIVER] . ' » '; - $link = substr(preg_replace('~(db|ns)=[^&]*&~', '', ME), 0, -1); - $server = (SERVER != "" ? h(SERVER) : lang('Server')); - if ($breadcrumb === false) { - echo "$server\n"; - } else { - echo "$server » "; - if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) { - echo '' . h(DB) . ' » '; - } - if (is_array($breadcrumb)) { - if ($_GET["ns"] != "") { - echo '' . h($_GET["ns"]) . ' » '; + if (isset($breadcrumb)) { + $link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1); + echo '

$title_all

\n"; + echo "
\n"; } - echo "

$title_all

\n"; restart_session(); if ($_SESSION["messages"]) { echo "
" . implode("
\n
", $_SESSION["messages"]) . "
\n"; @@ -78,7 +81,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { */ function page_footer($missing = "") { global $adminer; - ?> + if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + ?> +
@@ -86,4 +91,5 @@ function page_footer($missing = "") { navigation($missing); ?> selectLinks($table_status, $set); if (!$columns) { echo "

" . lang('Unable to select the table') . ($fields ? "." : ": " . error()) . "\n"; } else { - echo "

\n"; + echo "\n"; echo "
"; hidden_fields_get(); echo (DB != "" ? '' . (isset($_GET["ns"]) ? '' : "") : ""); // not used in Editor @@ -254,7 +254,7 @@ if (!$columns) { if ($name != "") { $order++; $names[$key] = $name; - echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions + echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions } $functions[$key] = $val["fun"]; next($select); diff --git a/adminer/static/editing.js b/adminer/static/editing.js index 72506d66..91ef87f1 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -34,14 +34,6 @@ function bodyLoad(version, protocol) { document.body.appendChild(script); } -/** Get value of select -* @param HTMLSelectElement -* @return string -*/ -function selectValue(select) { - return select.value || select.options[select.selectedIndex].text; -} - /** Get value of dynamically created form field * @param HTMLFormElement * @param string diff --git a/adminer/static/functions.js b/adminer/static/functions.js index f610ab8d..acdd3b72 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -32,6 +32,14 @@ function verifyVersion(protocol) { document.body.appendChild(script); } +/** Get value of select +* @param HTMLSelectElement +* @return string +*/ +function selectValue(select) { + return (select.value !== undefined ? select.value : select.options[select.selectedIndex].text); +} + /** Check all elements matching given name * @param HTMLInputElement * @param RegExp @@ -123,6 +131,57 @@ function selectAddRow(field) { +var ajaxState = 0; +var ajaxTimeout; + +/** Create AJAX request +* @param string +* @return XMLHttpRequest or false in case of an error +*/ +function ajax(url) { + var xmlhttp; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); + } else { + return false; + } + var currentState = ++ajaxState; + clearTimeout(ajaxTimeout); + ajaxTimeout = setTimeout(function () { + setHtml('main', ''); + }, 1000); // defer displaying loader + xmlhttp.open('GET', url); + xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4 && currentState == ajaxState) { + clearTimeout(ajaxTimeout); + setHtml('main', xmlhttp.responseText); + if (window.jush) { + jush.highlight_tag('code'); + } + } + }; + xmlhttp.send(''); + return xmlhttp; +} + +/** Send form by AJAX GET +* @param HTMLFormElement +* @return XMLHttpRequest or false in case of an error +*/ +function ajaxForm(form) { + var params = [ ]; + for (var i=0; i < form.elements.length; i++) { + var el = form.elements[i]; + if (el.name && (!/checkbox|radio/i.test(el.type) || el.checked)) { + params.push(el.name + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value)); + } + } + return ajax((form.action || location.pathname) + '?' + params.join('&')); +} + /** Display edit field diff --git a/adminer/static/loader.gif b/adminer/static/loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..f2a1bc0c6f545e20e631a96e8e92f9822e75d046 GIT binary patch literal 673 zcmZ?wbhEHb6krfw_{6~Q|Nnmm28Kh24mmkF0U1e2Nli^nlO|14{3qpHl$uzQnxasi zS(2fUn3Y(Olb@KPmzkHA&!G5|g@FsGT=74*pKD04vtxj(k)8oFBTz^Oh=E26FfcG1 zbL_hF&)}42ws10s6^G;;cE1^EoUR)U5A70}d2pLv!jVIT7j&Z~EblI3x0K*v_sV|m z0W=b9G$XP(CLnYCdK49;TX=SFc-G}o=oA=|U?{1O;Nu!CwW3C5Yw7*Bi4yD$3fCnb zwK+>}QdQ9sf*QnxY>*kpE+b{_Q;sJloS71)&(@kO!}mqf@1v(v;*8Y=G9S3kY~Cw# zY=t&c z;3~JK4HxB^lY(MD+sYeQ=t%XSSW;x^1M?dTvN=W^yNcAcy`HCte31C;)5xP%b~qs> zDP&4(%TBqBNGHwnryK;BdMI$fEg xd0mc!C@j^ZpLxYv4HmnPfI0THYuv<%+6iSmMn&w3dPGDfL1|=LY008wP(boU~ literal 0 HcmV?d00001 diff --git a/compile.php b/compile.php index a9cc4e4b..2cfd8ad7 100644 --- a/compile.php +++ b/compile.php @@ -254,6 +254,7 @@ foreach (array("adminer", "editor") as $project) { $file = str_replace('' . "\n", "", $file); $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&version=' . $VERSION; + $file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&version=$VERSION", $file); $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '', $file); $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file); $file = str_replace("'../externals/jush/'", "protocol + '://www.adminer.org/static/'", $file); diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 8c8d990d..9c5df119 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -58,6 +58,7 @@ document.getElementById('username').focus(); echo '

' . lang('New item') . "\n"; } echo ">>\n"; + echo "#\n"; } function backwardKeys($table, $tableName) { From 8d4b241156139b219172d21372d87f0c80b24950 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 07:19:01 +0200 Subject: [PATCH 02/26] Save bytes --- adminer/static/functions.js | 43 ++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index acdd3b72..c1d25c5e 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -139,31 +139,26 @@ var ajaxTimeout; * @return XMLHttpRequest or false in case of an error */ function ajax(url) { - var xmlhttp; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); - } else { - return false; - } - var currentState = ++ajaxState; - clearTimeout(ajaxTimeout); - ajaxTimeout = setTimeout(function () { - setHtml('main', ''); - }, 1000); // defer displaying loader - xmlhttp.open('GET', url); - xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4 && currentState == ajaxState) { - clearTimeout(ajaxTimeout); - setHtml('main', xmlhttp.responseText); - if (window.jush) { - jush.highlight_tag('code'); + var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); + if (xmlhttp) { + var currentState = ++ajaxState; + clearTimeout(ajaxTimeout); + ajaxTimeout = setTimeout(function () { + setHtml('main', ''); + }, 1000); // defer displaying loader + xmlhttp.open('GET', url); + xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4 && currentState == ajaxState) { + clearTimeout(ajaxTimeout); + setHtml('main', xmlhttp.responseText); + if (window.jush) { + jush.highlight_tag('code'); + } } - } - }; - xmlhttp.send(''); + }; + xmlhttp.send(''); + } return xmlhttp; } From a6bbe1bb3b760e47c3b0d52162d144cbfb3a1c39 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 07:50:40 +0200 Subject: [PATCH 03/26] Save select data by AJAX --- adminer/include/functions.inc.php | 2 +- adminer/select.inc.php | 4 ++-- adminer/static/functions.js | 24 +++++++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index ea81a1c9..d3489447 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -345,7 +345,7 @@ function redirect($location, $message = null) { restart_session(); $_SESSION["messages"][] = $message; } - if (isset($location)) { + if (isset($location) && $_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { header("Location: " . ($location != "" ? $location : ".")); exit; } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8d118bcd..441681e6 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -333,7 +333,7 @@ if (!$columns) { } } $id = h("val[$unique_idf][" . bracket_escape($key) . "]"); - $value = $_POST["val"][$unique_idf][bracket_escape($key)]; + $value = ($error ? $_POST["val"][$unique_idf][bracket_escape($key)] : null); $h_value = h(isset($value) ? $value : $row[$key]); $long = strpos($val, "..."); $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key]; @@ -380,7 +380,7 @@ if (!$columns) { if (!information_schema(DB)) { ?>

- + diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c1d25c5e..f554758a 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -136,17 +136,22 @@ var ajaxTimeout; /** Create AJAX request * @param string +* @param string * @return XMLHttpRequest or false in case of an error */ -function ajax(url) { +function ajax(url, data) { var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); if (xmlhttp) { var currentState = ++ajaxState; clearTimeout(ajaxTimeout); ajaxTimeout = setTimeout(function () { setHtml('main', ''); - }, 1000); // defer displaying loader - xmlhttp.open('GET', url); + }, 500); // defer displaying loader + var method = (data === undefined ? 'GET' : 'POST'); + xmlhttp.open(method, url); + if (method == 'POST') { + xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && currentState == ajaxState) { @@ -154,10 +159,11 @@ function ajax(url) { setHtml('main', xmlhttp.responseText); if (window.jush) { jush.highlight_tag('code'); + jush.highlight_tag('pre', 0); } } }; - xmlhttp.send(''); + xmlhttp.send(data); } return xmlhttp; } @@ -170,11 +176,15 @@ function ajaxForm(form) { var params = [ ]; for (var i=0; i < form.elements.length; i++) { var el = form.elements[i]; - if (el.name && (!/checkbox|radio/i.test(el.type) || el.checked)) { - params.push(el.name + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value)); + if (el.name && (!/checkbox|radio|submit|file/i.test(el.type) || el.checked)) { + params.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value)); } } - return ajax((form.action || location.pathname) + '?' + params.join('&')); + if (form.method == 'post') { + return ajax(form.action || location.href, params.join('&')); + } else { + return ajax((form.action || location.pathname) + '?' + params.join('&')); + } } From 1a5bec94d978f3514f3ebbc3106e774bd00064b9 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 08:02:12 +0200 Subject: [PATCH 04/26] Send the form by AJAX with Ctrl+Enter --- adminer/select.inc.php | 2 +- adminer/static/functions.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index fd91e16a..859de979 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -380,7 +380,7 @@ if (!$columns) { if (!information_schema(DB)) { ?>
- + diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 0a441d58..c1ebf6f9 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -240,7 +240,7 @@ function selectDblClick(td, event, text) { }); input.rows = rows; input.onkeydown = function (event) { - return textareaKeydown(input, event || window.event); + return textareaKeydown(input, event || window.event, false, document.getElementById('save')); }; } if (document.selection) { From d82e69636c3edf44bc30541ff67c385a5e2d30ec Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 16:00:29 +0200 Subject: [PATCH 05/26] Minimal inline edit input width --- adminer/static/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c1ebf6f9..7b32fd0c 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -232,7 +232,7 @@ function selectDblClick(td, event, text) { var input = document.createElement(text ? 'textarea' : 'input'); input.name = td.id; input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); //   or i - NULL - input.style.width = (td.clientWidth - 14) + 'px'; // 14 = 2 * (td.border + td.padding + input.border) + input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border) if (text) { var rows = 1; value.replace(/\n/g, function () { From 41f4c62fcd1ff362c1bdecc3128694f33103b821 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 16:07:09 +0200 Subject: [PATCH 06/26] Change message to "increase Text length" --- adminer/lang/ca.inc.php | 2 +- adminer/lang/cs.inc.php | 2 +- adminer/lang/de.inc.php | 2 +- adminer/lang/es.inc.php | 2 +- adminer/lang/et.inc.php | 2 +- adminer/lang/fr.inc.php | 2 +- adminer/lang/hu.inc.php | 2 +- adminer/lang/it.inc.php | 2 +- adminer/lang/ja.inc.php | 2 +- adminer/lang/nl.inc.php | 2 +- adminer/lang/ru.inc.php | 2 +- adminer/lang/sk.inc.php | 2 +- adminer/lang/ta.inc.php | 2 +- adminer/lang/zh-tw.inc.php | 2 +- adminer/lang/zh.inc.php | 2 +- adminer/select.inc.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/adminer/lang/ca.inc.php b/adminer/lang/ca.inc.php index f64c9680..dbdb312b 100644 --- a/adminer/lang/ca.inc.php +++ b/adminer/lang/ca.inc.php @@ -235,7 +235,7 @@ $translations = array( 'Databases have been dropped.' => 'S\'han suprimit les bases de dades.', 'File exists.' => 'El fitxer ja existeix.', 'Double click on a value to modify it.' => 'Fes un doble clic a un valor per modificar-lo.', - 'Increase text length to modify this value.' => 'Incrementa la longitud del text per modificar aquest valor.', + 'Increase Text length to modify this value.' => 'Incrementa la Longitud del text per modificar aquest valor.', 'Use edit link to modify this value.' => 'Utilitza l\'enllaç d\'edició per modificar aquest valor.', 'Alter schema' => 'Modifica l\'esquema', 'Create schema' => 'Crea un esquema', diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 6ab97b0a..98b3e823 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -235,7 +235,7 @@ $translations = array( 'Databases have been dropped.' => 'Databáze byly odstraněny.', 'File exists.' => 'Soubor existuje.', '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ů.', + '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.', 'Alter schema' => 'Pozměnit schéma', 'Create schema' => 'Vytvořit schéma', diff --git a/adminer/lang/de.inc.php b/adminer/lang/de.inc.php index 00647c80..df431c8f 100644 --- a/adminer/lang/de.inc.php +++ b/adminer/lang/de.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Typ gelöscht.', 'Type has been created.' => 'Typ erstellt.', 'Double click on a value to modify it.' => 'Doppelklick zum Bearbeiten des Wertes.', - 'Increase text length to modify this value.' => 'Vergrössern Sie die Textlänge um den Wert ändern zu können.', + 'Increase Text length to modify this value.' => 'Vergrössern Sie die Textlänge um den Wert ändern zu können.', 'Use edit link to modify this value.' => 'Benutzen Sie den Link zum editieren dieses Wertes.', 'last' => 'letzte', 'From server' => 'Auf Server', diff --git a/adminer/lang/es.inc.php b/adminer/lang/es.inc.php index 896f0deb..6c2a3f62 100644 --- a/adminer/lang/es.inc.php +++ b/adminer/lang/es.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Tipo eliminado.', 'Type has been created.' => 'Tipo creado.', 'Double click on a value to modify it.' => 'Doble-clic sobre el valor para editarlo.', - 'Increase text length to modify this value.' => 'Aumente el tamaño del campo de texto para modificar este valor.', + 'Increase Text length to modify this value.' => 'Aumente el tamaño del campo de texto para modificar este valor.', 'Use edit link to modify this value.' => 'Utilice el enlace de modificar para realizar los cambios.', 'last' => 'último', 'From server' => 'Desde servidor', diff --git a/adminer/lang/et.inc.php b/adminer/lang/et.inc.php index fe7110f9..7b79eaa8 100644 --- a/adminer/lang/et.inc.php +++ b/adminer/lang/et.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Tüüp on edukalt kustutatud.', 'Type has been created.' => 'Tüüp on edukalt loodud.', 'Double click on a value to modify it.' => 'Väärtuse muutmiseks topelt-kliki sellel.', - 'Increase text length to modify this value.' => 'Väärtuse muutmiseks suurenda tekstiveeru pikkust.', + 'Increase Text length to modify this value.' => 'Väärtuse muutmiseks suurenda Tekstiveeru pikkust.', 'Use edit link to modify this value.' => 'Väärtuse muutmiseks kasuta muutmislinki.', 'last' => 'viimane', 'From server' => 'Serverist', diff --git a/adminer/lang/fr.inc.php b/adminer/lang/fr.inc.php index 302eb1f6..672f60c9 100644 --- a/adminer/lang/fr.inc.php +++ b/adminer/lang/fr.inc.php @@ -245,7 +245,7 @@ $translations = array( 'Type has been dropped.' => 'Le type a été supprimé.', 'Type has been created.' => 'Le type a été créé.', 'Double click on a value to modify it.' => 'Double-cliquez sur une valeur pour la modifier.', - 'Increase text length to modify this value.' => 'Augmentez la longueur de texte affiché pour modifier cette valeur.', + 'Increase Text length to modify this value.' => 'Augmentez la Longueur de texte affiché pour modifier cette valeur.', 'Use edit link to modify this value.' => 'Utilisez le lien "modifier" pour modifier cette valeur.', 'last' => 'dernière', 'From server' => 'Depuis le serveur', diff --git a/adminer/lang/hu.inc.php b/adminer/lang/hu.inc.php index b553a1c9..ed44e2e9 100644 --- a/adminer/lang/hu.inc.php +++ b/adminer/lang/hu.inc.php @@ -235,7 +235,7 @@ $translations = array( 'Databases have been dropped.' => 'Adatbázis eldobva.', 'File exists.' => 'A fájl létezik.', 'Double click on a value to modify it.' => 'Kattints kétszer az értékre a szerkesztéshez.', - 'Increase text length to modify this value.' => 'Növeld a szöveg hosszát, hogy módosítani tudd ezt az értéket.', + 'Increase Text length to modify this value.' => 'Növeld a Szöveg hosszát, hogy módosítani tudd ezt az értéket.', 'Use edit link to modify this value.' => 'Használd a szerkesztés hivatkozást ezen érték módosításához.', 'Alter schema' => 'Séma módosítása', 'Create schema' => 'Séma létrehozása', diff --git a/adminer/lang/it.inc.php b/adminer/lang/it.inc.php index f3a4422b..df8287e2 100644 --- a/adminer/lang/it.inc.php +++ b/adminer/lang/it.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Tipo definito dall\'utente eliminato.', 'Type has been created.' => 'Tipo definito dall\'utente creato.', 'Double click on a value to modify it.' => 'Fai doppio click su un valore per modificarlo.', - 'Increase text length to modify this value.' => 'Aumenta la lunghezza del testo per modificare questo valore.', + 'Increase Text length to modify this value.' => 'Aumenta la Lunghezza del testo per modificare questo valore.', 'Use edit link to modify this value.' => 'Usa il link modifica per modificare questo valore.', 'last' => 'ultima', 'From server' => 'Dal server', diff --git a/adminer/lang/ja.inc.php b/adminer/lang/ja.inc.php index acddf229..c93532ac 100644 --- a/adminer/lang/ja.inc.php +++ b/adminer/lang/ja.inc.php @@ -247,7 +247,7 @@ $translations = array( 'Type has been dropped.' => 'ユーザー定義型を削除しました', 'Type has been created.' => 'ユーザー定義型を追加しました', 'Double click on a value to modify it.' => 'ダブルクリックして編集', - 'Increase text length to modify this value.' => '編集枠を広げる', + 'Increase Text length to modify this value.' => '編集枠を広げる', 'Use edit link to modify this value.' => 'リンクを編集する', 'last' => '最終', 'From server' => 'サーバーから実行', diff --git a/adminer/lang/nl.inc.php b/adminer/lang/nl.inc.php index 16cd8245..c5864edc 100644 --- a/adminer/lang/nl.inc.php +++ b/adminer/lang/nl.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Type verwijderd.', 'Type has been created.' => 'Type aangemaakt.', 'Double click on a value to modify it.' => 'Dubbelklik op een waarde om deze te bewerken.', - 'Increase text length to modify this value.' => 'Verhoog de lengte om deze waarde te bewerken.', + 'Increase Text length to modify this value.' => 'Verhoog de lengte om deze waarde te bewerken.', 'Use edit link to modify this value.' => 'Gebruik de link "bewerk" om deze waarde te wijzigen.', 'last' => 'laatste', 'From server' => 'Van server', diff --git a/adminer/lang/ru.inc.php b/adminer/lang/ru.inc.php index f2ce6ea2..a253c88b 100644 --- a/adminer/lang/ru.inc.php +++ b/adminer/lang/ru.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => 'Тип удален.', 'Type has been created.' => 'Создан новый тип.', 'Double click on a value to modify it.' => 'Кликни два раза по значению, чтобы его изменить.', - 'Increase text length to modify this value.' => 'Увеличь длину текста, чтобы изменить это значение.', + 'Increase Text length to modify this value.' => 'Увеличь Длину текста, чтобы изменить это значение.', 'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».', 'last' => 'последняя', 'From server' => 'С сервера', diff --git a/adminer/lang/sk.inc.php b/adminer/lang/sk.inc.php index 2005b330..611f367b 100644 --- a/adminer/lang/sk.inc.php +++ b/adminer/lang/sk.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been created.' => 'Typ bol vytvorený.', 'Alter type' => 'Pozmeniť typ', 'Double click on a value to modify it.' => 'Dvojkliknite na políčko, ktoré chcete zmeniť.', - 'Increase text length to modify this value.' => 'Pre zmenu tejto hodnoty zvýšte dĺžku textov.', + 'Increase Text length to modify this value.' => 'Pre zmenu tejto hodnoty zvýšte Dĺžku textov.', 'Use edit link to modify this value.' => 'Pre zmenu tejto hodnoty použite odkaz upraviť.', 'last' => 'posledný', 'From server' => 'Zo serveru', diff --git a/adminer/lang/ta.inc.php b/adminer/lang/ta.inc.php index b31e23d7..d716700d 100644 --- a/adminer/lang/ta.inc.php +++ b/adminer/lang/ta.inc.php @@ -236,7 +236,7 @@ $translations = array( 'Schema has been created.' => 'அமைப்புமுறை உருவாக்க‌ப்ப‌ட்ட‌து.', 'Schema has been altered.' => 'அமைப்புமுறை மாற்ற‌ப்ப‌ட்ட‌து.', 'Double click on a value to modify it.' => 'ம‌திப்பினை மாற்ற அத‌ன் மீது இருமுறை சொடுக்க‌வும் (Double click).', - 'Increase text length to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற, டெக்ஸ்ட் நீள‌த்தினை அதிக‌ரிக்க‌வும்.', + 'Increase Text length to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற, டெக்ஸ்ட் நீள‌த்தினை அதிக‌ரிக்க‌வும்.', 'Use edit link to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற‌, தொகுப்பு இணைப்பினை உப‌யோகிக்க‌வும்.', 'last' => 'க‌டைசி', 'Sequence has been dropped.' => 'வ‌ரிசைமுறை நீக்க‌ப்ப‌ட்ட‌து.', diff --git a/adminer/lang/zh-tw.inc.php b/adminer/lang/zh-tw.inc.php index 759f7d87..1930a7e2 100644 --- a/adminer/lang/zh-tw.inc.php +++ b/adminer/lang/zh-tw.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => '已刪除類型。', 'Type has been created.' => '已建立類型。', 'Double click on a value to modify it.' => '雙擊以進行修改。', - 'Increase text length to modify this value.' => '增加字串長度來修改。', + 'Increase Text length to modify this value.' => '增加字串長度來修改。', 'Use edit link to modify this value.' => '使用編輯連結來修改。', 'last' => '最後一頁', 'From server' => '從伺服器', diff --git a/adminer/lang/zh.inc.php b/adminer/lang/zh.inc.php index b1f034d0..14045991 100644 --- a/adminer/lang/zh.inc.php +++ b/adminer/lang/zh.inc.php @@ -246,7 +246,7 @@ $translations = array( 'Type has been dropped.' => '已丢弃类型。', 'Type has been created.' => '已创建类型。', 'Double click on a value to modify it.' => '在值上双击类修改它。', - 'Increase text length to modify this value.' => '增加文本长度以修改该值。', + 'Increase Text length to modify this value.' => '增加文本长度以修改该值。', 'Use edit link to modify this value.' => '使用编辑链接来修改该值。', 'last' => '最后', 'From server' => '来自服务器', diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 859de979..6606e19e 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -340,7 +340,7 @@ if (!$columns) { $text = ereg('text|lob', $field["type"]); echo (($_GET["modify"] && $editable) || isset($value) ? "" . ($text ? "" : "") - : "" . $adminer->selectVal($val, $link, $field) + : "" . $adminer->selectVal($val, $link, $field) ); } } From a93e069d062c38ff457c65a8b52ac8d147ba89e4 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 23:54:41 +0200 Subject: [PATCH 07/26] Edit, clone and delete by AJAX --- adminer/select.inc.php | 8 ++++---- adminer/static/functions.js | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 6606e19e..2bcac10d 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -380,10 +380,10 @@ if (!$columns) { if (!information_schema(DB)) { ?>
- - - - + + + +
Date: Mon, 18 Oct 2010 00:05:39 +0200 Subject: [PATCH 08/26] Clear POST with AJAX redirect --- adminer/include/functions.inc.php | 9 ++++++--- adminer/select.inc.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index f4ab0c3e..9bb5ce18 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -345,9 +345,12 @@ function redirect($location, $message = null) { restart_session(); $_SESSION["messages"][] = $message; } - if (isset($location) && $_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { - header("Location: " . ($location != "" ? $location : ".")); - exit; + if (isset($location)) { + if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + header("Location: " . ($location != "" ? $location : ".")); + exit; + } + $_POST = array(); } } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 2bcac10d..73430d08 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -333,7 +333,7 @@ if (!$columns) { } } $id = h("val[$unique_idf][" . bracket_escape($key) . "]"); - $value = ($error ? $_POST["val"][$unique_idf][bracket_escape($key)] : null); + $value = $_POST["val"][$unique_idf][bracket_escape($key)]; $h_value = h(isset($value) ? $value : $row[$key]); $long = strpos($val, "..."); $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key]; From e3b829701ef5dacdfb1fda8106cb9add3cc51f83 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 00:09:29 +0200 Subject: [PATCH 09/26] Save and continue by AJAX --- adminer/edit.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 5a7c73e7..32424b2d 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -100,7 +100,7 @@ if (isset($_GET["select"])) { if ($fields) { echo "\n"; if (!isset($_GET["select"])) { - echo '\n"; + echo '\n"; } } if ($update) { From 28f494783f6763e6136f52ff0ff85502fad348dd Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 07:43:50 +0200 Subject: [PATCH 10/26] Multi save and delete by AJAX --- adminer/edit.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 32424b2d..1d23d12c 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -98,13 +98,13 @@ if (isset($_GET["select"])) { hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); } if ($fields) { - echo "\n"; + echo "\n"; if (!isset($_GET["select"])) { echo '\n"; } } if ($update) { - echo "\n"; + echo "\n"; } ?> From 78adfc2e3a433eab16432895549cfb0af945b3b2 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 07:54:08 +0200 Subject: [PATCH 11/26] Cancel link for multi-edit --- adminer/edit.inc.php | 3 +++ adminer/lang/cs.inc.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 1d23d12c..34399f1e 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -106,5 +106,8 @@ if ($fields) { if ($update) { echo "\n"; } +if (isset($_GET["select"])) { + echo "" . lang('Cancel') . "\n"; +} ?> diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 4c91e62a..9f10c311 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -290,4 +290,6 @@ $translations = array( // function translation used in Editor 'now' => 'teď', + + 'Cancel' => 'Storno', ); From 390e38b8f5137518be1738ea96c50f65ea2ef306 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 13:57:22 +0200 Subject: [PATCH 12/26] Load long texts for inline-edit by AJAX Display link to current page only under AJAX --- adminer/edit.inc.php | 2 +- adminer/include/adminer.inc.php | 2 +- adminer/include/design.inc.php | 4 +- adminer/include/functions.inc.php | 9 ++++- adminer/lang/ca.inc.php | 1 - adminer/lang/cs.inc.php | 1 - adminer/lang/de.inc.php | 1 - adminer/lang/es.inc.php | 1 - adminer/lang/et.inc.php | 1 - adminer/lang/fr.inc.php | 1 - adminer/lang/hu.inc.php | 1 - adminer/lang/it.inc.php | 1 - adminer/lang/ja.inc.php | 1 - adminer/lang/nl.inc.php | 1 - adminer/lang/ru.inc.php | 1 - adminer/lang/sk.inc.php | 1 - adminer/lang/ta.inc.php | 1 - adminer/lang/zh-tw.inc.php | 1 - adminer/lang/zh.inc.php | 1 - adminer/select.inc.php | 14 +++++-- adminer/static/functions.js | 66 ++++++++++++++++++++----------- editor/include/adminer.inc.php | 4 +- 22 files changed, 68 insertions(+), 48 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 34399f1e..1a478c58 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -107,7 +107,7 @@ if ($update) { echo "\n"; } if (isset($_GET["select"])) { - echo "" . lang('Cancel') . "\n"; + echo "" . lang('Cancel') . "\n"; } ?> diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 2944c9cd..418a2cc8 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -130,7 +130,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . " #\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; } /** Description of a row in a table diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index a7716bb7..aa14ea02 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -10,7 +10,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { global $LANG, $HTTPS, $adminer, $connection, $drivers; header("Content-Type: text/html; charset=utf-8"); $adminer->headers(); - if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + if (!is_ajax()) { $title_all = $title . ($title2 != "" ? ": " . h($title2) : ""); $protocol = ($HTTPS ? "https" : "http"); ?> @@ -81,7 +81,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { */ function page_footer($missing = "") { global $adminer; - if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + if (!is_ajax()) { ?>

diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 9bb5ce18..6c78fa70 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -335,6 +335,13 @@ function auth_url($driver, $server, $username) { ; } +/** Find whether it is an AJAX request +* @return bool +*/ +function is_ajax() { + return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"); +} + /** Send Location header and exit * @param string null to only set a message * @param string @@ -346,7 +353,7 @@ function redirect($location, $message = null) { $_SESSION["messages"][] = $message; } if (isset($location)) { - if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + if (!is_ajax()) { header("Location: " . ($location != "" ? $location : ".")); exit; } diff --git a/adminer/lang/ca.inc.php b/adminer/lang/ca.inc.php index 6ba91fd4..cca98ebd 100644 --- a/adminer/lang/ca.inc.php +++ b/adminer/lang/ca.inc.php @@ -235,7 +235,6 @@ $translations = array( 'Databases have been dropped.' => 'S\'han suprimit les bases de dades.', 'File exists.' => 'El fitxer ja existeix.', 'Double click on a value to modify it.' => 'Fes un doble clic a un valor per modificar-lo.', - 'Increase Text length to modify this value.' => 'Incrementa la Longitud del text per modificar aquest valor.', 'Use edit link to modify this value.' => 'Utilitza l\'enllaç d\'edició per modificar aquest valor.', 'Alter schema' => 'Modifica l\'esquema', 'Create schema' => 'Crea un esquema', diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 9f10c311..a80e0dac 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -251,7 +251,6 @@ $translations = array( // 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 diff --git a/adminer/lang/de.inc.php b/adminer/lang/de.inc.php index df431c8f..9915b655 100644 --- a/adminer/lang/de.inc.php +++ b/adminer/lang/de.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Typ gelöscht.', 'Type has been created.' => 'Typ erstellt.', 'Double click on a value to modify it.' => 'Doppelklick zum Bearbeiten des Wertes.', - 'Increase Text length to modify this value.' => 'Vergrössern Sie die Textlänge um den Wert ändern zu können.', 'Use edit link to modify this value.' => 'Benutzen Sie den Link zum editieren dieses Wertes.', 'last' => 'letzte', 'From server' => 'Auf Server', diff --git a/adminer/lang/es.inc.php b/adminer/lang/es.inc.php index 6c2a3f62..dd1dfdf1 100644 --- a/adminer/lang/es.inc.php +++ b/adminer/lang/es.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Tipo eliminado.', 'Type has been created.' => 'Tipo creado.', 'Double click on a value to modify it.' => 'Doble-clic sobre el valor para editarlo.', - 'Increase Text length to modify this value.' => 'Aumente el tamaño del campo de texto para modificar este valor.', 'Use edit link to modify this value.' => 'Utilice el enlace de modificar para realizar los cambios.', 'last' => 'último', 'From server' => 'Desde servidor', diff --git a/adminer/lang/et.inc.php b/adminer/lang/et.inc.php index 7b79eaa8..dfddb494 100644 --- a/adminer/lang/et.inc.php +++ b/adminer/lang/et.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Tüüp on edukalt kustutatud.', 'Type has been created.' => 'Tüüp on edukalt loodud.', 'Double click on a value to modify it.' => 'Väärtuse muutmiseks topelt-kliki sellel.', - 'Increase Text length to modify this value.' => 'Väärtuse muutmiseks suurenda Tekstiveeru pikkust.', 'Use edit link to modify this value.' => 'Väärtuse muutmiseks kasuta muutmislinki.', 'last' => 'viimane', 'From server' => 'Serverist', diff --git a/adminer/lang/fr.inc.php b/adminer/lang/fr.inc.php index 672f60c9..763cf661 100644 --- a/adminer/lang/fr.inc.php +++ b/adminer/lang/fr.inc.php @@ -245,7 +245,6 @@ $translations = array( 'Type has been dropped.' => 'Le type a été supprimé.', 'Type has been created.' => 'Le type a été créé.', 'Double click on a value to modify it.' => 'Double-cliquez sur une valeur pour la modifier.', - 'Increase Text length to modify this value.' => 'Augmentez la Longueur de texte affiché pour modifier cette valeur.', 'Use edit link to modify this value.' => 'Utilisez le lien "modifier" pour modifier cette valeur.', 'last' => 'dernière', 'From server' => 'Depuis le serveur', diff --git a/adminer/lang/hu.inc.php b/adminer/lang/hu.inc.php index 88291d2b..a36adca3 100644 --- a/adminer/lang/hu.inc.php +++ b/adminer/lang/hu.inc.php @@ -235,7 +235,6 @@ $translations = array( 'Databases have been dropped.' => 'Adatbázis eldobva.', 'File exists.' => 'A fájl létezik.', 'Double click on a value to modify it.' => 'Kattints kétszer az értékre a szerkesztéshez.', - 'Increase Text length to modify this value.' => 'Növeld a Szöveg hosszát, hogy módosítani tudd ezt az értéket.', 'Use edit link to modify this value.' => 'Használd a szerkesztés hivatkozást ezen érték módosításához.', 'Alter schema' => 'Séma módosítása', 'Create schema' => 'Séma létrehozása', diff --git a/adminer/lang/it.inc.php b/adminer/lang/it.inc.php index 900f1544..3af422d2 100644 --- a/adminer/lang/it.inc.php +++ b/adminer/lang/it.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Tipo definito dall\'utente eliminato.', 'Type has been created.' => 'Tipo definito dall\'utente creato.', 'Double click on a value to modify it.' => 'Fai doppio click su un valore per modificarlo.', - 'Increase Text length to modify this value.' => 'Aumenta la Lunghezza del testo per modificare questo valore.', 'Use edit link to modify this value.' => 'Usa il link modifica per modificare questo valore.', 'last' => 'ultima', 'From server' => 'Dal server', diff --git a/adminer/lang/ja.inc.php b/adminer/lang/ja.inc.php index c93532ac..39228c3d 100644 --- a/adminer/lang/ja.inc.php +++ b/adminer/lang/ja.inc.php @@ -247,7 +247,6 @@ $translations = array( 'Type has been dropped.' => 'ユーザー定義型を削除しました', 'Type has been created.' => 'ユーザー定義型を追加しました', 'Double click on a value to modify it.' => 'ダブルクリックして編集', - 'Increase Text length to modify this value.' => '編集枠を広げる', 'Use edit link to modify this value.' => 'リンクを編集する', 'last' => '最終', 'From server' => 'サーバーから実行', diff --git a/adminer/lang/nl.inc.php b/adminer/lang/nl.inc.php index c5864edc..e8df9222 100644 --- a/adminer/lang/nl.inc.php +++ b/adminer/lang/nl.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Type verwijderd.', 'Type has been created.' => 'Type aangemaakt.', 'Double click on a value to modify it.' => 'Dubbelklik op een waarde om deze te bewerken.', - 'Increase Text length to modify this value.' => 'Verhoog de lengte om deze waarde te bewerken.', 'Use edit link to modify this value.' => 'Gebruik de link "bewerk" om deze waarde te wijzigen.', 'last' => 'laatste', 'From server' => 'Van server', diff --git a/adminer/lang/ru.inc.php b/adminer/lang/ru.inc.php index b7d0ef5c..48c1735c 100644 --- a/adminer/lang/ru.inc.php +++ b/adminer/lang/ru.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => 'Тип удален.', 'Type has been created.' => 'Создан новый тип.', 'Double click on a value to modify it.' => 'Кликни два раза по значению, чтобы его изменить.', - 'Increase Text length to modify this value.' => 'Увеличь Длину текста, чтобы изменить это значение.', 'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».', 'last' => 'последняя', 'From server' => 'С сервера', diff --git a/adminer/lang/sk.inc.php b/adminer/lang/sk.inc.php index 33f5cc34..282c2cf9 100644 --- a/adminer/lang/sk.inc.php +++ b/adminer/lang/sk.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been created.' => 'Typ bol vytvorený.', 'Alter type' => 'Pozmeniť typ', 'Double click on a value to modify it.' => 'Dvojkliknite na políčko, ktoré chcete zmeniť.', - 'Increase Text length to modify this value.' => 'Pre zmenu tejto hodnoty zvýšte Dĺžku textov.', 'Use edit link to modify this value.' => 'Pre zmenu tejto hodnoty použite odkaz upraviť.', 'last' => 'posledný', 'From server' => 'Zo serveru', diff --git a/adminer/lang/ta.inc.php b/adminer/lang/ta.inc.php index 53409554..49febf59 100644 --- a/adminer/lang/ta.inc.php +++ b/adminer/lang/ta.inc.php @@ -236,7 +236,6 @@ $translations = array( 'Schema has been created.' => 'அமைப்புமுறை உருவாக்க‌ப்ப‌ட்ட‌து.', 'Schema has been altered.' => 'அமைப்புமுறை மாற்ற‌ப்ப‌ட்ட‌து.', 'Double click on a value to modify it.' => 'ம‌திப்பினை மாற்ற அத‌ன் மீது இருமுறை சொடுக்க‌வும் (Double click).', - 'Increase Text length to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற, டெக்ஸ்ட் நீள‌த்தினை அதிக‌ரிக்க‌வும்.', 'Use edit link to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற‌, தொகுப்பு இணைப்பினை உப‌யோகிக்க‌வும்.', 'last' => 'க‌டைசி', 'Sequence has been dropped.' => 'வ‌ரிசைமுறை நீக்க‌ப்ப‌ட்ட‌து.', diff --git a/adminer/lang/zh-tw.inc.php b/adminer/lang/zh-tw.inc.php index 1930a7e2..b9ad1908 100644 --- a/adminer/lang/zh-tw.inc.php +++ b/adminer/lang/zh-tw.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => '已刪除類型。', 'Type has been created.' => '已建立類型。', 'Double click on a value to modify it.' => '雙擊以進行修改。', - 'Increase Text length to modify this value.' => '增加字串長度來修改。', 'Use edit link to modify this value.' => '使用編輯連結來修改。', 'last' => '最後一頁', 'From server' => '從伺服器', diff --git a/adminer/lang/zh.inc.php b/adminer/lang/zh.inc.php index 14045991..bcfd0ba4 100644 --- a/adminer/lang/zh.inc.php +++ b/adminer/lang/zh.inc.php @@ -246,7 +246,6 @@ $translations = array( 'Type has been dropped.' => '已丢弃类型。', 'Type has been created.' => '已创建类型。', 'Double click on a value to modify it.' => '在值上双击类修改它。', - 'Increase Text length to modify this value.' => '增加文本长度以修改该值。', 'Use edit link to modify this value.' => '使用编辑链接来修改该值。', 'last' => '最后', 'From server' => '来自服务器', diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 412359b8..aa175afc 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -26,6 +26,14 @@ $limit = $adminer->selectLimitProcess(); $from = ($select ? implode(", ", $select) : "*") . "\nFROM " . table($TABLE); $group_by = ($group && count($group) < count($select) ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""); +if ($_GET["val"] && is_ajax()) { + header("Content-Type: text/plain; charset=utf-8"); + foreach ($_GET["val"] as $unique_idf => $row) { + echo $connection->result("SELECT" . limit(idf_escape(key($row)) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1)); + } + exit; +} + if ($_POST && !$error) { $where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")"; $primary = $unselected = null; @@ -254,7 +262,7 @@ if (!$columns) { if ($name != "") { $order++; $names[$key] = $name; - echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions + echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions } $functions[$key] = $val["fun"]; next($select); @@ -336,11 +344,11 @@ if (!$columns) { $value = $_POST["val"][$unique_idf][bracket_escape($key)]; $h_value = h(isset($value) ? $value : $row[$key]); $long = strpos($val, "..."); - $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key]; + $editable = is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key]; $text = ereg('text|lob', $field["type"]); echo (($_GET["modify"] && $editable) || isset($value) ? "" . ($text ? "" : "") - : "" . $adminer->selectVal($val, $link, $field) + : "" . $adminer->selectVal($val, $link, $field) ); } } diff --git a/adminer/static/functions.js b/adminer/static/functions.js index d9d93846..30869daa 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -163,36 +163,23 @@ function textareaKeydown(target, event, tab, button) { -var ajaxState = 0; -var ajaxTimeout; - /** Create AJAX request * @param string +* @param function (text) * @param [string] * @return XMLHttpRequest or false in case of an error */ -function ajax(url, data) { +function ajax(url, callback, data) { var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); if (xmlhttp) { - var currentState = ++ajaxState; - clearTimeout(ajaxTimeout); - ajaxTimeout = setTimeout(function () { - setHtml('main', ''); - }, 500); // defer displaying loader - var method = (data === undefined ? 'GET' : 'POST'); - xmlhttp.open(method, url); - if (method == 'POST') { + xmlhttp.open((data === undefined ? 'GET' : 'POST'), url); + if (data) { xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4 && currentState == ajaxState) { - clearTimeout(ajaxTimeout); - setHtml('main', xmlhttp.responseText); - if (window.jush) { - jush.highlight_tag('code'); - jush.highlight_tag('pre', 0); - } + xmlhttp.onreadystatechange = function (text) { + if (xmlhttp.readyState == 4) { + callback(xmlhttp.responseText); } }; xmlhttp.send(data); @@ -200,6 +187,32 @@ function ajax(url, data) { return xmlhttp; } +var ajaxState = 0; +var ajaxTimeout; + +/** Load content to #main +* @param string +* @param [string] +* @return XMLHttpRequest or false in case of an error +*/ +function ajaxMain(url, data) { + var currentState = ++ajaxState; + clearTimeout(ajaxTimeout); + ajaxTimeout = setTimeout(function () { + setHtml('main', ''); + }, 500); // defer displaying loader + return ajax(url, function (text) { + if (currentState == ajaxState) { + clearTimeout(ajaxTimeout); + setHtml('main', text); + if (window.jush) { + jush.highlight_tag('code'); + jush.highlight_tag('pre', 0); + } + } + }, data); +} + /** Send form by AJAX GET * @param HTMLFormElement * @param [string] @@ -217,9 +230,9 @@ function ajaxForm(form, data) { params.push(data); } if (form.method == 'post') { - return ajax(form.action || location.href, params.join('&')); + return ajaxMain(form.action || location.href, params.join('&')); } else { - return ajax((form.action || location.pathname) + '?' + params.join('&')); + return ajaxMain((form.action || location.pathname) + '?' + params.join('&')); } } @@ -228,14 +241,13 @@ function ajaxForm(form, data) { /** Display edit field * @param HTMLElement * @param MouseEvent -* @param boolean display textarea instead of input +* @param number display textarea instead of input, 2 - load long text */ function selectDblClick(td, event, text) { var pos = event.rangeOffset; var value = (td.firstChild.firstChild ? td.firstChild.firstChild.data : (td.firstChild.alt ? td.firstChild.alt : td.firstChild.data)); var input = document.createElement(text ? 'textarea' : 'input'); input.name = td.id; - input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); //   or i - NULL input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border) if (text) { var rows = 1; @@ -258,6 +270,12 @@ function selectDblClick(td, event, text) { td.innerHTML = ''; td.appendChild(input); input.focus(); + if (text == 2) { // long text + return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (text) { + input.value = text; + }); + } + input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); //   or i - NULL input.selectionStart = pos; input.selectionEnd = pos; if (document.selection) { diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 9495d944..224246c3 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -62,7 +62,9 @@ document.getElementById('username').focus(); echo '

' . lang('New item') . "\n"; } echo ">>\n"; - echo "#\n"; + if (is_ajax()) { + echo "#\n"; + } } function backwardKeys($table, $tableName) { From 388680ac62b6b2b624e8266ab5d2328d4bf0ddf3 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 16:56:10 +0200 Subject: [PATCH 13/26] Maria renamed to Aria --- adminer/indexes.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index cb9f5c10..afb91270 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -2,7 +2,7 @@ $TABLE = $_GET["indexes"]; $index_types = array("PRIMARY", "UNIQUE", "INDEX"); $table_status = table_status($TABLE); -if (ereg("MyISAM|Maria", $table_status["Engine"])) { +if (eregi("MyISAM|M?aria", $table_status["Engine"])) { $index_types[] = "FULLTEXT"; } $indexes = indexes($TABLE); From 6e3c7cba1f5856cb66a9da8029c61daa6d8a63df Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 22:39:17 +0200 Subject: [PATCH 14/26] Use AJAX for pagination --- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- adminer/select.inc.php | 5 +++-- editor/include/adminer.inc.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 418a2cc8..5a31af0b 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -130,7 +130,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; } /** Description of a row in a table diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 6c78fa70..683135c1 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -442,7 +442,7 @@ function remove_from_uri($param = "") { * @return string */ function pagination($page, $current) { - return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); + return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); } /** Get file contents from $_FILES diff --git a/adminer/select.inc.php b/adminer/select.inc.php index aa175afc..715a0757 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -377,11 +377,12 @@ if (!$columns) { if (intval($limit) && $found_rows > $limit) { // display first, previous 4, next 4 and last page $max_page = floor(($found_rows - 1) / $limit); - echo '" . lang('Page') . ":" . pagination(0, $page) . ($page > 5 ? " ..." : ""); + echo '" . lang('Page') . ":"; + echo pagination(0, $page) . ($page > 5 ? " ..." : ""); for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) { echo pagination($i, $page); } - echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); + echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); } echo " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " . checkbox("all", 1, 0, lang('whole result')) . "\n"; diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 224246c3..a198d118 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -61,7 +61,7 @@ document.getElementById('username').focus(); if (isset($set)) { echo '

' . lang('New item') . "\n"; } - echo ">>\n"; + echo ">>\n"; if (is_ajax()) { echo "#\n"; } From d9fbb905f3f0d6a1df872df010275f591c803c33 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 23:44:00 +0200 Subject: [PATCH 15/26] SQL command by AJAX --- adminer/sql.inc.php | 10 ++++++---- adminer/static/functions.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 69f9a1d9..fa88156c 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -18,7 +18,7 @@ if (!$error && $_POST) { : "compress.bzip2://adminer.sql.bz2" )), "rb"); $query = ($fp ? fread($fp, 1e6) : false); - } elseif ($_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE + } elseif ($_FILES["sql_file"] && $_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE $query = get_file("sql_file", true); } if (is_string($query)) { // get_file() returns error as number, fread() as false @@ -126,9 +126,11 @@ if (!$error && $_POST) { echo "

" . upload_error($query) . "\n"; } } + +$uploads = ini_bool("file_uploads"); ?> -

+!ajaxForm(this);">

document.getElementsByTagName('textarea')[0].focus();\n"); -echo "

" . (ini_bool("file_uploads") ? lang('File upload') . ': ' : lang('File uploads are disabled.')); +echo "

" . ($uploads ? lang('File upload') . ': ' : lang('File uploads are disabled.')); ?>

@@ -155,7 +157,7 @@ foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) { } } echo lang('Webserver file %s', "adminer.sql" . ($compress ? "[" . implode("|", $compress) . "]" : "") . ""); -echo ' '; +echo ' '; echo "

\n"; if ($history) { diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 30869daa..f1439bf4 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -154,7 +154,7 @@ function textareaKeydown(target, event, tab, button) { if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey) { // shiftKey allowed if (button) { button.click(); - } else { + } else if (!target.form.onsubmit || target.form.onsubmit() !== false) { target.form.submit(); } } From 21e70bc00f8627bec4e6f69e541730eabb60f567 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 00:11:54 +0200 Subject: [PATCH 16/26] IE compatibility --- adminer/static/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index f1439bf4..c355f4b2 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -230,7 +230,7 @@ function ajaxForm(form, data) { params.push(data); } if (form.method == 'post') { - return ajaxMain(form.action || location.href, params.join('&')); + return ajaxMain((/\?/.test(form.action) ? form.action : location.href), params.join('&')); // ? - always part of Adminer URL } else { return ajaxMain((form.action || location.pathname) + '?' + params.join('&')); } From 4fe9b606ece2832e1aaa86f18d80e97ed4aa0cdb Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 00:22:09 +0200 Subject: [PATCH 17/26] Don't send SQL commands by AJAX (can change navigation and flushes output) --- adminer/sql.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index fa88156c..c4f74574 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -18,7 +18,7 @@ if (!$error && $_POST) { : "compress.bzip2://adminer.sql.bz2" )), "rb"); $query = ($fp ? fread($fp, 1e6) : false); - } elseif ($_FILES["sql_file"] && $_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE + } elseif ($_FILES && $_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE $query = get_file("sql_file", true); } if (is_string($query)) { // get_file() returns error as number, fread() as false @@ -126,11 +126,9 @@ if (!$error && $_POST) { echo "

" . upload_error($query) . "\n"; } } - -$uploads = ini_bool("file_uploads"); ?> -!ajaxForm(this);"> +

document.getElementsByTagName('textarea')[0].focus();\n"); -echo "

" . ($uploads ? lang('File upload') . ': ' : lang('File uploads are disabled.')); +echo "

" . (ini_bool("file_uploads") ? lang('File upload') . ': ' : lang('File uploads are disabled.')); ?>

@@ -157,7 +155,7 @@ foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) { } } echo lang('Webserver file %s', "adminer.sql" . ($compress ? "[" . implode("|", $compress) . "]" : "") . ""); -echo ' '; +echo ' '; echo "\n"; if ($history) { From c5ee9778b4bc3214dbffb4f98ed4a9e681bc1563 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 00:57:37 +0200 Subject: [PATCH 18/26] Set in-place input name after value to never send empty data --- adminer/static/functions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c355f4b2..6a1fb84d 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -247,7 +247,6 @@ function selectDblClick(td, event, text) { var pos = event.rangeOffset; var value = (td.firstChild.firstChild ? td.firstChild.firstChild.data : (td.firstChild.alt ? td.firstChild.alt : td.firstChild.data)); var input = document.createElement(text ? 'textarea' : 'input'); - input.name = td.id; input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border) if (text) { var rows = 1; @@ -273,9 +272,11 @@ function selectDblClick(td, event, text) { if (text == 2) { // long text return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (text) { input.value = text; + input.name = td.id; }); } input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); //   or i - NULL + input.name = td.id; input.selectionStart = pos; input.selectionEnd = pos; if (document.selection) { From c313dd83a23e87bd18dc20f045a037b8ae9c07a4 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 01:40:49 +0200 Subject: [PATCH 19/26] Deferred operations by AJAX instead of JS (doesn't require sending token) --- adminer/db.inc.php | 4 +--- adminer/include/connect.inc.php | 2 +- adminer/include/functions.inc.php | 19 +++++++++++++++++++ adminer/script.inc.php | 19 +++++++++---------- adminer/static/functions.js | 13 +++++++++++++ 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/adminer/db.inc.php b/adminer/db.inc.php index b433c49f..dd668031 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -155,8 +155,6 @@ if ($_GET["ns"] !== "") { } if ($tables_list) { - page_footer(); - echo "\n"; - exit; // page_footer() already called + echo "\n"; } } diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 1f58a6ef..52a910cf 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -45,7 +45,7 @@ function connect_error() { } page_footer("db"); if ($databases) { - echo "\n"; + echo "\n"; } } diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 683135c1..b063e735 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -482,6 +482,25 @@ function odd($return = ' class="odd"') { return ($i++ % 2 ? $return : ''); } +/** Print one row in JSON object +* @param string or "" to close the object +* @param string +* @return null +*/ +function json_row($key, $val = null) { + static $first = true; + if ($first) { + echo "{"; + } + if ($key != "") { + echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, '\\"') . '": ' . (isset($val) ? '"' . addcslashes($val, '\\"') . '"' : 'undefined'); + $first = false; + } else { + echo "\n}\n"; + $first = true; + } +} + /** Check whether the string is in UTF-8 * @param string * @return bool diff --git a/adminer/script.inc.php b/adminer/script.inc.php index 81d663e9..5b892514 100644 --- a/adminer/script.inc.php +++ b/adminer/script.inc.php @@ -1,38 +1,37 @@ 0, "Index_length" => 0, "Data_free" => 0); foreach (table_status() as $row) { - $id = addcslashes($row["Name"], "\\'/"); - echo "setHtml('Comment-$id', '" . addcslashes(nbsp($row["Comment"]), "'\\") . "');\n"; + $id = $row["Name"]; + json_row("Comment-$id", nbsp($row["Comment"])); if (!is_view($row)) { foreach (array("Engine", "Collation") as $key) { - echo "setHtml('$key-$id', '" . addcslashes(nbsp($row[$key]), "'\\") . "');\n"; + json_row("$key-$id", nbsp($row[$key])); } foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) { if ($row[$key] != "") { $val = number_format($row[$key], 0, '.', lang(',')); - echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n"; + json_row("$key-$id", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val)); if (isset($sums[$key])) { $sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0); } } elseif (array_key_exists($key, $row)) { - echo "setHtml('$key-$id');\n"; + json_row("$key-$id"); } } } } foreach ($sums as $key => $val) { - echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n"; + json_row("sum-$key", number_format($val, 0, '.', lang(','))); } + json_row(""); } else { // connect foreach (count_tables(get_databases()) as $db => $val) { - echo "setHtml('tables-" . addcslashes($db, "\\'/") . "', '$val');\n"; + json_row("tables-$db", $val); } + json_row(""); } exit; // don't print footer diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 6a1fb84d..54728a00 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -187,6 +187,19 @@ function ajax(url, callback, data) { return xmlhttp; } +/** Use setHtml(key, value) for JSON response +* @param string +* @return XMLHttpRequest or false in case of an error +*/ +function ajaxSetHtml(url) { + return ajax(url, function (text) { + var data = eval('(' + text + ')'); + for (var key in data) { + setHtml(key, data[key]); + } + }); +} + var ajaxState = 0; var ajaxTimeout; From 0ba6eaa3e21e22ea0f6dd49dc91719d91a148380 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 19 Oct 2010 16:44:12 +0200 Subject: [PATCH 20/26] Handle sending the form without AJAX after AJAX request --- adminer/edit.inc.php | 2 +- adminer/select.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 1a478c58..f3f86087 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -64,7 +64,7 @@ if ($_POST["save"]) { } ?> - +" method="post" enctype="multipart/form-data"> \n"; diff --git a/adminer/select.inc.php b/adminer/select.inc.php index c7315f7a..bdfdced8 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -231,7 +231,7 @@ if (!$columns) { $result->seek($limit * $page); } $email_fields = array(); - echo "\n"; + echo "\n"; // $_SERVER["REQUEST_URI"] is required for sending the form after an AJAX request $rows = array(); while ($row = $result->fetch_assoc()) { $rows[] = $row; From b37435d7162b70c9de27941e26cc83c0ea19b531 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 00:15:33 +0200 Subject: [PATCH 21/26] Don't use AJAX with Ctrl --- adminer/edit.inc.php | 2 +- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- adminer/select.inc.php | 6 +++--- adminer/static/functions.js | 6 +++++- editor/include/adminer.inc.php | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index f3f86087..4390bc0c 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -107,7 +107,7 @@ if ($update) { echo "\n"; } if (isset($_GET["select"])) { - echo "" . lang('Cancel') . "\n"; + echo "" . lang('Cancel') . "\n"; } ?> diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 5a31af0b..a24b1ba8 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -130,7 +130,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; } /** Description of a row in a table diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0c477db9..36ba8916 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -450,7 +450,7 @@ function remove_from_uri($param = "") { * @return string */ function pagination($page, $current) { - return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); + return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); } /** Get file contents from $_FILES diff --git a/adminer/select.inc.php b/adminer/select.inc.php index bdfdced8..cbb2ac89 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -262,7 +262,7 @@ if (!$columns) { if ($name != "") { $order++; $names[$key] = $name; - echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions + echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions } $functions[$key] = $val["fun"]; next($select); @@ -377,12 +377,12 @@ if (!$columns) { if (intval($limit) && $found_rows > $limit) { // display first, previous 4, next 4 and last page $max_page = floor(($found_rows - 1) / $limit); - echo '" . lang('Page') . ":"; + echo '" . lang('Page') . ":"; echo pagination(0, $page) . ($page > 5 ? " ..." : ""); for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) { echo pagination($i, $page); } - echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); + echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); } echo " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " . checkbox("all", 1, 0, lang('whole result')) . "\n"; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 27a3468f..c04e9bde 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -206,9 +206,13 @@ var ajaxTimeout; /** Load content to #main * @param string * @param [string] +* @param [MouseEvent] * @return XMLHttpRequest or false in case of an error */ -function ajaxMain(url, data) { +function ajaxMain(url, data, event) { + if (event && event.ctrlKey) { + return false; + } var currentState = ++ajaxState; clearTimeout(ajaxTimeout); ajaxTimeout = setTimeout(function () { diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 6fe01978..b1fe1470 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -61,7 +61,7 @@ document.getElementById('username').focus(); if (isset($set)) { echo '

' . lang('New item') . "\n"; } - echo ">>\n"; + echo ">>\n"; if (is_ajax()) { echo "#\n"; } From b53585369455fa258e33c63cf93dd05a07c0872e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 17:09:30 +0100 Subject: [PATCH 22/26] Full AJAX only with pushState to work correctly with history --- adminer/edit.inc.php | 5 +--- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 6 ++++- adminer/lang/cs.inc.php | 2 -- adminer/select.inc.php | 2 +- adminer/static/functions.js | 41 +++++++++++++++++++++++++------ 6 files changed, 41 insertions(+), 17 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 4390bc0c..1d23d12c 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -64,7 +64,7 @@ if ($_POST["save"]) { } ?> -

" method="post" enctype="multipart/form-data"> + \n"; @@ -106,8 +106,5 @@ if ($fields) { if ($update) { echo "\n"; } -if (isset($_GET["select"])) { - echo "" . lang('Cancel') . "\n"; -} ?>
diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index a24b1ba8..b9bb39cb 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -130,7 +130,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "\n"; } /** Description of a row in a table diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 36ba8916..550fd999 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -361,10 +361,14 @@ function redirect($location, $message = null) { $_SESSION["messages"][] = $message; } if (isset($location)) { + if ($location == "") { + $location = "."; + } if (!is_ajax()) { - header("Location: " . ($location != "" ? $location : ".")); + header("Location: $location"); exit; } + header("X-AJAX-Redirect: $location"); $_POST = array(); } } diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index a80e0dac..f2cd1048 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -289,6 +289,4 @@ $translations = array( // function translation used in Editor 'now' => 'teď', - - 'Cancel' => 'Storno', ); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index cbb2ac89..a4473995 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -231,7 +231,7 @@ if (!$columns) { $result->seek($limit * $page); } $email_fields = array(); - echo "

\n"; // $_SERVER["REQUEST_URI"] is required for sending the form after an AJAX request + echo "\n"; $rows = array(); while ($row = $result->fetch_assoc()) { $rows[] = $row; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c04e9bde..dd161f23 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -172,13 +172,17 @@ function textareaKeydown(target, event, tab, button) { function ajax(url, callback, data) { var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); if (xmlhttp) { - xmlhttp.open((data === undefined ? 'GET' : 'POST'), url); + xmlhttp.open((data ? 'POST' : 'GET'), url); if (data) { xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xmlhttp.onreadystatechange = function (text) { if (xmlhttp.readyState == 4) { + var redirect = xmlhttp.getResponseHeader('X-AJAX-Redirect'); + if (redirect && history.replaceState) { + history.replaceState(null, '', redirect); + } callback(xmlhttp.responseText); } }; @@ -203,16 +207,12 @@ function ajaxSetHtml(url) { var ajaxState = 0; var ajaxTimeout; -/** Load content to #main +/** Safely load content to #main * @param string * @param [string] -* @param [MouseEvent] * @return XMLHttpRequest or false in case of an error */ -function ajaxMain(url, data, event) { - if (event && event.ctrlKey) { - return false; - } +function ajaxSend(url, data) { var currentState = ++ajaxState; clearTimeout(ajaxTimeout); ajaxTimeout = setTimeout(function () { @@ -230,6 +230,29 @@ function ajaxMain(url, data, event) { }, data); } +/** Load content to #main +* @param string +* @param [string] +* @param [MouseEvent] +* @return XMLHttpRequest or false in case of an error +*/ +function ajaxMain(url, data, event) { + if (!history.pushState || (event && event.ctrlKey)) { + return false; + } + history.pushState(data, '', url); + return ajaxSend(url, data); +} + +/** Revive page from history +* @param PopStateEvent +*/ +window.onpopstate = function (event) { + if (ajaxState || event.state) { + ajaxSend(location.href, event.state); + } +} + /** Send form by AJAX GET * @param HTMLFormElement * @param [string] @@ -239,7 +262,9 @@ function ajaxForm(form, data) { var params = [ ]; for (var i=0; i < form.elements.length; i++) { var el = form.elements[i]; - if (el.name && (!/checkbox|radio|submit|file/i.test(el.type) || el.checked)) { + if (/file/i.test(el.type) && el.value) { + return false; + } else if (el.name && (!/checkbox|radio|submit|file/i.test(el.type) || el.checked)) { params.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value)); } } From d8c7ea9837552b3e485d9135a2fb72fc2e15dce5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 17:17:46 +0100 Subject: [PATCH 23/26] Highlighting only inside --- adminer/include/adminer.inc.php | 2 +- adminer/sql.inc.php | 2 +- adminer/static/editing.js | 3 +-- adminer/static/functions.js | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index b9bb39cb..804f5958 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -398,7 +398,7 @@ document.getElementById('username').focus(); ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment : $query ); //! respect $_GET["ns"] - return " " . lang('SQL command') . "'; + return " " . lang('SQL command') . "'; } /** Functions displayed in edit form diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index c4f74574..26641567 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -59,7 +59,7 @@ if (!$error && $_POST) { $empty = false; $q = substr($query, 0, $match[0][1]); $commands++; - echo "
" . shorten_utf8(trim($q), 1000) . "
\n"; + echo "
" . shorten_utf8(trim($q), 1000) . "
\n"; ob_flush(); flush(); // can take a long time - show the running query $start = explode(" ", microtime()); // microtime(true) is available since PHP 5 diff --git a/adminer/static/editing.js b/adminer/static/editing.js index 95e452f5..4ac8f493 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -22,8 +22,7 @@ function bodyLoad(version, protocol) { if (window.jushLinks) { jush.custom_links = jushLinks; } - jush.highlight_tag('pre', 0); - jush.highlight_tag('code'); + jush.highlight_tag('code', 0); } }; script.onreadystatechange = function () { diff --git a/adminer/static/functions.js b/adminer/static/functions.js index dd161f23..97c2b354 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -223,8 +223,7 @@ function ajaxSend(url, data) { clearTimeout(ajaxTimeout); setHtml('main', text); if (window.jush) { - jush.highlight_tag('code'); - jush.highlight_tag('pre', 0); + jush.highlight_tag('code', 0); } } }, data); From 3d4b83128058c3e6623b29177e0d5f561a7d2c20 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 17:55:13 +0100 Subject: [PATCH 24/26] Whitespace --- adminer/lang/pl.inc.php | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/adminer/lang/pl.inc.php b/adminer/lang/pl.inc.php index 032d4cfd..9d2eca48 100644 --- a/adminer/lang/pl.inc.php +++ b/adminer/lang/pl.inc.php @@ -63,9 +63,7 @@ $translations = array( 'Action' => 'Czynność', 'edit' => 'zmień', 'Page' => 'Strona', - 'Query executed OK, %d row(s) affected.' => array('Wykonanie pomyślne, zmieniono %d rekord.', - 'Wykonanie pomyślne, zmieniono %d rekordy.', - 'Wykonanie pomyślne, zmieniono %d rekordów.'), + 'Query executed OK, %d row(s) affected.' => array('Wykonanie pomyślne, zmieniono %d rekord.', 'Wykonanie pomyślne, zmieniono %d rekordy.', 'Wykonanie pomyślne, zmieniono %d rekordów.'), 'Error in query' => 'Bląd w zapytaniu', 'Execute' => 'Wykonaj', 'Table' => 'Tabela', @@ -81,9 +79,7 @@ $translations = array( 'Unable to upload a file.' => 'Nie było możliwe nagrać plik.', 'File upload' => 'Nagranie pliku', 'File uploads are disabled.' => 'Nagranie pliku nie jest dozwolone.', - 'Routine has been called, %d row(s) affected.' => array('Procedura była uruchomiona, został zmieniony %d rekord.', - 'Procedura była uruchomiona, zostały zmienione %d rekordy.', - 'Procedura była uruchomiona, %d rekordów zostało zmienionych.'), + 'Routine has been called, %d row(s) affected.' => array('Procedura była uruchomiona, został zmieniony %d rekord.', 'Procedura była uruchomiona, zostały zmienione %d rekordy.', 'Procedura była uruchomiona, %d rekordów zostało zmienionych.'), 'Call' => 'Uruchomić', 'No extension' => 'Bez rozszerzenia', 'None of the supported PHP extensions (%s) are available.' => 'Nie jest dostępne żadne z PHP rozszerzeń (%s).', @@ -112,9 +108,7 @@ $translations = array( 'Create view' => 'Utwórz perspektywę', 'Name' => 'Nazwa', 'Process list' => 'Lista procesów', - '%d process(es) have been killed.' => array('Wątek %d został unicestwiony.', - 'Unicestwiono %d wątki.', - 'Unicestwiono %d wątków.'), + '%d process(es) have been killed.' => array('Wątek %d został unicestwiony.', 'Unicestwiono %d wątki.', 'Unicestwiono %d wątków.'), 'Kill' => 'Unicestwij', 'Parameter name' => 'Nazwa parametru', 'Database schema' => 'Schemat bazy danych', @@ -148,8 +142,7 @@ $translations = array( 'Routine' => 'Procedura', 'Grant' => 'Udzielić', 'Revoke' => 'Odwołać', - 'Too big POST data. Reduce the data or increase the %s configuration directive.' => - 'Zbyt duże POST data. Zmiejszyj data albo podwyższ wartość w konfiguracji %s.', + 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Zbyt duże POST data. Zmiejszyj data albo podwyższ wartość w konfiguracji %s.', 'Logged as: %s' => 'Zalogowany jako: %s', 'Move up' => 'Przesuń w górę', 'Move down' => 'Przesuń w dół', @@ -194,9 +187,7 @@ $translations = array( 'Engine' => 'Engine', 'Save and continue edit' => 'Zapisz i kontynuuj edycję', 'original' => 'oryginalny', - '%d item(s) have been affected.' => array('Został dotknięty %d rekord.', - 'Zostały dotknięte %d rekordy.', - 'Zostało dotkniętych %d rekordów.'), + '%d item(s) have been affected.' => array('Został dotknięty %d rekord.', 'Zostały dotknięte %d rekordy.', 'Zostało dotkniętych %d rekordów.'), 'whole result' => 'cały wynik', 'Tables have been dropped.' => 'Tabele zostały usunięte.', 'Clone' => 'Klonować', @@ -204,32 +195,25 @@ $translations = array( 'Partitions' => 'Rozdziały', 'Partition name' => 'Nazwa rozdziału', 'Values' => 'Wartości', - '%d row(s) have been imported.' => array('%d rekord został importowany.', - '%d rekordy zostały importowane.', - 'Zostało importowanych %d rekordów.'), + '%d row(s) have been imported.' => array('%d rekord został importowany.', '%d rekordy zostały importowane.', 'Zostało importowanych %d rekordów.'), 'CSV Import' => 'Import CSV', 'Import' => 'Import', 'Show structure' => 'Pokaż całą strukturę', 'Select data' => 'Pokaż dane', 'Stop on error' => 'Stop w przypadku błędu', - 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => - 'Przekroczono maksymalną liczbę pól. Zwiększ %s i %s.', + 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s i %s.', 'anywhere' => 'kdziekolwiek', '%.3f s' => '%.3f s', '$1-$3-$5' => '$6.$4.$1', '[yyyy]-mm-dd' => 'd.m.[rrrr]', 'History' => 'Historia', 'Variables' => 'Zmienne', - '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.', + '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' => 'Nadawca', 'Subject' => 'Temat', 'Send' => 'Wyślij', - '%d e-mail(s) have been sent.' => array('Został wysłany %d e-mail.', - 'Zostały wysłane %d e-maile.', 'Zostało wysłanych %d e-mailów.'), + '%d e-mail(s) have been sent.' => array('Został wysłany %d e-mail.', 'Zostały wysłane %d e-maile.', 'Zostało wysłanych %d e-mailów.'), 'Run file' => 'Uruchomić plik', 'Numbers' => 'Numery', 'Date and time' => 'Datum i czas', From 87d617c68d2a07fba34225e6e98039b34eef38b5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 18:00:19 +0100 Subject: [PATCH 25/26] No extra newline for English --- lang.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang.php b/lang.php index 8c9649d8..cecd6bee 100644 --- a/lang.php +++ b/lang.php @@ -41,7 +41,9 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS } } if ($messages) { - $s .= "\n"; + if (basename($filename) != "en.inc.php") { + $s .= "\n"; + } foreach ($messages as $idf => $val) { // add new messages if ($val == "," && strpos($idf, "%d")) { From caf1ba8af583632490027ecf75ab3f7353edf50c Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Nov 2010 18:07:29 +0100 Subject: [PATCH 26/26] Bump version --- adminer/include/version.inc.php | 2 +- changes.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/adminer/include/version.inc.php b/adminer/include/version.inc.php index 04b058a1..b558b323 100644 --- a/adminer/include/version.inc.php +++ b/adminer/include/version.inc.php @@ -1,2 +1,2 @@