From 34349f148209108b43b842b4ec66e55d55a9b4fb Mon Sep 17 00:00:00 2001
From: Jakub Vrana
Date: Wed, 24 Jul 2013 13:00:37 -0700
Subject: [PATCH] Revert Displaying SQL edit form on Ctrl+click on the select
query
---
adminer/include/adminer.inc.php | 116 ++++++++++++++++----------------
adminer/static/editing.js | 26 +------
changes.txt | 1 +
3 files changed, 60 insertions(+), 83 deletions(-)
diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index 7e509650..5b93d9b9 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -4,21 +4,21 @@
class Adminer {
/** @var array operators used in select, null for all operators */
var $operators;
-
+
/** Name in title and navigation
* @return string HTML code
*/
function name() {
return "Adminer";
}
-
+
/** Connection parameters
* @return array ($server, $username, $password)
*/
function credentials() {
return array(SERVER, $_GET["username"], get_session("pwds"));
}
-
+
/** Get key used for permanent login
* @param bool
* @return string cryptic string which gets combined with password or false in case of an error
@@ -26,7 +26,7 @@ class Adminer {
function permanentLogin($create = false) {
return password_file($create);
}
-
+
/** Identifier of selected database
* @return string
*/
@@ -34,7 +34,7 @@ class Adminer {
// should be used everywhere instead of DB
return DB;
}
-
+
/** Get cached list of databases
* @param bool
* @return array
@@ -42,28 +42,28 @@ class Adminer {
function databases($flush = true) {
return get_databases($flush);
}
-
+
/** Specify limit for waiting on some slow queries like DB list
* @return float number of seconds
*/
function queryTimeout() {
return 5;
}
-
+
/** Headers to send before HTML output
* @return bool true to send security headers
*/
function headers() {
return true;
}
-
+
/** Print HTML code inside
* @return bool true to link adminer.css if exists
*/
function head() {
return true;
}
-
+
/** Print login form
* @return null
*/
@@ -86,7 +86,7 @@ username.form['auth[driver]'].onchange();
echo "
\n";
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
}
-
+
/** Authorize the user
* @param string
* @param string
@@ -95,7 +95,7 @@ username.form['auth[driver]'].onchange();
function login($login, $password) {
return true;
}
-
+
/** Table caption used in navigation and headings
* @param array result of SHOW TABLE STATUS
* @return string HTML code, "" to ignore table
@@ -103,7 +103,7 @@ username.form['auth[driver]'].onchange();
function tableName($tableStatus) {
return h($tableStatus["Name"]);
}
-
+
/** Field caption used in select and edit
* @param array single field returned from fields()
* @param int order of column in select
@@ -112,7 +112,7 @@ username.form['auth[driver]'].onchange();
function fieldName($field, $order = 0) {
return '' . h($field["field"]) . '';
}
-
+
/** Print links after select heading
* @param array result of SHOW TABLE STATUS
* @param string new item options, NULL for no new item
@@ -137,7 +137,7 @@ username.form['auth[driver]'].onchange();
}
echo "\n";
}
-
+
/** Get foreign keys for table
* @param string
* @return array same format as foreign_keys()
@@ -145,7 +145,7 @@ username.form['auth[driver]'].onchange();
function foreignKeys($table) {
return foreign_keys($table);
}
-
+
/** Find backward keys for table
* @param string
* @param string
@@ -154,7 +154,7 @@ username.form['auth[driver]'].onchange();
function backwardKeys($table, $tableName) {
return array();
}
-
+
/** Print backward keys for row
* @param array result of $this->backwardKeys()
* @param array
@@ -162,19 +162,19 @@ username.form['auth[driver]'].onchange();
*/
function backwardKeysPrint($backwardKeys, $row) {
}
-
+
/** Query printed in select before execution
* @param string query to be executed
* @return string
*/
function selectQuery($query) {
- global $jush, $token;
- return "
\n"; //
- required for IE9 inline edit
+ . "" // - required for IE9 inline edit
+ ;
}
-
+
/** Description of a row in a table
* @param string
* @return string SQL expression, empty string for no description
@@ -182,7 +182,7 @@ username.form['auth[driver]'].onchange();
function rowDescription($table) {
return "";
}
-
+
/** Get descriptions of selected data
* @param array all data to print
* @param array
@@ -191,7 +191,7 @@ username.form['auth[driver]'].onchange();
function rowDescriptions($rows, $foreignKeys) {
return $rows;
}
-
+
/** Get a link to use in select table
* @param string raw value of the field
* @param array single field returned from fields()
@@ -199,7 +199,7 @@ username.form['auth[driver]'].onchange();
*/
function selectLink($val, $field) {
}
-
+
/** Value printed in select table
* @param string HTML-escaped value to print
* @param string link to foreign key
@@ -213,7 +213,7 @@ username.form['auth[driver]'].onchange();
}
return ($link ? "$return" : $return);
}
-
+
/** Value conversion used in select and edit
* @param string
* @param array single field returned from fields()
@@ -222,7 +222,7 @@ username.form['auth[driver]'].onchange();
function editVal($val, $field) {
return $val;
}
-
+
/** Print columns box in select
* @param array result of selectColumnsProcess()[0]
* @param array selectable columns
@@ -243,7 +243,7 @@ username.form['auth[driver]'].onchange();
}
echo "\n";
}
-
+
/** Print search box in select
* @param array result of selectSearchProcess()
* @param array selectable columns
@@ -273,7 +273,7 @@ username.form['auth[driver]'].onchange();
}
echo "\n";
}
-
+
/** Print order box in select
* @param array result of selectOrderProcess()
* @param array selectable columns
@@ -294,7 +294,7 @@ username.form['auth[driver]'].onchange();
echo checkbox("desc[$i]", 1, false, lang('descending')) . "\n";
echo "\n";
}
-
+
/** Print limit box in select
* @param string result of selectLimitProcess()
* @return null
@@ -304,7 +304,7 @@ username.form['auth[driver]'].onchange();
echo "";
echo "\n";
}
-
+
/** Print text length box in select
* @param string result of selectLengthProcess()
* @return null
@@ -316,7 +316,7 @@ username.form['auth[driver]'].onchange();
echo "\n";
}
}
-
+
/** Print action box in select
* @param array
* @return null
@@ -342,21 +342,21 @@ username.form['auth[driver]'].onchange();
echo "\n";
echo "\n";
}
-
+
/** Print command box in select
* @return bool whether to print default commands
*/
function selectCommandPrint() {
return !information_schema(DB);
}
-
+
/** Print import box in select
* @return bool whether to print default import
*/
function selectImportPrint() {
return !information_schema(DB);
}
-
+
/** Print extra text in the end of a select form
* @param array fields holding e-mails
* @param array selectable columns
@@ -364,7 +364,7 @@ username.form['auth[driver]'].onchange();
*/
function selectEmailPrint($emailFields, $columns) {
}
-
+
/** Process columns box in select
* @param array selectable columns
* @param array
@@ -384,7 +384,7 @@ username.form['auth[driver]'].onchange();
}
return array($select, $group);
}
-
+
/** Process search box in select
* @param array
* @param array
@@ -431,7 +431,7 @@ username.form['auth[driver]'].onchange();
}
return $return;
}
-
+
/** Process order box in select
* @param array
* @param array
@@ -448,21 +448,21 @@ username.form['auth[driver]'].onchange();
}
return $return;
}
-
+
/** Process limit box in select
* @return string expression to use in LIMIT, will be escaped
*/
function selectLimitProcess() {
return (isset($_GET["limit"]) ? $_GET["limit"] : "50");
}
-
+
/** Process length box in select
* @return string number of characters to shorten texts, will be escaped
*/
function selectLengthProcess() {
return (isset($_GET["text_length"]) ? $_GET["text_length"] : "100");
}
-
+
/** Process extras in select form
* @param array AND conditions
* @param array
@@ -471,7 +471,7 @@ username.form['auth[driver]'].onchange();
function selectEmailProcess($where, $foreignKeys) {
return false;
}
-
+
/** Build SQL query used in select
* @param array result of selectColumnsProcess()[0]
* @param array result of selectSearchProcess()
@@ -484,7 +484,7 @@ username.form['auth[driver]'].onchange();
function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
return "";
}
-
+
/** Query printed after execution in the message
* @param string executed query
* @return string
@@ -500,7 +500,7 @@ username.form['auth[driver]'].onchange();
$history[$_GET["db"]][] = array($query, time()); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
return " " . @date("H:i:s") . "" . lang('SQL command') . "