dynamic length

This commit is contained in:
Marc Delisle
2001-07-19 18:54:19 +00:00
parent 2b7ce4ea1a
commit 7d5c43d1f4
10 changed files with 44 additions and 14 deletions

View File

@@ -5,6 +5,13 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-07-19 Marc Delisle <lem9@users.sourceforge.net>
* config.inc.php3, tbl_change.php3, db_details.php3, lib.inc.php3,
tbl_properties.php3, tbl_properties_inc.php3, tbl_select.php3,
Documentation.html:
Feature #429771: dynamic lenght for input fields, and new config
for textareas
2001-07-18 Steve Alberty <alberty@neptunlabs.de> 2001-07-18 Steve Alberty <alberty@neptunlabs.de>
* left.php3: add 'or mysql_die()' for mysql_list_dbs to suppress * left.php3: add 'or mysql_die()' for mysql_list_dbs to suppress
'unable to save result' warnings 'unable to save result' warnings

View File

@@ -464,9 +464,15 @@
<br /><br /> <br /><br />
</dd> </dd>
<dt><b>$cfgMaxInputsize </b>integer</dt> <dt><b>$cfgTextareaCols </b>integer</dt>
<dd> <dd>
Size of the edit-field when adding a new record to a table. Number of columns for the textareas.
<br /><br />
</dd>
<dt><b>$cfgTextareaRows </b>integer</dt>
<dd>
Number of rows for the textareas.
<br /><br /> <br /><br />
</dd> </dd>

View File

@@ -77,11 +77,11 @@ $cfgThBgcolor = "#D3DCE3";
$cfgBgcolorOne = "#CCCCCC"; $cfgBgcolorOne = "#CCCCCC";
$cfgBgcolorTwo = "#DDDDDD"; $cfgBgcolorTwo = "#DDDDDD";
$cfgMaxRows = 30; $cfgMaxRows = 30;
$cfgMaxInputsize = "300px";
$cfgOrder = "ASC"; $cfgOrder = "ASC";
$cfgShowBlob = true; $cfgShowBlob = true;
$cfgShowSQL = true; $cfgShowSQL = true;
$cfgTextareaCols = "40";
$cfgTextareaRows = "7";
$cfgModifyDeleteAtLeft = true; $cfgModifyDeleteAtLeft = true;
$cfgModifyDeleteAtRight = false; $cfgModifyDeleteAtRight = false;

View File

