]> git.joonet.de Git - adminer.git/commitdiff
Hide fieldsets in select
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 09:35:21 +0000 (09:35 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 09:35:21 +0000 (09:35 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@693 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/default.css
adminer/functions.js
adminer/lang/cs.inc.php
adminer/select.inc.php
changes.txt

index 5ea9593685722fb5137f19b771f4866a87eab334..0c6f6b978edcdd981ec4b18ee7d8b6e832b64f27 100644 (file)
@@ -14,7 +14,6 @@ p { margin: 0 20px 1em 0; }
 img { vertical-align: middle; border: 0; }
 code { background: #eee; }
 .js .hidden { display: none; }
-.popup { position: absolute; }
 .nowrap { white-space: nowrap; }
 .wrap { white-space: normal; }
 .error { color: red; background: #fee; padding: .5em .8em; }
index 825c938b0c7f6d90c7e93e1ec07f8e65aaabb5ad..787902edb39305f3c358629a29a9aea0065512f3 100644 (file)
@@ -6,14 +6,6 @@ function toggle(id) {
        return true;
 }
 
-function popup(el) {
-       el.getElementsByTagName('span')[0].className = 'popup';
-}
-
-function popdown(el) {
-       el.getElementsByTagName('span')[0].className = 'hidden';
-}
-
 function verify_version(version) {
        document.cookie = 'adminer_version=0';
        var script = document.createElement('script');
index 5e5468686f9edc176fb6f86bf7defda9f881f2cb..41c30205b7f558fed3c6f13b171a40635ec6cf78 100644 (file)
@@ -57,7 +57,7 @@ $translations = array(
        'Select' => 'Vypsat',
        'New item' => 'Nová položka',
        'Search' => 'Vyhledat',
-       'ASC' => 'vzestupně',
+       'Sort' => 'Setřídit',
        'DESC' => 'sestupně',
        'Limit' => 'Limit',
        'No rows.' => 'Žádné řádky.',
index bbf8e275ea49b418f5469bc0ae94f17d190f22eb..0e64c2401266290d86bc2cb77a8d03fe69f2ab7b 100644 (file)
@@ -152,7 +152,7 @@ if (!$columns) {
        echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".</p>\n";
 } else {
        echo "<form action='' id='form'>\n";
-       echo "<fieldset><legend>" . lang('Select') . "</legend>\n";
+       echo '<fieldset><legend><a href="#fieldset-select" onclick="return !toggle(\'fieldset-select\');">' . lang('Select') . "</a></legend><div id='fieldset-select'" . ($select ? "" : " class='hidden'") . ">\n";
        if (strlen($_GET["server"])) {
                echo '<input type="hidden" name="server" value="' . htmlspecialchars($_GET["server"]) . '" />';
        }
@@ -169,9 +169,9 @@ if (!$columns) {
        }
        echo "<div><select name='columns[$i][fun]' onchange='this.nextSibling.onchange();'><option></option>" . optionlist($fun_group) . "</select>";
        echo "<select name='columns[$i][col]' onchange='select_add_row(this);'><option></option>" . optionlist($columns) . "</select></div>\n";
-       echo "</fieldset>\n";
+       echo "</div></fieldset>\n";
        
-       echo "<fieldset><legend>" . lang('Search') . "</legend>\n";
+       echo '<fieldset><legend><a href="#fieldset-search" onclick="return !toggle(\'fieldset-search\');">' . lang('Search') . "</a></legend><div id='fieldset-search'" . ($where ? "" : " class='hidden'") . ">\n";
        foreach ($indexes as $i => $index) {
                if ($index["type"] == "FULLTEXT") {
                        echo "(<i>" . implode("</i>, <i>", array_map('htmlspecialchars', $index["columns"])) . "</i>) AGAINST";
@@ -192,17 +192,34 @@ if (!$columns) {
        echo "<div><select name='where[$i][col]' onchange='select_add_row(this);'><option value=''>" . lang('(anywhere)') . "</option>" . optionlist($columns) . "</select>";
        echo "<select name='where[$i][op]' onchange='where_change(this);'>" . optionlist($operators) . "</select>";
        echo "<input name='where[$i][val]' /></div>\n";
-       echo "</fieldset>\n";
+       echo "</div></fieldset>\n";
+       
+       echo '<fieldset><legend><a href="#fieldset-sort" onclick="return !toggle(\'fieldset-sort\');">' . lang('Sort') . "</a></legend><div id='fieldset-sort'" . (count($order) > 1 ? "" : " class='hidden'") . ">\n";
+       $i = 0;
+       foreach ((array) $_GET["order"] as $key => $val) {
+               if (in_array($val, $columns, true)) {
+                       echo "<div><select name='order[$i]'><option></option>" . optionlist($columns, $val) . "</select>";
+                       echo "<label><input type='checkbox' name='desc[$i]' value='1'" . (isset($_GET["desc"][$key]) ? " checked='checked'" : "") . " />" . lang('DESC') . "</label></div>\n";
+                       $i++;
+               }
+       }
+       echo "<div><select name='order[$i]' onchange='select_add_row(this);'><option></option>" . optionlist($columns) . "</select>";
+       echo "<label><input type='checkbox' name='desc[$i]' value='1' />" . lang('DESC') . "</label></div>\n";
+       echo "</div></fieldset>\n";
        
        echo "<fieldset><legend>" . lang('Limit') . "</legend><div>";
-       echo hidden_fields(array("order" => (array) $_GET["order"], "desc" => (array) $_GET["desc"]));
-       echo "<input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\" /></div></fieldset>\n";
+       echo "<input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\" />";
+       echo "</div></fieldset>\n";
        
        if (isset($text_length)) {
-               echo "<fieldset><legend>" . lang('Text length') . "</legend><div><input name='text_length' size='3' value=\"" . htmlspecialchars($text_length) . "\" /></div></fieldset>\n";
+               echo "<fieldset><legend>" . lang('Text length') . "</legend><div>";
+               echo "<input name='text_length' size='3' value=\"" . htmlspecialchars($text_length) . "\" />";
+               echo "</div></fieldset>\n";
        }
        
-       echo "<fieldset><legend>" . lang('Action') . "</legend><div><input type='submit' value='" . lang('Select') . "' /></div></fieldset>\n";
+       echo "<fieldset><legend>" . lang('Action') . "</legend><div>";
+       echo "<input type='submit' value='" . lang('Select') . "' />";
+       echo "</div></fieldset>\n";
        echo "</form>\n";
        
        $query = "SELECT " . ($select ? (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) : "*") . " $from";
@@ -228,17 +245,7 @@ if (!$columns) {
                                if (!$j) {
                                        echo '<thead><tr><td><input type="checkbox" id="all-page" onclick="form_check(this, /check/);" /></td>';
                                        foreach ($row as $key => $val) {
-                                               $pos = array_search($key, (array) $_GET["order"]);
-                                               $uri = remove_from_uri($pos !== false ? "(order|desc)%5B$pos%5D" : "");
-                                               $pos2 = 0;
-                                               if ($_GET["order"]) {
-                                                       $pos2 = max(array_keys($_GET["order"]));
-                                                       $pos2 += ($pos2 !== $pos ? 1 : 0);
-                                               }
-                                               echo '<th onmouseover="popup(this);" onmouseout="popdown(this);"><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . htmlspecialchars($key) . '</a><span class="hidden">';
-                                               echo '<a href="' . htmlspecialchars("$uri&order%5B$pos2%5D=" . urlencode($key)) . "\"><img src='up.gif' alt='^' title='" . lang('ASC') . "' /></a>";
-                                               echo '<a href="' . htmlspecialchars("$uri&order%5B$pos2%5D=" . urlencode($key) . "&desc%5B$pos2%5D=1") . "\"><img src='down.gif' alt='v' title='" . lang('DESC') . "' /></a>";
-                                               echo '</span></th>';
+                                               echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . htmlspecialchars($key) . '</a></th>';
                                        }
                                        echo "</tr></thead>\n";
                                }
index 4af05f9bfa58b1b9bbaf37b948aae971074e9c06..61679ec3b914e356cbb152f04ff8f9cb8b121623 100644 (file)
@@ -13,7 +13,7 @@ All privileges in user rights
 Fix FOUND_ROWS() in SQL command
 Export only selected columns in select
 Include views in drop and move on database overview
-Simplify order in select
+Hide fieldsets in select
 Use \n in SQL commands
 
 phpMinAdmin 1.10.1: