diff --git a/adminer/db.inc.php b/adminer/db.inc.php
index a33adb2b..c5e4c873 100644
--- a/adminer/db.inc.php
+++ b/adminer/db.inc.php
@@ -114,17 +114,17 @@ if ($adminer->homepage()) {
echo "\n";
if (!information_schema(DB)) {
- $analyze = "";
- $optimize = "";
+ $vacuum = " ";
+ $optimize = " ";
echo "
\n";
}
@@ -786,6 +785,7 @@ username.form['auth[driver]'].onchange();
$links[] = preg_quote($table, '/');
}
echo "
+
type;
echo "
name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($name)
- . ($orgtables && $jush == "sql" ? doc_link("explain-output.html#explain_" . strtolower($name)) : "")
+ . ($orgtables ? doc_link("explain-output.html#explain_" . strtolower($name)) : "")
;
}
echo "\n";
@@ -458,35 +458,21 @@ function doc_link($path) {
global $jush, $connection;
$urls = array(
'sql' => "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
+ /* not used:
'sqlite' => "http://www.sqlite.org/",
'pgsql' => "http://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
'mssql' => "http://msdn.microsoft.com/library/",
'oracle' => "http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
+ */
);
return ($urls[$jush] ? "?" : "");
}
-/** Create link to documentation of database command
-* @param string lower-case
-* @return string HTML code
+/** Return events to display help on mouse over
+* @param string
+* @param bool
+* @return string
*/
-function doc_command($command) {
- global $jush;
- switch ($jush) {
- case 'sql': return doc_link("$command.html");
- case 'sqlite': return doc_link("lang_" . str_replace("-", "", $command) . ".html");
- case 'pgsql': return doc_link("sql-" . str_replace("-", "", $command) . ".html");
- case 'mssql':
- $links = array(
- 'drop-table' => 'ms173790',
- 'truncate-table' => 'ms177570',
- );
- return doc_link("$links[$command].aspx");
- case 'oracle':
- $links = array(
- 'drop-table' => 'statements_9003.htm',
- 'truncate-table' => 'statements_10006.htm',
- );
- return doc_link($links[$command]);
- }
+function on_help($command, $right = 0) {
+ return " onmouseover=\"helpMouseover(this, '" . js_escape($command) . "', $right);\" onmouseout='helpMouseout();'";
}
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index f046ec44..0f9a7ba4 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -799,7 +799,10 @@ function input($field, $value, $function) {
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . h(js_escape(bracket_escape($field["field"]))) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
- echo (count($functions) > 1 ? html_select("function[$name]", $functions, $function === null || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);") : nbsp(reset($functions))) . ' | ';
+ echo (count($functions) > 1
+ ? html_select("function[$name]", $functions, $function === null || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);")
+ : nbsp(reset($functions))
+ ) . ' | ';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") {
echo $input;
diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php
index 721c5efb..1d776e43 100644
--- a/adminer/lang/cs.inc.php
+++ b/adminer/lang/cs.inc.php
@@ -104,6 +104,7 @@ $translations = array(
'%d in total' => '%d celkem',
'Analyze' => 'Analyzovat',
'Optimize' => 'Optimalizovat',
+ 'Vacuum' => 'Vyčistit',
'Check' => 'Zkontrolovat',
'Repair' => 'Opravit',
'Truncate' => 'Vyprázdnit',
diff --git a/adminer/lang/xx.inc.php b/adminer/lang/xx.inc.php
index d84bf2a7..05b62853 100644
--- a/adminer/lang/xx.inc.php
+++ b/adminer/lang/xx.inc.php
@@ -104,6 +104,7 @@ $translations = array(
'%d in total' => 'xx',
'Analyze' => 'xx',
'Optimize' => 'xx',
+ 'Vacuum' => 'xx',
'Check' => 'xx',
'Repair' => 'xx',
'Truncate' => 'xx',
diff --git a/adminer/processlist.inc.php b/adminer/processlist.inc.php
index 5d8cb84b..da66cfdd 100644
--- a/adminer/processlist.inc.php
+++ b/adminer/processlist.inc.php
@@ -22,9 +22,7 @@ foreach (process_list() as $i => $row) {
if (!$i) {
echo "" . (support("kill") ? " " : "");
foreach ($row as $key => $val) {
- echo " | $key"
- . ($jush == "sql" ? doc_link("show-processlist.html#processlist_" . strtolower($key)) : "")
- ;
+ echo " | $key" . doc_link("show-processlist.html#processlist_" . strtolower($key));
}
echo " | \n";
}
diff --git a/adminer/static/default.css b/adminer/static/default.css
index 9cfde193..d8bd1406 100644
--- a/adminer/static/default.css
+++ b/adminer/static/default.css
@@ -68,6 +68,7 @@ input.required { box-shadow: 1px 1px 1px red; }
#schema { margin-left: 60px; position: relative; -moz-user-select: none; -webkit-user-select: none; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }
+#help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; }
.rtl h2 { margin: 0 -18px 20px 0; }
.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; }
diff --git a/adminer/static/editing.js b/adminer/static/editing.js
index 92b053d8..64fbc9c5 100644
--- a/adminer/static/editing.js
+++ b/adminer/static/editing.js
@@ -612,3 +612,35 @@ function schemaMouseup(ev, db) {
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
}
}
+
+var helpOpen;
+
+function helpMouseover(el, text, right) {
+ if (window.jush) {
+ helpOpen = 1;
+ var help = document.getElementById('help');
+ help.innerHTML = text;
+ jush.highlight_tag([ help ]);
+ alterClass(help, 'hidden');
+ var top = 0, left = 0, parent = el;
+ do {
+ top += parent.offsetTop;
+ left += parent.offsetLeft;
+ } while (parent = parent.offsetParent);
+ help.style.top = (top - (right ? (help.offsetHeight - el.offsetHeight) / 2 : help.offsetHeight)) + 'px';
+ help.style.left = (left + (right ? el.offsetWidth : (el.offsetWidth - help.offsetWidth) / 2)) + 'px';
+ }
+}
+
+function helpMouseout() {
+ helpOpen = 0;
+ setTimeout(function () {
+ if (!helpOpen) {
+ helpClose();
+ }
+ }, 200);
+}
+
+function helpClose() {
+ alterClass(document.getElementById('help'), 'hidden', true);
+}
|