Rename JavaScript functions
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@638 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
f507c81863
commit
ab38ea5b1e
12
dump.inc.php
12
dump.inc.php
|
@ -154,10 +154,10 @@ echo "<tr><th>" . lang('Data') . "</th><td><select name='data_style'><option></o
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!strlen($_GET["db"])) {
|
if (!strlen($_GET["db"])) {
|
||||||
echo "<table cellspacing='0'>\n<thead><tr><th align='left'><label><input type='checkbox' id='check-databases' checked='checked' onclick='dump_check(this, /^databases\\[/);' />" . lang('Database') . "</label></th></tr></thead>\n";
|
echo "<table cellspacing='0'>\n<thead><tr><th align='left'><label><input type='checkbox' id='check-databases' checked='checked' onclick='form_check(this, /^databases\\[/);' />" . lang('Database') . "</label></th></tr></thead>\n";
|
||||||
foreach (get_databases() as $db) {
|
foreach (get_databases() as $db) {
|
||||||
if ($db != "information_schema" || $dbh->server_info < 5) {
|
if ($db != "information_schema" || $dbh->server_info < 5) {
|
||||||
echo '<tr><td><label><input type="checkbox" name="databases[]" value="' . htmlspecialchars($db) . '" checked="checked" onclick="dump_uncheck(\'check-databases\');" />' . htmlspecialchars($db) . "</label></td></tr>\n";
|
echo '<tr><td><label><input type="checkbox" name="databases[]" value="' . htmlspecialchars($db) . '" checked="checked" onclick="form_uncheck(\'check-databases\');" />' . htmlspecialchars($db) . "</label></td></tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
@ -166,18 +166,18 @@ if (!strlen($_GET["db"])) {
|
||||||
if (strlen($_GET["db"])) {
|
if (strlen($_GET["db"])) {
|
||||||
$checked = (strlen($_GET["dump"]) ? "" : " checked='checked'");
|
$checked = (strlen($_GET["dump"]) ? "" : " checked='checked'");
|
||||||
echo "<table cellspacing='0'>\n<thead><tr>";
|
echo "<table cellspacing='0'>\n<thead><tr>";
|
||||||
echo "<th align='left'><label><input type='checkbox' id='check-tables'$checked onclick='dump_check(this, /^tables\\[/);' />" . lang('Tables') . "</label></th>";
|
echo "<th align='left'><label><input type='checkbox' id='check-tables'$checked onclick='form_check(this, /^tables\\[/);' />" . lang('Tables') . "</label></th>";
|
||||||
echo "<th align='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='dump_check(this, /^data\\[/);' /></label></th>";
|
echo "<th align='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='form_check(this, /^data\\[/);' /></label></th>";
|
||||||
echo "</tr></thead>\n";
|
echo "</tr></thead>\n";
|
||||||
$views = "";
|
$views = "";
|
||||||
$result = $dbh->query("SHOW TABLE STATUS");
|
$result = $dbh->query("SHOW TABLE STATUS");
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
$checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'");
|
$checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'");
|
||||||
$print = '<tr><td><label><input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"dump_uncheck('check-tables');\" />" . htmlspecialchars($row["Name"]) . "</label></td>";
|
$print = '<tr><td><label><input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-tables');\" />" . htmlspecialchars($row["Name"]) . "</label></td>";
|
||||||
if (!$row["Engine"]) {
|
if (!$row["Engine"]) {
|
||||||
$views .= "$print</tr>\n";
|
$views .= "$print</tr>\n";
|
||||||
} else {
|
} else {
|
||||||
echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? lang('~ %s', $row["Rows"]) : $row["Rows"]) . '<input type="checkbox" name="data[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"dump_uncheck('check-data');\" /></label></td></tr>\n";
|
echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? lang('~ %s', $row["Rows"]) : $row["Rows"]) . '<input type="checkbox" name="data[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-data');\" /></label></td></tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "$views</table>\n";
|
echo "$views</table>\n";
|
||||||
|
|
26
functions.js
26
functions.js
|
@ -6,7 +6,7 @@ function toggle(id) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_version(version) {
|
function verify_version(version) {
|
||||||
document.cookie = 'phpMinAdmin_version=0';
|
document.cookie = 'phpMinAdmin_version=0';
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = 'http://www.phpminadmin.net/version.php?version=' + version;
|
script.src = 'http://www.phpminadmin.net/version.php?version=' + version;
|
||||||
|
@ -29,15 +29,19 @@ function load_jush() {
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
function tables_check(el) {
|
function form_check(el, name) {
|
||||||
var elems = el.form.elements;
|
var elems = el.form.elements;
|
||||||
for (var i=0; i < elems.length; i++) {
|
for (var i=0; i < elems.length; i++) {
|
||||||
if (elems[i].name == 'tables[]') {
|
if (name.test(elems[i].name)) {
|
||||||
elems[i].checked = el.checked;
|
elems[i].checked = el.checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function form_uncheck(id) {
|
||||||
|
document.getElementById(id).checked = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function where_change(op) {
|
function where_change(op) {
|
||||||
|
@ -253,19 +257,3 @@ function schema_mouseup(ev) {
|
||||||
document.cookie = 'schema=' + encodeURIComponent(s.substr(1)) + '; expires=' + date + '; path=' + location.pathname + location.search;
|
document.cookie = 'schema=' + encodeURIComponent(s.substr(1)) + '; expires=' + date + '; path=' + location.pathname + location.search;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dump_check(el, name) {
|
|
||||||
var inputs = el.form.getElementsByTagName('input');
|
|
||||||
for (var i=0; i < inputs.length; i++) {
|
|
||||||
if (name.test(inputs[i].name)) {
|
|
||||||
inputs[i].checked = el.checked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function dump_uncheck(id) {
|
|
||||||
document.getElementById(id).checked = false;
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ function connect_error() {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
onload = function () {
|
onload = function () {
|
||||||
check_version('<?php echo $VERSION; ?>');
|
verify_version('<?php echo $VERSION; ?>');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -171,10 +171,10 @@ if (isset($_GET["download"])) {
|
||||||
} else {
|
} else {
|
||||||
echo "<form action='' method='post'>\n";
|
echo "<form action='' method='post'>\n";
|
||||||
echo "<table cellspacing='0'>\n";
|
echo "<table cellspacing='0'>\n";
|
||||||
echo '<thead><tr><td><input type="checkbox" onclick="tables_check(this);" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Comment') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . "</td></tr></thead>\n";
|
echo '<thead><tr><td><input id="check-all" type="checkbox" onclick="form_check(this, /^tables\[/);" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Comment') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . "</td></tr></thead>\n";
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
table_comment($row);
|
table_comment($row);
|
||||||
echo '<tr class="nowrap' . odd(' odd') . '"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : " ") . "</td><td>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a>');
|
echo '<tr class="nowrap' . odd(' odd') . '"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');" /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : " ") . "</td><td>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a>');
|
||||||
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") : array()) as $key => $link) {
|
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") : array()) as $key => $link) {
|
||||||
$val = number_format($row[$key], 0, '.', lang(','));
|
$val = number_format($row[$key], 0, '.', lang(','));
|
||||||
echo '</td><td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : ' ');
|
echo '</td><td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : ' ');
|
||||||
|
|
Loading…
Reference in a new issue