cvs: pear /HTML_Form package.xml /HTML_Form/HTML Form.php /HTML_Form/tests form.phpt
| From: | Daniel Convissor | Date: | Tue, 15 Jun 2004 18:27:30 +0000 |
| Subject: | cvs: pear /HTML_Form package.xml /HTML_Form/HTML Form.php /HTML_Form/tests form.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20697@lists.php.net to get a copy of this message | ||
danielc Tue Jun 15 14:27:30 2004 EDT
Modified files:
/pear/HTML_Form package.xml
/pear/HTML_Form/HTML Form.php
/pear/HTML_Form/tests form.phpt
Log:
* Add $attr, $caption and $capattr parameters to dislpay().
* Improve docblocks for *passwordRow() methods.
* Remove call to reset() in display, foreach does that automatically.
* Some whitespace cleanup.
http://cvs.php.net/diff.php/pear/HTML_Form/package.xml?r1=1.11&r2=1.12&ty=u
Index: pear/HTML_Form/package.xml
diff -u pear/HTML_Form/package.xml:1.11 pear/HTML_Form/package.xml:1.12
--- pear/HTML_Form/package.xml:1.11 Sun Jun 13 23:19:19 2004
+++ pear/HTML_Form/package.xml Tue Jun 15 14:27:30 2004
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<package version="1.0">
- <!-- $Id: package.xml,v 1.11 2004/06/14 03:19:19 danielc Exp $ -->
+ <!-- $Id: package.xml,v 1.12 2004/06/15 18:27:30 danielc Exp $ -->
<name>HTML_Form</name>
<summary>Simple HTML form package</summary>
<description>
@@ -25,10 +25,33 @@
</maintainer>
</maintainers>
<release>
- <version>1.1.0RC1</version>
+ <version>1.1.0RC2</version>
<state>beta</state>
- <date>2004-06-14</date>
+ <date>2004-06-15</date>
<notes><![CDATA[
+* Add $attr, $caption and $capattr parameters to dislpay().
+
+* Improve docblocks for *passwordRow() methods.
+ ]]>
+ </notes>
+ <filelist>
+ <file role="php" name="HTML/Form.php"/>
+ <dir name="tests" role="test">
+ <file name="form.phpt">
+ <replace from="@include_path@" to="php_dir"
type="pear-config"/>
+ </file>
+ </dir>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="4.0.0" />
+ </deps>
+ </release>
+ <changelog>
+ <release>
+ <version>1.1.0RC1</version>
+ <state>beta</state>
+ <date>2004-06-14</date>
+ <notes><![CDATA[
* Don't pass $this->action through basename() in
returnStart() or start(). Bug #658.
@@ -120,21 +143,9 @@
select: 4 should have been 5
* Added tests.
- ]]>
- </notes>
- <filelist>
- <file role="php" name="HTML/Form.php"/>
- <dir name="tests" role="test">
- <file name="form.phpt">
- <replace from="@include_path@" to="php_dir"
type="pear-config"/>
- </file>
- </dir>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="4.0.0" />
- </deps>
- </release>
- <changelog>
+ ]]>
+ </notes>
+ </release>
<release>
<version>1.0.1</version>
<state>stable</state>
http://cvs.php.net/diff.php/pear/HTML_Form/HTML/Form.php?r1=1.9&r2=1.10&ty=u
Index: pear/HTML_Form/HTML/Form.php
diff -u pear/HTML_Form/HTML/Form.php:1.9 pear/HTML_Form/HTML/Form.php:1.10
--- pear/HTML_Form/HTML/Form.php:1.9 Tue Jun 15 13:46:58 2004
+++ pear/HTML_Form/HTML/Form.php Tue Jun 15 14:27:30 2004
@@ -18,7 +18,7 @@
// | Daniel Convissor <danielc@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Form.php,v 1.9 2004/06/15 17:46:58 danielc Exp $
+// $Id: Form.php,v 1.10 2004/06/15 18:27:30 danielc Exp $
//
// HTML form utility functions.
@@ -51,7 +51,7 @@
* @author Stig Bakken <ssb@fast.no>
* @author Urs Gehrig <urs@circle.ch>
* @author Daniel Convissor <danielc@php.net>
- * @version $Id: Form.php,v 1.9 2004/06/15 17:46:58 danielc Exp $
+ * @version $Id: Form.php,v 1.10 2004/06/15 18:27:30 danielc Exp $
* @access public
*/
class HTML_Form
@@ -130,13 +130,13 @@
function HTML_Form($action, $method = 'get', $name = '', $target =
'',
$enctype = '', $attr = '')
{
- $this->action = $action;
- $this->method = $method;
- $this->name = $name;
- $this->fields = array();
- $this->target = $target;
+ $this->action = $action;
+ $this->method = $method;
+ $this->name = $name;
+ $this->fields = array();
+ $this->target = $target;
$this->enctype = $enctype;
- $this->attr = $attr;
+ $this->attr = $attr;
}
@@ -2246,12 +2246,17 @@
*
* NOTE: can NOT be called statically.
*
+ * @param string $attr a string of additional attributes to be put
+ * in the <table> tag (example:
'class="foo"')
+ * @param string $caption if present, a <caption> is added to the table
+ * @param string $capattr a string of additional attributes to be put
+ * in the <caption> tag (example:
'class="foo"')
* @return void
*
* @access public
* @see HTML_Form::end(), HTML_Form::end()
*/
- function display()
+ function display($attr = '', $caption = '', $capattr = '')
{
$arrname = '_' . strtoupper($this->method);
if (isset($$arrname)) {
@@ -2266,8 +2271,13 @@
}
$this->start();
- print "<table>\n";
- reset($this->fields);
+ print '<table ' . $attr . ">\n";
+
+ if ($caption) {
+ print ' <caption ' . $capattr . ">\n " . $caption;
+ print "\n </caption>\n";
+ }
+
$hidden = array();
foreach ($this->fields as $i => $data) {
/*
http://cvs.php.net/diff.php/pear/HTML_Form/tests/form.phpt?r1=1.1&r2=1.2&ty=u
Index: pear/HTML_Form/tests/form.phpt
diff -u pear/HTML_Form/tests/form.phpt:1.1 pear/HTML_Form/tests/form.phpt:1.2
--- pear/HTML_Form/tests/form.phpt:1.1 Sun Jun 13 23:04:58 2004
+++ pear/HTML_Form/tests/form.phpt Tue Jun 15 14:27:30 2004
@@ -9,7 +9,7 @@
*
* @category HTML
* @package HTML_Form
- * @version $Id: form.phpt,v 1.1 2004/06/14 03:04:58 danielc Exp $
+ * @version $Id: form.phpt,v 1.2 2004/06/15 18:27:30 danielc Exp $
*/
if (!defined('PATH_SEPARATOR')) {
@@ -468,7 +468,7 @@
echo "============ FORM MANUAL ============\n";
$tmp =& new HTML_Form('test.php', 'post', 'nm', 'tgt',
'enc', 'id="i"');
$tmp->addText('nm', 'Ttl');
-$tmp->display();
+$tmp->display('class="tbl"', 'A Caption For You',
'class="cap"');
?>
--GET--
@@ -1359,7 +1359,10 @@
<input type="file" name="nm" size="5" accept="ac"
id="i"/><br />
============ FORM MANUAL ============
<form action="test.php" method="post" name="nm"
target="tgt" enctype="enc" id="i">
-<table>
+<table class="tbl">
+ <caption class="cap">
+ A Caption For You
+ </caption>
<tr>
<th align="right">Ttl:</th>
<td >