Permalink
Browse files

Hide fieldsets in select

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@693 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent b5fa22e commit b142000d8b7c3f2d1f47da53e602d47de3f2a2f5 jakubvrana committed Jun 15, 2009
Showing with 28 additions and 30 deletions.
  1. +0 −1 adminer/default.css
  2. +0 −8 adminer/functions.js
  3. +1 −1 adminer/lang/cs.inc.php
  4. +26 −19 adminer/select.inc.php
  5. +1 −1 changes.txt
View
@@ -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; }
View
@@ -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');
View
@@ -57,7 +57,7 @@
'Select' => 'Vypsat',
'New item' => 'Nová položka',
'Search' => 'Vyhledat',
- 'ASC' => 'vzestupně',
+ 'Sort' => 'Setřídit',
'DESC' => 'sestupně',
'Limit' => 'Limit',
'No rows.' => 'Žádné řádky.',
View
@@ -152,7 +152,7 @@
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 @@
}
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 @@
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 (!$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";
}
View
@@ -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:

0 comments on commit b142000

Please sign in to comment.