1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-04 11:45:48 +02:00

Compare commits

..

14 Commits

Author SHA1 Message Date
Jakub Vrana
2d18afaf7f Release 3.5.1 2012-08-09 22:47:12 -07:00
Jakub Vrana
9a3b3db4f6 Comment 2012-08-09 12:18:31 -07:00
Jakub Vrana
a4e38a266d Remove definer from routine and event 2012-08-09 09:39:12 -07:00
Jakub Vrana
ca32e71e42 Ignore bit type when searching strings 2012-08-09 09:37:51 -07:00
Jakub Vrana
4b4fa16a37 Autodisplay long table names in tables filter plugin 2012-08-09 09:11:55 -07:00
Jakub Vrana
69d49e30c5 Support same name fields in CSV export 2012-08-09 08:57:45 -07:00
Jakub Vrana
7fcfb0d16a Don't include trailing space to delimiter 2012-08-09 08:39:54 -07:00
Jakub Vrana
1501d60f14 Descending order after second click on column caption 2012-08-08 22:40:38 -07:00
Jakub Vrana
e5b1c99d87 Support Shift+click in export 2012-08-08 09:23:46 -07:00
Jakub Vrana
b49061b863 Add JS function for getting parent tag 2012-08-08 09:22:23 -07:00
Jakub Vrana
5fd21e122a Set source checkbox only in click without Shift 2012-08-08 08:54:15 -07:00
Jakub Vrana
b783b9487d Don't display tables list on server pages 2012-08-08 08:41:52 -07:00
Jakub Vrana
99343701ab Autodisplay long logins in saved logins list 2012-08-08 08:27:50 -07:00
Jakub Vrana
c09a147b2e Develop 2012-08-05 09:15:05 -07:00
12 changed files with 83 additions and 40 deletions

View File

@@ -48,14 +48,14 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
foreach (array("FUNCTION", "PROCEDURE") as $routine) { foreach (array("FUNCTION", "PROCEDURE") as $routine) {
foreach (get_rows("SHOW $routine STATUS WHERE Db = " . q($db), null, "-- ") as $row) { foreach (get_rows("SHOW $routine STATUS WHERE Db = " . q($db), null, "-- ") as $row) {
$out .= ($style != 'DROP+CREATE' ? "DROP $routine IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") $out .= ($style != 'DROP+CREATE' ? "DROP $routine IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. $connection->result("SHOW CREATE $routine " . idf_escape($row["Name"]), 2) . ";;\n\n"; . remove_definer($connection->result("SHOW CREATE $routine " . idf_escape($row["Name"]), 2)) . ";;\n\n";
} }
} }
} }
if ($_POST["events"]) { if ($_POST["events"]) {
foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) { foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) {
$out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") $out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. $connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3) . ";;\n\n"; . remove_definer($connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3)) . ";;\n\n";
} }
} }
if ($out) { if ($out) {
@@ -197,11 +197,11 @@ if (DB != "") {
$name = $table_status["Name"]; $name = $table_status["Name"];
$prefix = ereg_replace("_.*", "", $name); $prefix = ereg_replace("_.*", "", $name);
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name $checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "formUncheck('check-tables');"); $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');");
if (is_view($table_status)) { if (is_view($table_status)) {
$views .= "$print\n"; $views .= "$print\n";
} else { } else {
echo "$print<td align='right'><label>" . ($table_status["Engine"] == "InnoDB" && $table_status["Rows"] ? "~ " : "") . $table_status["Rows"] . checkbox("data[]", $name, $checked, "", "formUncheck('check-data');") . "</label>\n"; echo "$print<td align='right'><label>" . ($table_status["Engine"] == "InnoDB" && $table_status["Rows"] ? "~ " : "") . $table_status["Rows"] . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n";
} }
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }

View File

@@ -395,7 +395,7 @@ username.form['auth[driver]'].onchange();
// find anywhere // find anywhere
$cols = array(); $cols = array();
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
if (is_numeric($val["val"]) || !ereg('int|float|double|decimal', $field["type"])) { if (is_numeric($val["val"]) || !ereg('int|float|double|decimal|bit', $field["type"])) {
$name = idf_escape($name); $name = idf_escape($name);
$cols[] = ($jush == "sql" && ereg('char|text|enum|set', $field["type"]) && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name); $cols[] = ($jush == "sql" && ereg('char|text|enum|set', $field["type"]) && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name);
} }
@@ -573,8 +573,7 @@ username.form['auth[driver]'].onchange();
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n"; echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
} }
if ($is_view) { if ($is_view) {
// remove DEFINER with current user $create = remove_definer($create);
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $create); //! proper escaping of user
} }
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n"; echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
} }
@@ -672,25 +671,32 @@ DROP PROCEDURE adminer_alter;
if ($result) { if ($result) {
$insert = ""; $insert = "";
$buffer = ""; $buffer = "";
while ($row = $result->fetch_assoc()) { $keys = array();
while ($row = $result->fetch_row()) {
if (!$keys) {
foreach ($row as $val) {
$field = $result->fetch_field();
$keys[] = $field->name;
}
}
if ($_POST["format"] != "sql") { if ($_POST["format"] != "sql") {
if ($style == "table") { if ($style == "table") {
dump_csv(array_keys($row)); dump_csv($keys);
$style = "INSERT"; $style = "INSERT";
} }
dump_csv($row); dump_csv($row);
} else { } else {
if (!$insert) { if (!$insert) {
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES"; $insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
} }
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
$row[$key] = ($val !== null ? (ereg('int|float|double|decimal|bit', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions $row[$key] = ($val !== null ? (ereg('int|float|double|decimal|bit', $fields[$keys[$key]]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
} }
$s = implode(",\t", $row); $s = implode(",\t", $row);
if ($style == "INSERT+UPDATE") { if ($style == "INSERT+UPDATE") {
$set = array(); $set = array();
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = $val"; $set[] = idf_escape($keys[$key]) . " = $val";
} }
echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n"; echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else { } else {
@@ -777,7 +783,7 @@ DROP PROCEDURE adminer_alter;
foreach ($usernames as $username => $password) { foreach ($usernames as $username => $password) {
if ($password !== null) { if ($password !== null) {
if ($first) { if ($first) {
echo "<p>\n"; echo "<p id='logins' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
$first = false; $first = false;
} }
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n"; echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
@@ -803,7 +809,7 @@ DROP PROCEDURE adminer_alter;
</p> </p>
</form> </form>
<form action=""> <form action="">
<p style="overflow: hidden;"> <p id="dbs">
<?php hidden_fields_get(); ?> <?php hidden_fields_get(); ?>
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?> <?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>> <input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
@@ -821,7 +827,7 @@ DROP PROCEDURE adminer_alter;
: (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">' : (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
: ""))); : "")));
echo "</p></form>\n"; echo "</p></form>\n";
if ($_GET["ns"] !== "" && !$missing) { if ($_GET["ns"] !== "" && !$missing && DB != "") {
echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n"; echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
$tables = tables_list(); $tables = tables_list();
if (!$tables) { if (!$tables) {
@@ -848,7 +854,7 @@ DROP PROCEDURE adminer_alter;
* @return null * @return null
*/ */
function tablesPrint($tables) { function tablesPrint($tables) {
echo '<p id="tables" onmouseover="this.style.overflow = \'visible\';" onmouseout="this.style.overflow = \'auto\';">' . "\n"; echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $type) { foreach ($tables as $table => $type) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> "; echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status

View File

@@ -357,6 +357,14 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
return $dropped; return $dropped;
} }
/** Remove current user definer from SQL command
* @param string
* @return string
*/
function remove_definer($query) {
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
}
/** Get string to add a file in TAR /** Get string to add a file in TAR
* @param string * @param string
* @param string * @param string

View File

@@ -1,2 +1,2 @@
<?php <?php
$VERSION = "3.5.0"; $VERSION = "3.5.1";

View File

@@ -273,11 +273,14 @@ if (!$columns) {
if ($name != "") { if ($name != "") {
$rank++; $rank++;
$names[$key] = $name; $names[$key] = $name;
$column = idf_escape($key);
$href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key); $href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key);
$desc = "&desc%5B0%5D=1";
echo '<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">'; echo '<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">';
echo '<a href="' . h($href) . '">' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . "</a>"; //! columns looking like functions echo '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && count($group) < count($select) && $group[0] == $column) ? $desc : '')) . '">'; // $order[0] == $key - COUNT(*)
echo (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . "</a>"; //! columns looking like functions
echo "<span class='column hidden'>"; echo "<span class='column hidden'>";
echo "<a href='" . h("$href&desc%5B0%5D=1") . "' title='" . lang('descending') . "' class='text'> ↓</a>"; echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";
if (!$val["fun"]) { if (!$val["fun"]) {
echo '<a href="#fieldset-search" onclick="selectSearch(\'' . h(js_escape($key)) . '\'); return false;" title="' . lang('Search') . '" class="text jsonly"> =</a>'; echo '<a href="#fieldset-search" onclick="selectSearch(\'' . h(js_escape($key)) . '\'); return false;" title="' . lang('Search') . '" class="text jsonly"> =</a>';
} }

View File

@@ -58,7 +58,7 @@ if (!$error && $_POST) {
$dump_format = $adminer->dumpFormat(); $dump_format = $adminer->dumpFormat();
unset($dump_format["sql"]); unset($dump_format["sql"]);
while ($query != "") { while ($query != "") {
if (!$offset && preg_match("~^$space*DELIMITER\\s+(.+)~i", $query, $match)) { if (!$offset && preg_match("~^$space*DELIMITER\\s+(\\S+)~i", $query, $match)) {
$delimiter = $match[1]; $delimiter = $match[1];
$query = substr($query, strlen($match[0])); $query = substr($query, strlen($match[0]));
} else { } else {

View File

@@ -47,8 +47,9 @@ input[type=image] { vertical-align: middle; }
.icon { width: 18px; height: 18px; } .icon { width: 18px; height: 18px; }
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; white-space: nowrap; } #menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; white-space: nowrap; }
#menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; } #menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
#tables { overflow: auto; } #dbs { overflow: hidden; }
#tables a { background: #fff; } #logins, #tables { overflow: auto; }
#logins a, #tables a { background: #fff; }
#content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; } #content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
#lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; } #lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; } #breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }

View File

@@ -64,7 +64,7 @@ function typePassword(el, disable) {
} }
function loginDriver(driver) { function loginDriver(driver) {
var trs = driver.parentNode.parentNode.parentNode.rows; var trs = parentTag(driver, 'table').rows;
for (var i=1; i < trs.length - 1; i++) { for (var i=1; i < trs.length - 1; i++) {
trs[i].className = (/sqlite/.test(driver.value) ? 'hidden' : ''); trs[i].className = (/sqlite/.test(driver.value) ? 'hidden' : '');
} }
@@ -236,7 +236,7 @@ function editingAddRow(button, allowed, focus) {
} }
var match = /(\d+)(\.\d+)?/.exec(button.name); var match = /(\d+)(\.\d+)?/.exec(button.name);
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1'; var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
var row = button.parentNode.parentNode; var row = parentTag(button, 'tr');
var row2 = row.cloneNode(true); var row2 = row.cloneNode(true);
var tags = row.getElementsByTagName('select'); var tags = row.getElementsByTagName('select');
var tags2 = row2.getElementsByTagName('select'); var tags2 = row2.getElementsByTagName('select');
@@ -282,7 +282,7 @@ function editingAddRow(button, allowed, focus) {
function editingRemoveRow(button) { function editingRemoveRow(button) {
var field = formField(button.form, button.name.replace(/drop_col(.+)/, 'fields$1[field]')); var field = formField(button.form, button.name.replace(/drop_col(.+)/, 'fields$1[field]'));
field.parentNode.removeChild(field); field.parentNode.removeChild(field);
button.parentNode.parentNode.style.display = 'none'; parentTag(button, 'tr').style.display = 'none';
return true; return true;
} }
@@ -368,9 +368,9 @@ function partitionByChange(el) {
* @param HTMLInputElement * @param HTMLInputElement
*/ */
function partitionNameChange(el) { function partitionNameChange(el) {
var row = el.parentNode.parentNode.cloneNode(true); var row = parentTag(el, 'tr').cloneNode(true);
row.firstChild.firstChild.value = ''; row.firstChild.firstChild.value = '';
el.parentNode.parentNode.parentNode.appendChild(row); parentTag(el, 'table').appendChild(row);
el.onchange = function () {}; el.onchange = function () {};
} }
@@ -381,13 +381,13 @@ function partitionNameChange(el) {
*/ */
function foreignAddRow(field) { function foreignAddRow(field) {
field.onchange = function () { }; field.onchange = function () { };
var row = field.parentNode.parentNode.cloneNode(true); var row = parentTag(field, 'tr').cloneNode(true);
var selects = row.getElementsByTagName('select'); var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/\]/, '1$&'); selects[i].name = selects[i].name.replace(/\]/, '1$&');
selects[i].selectedIndex = 0; selects[i].selectedIndex = 0;
} }
field.parentNode.parentNode.parentNode.appendChild(row); parentTag(field, 'table').appendChild(row);
} }
@@ -397,8 +397,7 @@ function foreignAddRow(field) {
*/ */
function indexesAddRow(field) { function indexesAddRow(field) {
field.onchange = function () { }; field.onchange = function () { };
var parent = field.parentNode.parentNode; var row = parentTag(field, 'tr').cloneNode(true);
var row = parent.cloneNode(true);
var selects = row.getElementsByTagName('select'); var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1'); selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1');
@@ -409,7 +408,7 @@ function indexesAddRow(field) {
inputs[i].name = inputs[i].name.replace(/indexes\[\d+/, '$&1'); inputs[i].name = inputs[i].name.replace(/indexes\[\d+/, '$&1');
inputs[i].value = ''; inputs[i].value = '';
} }
parent.parentNode.appendChild(row); parentTag(field, 'table').appendChild(row);
} }
/** Change column in index /** Change column in index
@@ -417,7 +416,7 @@ function indexesAddRow(field) {
* @param string name prefix * @param string name prefix
*/ */
function indexesChangeColumn(field, prefix) { function indexesChangeColumn(field, prefix) {
var columns = field.parentNode.parentNode.getElementsByTagName('select'); var columns = parentTag(field, 'td').getElementsByTagName('select');
var names = []; var names = [];
for (var i=0; i < columns.length; i++) { for (var i=0; i < columns.length; i++) {
var value = selectValue(columns[i]); var value = selectValue(columns[i]);
@@ -448,7 +447,7 @@ function indexesAddColumn(field, prefix) {
var input = column.getElementsByTagName('input')[0]; var input = column.getElementsByTagName('input')[0];
input.name = input.name.replace(/\]\[\d+/, '$&1'); input.name = input.name.replace(/\]\[\d+/, '$&1');
input.value = ''; input.value = '';
field.parentNode.parentNode.appendChild(column); parentTag(field, 'td').appendChild(column);
field.onchange(); field.onchange();
} }

View File

@@ -38,11 +38,24 @@ function selectValue(select) {
return ((selected.attributes.value || {}).specified ? selected.value : selected.text); return ((selected.attributes.value || {}).specified ? selected.value : selected.text);
} }
/** Get parent node with specified tag name.
* @param HTMLElement
* @param string
* @return HTMLElement
*/
function parentTag(el, tag) {
var re = new RegExp('^' + tag + '$', 'i');
while (!re.test(el.tagName)) {
el = el.parentNode;
}
return el;
}
/** Set checked class /** Set checked class
* @param HTMLInputElement * @param HTMLInputElement
*/ */
function trCheck(el) { function trCheck(el) {
var tr = el.parentNode.parentNode; var tr = parentTag(el, 'tr');
tr.className = tr.className.replace(/(^|\s)checked(\s|$)/, '$2') + (el.checked ? ' checked' : ''); tr.className = tr.className.replace(/(^|\s)checked(\s|$)/, '$2') + (el.checked ? ' checked' : '');
} }
@@ -135,7 +148,7 @@ function checkboxClick(event, el) {
} }
if (event.shiftKey && (!lastChecked || lastChecked.name == el.name)) { if (event.shiftKey && (!lastChecked || lastChecked.name == el.name)) {
var checked = (lastChecked ? lastChecked.checked : true); var checked = (lastChecked ? lastChecked.checked : true);
var inputs = el.parentNode.parentNode.parentNode.getElementsByTagName('input'); var inputs = parentTag(el, 'table').getElementsByTagName('input');
var checking = !lastChecked; var checking = !lastChecked;
for (var i=0; i < inputs.length; i++) { for (var i=0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
@@ -152,8 +165,9 @@ function checkboxClick(event, el) {
} }
} }
} }
} else {
lastChecked = el;
} }
lastChecked = el;
} }
/** Set HTML code of an element /** Set HTML code of an element
@@ -195,6 +209,14 @@ function pageClick(href, page, event) {
} }
} }
function menuOver(el) {
el.style.overflow = 'visible';
}
function menuOut(el) {
el.style.overflow = 'auto';
}
/** Add row in select fieldset /** Add row in select fieldset

View File

@@ -1,3 +1,7 @@
Adminer 3.5.1 (released 2012-08-10):
Support same name fields in CSV export
Support Shift+click in export
Adminer 3.5.0 (released 2012-08-05): Adminer 3.5.0 (released 2012-08-05):
Links for column search in select Links for column search in select
Autohide column context menu in select Autohide column context menu in select

View File

@@ -532,7 +532,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) { foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) {
if ($password !== null) { if ($password !== null) {
if ($first) { if ($first) {
echo "<p>\n"; echo "<p id='logins' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
$first = false; $first = false;
} }
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n"; echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n";
@@ -559,7 +559,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
} }
function tablesPrint($tables) { function tablesPrint($tables) {
echo '<p id="tables" onmouseover="this.style.overflow = \'visible\';" onmouseout="this.style.overflow = \'auto\';">' . "\n"; echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $row) { foreach ($tables as $row) {
$name = $this->tableName($row); $name = $this->tableName($row);
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name

View File

@@ -23,7 +23,7 @@ function tablesFilter(value) {
</script> </script>
<p class="jsonly"><input onkeyup="tablesFilter(this.value);"> <p class="jsonly"><input onkeyup="tablesFilter(this.value);">
<?php <?php
echo "<p id='tables'>\n"; echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $type) { foreach ($tables as $table => $type) {
echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> "; echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n"; echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n";