]> git.joonet.de Git - adminer.git/commitdiff
Return to referer after edit
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 5 Mar 2010 16:18:45 +0000 (16:18 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 5 Mar 2010 16:18:45 +0000 (16:18 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1339 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/call.inc.php
adminer/edit.inc.php
changes.txt
editor/include/editing.inc.php
todo.txt

index 0f7fe0fe2a85bae43bc1db1b1648724bd01ea6ce..039868d82bc821f7d8759f33f808cd6a83d31436 100644 (file)
@@ -28,8 +28,7 @@ if (!$error && $_POST) {
                }
                $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
        }
-       $result = $connection->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")");
-       if (!$result) {
+       if (!$connection->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")")) {
                echo "<p class='error'>" . error() . "\n";
        } else {
                do {
index 005ab64e18e8759ea4bfbaafad2f96bc93461d01..edae47b5940de9ed54f24e0526cd370b562544b5 100644 (file)
@@ -9,8 +9,10 @@ foreach ($fields as $name => $field) {
        }
 }
 if ($_POST && !$error && !isset($_GET["select"])) {
-       $location = $_SERVER["REQUEST_URI"]; // continue edit or insert
-       if (!$_POST["insert"]) {
+       $location = $_POST["referer"];
+       if ($_POST["insert"]) { // continue edit or insert
+               $location = $_SERVER["REQUEST_URI"]; //! doesn't work with change in &where field
+       } elseif (!ereg('^.+&select=.+$', $location)) {
                $location = ME . "select=" . urlencode($TABLE);
                $i = 0; // append &set converted to &where
                foreach ((array) $_GET["set"] as $key => $val) {
@@ -96,6 +98,7 @@ if ($fields) {
 ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
 <input type="hidden" name="save" value="1">
 <?php
 if (isset($_GET["select"])) {
index 0f7bf97c5e155b74ec8341f8ec70d9a6bf1e510d..ab456c2d1ece98e6baa9f463beffbfafd15305c3 100644 (file)
@@ -1,3 +1,7 @@
+Adminer 2.3.1-dev:
+Add Drop button to Alter pages (regression from 2.0.0)
+Return to referer after edit
+
 Adminer 2.3.0 (released 2010-02-26):
 Support for permanent login (customization required)
 Search in all tables
index 31cf291b96735bacd8f171391f7408db4ecdca20..a1d73585b1441cb8d77f304f5fd285d99b48a39f 100644 (file)
@@ -1,9 +1,17 @@
 <?php
+/** Encode e-mail header in UTF-8
+* @param string
+* @return string
+*/
 function email_header($header) {
        // iconv_mime_encode requires PHP 5, imap_8bit requires IMAP extension
        return "=?UTF-8?B?" . base64_encode($header) . "?="; //! split long lines
 }
 
+/** Get keys from first column and values from second
+* @param string
+* @return array
+*/
 function get_key_vals($query) {
        global $connection;
        $return = array();
index 1d2832fcbd00e44340ed348a7d907a85f490ea93..1a1247598aa5a2d9802954823e958a9d96243a77 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -12,6 +12,7 @@ Highlight SQL textarea, then display query inside textarea in select - may use e
 Blob download and image display in edit form (important for Editor with hidden fields in select)
 Add title to Logout, edit (in select) and select (in menu) in style "hever"
 Shift-click in checkboxes to select range
+? LIKE %% operator
 ? Column and table names auto-completition in SQL textarea
 ? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
 ? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB