Allow Adaptive Textarea's when editting values (Juergen Weigert)
authormr-russ <mr-russ>
Sun, 20 Feb 2005 04:47:46 +0000 (04:47 +0000)
committermr-russ <mr-russ>
Sun, 20 Feb 2005 04:47:46 +0000 (04:47 +0000)
HISTORY
classes/database/Postgres.php

diff --git a/HISTORY b/HISTORY
index 804bdcb9b9288354004b6d41991da06e6cd1cf70..7f61da1805239b76fc7c98d4916c9f1205e0b41d 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -7,6 +7,7 @@ Version 3.6-dev
 Features
 * Allow current database to be at the top
 * Allow base URL of PostgreSQL documentation to be configured
+* Allow variable size textarea when editing values (Juergen Weigert)
 
 Bugs
 * Tree Icons are displayed middle instead of top
index 4d002a58b61c604bb62092fa1f530e6047342bf7..6f58847284eed4fbcdaac671c458efff3411020b 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.253 2005/02/10 21:21:00 mr-russ Exp $
+ * $Id: Postgres.php,v 1.254 2005/02/20 04:47:46 mr-russ Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -281,12 +281,18 @@ class Postgres extends ADODB_base {
                                // EXCEPT the 'special' ones like \r \n \t, etc.
                                $value = addCSlashes($value, "\0..\37\177..\377");
                        case 'text':
-                               echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"5\" cols=\"75\" wrap=\"virtual\"{$action_str}>\n";
+                               $n = substr_count($value, "\n");
+                               $n = $n < 5 ? 5 : $n;
+                               $n = $n > 20 ? 20 : $n;
+                               echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"{$n}\" cols=\"75\" wrap=\"virtual\"{$action_str}>\n";
                                echo htmlspecialchars($value);
                                echo "</textarea>\n";
                                break;
                        case 'character':
-                               echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"2\" cols=\"35\" wrap=\"virtual\"{$action_str}>\n";
+                               $n = substr_count($value, "\n");
+                               $n = $n < 5 ? 5 : $n;
+                               $n = $n > 20 ? 20 : $n;
+                               echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"{$n}\" cols=\"35\" wrap=\"virtual\"{$action_str}>\n";
                                echo htmlspecialchars($value);
                                echo "</textarea>\n";
                                break;