cvs: php4 /pear/HTML Form.php
| From: | Stig Bakken | Date: | Sat, 22 Dec 2001 04:42:47 +0000 |
| Subject: | cvs: php4 /pear/HTML Form.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1656@lists.php.net to get a copy of this message | ||
ssb Fri Dec 21 23:42:47 2001 EDT
Modified files:
/php4/pear/HTML Form.php
Log:
* set enctype automatically when adding files
Index: php4/pear/HTML/Form.php
diff -u php4/pear/HTML/Form.php:1.19 php4/pear/HTML/Form.php:1.20
--- php4/pear/HTML/Form.php:1.19 Tue Dec 11 10:31:24 2001
+++ php4/pear/HTML/Form.php Fri Dec 21 23:42:47 2001
@@ -17,7 +17,7 @@
// | Urs Gehrig <urs@circle.ch> |
// +----------------------------------------------------------------------+
//
-// $Id: Form.php,v 1.19 2001/12/11 15:31:24 sebastian Exp $
+// $Id: Form.php,v 1.20 2001/12/22 04:42:47 ssb Exp $
//
// HTML form utility functions.
//
@@ -53,9 +53,6 @@
/** DB_storage object, if tied to one */
var $storageObject;
- /** <FORM ENCODING=""> attribute value */
- var $encoding;
-
/** TARGET attribute of <FORM> tag */
var $target;
@@ -72,7 +69,6 @@
$this->method = $method;
$this->name = $name;
$this->fields = array();
- $this->encoding = '';
$this->target = $target;
$this->enctype = $enctype;
}
@@ -164,22 +160,24 @@
}
// }}}
-
- // {{{ adding misssing addBlank function
+ // {{{ addBlank()
function addBlank($i,$title = '')
{
$this->fields[] = array("blank", $i, $title);
}
+ // }}}
// {{{ addFile
function addFile($name, $title, $maxsize = HTML_FORM_MAX_FILE_SIZE,
$size = HTML_FORM_TEXT_SIZE, $accept = '')
{
+ $this->enctype = "multipart/form-data";
$this->fields[] = array("file", $name, $title, $maxsize, $size, $accept);
}
+ // }}}
// {{{ start()
function start()
@@ -417,7 +415,7 @@
print " ";
}
-
+ // }}}
// {{{ displayBlankRow()
function displayBlankRow($i, $title= '')
@@ -441,7 +439,7 @@
}
}
- // }}}displayBlankRow()
+ // }}}
// {{{ displayFile()
function displayFile($name, $maxsize = HTML_FORM_MAX_FILE_SIZE,
@@ -456,14 +454,13 @@
}
// }}}displayFile()
-
// {{{ displayFileRow()
function displayFileRow($name, $title, $maxsize = HTML_FORM_MAX_FILE_SIZE,
$size = HTML_FORM_TEXT_SIZE, $accept = '')
{
print " <TR>\n";
- print " <TH ALIGN=\"right\">$title</TH>";
+ print " <TH ALIGN=\"right\">$title:</TH>";
print " <TD>";
$this->displayFile($name, $maxsize, $size, $accept);
print "</TD>\n";