@@ -11,7 +11,6 @@ if (!isset($message)) {
show_message($message); show_message($message);
} }
/** /**
* Displays an html table with all the tables contained into the current * Displays an html table with all the tables contained into the current
* database * database
@@ -261,7 +260,10 @@ if ($num_tables > 0) {
<input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>" /> <input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>" />
<?php echo $strRunSQLQuery . $db . ' ' . show_docu('manual_Reference.html#SELECT'); ?>&nbsp;:<br /> <?php echo $strRunSQLQuery . $db . ' ' . show_docu('manual_Reference.html#SELECT'); ?>&nbsp;:<br />
<div style="margin-bottom: 5px"> <div style="margin-bottom: 5px">
<textarea name="sql_query" cols="40" rows="3" wrap="virtual" style="width: <?php echo $cfgMaxInputsize; ?>"> <textarea name="sql_query" wrap="virtual"
rows="<?php echo $cfgTextareaRows; ?>"
cols="<?php echo $cfgTextareaCols; ?>"
>
<?php if (isset($show_query)) { <?php if (isset($show_query)) {
echo $show_query=="y" ? $sql_query : ''; echo $show_query=="y" ? $sql_query : '';
} }

View File

@@ -23,4 +23,4 @@ if (!empty($HTTP_POST_FILES)) {
$$name = $value['tmp_name']; $$name = $value['tmp_name'];
} }
} }
?> ?>

View File

@@ -3,6 +3,10 @@
require("./config.inc.php3"); require("./config.inc.php3");
// if they are using an old config.inc.php3
if (!isset($cfgTextareaCols)) $cfgTextareaCols="40";
if (!isset($cfgTextareaRows)) $cfgTextareaRows="7";
if(!defined("__LIB_INC__")){ if(!defined("__LIB_INC__")){
define("__LIB_INC__", 1); define("__LIB_INC__", 1);

View File

@@ -81,7 +81,6 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
} }
echo "<td>$type</td>\n"; echo "<td>$type</td>\n";
// THE VALUE COLUMN
if(isset($row) && isset($row[$field])) if(isset($row) && isset($row[$field]))
{ {
$special_chars = htmlspecialchars($row[$field]); $special_chars = htmlspecialchars($row[$field]);
@@ -119,9 +118,12 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
echo "</select></td>\n"; echo "</select></td>\n";
} }
// THE VALUE COLUMN
if(strstr($row_table_def["Type"], "text")) if(strstr($row_table_def["Type"], "text"))
{ {
echo "<td><textarea name=fields[$field] style=\"width:$cfgMaxInputsize;\" rows=5>$special_chars</textarea></td>\n"; echo "<td><textarea name=fields[$field] rows=\"$cfgTextareaRows\"
cols=\"$cfgTextareaCols\" >$special_chars</textarea></td>\n";
if (strlen($special_chars) > 32000) if (strlen($special_chars) > 32000)
echo "<td>$strTextAreaLength</td>"; echo "<td>$strTextAreaLength</td>";
} }
@@ -210,11 +212,14 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
elseif((strstr($row_table_def["Type"], "blob") || strstr($row_table_def["Type"], "binary")) && !empty($data)) elseif((strstr($row_table_def["Type"], "blob") || strstr($row_table_def["Type"], "binary")) && !empty($data))
{ {
echo "<td>" . $strBinaryDoNotEdit; echo "<td>" . $strBinaryDoNotEdit;
echo "<input type=\"hidden\" name=fields[$field] value=\"".$special_chars."\" style=\"width:$cfgMaxInputsize;\" maxlength=$len></td>"; echo "<input type=\"hidden\" name=fields[$field] value=\"".$special_chars."\"></td>";
} }
else else
{ {
echo "<td><input type=text name=fields[$field] value=\"".$special_chars."\" style=\"width:$cfgMaxInputsize;\" maxlength=$len></td>"; $fieldsize=($len>40? 40: $len);
echo "<td><input type=text name=fields[$field]
value=\"".$special_chars."\" maxlength=\"$len\" size=\"$fieldsize\"></td>";
} }
echo "</tr>\n"; echo "</tr>\n";
} }

View File

@@ -201,7 +201,7 @@ if($action == "tbl_create.php3" && MYSQL_MAJOR_VERSION >= "3.23")
{ {
echo "$strTableComments:<br>"; echo "$strTableComments:<br>";
?> ?>
<input type="text" name="comment" style="width: <?php echo $cfgMaxInputsize;?>" maxlength="80"> <input type="text" name="comment" size="40" maxlength="80">
<?php <?php
//BEGIN - Table Type - 2 May 2001 - Robbat2 - change by staybyte - 11 June 2001 //BEGIN - Table Type - 2 May 2001 - Robbat2 - change by staybyte - 11 June 2001
if($action == "tbl_create.php3") if($action == "tbl_create.php3")

View File

@@ -467,7 +467,10 @@ echo "\n";
<input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>" /> <input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>" />
<?php echo $strRunSQLQuery . $db . ' ' . show_docu('manual_Reference.html#SELECT'); ?>&nbsp;:<br /> <?php echo $strRunSQLQuery . $db . ' ' . show_docu('manual_Reference.html#SELECT'); ?>&nbsp;:<br />
<div style="margin-bottom: 5px"> <div style="margin-bottom: 5px">
<textarea name="sql_query" cols="40" rows="3" wrap="virtual" style="width: <?php echo $cfgMaxInputsize; ?>"> <textarea name="sql_query" wrap="virtual"
rows="<?php echo $cfgTextareaRows; ?>"
cols="<?php echo $cfgTextareaCols; ?>"
>
SELECT * FROM <?php echo $table; ?> WHERE 1 SELECT * FROM <?php echo $table; ?> WHERE 1
</textarea><br /> </textarea><br />
</div> </div>

View File

@@ -58,7 +58,10 @@ if(!isset($param) || $param[0] == "") {
echo "<tr bgcolor=".$bgcolor.">"; echo "<tr bgcolor=".$bgcolor.">";
echo "<td>$field</td>"; echo "<td>$field</td>";
echo "<td>$type</td>"; echo "<td>$type</td>";
echo "<td><input type=text name=fields[] style=\"width: ".$cfgMaxInputsize."\" maxlength=".$len."></td>\n";
$fieldsize=($len>40? 40: $len);
echo "<td><input type=text name=fields[]
size=\"$fieldsize\" maxlength=".$len."></td>\n";
echo "<input type=hidden name=names[] value=\"$field\">\n"; echo "<input type=hidden name=names[] value=\"$field\">\n";
echo "<input type=hidden name=types[] value=\"$type\">\n"; echo "<input type=hidden name=types[] value=\"$type\">\n";
echo "</tr>"; echo "</tr>";