]> git.joonet.de Git - adminer.git/commitdiff
Load long texts for inline-edit by AJAX
authorJakub Vrana <jakub@vrana.cz>
Mon, 18 Oct 2010 11:57:22 +0000 (13:57 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 18 Oct 2010 11:57:22 +0000 (13:57 +0200)
Display link to current page only under AJAX

22 files changed:
adminer/edit.inc.php
adminer/include/adminer.inc.php
adminer/include/design.inc.php
adminer/include/functions.inc.php
adminer/lang/ca.inc.php
adminer/lang/cs.inc.php
adminer/lang/de.inc.php
adminer/lang/es.inc.php
adminer/lang/et.inc.php
adminer/lang/fr.inc.php
adminer/lang/hu.inc.php
adminer/lang/it.inc.php
adminer/lang/ja.inc.php
adminer/lang/nl.inc.php
adminer/lang/ru.inc.php
adminer/lang/sk.inc.php
adminer/lang/ta.inc.php
adminer/lang/zh-tw.inc.php
adminer/lang/zh.inc.php
adminer/select.inc.php
adminer/static/functions.js
editor/include/adminer.inc.php

index 34399f1e1c58838c09d40095b73fbcc827acb378..1a478c58a6648df59f12ccec629cc51bd72c4109 100644 (file)
@@ -107,7 +107,7 @@ if ($update) {
        echo "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "')" . (isset($_GET["select"]) ? " &amp;&amp; !ajaxForm(this.form, 'delete=1')" : "") . ";\">\n";
 }
 if (isset($_GET["select"])) {
-       echo "<a href='" . h($_SERVER["REQUEST_URI"]) . "' onclick='return !ajax(this.href);'>" . lang('Cancel') . "</a>\n";
+       echo "<a href='" . h($_SERVER["REQUEST_URI"]) . "' onclick='return !ajaxMain(this.href);'>" . lang('Cancel') . "</a>\n";
 }
 ?>
 </form>
index 2944c9cd8e48fc5ab4f8b0a31d54685c3d9489c4..418a2cc80c0a81783ed62d634f6c86c47f129b3a 100644 (file)
@@ -130,7 +130,7 @@ document.getElementById('username').focus();
        */
        function selectQuery($query) {
                global $jush;
-               return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a> <a href='" . h($_SERVER["REQUEST_URI"]) . "'>#</a>\n";
+               return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" . (is_ajax() ? " <a href='" . h($_SERVER["REQUEST_URI"]) . "'>#</a>" : "") . "\n";
        }
        
        /** Description of a row in a table
index a7716bb7edf1efea65a52a5b92204738dcec93cd..aa14ea02d3df36b3ca7cc3f88bdf58a451cc3974 100644 (file)
@@ -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()) {
                ?>
 </div>
 </div>
index 9bb5ce18f18c73ef0f4e56a3b74e258505f7616f..6c78fa70bdb37c564bfab9ec1d5d99808305ded9 100644 (file)
@@ -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;
                }
index 6ba91fd44fde38736481dc39c3d8f9034d019355..cca98ebd37c95b3f1f3f27e0b02fbc5dcf391093 100644 (file)
@@ -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',
index 9f10c311abb866999c9d23580f6e89f13ee9dbf9..a80e0dac896428bee93564e4e15aa3d0c5b457bd 100644 (file)
@@ -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
index df431c8fc38ff6ab76d89ad452312a9339365dd0..9915b655dd67b47d2ad0884a35059acca05745c7 100644 (file)
@@ -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',
index 6c2a3f62e06580031345f6b253c02d9603424f61..dd1dfdf193fbdbdef408a7b4bfd47cf7f7b5fb33 100644 (file)
@@ -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',
index 7b79eaa8dfe508e752f940cf0024a2d46e5fbba2..dfddb4949f37f24c25eb2d2b6290d446bbe31c0a 100644 (file)
@@ -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',
index 672f60c962187c6c81e278d5fdba9b28734eeb50..763cf661aeca71c9687bd7c03cf2592c387ce77c 100644 (file)
@@ -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',
index 88291d2b7792c85f1453c0815a9a0684bc4690aa..a36adca38a0e842e74a261ad293db92210556c89 100644 (file)
@@ -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',
index 900f154401e8d107525a28dbb9afabe15f281850..3af422d24d6c1bc02bfe1da1ac2f2dd4c20fcf83 100644 (file)
@@ -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',
index c93532ac12175ad25b22ac2ebaccf0b48206d58d..39228c3d49b24cfdb40864ad7aeb32e256e8d033 100644 (file)
@@ -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' => 'サーバーから実行',
index c5864edc855eb869906664d56034e6c4bf75764f..e8df922239b0423b6f2c88de4923702057747b07 100644 (file)
@@ -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',
index b7d0ef5c11b84897cbe7715b2251f4bab62c788b..48c1735c48ba20cd87836dbb0c82151e63384ba7 100644 (file)
@@ -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' => 'С сервера',
index 33f5cc34c86c7a6af424f14e51c09043bf0d6bfc..282c2cf93c4732e325658a32399bf58572cdbc3d 100644 (file)
@@ -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',
index 53409554227fdc5338e73908f2dc7ef18df3497a..49febf59afedef7e7bf296bf4c48559a461e558b 100644 (file)
@@ -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.' => 'வ‌ரிசைமுறை நீக்க‌ப்ப‌ட்ட‌து.',
index 1930a7e22dccb8840c4a0671e3e20477f80a7364..b9ad1908e6559943eb0ba20a8cfa4c6034c35d23 100644 (file)
@@ -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' => '從伺服器',
index 14045991275c09d6cf2a13909cff1aee1dee1daf..bcfd0ba4424e9fe21fe4cec6742aafab947ccb40 100644 (file)
@@ -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' => '来自服务器',
index 412359b8a6c6a4af73732f36535e8fc935a384fc..aa175afc275d2b941f6774b75b8f94242a861fe5 100644 (file)
@@ -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 '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"][0] == $key && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '" onclick="return !ajax(this.href);">' . apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions
+                                       echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"][0] == $key && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '" onclick="return !ajaxMain(this.href);">' . apply_sql_function($val["fun"], $name) . "</a>"; //! 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, "<i>...</i>");
-                                               $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)
                                                        ? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "' onkeydown='return textareaKeydown(this, event);'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
-                                                       : "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($text ? ", 1" : "") . ")" : "alert('" . h($long ? lang('Increase Text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
+                                                       : "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
                                                );
                                        }
                                }
index d9d93846eec0ec6f42a670278b8bb5a9b38022be..30869daa586eaee504595d398cac0c6a3ae22ddf 100644 (file)
@@ -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', '<img src="../adminer/static/loader.gif" alt="">');
-               }, 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', '<img src="../adminer/static/loader.gif" alt="">');
+       }, 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); // &nbsp; 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); // &nbsp; or i - NULL
        input.selectionStart = pos;
        input.selectionEnd = pos;
        if (document.selection) {
index 9495d9442ec70822fa56859462398bb137e61321..224246c344cfc3698c76623afaf0ccbfcdc82e02 100644 (file)
@@ -62,7 +62,9 @@ document.getElementById('username').focus();
                        echo '<p class="tabs"><a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . "</a>\n";
                }
                echo "<a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "'>&gt;&gt;</a>\n";
-               echo "<a href='" . h($_SERVER["REQUEST_URI"]) . "'>#</a>\n";
+               if (is_ajax()) {
+                       echo "<a href='" . h($_SERVER["REQUEST_URI"]) . "'>#</a>\n";
+               }
        }
        
        function backwardKeys($table, $tableName) {