]> git.joonet.de Git - adminer.git/commitdiff
Rename JavaScript functions
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 1 Jun 2009 13:06:11 +0000 (13:06 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 1 Jun 2009 13:06:11 +0000 (13:06 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@638 7c3ca157-0c34-0410-bff1-cbf682f78f5c

dump.inc.php
functions.js
include/connect.inc.php
index.php

index 98a8db0a7176e8b2a7af4a48567dc1d1bb29120e..88d3c204e6c7d1da9b31d7e886fd6dc35c5cb227 100644 (file)
@@ -154,10 +154,10 @@ echo "<tr><th>" . lang('Data') . "</th><td><select name='data_style'><option></o
 
 <?php
 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) {
                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";
@@ -166,18 +166,18 @@ if (!strlen($_GET["db"])) {
 if (strlen($_GET["db"])) {
        $checked = (strlen($_GET["dump"]) ? "" : " checked='checked'");
        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='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='dump_check(this, /^data\\[/);' /></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='form_check(this, /^data\\[/);' /></label></th>";
        echo "</tr></thead>\n";
        $views = "";
        $result = $dbh->query("SHOW TABLE STATUS");
        while ($row = $result->fetch_assoc()) {
                $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"]) {
                        $views .= "$print</tr>\n";
                } 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";
index 4c8d4510ecb61f960a54c9b659ca8afe0a2d8abc..0fb94e6d8062f4f99100848d4e5121729d7aec38 100644 (file)
@@ -6,7 +6,7 @@ function toggle(id) {
        return true;
 }
 
-function check_version(version) {
+function verify_version(version) {
        document.cookie = 'phpMinAdmin_version=0';
        var script = document.createElement('script');
        script.src = 'http://www.phpminadmin.net/version.php?version=' + version;
@@ -29,15 +29,19 @@ function load_jush() {
        document.body.appendChild(script);
 }
 
-function tables_check(el) {
+function form_check(el, name) {
        var elems = el.form.elements;
        for (var i=0; i < elems.length; i++) {
-               if (elems[i].name == 'tables[]') {
+               if (name.test(elems[i].name)) {
                        elems[i].checked = el.checked;
                }
        }
 }
 
+function form_uncheck(id) {
+       document.getElementById(id).checked = false;
+}
+
 
 
 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;
        }
 }
-
-
-
-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;
-}
index 20b083d16026306945086386d4200a1a44c5460e..222304e8056d9f72a7d98a01c7f67f79fa59731b 100644 (file)
@@ -14,7 +14,7 @@ function connect_error() {
                        ?>
 <script type="text/javascript">
 onload = function () {
-       check_version('<?php echo $VERSION; ?>');
+       verify_version('<?php echo $VERSION; ?>');
 };
 </script>
 <?php
index 8ac13b250bd2b2b7e8560e81bc61bb39f35eab86..8fdd2fff5d43bdaae4c8e90a95c9a4781dd57212 100644 (file)
--- a/index.php
+++ b/index.php
@@ -171,10 +171,10 @@ if (isset($_GET["download"])) {
                        } else {
                                echo "<form action='' method='post'>\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()) {
                                        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"]) : "&nbsp;") . "</td><td>$row[Collation]" : '&nbsp;</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"]) : "&nbsp;") . "</td><td>$row[Collation]" : '&nbsp;</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) {
                                                $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>' : '&nbsp;');