]> git.joonet.de Git - adminer.git/commitdiff
Highlight odd and hover rows
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 30 Apr 2009 15:21:31 +0000 (15:21 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 30 Apr 2009 15:21:31 +0000 (15:21 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@591 7c3ca157-0c34-0410-bff1-cbf682f78f5c

changes.txt
default.css
dump.inc.php
editing.inc.php
functions.inc.php
index.php
indexes.inc.php
privileges.inc.php
processlist.inc.php
select.inc.php
user.inc.php

index fd30cd1218a674097e763450158506883517113b..c8c4a2503251bdaab2dd8293fb119f3292e1bfc8 100644 (file)
@@ -1,3 +1,6 @@
+phpMinAdmin 1.10.1:
+Highlight odd and hover rows
+
 phpMinAdmin 1.10.0:
 Partitioning (MySQL 5.1)
 CSV import
index 78ebf57d2fcef9c8012d8cf2f7eb7f2a0e1a8683..344c125200f35eaf9e093409c86aef11f18127dd 100644 (file)
@@ -1,4 +1,4 @@
-body { color: #000; background-color: #fff; line-height: 1.25em; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0; font-size: 90%; }
+body { color: #000; background: #fff; line-height: 1.25em; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0; font-size: 90%; }
 a { color: blue; }
 a:visited { color: navy; }
 a:hover { color: red; }
@@ -12,7 +12,7 @@ th { background: #eee; }
 fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: 0 .5em .5em 0; border: 1px solid #999; }
 p { margin: 0 20px 1em 0; }
 img { vertical-align: middle; }
-code { background-color: #eee; }
+code { background: #eee; }
 .js .hidden { display: none; }
 .nowrap { white-space: nowrap; }
 .error { color: red; background: #fee; padding: .5em .8em; }
@@ -21,6 +21,9 @@ code { background-color: #eee; }
 .date { color: #7F007F; }
 .enum { color: #007F7F; }
 .binary { color: red; }
+.odd td { background: #F8F8F8; }
+tr:hover td { background: #efe; }
+thead tr:hover td { background: transparent; }
 #menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
 #menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
 #menu form { margin: 0; }
index c01a8074a37164364c7b25fb7058c5e10fcd6995..06f75ec55d77b72faaf7427cc438d8708c895eec 100644 (file)
@@ -152,7 +152,7 @@ foreach (array('', 'USE', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) {
 echo "</tr></thead>\n";
 foreach ((strlen($_GET["db"]) ? array($_GET["db"]) : get_databases()) as $db) {
        if ($db != "information_schema" || $mysql->server_info < 5) {
-               echo "<tr><td>" . htmlspecialchars($db) . "</td>";
+               echo "<tr" . odd() . "><td>" . htmlspecialchars($db) . "</td>";
                foreach (array('', 'USE', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) {
                        echo '<td><input type="radio" name="databases[' . htmlspecialchars(bracket_escape($db)) . ']"' . ($val == (strlen($_GET["db"]) ? '' : 'CREATE') ? " checked='checked'" : "") . " value='$val' /></td>";
                }
@@ -171,8 +171,9 @@ foreach (array('', 'TRUNCATE, INSERT', 'INSERT', 'UPDATE') as $val) {
 echo "</tr></thead>\n";
 $views = "";
 $result = $mysql->query(strlen($_GET["db"]) ? "SHOW TABLE STATUS" : "SELECT 'Engine'");
+odd('');
 while ($row = $result->fetch_assoc()) {
-       $print = "<tr><td>" . htmlspecialchars($row["Name"]) . "</td>";
+       $print = "<tr" . odd() . "><td>" . htmlspecialchars($row["Name"]) . "</td>";
        foreach (array('', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) {
                $print .= '<td><input type="radio" name="tables[' . htmlspecialchars(bracket_escape($row["Name"])) . ']"' . ($val == (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : 'DROP, CREATE') ? " checked='checked'" : "") . " value='$val' /></td>";
        }
index c07d751b235848210e47d28d129d9f706fe89aba..16833b691f98b401f56f501d5869e155fabd0a6c 100644 (file)
@@ -106,7 +106,7 @@ function process_type($field, $collate = "COLLATE") {
 function edit_fields($fields, $collations, $type = "TABLE") {
        global $inout;
        ?>
-<tr>
+<thead><tr>
 <?php if ($type == "PROCEDURE") { ?><td><?php echo lang('IN-OUT'); ?></td><?php } ?>
 <th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?></th>
 <td><?php echo lang('Type'); ?></td>
@@ -118,14 +118,14 @@ function edit_fields($fields, $collations, $type = "TABLE") {
 <td><?php echo lang('Comment'); ?></td>
 <?php } ?>
 <td><input type="image" name="add[0]" src="plus.gif" title="<?php echo lang('Add next'); ?>" /></td>
-</tr>
+</tr></thead>
 <?php
        $column_comments = false;
        foreach ($fields as $i => $field) {
                $i++;
                $display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i]));
                ?>
-<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
+<tr<?php echo ($display ? odd() : " style='display: none;'"); ?>>
 <?php if ($type == "PROCEDURE") { ?><td><select name="fields[<?php echo $i; ?>][inout]"><?php echo optionlist($inout, $field["inout"]); ?></select></td><?php } ?>
 <th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo htmlspecialchars($field["field"]); ?>" maxlength="64" /><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>" /></th>
 <?php edit_type("fields[$i]", $field, $collations); ?>
@@ -191,6 +191,7 @@ function type_change($count, $allowed = 0) {
 <script type="text/javascript">// <![CDATA[
 var added = '.';
 var row_count = <?php echo $count; ?>;
+
 function add_row(button) {
        if (<?php echo $allowed; ?> && row_count >= <?php echo $allowed; ?>) {
                return false;
@@ -222,12 +223,15 @@ function add_row(button) {
        row_count++;
        return true;
 }
+
 function remove_row(button) {
        var field = button.form[button.name.replace(/drop_col(.+)/, 'fields$1[field]')];
        field.parentNode.removeChild(field);
        button.parentNode.parentNode.style.display = 'none';
+       //! should change class="odd" of next rows
        return true;
 }
+
 function type_change(type) {
        var name = type.name.substr(0, type.name.length - 6);
        for (var i=0; i < type.form.elements.length; i++) {
index f99dad389041f78bc3a36667fbc6922cb43d1f2d..8568b2f0bf854bdd5a4a0749a66a6a72be457763 100644 (file)
@@ -251,6 +251,14 @@ function get_file($key) {
        return (!$_FILES[$key] || $_FILES[$key]["error"] ? $_FILES[$key]["error"] : file_get_contents($_FILES[$key]["tmp_name"]));
 }
 
+function odd($s = ' class="odd"') {
+       static $i = 0;
+       if (!$s) { // reset counter
+               $i = 0;
+       }
+       return (++$i % 2 ? $s : '');
+}
+
 function select($result) {
        global $SELF;
        if (!$result->num_rows) {
@@ -292,7 +300,7 @@ function select($result) {
                                }
                                echo "</tr></thead>\n";
                        }
-                       echo "<tr>";
+                       echo "<tr" . odd() . ">";
                        foreach ($row as $key => $val) {
                                if (!isset($val)) {
                                        $val = "<i>NULL</i>";
index 2af28949fd4a07785ec0dd5fee4f25a9f244263d..253aa864ed84099bb04f7ba2adad72eba409df0c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -184,7 +184,7 @@ if (isset($_GET["download"])) {
                                echo '<thead><tr><td><input type="checkbox" onclick="var elems = this.form.elements; for (var i=0; elems.length > i; i++) if (elems[i].name == \'tables[]\') elems[i].checked = this.checked;" /></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"><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"' : '') . ' /></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('around %s', $val) : $val) . '</a>' : '&nbsp;');
index 6fbbdc1c3da13cbe74c13e484a6f23c13d0ec379..b482712e34eed1a4727ad6f6a42b91e016e4a98d 100644 (file)
@@ -95,11 +95,11 @@ function add_column(field) {
 
 <form action="" method="post">
 <table border="0" cellspacing="0" cellpadding="2">
-<thead><tr><th><?php echo lang('Index Type'); ?></th><td><?php echo lang('Column (length)'); ?></td></tr></thead>
+<thead><tr><th><?php echo lang('Index Type'); ?></th><th><?php echo lang('Column (length)'); ?></th></tr></thead>
 <?php
 $j = 0;
 foreach ($row["indexes"] as $index) {
-       echo "<tr><td><select name='indexes[$j][type]'" . ($j == count($row["indexes"]) - 1 ? " onchange='add_row(this);'" : "") . "><option></option>" . optionlist($index_types, $index["type"]) . "</select></td><td>\n";
+       echo "<tr" . odd() . "><td><select name='indexes[$j][type]'" . ($j == count($row["indexes"]) - 1 ? " onchange='add_row(this);'" : "") . "><option></option>" . optionlist($index_types, $index["type"]) . "</select></td><td>\n";
        ksort($index["columns"]);
        foreach ($index["columns"] as $i => $column) {
                echo "<span><select name='indexes[$j][columns][$i]'" . ($i == count($index["columns"]) ? " onchange='add_column(this);'" : "") . "><option></option>" . optionlist($fields, $column) . "</select>";
index 6365dd544d713fd19a39b6e0abd1792997af7dd0..c2522baefb2becbabe32af5bd359cfa2526fa396 100644 (file)
@@ -17,7 +17,7 @@ if (!$result) {
 echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
 echo "<thead><tr><th>&nbsp;</th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
 while ($row = $result->fetch_assoc()) {
-       echo '<tr><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&amp;host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
+       echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&amp;host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
 }
 echo "</table>\n";
 $result->free();
index 683cfda0690dfdf71fceb8e3caed653cab988379..32e5c642e43dcb9545b9b7c2c07a0aae617f4dfa 100644 (file)
@@ -19,7 +19,7 @@ for ($i=0; $row = $result->fetch_assoc(); $i++) {
        if (!$i) {
                echo "<thead><tr lang='en'><th>&nbsp;</th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
        }
-       echo "<tr><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
+       echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
 }
 $result->free();
 ?>
index b00068b3a7c0b2b42b8ac635aba2c29c51197aab..0b45b1ebec0a88b76090bfc6d42502fe6bff69a1 100644 (file)
@@ -280,7 +280,7 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
                                        echo "</tr></thead>\n";
                                }
                                $unique_idf = implode('&amp;', unique_idf($row, $indexes));
-                               echo '<tr><td><input type="checkbox" name="check[]" value="' . $unique_idf . '" onclick="this.form[\'all\'].checked = false;" />' . (count($select) == count($group) && $_GET["db"] != "information_schema" ? ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . '</a> <a href="' . htmlspecialchars($SELF) . 'clone=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('clone') . '</a></td>' : '');
+                               echo '<tr' . odd() . '><td><input type="checkbox" name="check[]" value="' . $unique_idf . '" onclick="this.form[\'all\'].checked = false;" />' . (count($select) == count($group) && $_GET["db"] != "information_schema" ? ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . '</a> <a href="' . htmlspecialchars($SELF) . 'clone=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('clone') . '</a></td>' : '');
                                foreach ($row as $key => $val) {
                                        if (!isset($val)) {
                                                $val = "<i>NULL</i>";
index a48cbfc0fabe92744fe4b4191909961b889c1c36..52bdc1d74027f1eefbad8ea90ed2aeffac0af49e 100644 (file)
@@ -156,7 +156,7 @@ foreach (array(
        "Procedures" => lang('Routine'),
 ) as $context => $desc) {
        foreach ((array) $privileges[$context] as $privilege => $comment) {
-               echo '<tr><td>' . $desc . '</td><td title="' . htmlspecialchars($comment) . '"><i>' . htmlspecialchars($privilege) . '</i></td>';
+               echo "<tr" . odd() . "><td>$desc</td><td title=\"" . htmlspecialchars($comment) . '"><i>' . htmlspecialchars($privilege) . '</i></td>';
                $i = 0;
                foreach ($grants as $object => $grant) {
                        $name = '"grants[' . $i . '][' . htmlspecialchars(strtoupper($privilege)) . ']"';