]> git.joonet.de Git - adminer.git/commitdiff
Max text length
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 11 Jul 2007 10:22:59 +0000 (10:22 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 11 Jul 2007 10:22:59 +0000 (10:22 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@120 7c3ca157-0c34-0410-bff1-cbf682f78f5c

design.inc.php
select.inc.php

index 58463e2403b54774b3fdde53b1f715bad0fc51ef..abd345027f733f1ceebde9e98b6545ca34392134 100644 (file)
@@ -22,7 +22,6 @@ PRE { margin: .12em 0; }
 TABLE { margin-top: 1em; }
 .error { color: Red; }
 .message { color: Green; }
-.select TD { max-height: 3em; overflow: auto; }
 #menu { position: absolute; top: 8px; left: 8px; width: 15em; overflow: auto; white-space: nowrap; }
 #content { margin-left: 16em; }
 </style>
index bfe4b5ef25d60da074b9e94f44d218328705f9c3..5503d863b9c7afa1185dafbc3b835d74d468c34d 100644 (file)
@@ -86,11 +86,27 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
        echo '<div><input name="limit" size="3" value="' . htmlspecialchars($limit) . '" /></div>';
        echo "</fieldset>\n";
        
+       $select = array();
+       unset($text_length);
+       foreach ($columns as $column) {
+               if (preg_match('~text|blob~', $fields[$column]["type"])) {
+                       $text_length = (isset($_GET["text_length"]) ? $_GET["text_length"] : "100");
+                       $select[] = (intval($text_length) ? "LEFT(" . idf_escape($column) . ", " . intval($text_length) . ") AS " : "") . idf_escape($column);
+               } else {
+                       $select[] = idf_escape($column);
+               }
+       }
+       if (isset($text_length)) {
+               echo "<fieldset><legend>" . lang('Text length') . "</legend>\n";
+               echo '<div><input name="text_length" size="3" value="' . htmlspecialchars($text_length) . '" /></div>';
+               echo "</fieldset>\n";
+       }
+       
        echo "<fieldset><legend>" . lang('Action') . "</legend><div><input type='submit' value='" . lang('Select') . "' /></div></fieldset>\n";
        echo "</form>\n";
        echo "<div style='clear: left;'></div>\n";
        
-       $result = $mysql->query("SELECT SQL_CALC_FOUND_ROWS " . implode(", ", array_map('idf_escape', $columns)) . " FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "") . (strlen($limit) ? " LIMIT " . intval($limit) . " OFFSET " . ($limit * $_GET["page"]) : ""));
+       $result = $mysql->query("SELECT SQL_CALC_FOUND_ROWS " . implode(", ", $select) . " FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "") . (strlen($limit) ? " LIMIT " . intval($limit) . " OFFSET " . ($limit * $_GET["page"]) : ""));
        if (!$result->num_rows) {
                echo "<p class='message'>" . lang('No rows.') . "</p>\n";
        } else {