]> git.joonet.de Git - adminer.git/commitdiff
Simplify order in select
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 3 Jun 2009 18:32:23 +0000 (18:32 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 3 Jun 2009 18:32:23 +0000 (18:32 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@646 7c3ca157-0c34-0410-bff1-cbf682f78f5c

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

index 956719f63133954be0d39d1fb31ad651fdea7065..3156526b474d234428b7cb9079bb92378b468f0d 100644 (file)
@@ -7,6 +7,7 @@ Version checker
 Separate JavaScript functions
 Always use the default style before the external one
 Always try to use the syntax highlighter
+Simplify order in select
 
 phpMinAdmin 1.10.1:
 Highlight odd and hover rows
index 6884be660dad899423b879fa6decbbc3eb13dc65..4f33cbfa56dd12caa3d401fa27c348c132024c7c 100644 (file)
@@ -14,6 +14,7 @@ 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; }
 .error { color: red; background: #fee; padding: .5em .8em; }
 .message { color: green; background: #efe; padding: .5em .8em; }
index 0fb94e6d8062f4f99100848d4e5121729d7aec38..0c94a34081a1dc84ca40d34331285e3efc15df54 100644 (file)
@@ -6,6 +6,14 @@ 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 = 'phpMinAdmin_version=0';
        var script = document.createElement('script');
index 30bdfd76277ff285f6b843b75f950a818f4e7034..08c8fc3a8d3c4461da9ba8b6bb868339237dbe9a 100644 (file)
@@ -58,6 +58,7 @@ $translations = array(
        'New item' => 'Nová položka',
        'Search' => 'Vyhledat',
        'Sort' => 'Setřídit',
+       'ASC' => 'vzestupně',
        'DESC' => 'sestupně',
        'Limit' => 'Limit',
        'No rows.' => 'Žádné řádky.',
index 1c4f643f56545b5bb268ac52f81f40d42bd53996..8a637f334e532689a37bb4670148b1ce24b5a07f 100644 (file)
@@ -58,7 +58,6 @@ $translations = array(
        'New item' => 'Nouvel élément',
        'Search' => 'Rechercher',
        'Sort' => 'Ordonner',
-       'DESC' => 'DESC',
        'Limit' => 'Limit',
        'No rows.' => 'Aucun résultat',
        'Action' => 'Action',
index 0d6c9013b41d4c4cdbdb3f7e3fa246756fdf3de8..1070caa3fc7c9e526516fa9f509cfb2cec73fe82 100644 (file)
@@ -58,7 +58,6 @@ $translations = array(
        'New item' => 'Nuovo elemento',
        'Search' => 'Cerca',
        'Sort' => 'Ordina',
-       'DESC' => 'DESC',
        'Limit' => 'Limite',
        'No rows.' => 'Nessuna riga.',
        'Action' => 'Azione',
index 7ae7cc3605866a57fcf4a2fb2d3a1c74256d3263..017c7aa3004e6d779de157fc7f6e384f60fd4253 100644 (file)
@@ -194,20 +194,9 @@ if (!$columns) {
        echo "<input name='where[$i][val]' /></div>\n";
        echo "</fieldset>\n";
        
-       echo "<fieldset><legend>" . lang('Sort') . "</legend>\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 "</fieldset>\n";
-       
-       echo "<fieldset><legend>" . lang('Limit') . "</legend><div><input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\" /></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";
        
        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";
@@ -239,7 +228,16 @@ if (!$columns) {
                                if (!$j) {
                                        echo '<thead><tr><td><label><input type="checkbox" name="all" value="1" />' . lang('whole result') . '</label></td>';
                                        foreach ($row as $key => $val) {
-                                               echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*')) . '&amp;order%5B0%5D=' . htmlspecialchars($key) . ($_GET["order"][0] === $key && !$_GET["desc"][0] ? '&amp;desc%5B0%5D=1' : '') . '">' . htmlspecialchars($key) . "</a></th>";
+                                               $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"][0] === $key && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . htmlspecialchars($key) . '</a>';
+                                               echo '<span class="hidden"><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></span></th>';
                                        }
                                        echo "</tr></thead>\n";
                                }
@@ -251,10 +249,8 @@ if (!$columns) {
                                        } elseif (preg_match('~blob|binary~', $fields[$key]["type"]) && preg_match('~[\\0-\\x8\\xb\\xc\\xe-\\x1F\\x80-\\xFF]~', $val)) {
                                                $val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&amp;field=' . urlencode($key) . '&amp;' . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
                                        } else {
-                                               if (!strlen(trim($val))) {
-                                                       $val = "&nbsp;";
-                                               } elseif (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"]) && strlen($val) > intval($text_length)) {
-                                                       $val = (preg_match('~blob~', $fields[$key]["type"]) ? nl2br(htmlspecialchars(substr($val, 0, intval($text_length)))) . "<em>...</em>" : shorten_utf8($val, intval($text_length)));
+                                               if (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
+                                                       $val = shorten_utf8($val, intval($text_length));
                                                } else {
                                                        $val = nl2br(htmlspecialchars($val));
                                                        if ($fields[$key]["type"] == "char") {