From: uw
Date: Sat May 19 20:57:18 2001
Modified files:
php-lib/php/form/form.inc
php-lib/php/form/form_commonobject.inc
php-lib/php/form/form_xmlfactory.inc
Log message:
- added setAddtionalHTML method
Index: php-lib/php/form/form.inc
diff -u php-lib/php/form/form.inc:1.30 php-lib/php/form/form.inc:1.31
--- php-lib/php/form/form.inc:1.30 Sat May 19 20:15:00 2001
+++ php-lib/php/form/form.inc Sat May 19 20:56:44 2001
@@ -28,7 +28,7 @@
* - tree (select box with options show as a tree)
*
* @author Ulf Wendel <[EMAIL PROTECTED]>
-* @version $Id: form.inc,v 1.30 2001/05/19 18:15:00 uw Exp $
+* @version $Id: form.inc,v 1.31 2001/05/19 18:56:44 uw Exp $
* @access public
* @package Form
*/
@@ -190,7 +190,15 @@
*/
var $target = "_self";
+ /**
+ * Additional html to be added before the closing form tag
+ *
+ * @var string
+ * @see setAdditionalHTML(), Finish(), getFinish()
+ */
+ var $additional_html;
+
/**
* Sets all paramters required for the opening [form} Tag
*
@@ -494,7 +502,7 @@
*/
function getFinish($additional_html = "", $sess = "") {
- $html = $additional_html;
+ $html = ("" != $additional_html) ? $additional_html :
+$this->additional_html;
if (0 != count($this->hidden_elements)) {
foreach ($this->hidden_elements as $k => $elname)
@@ -523,18 +531,14 @@
/**
* Generate the complete form.
*
- * @param string JavaScript form name. If empty no JavaScript
validation will be done.
- * @param string HTML method attribute: "POST" or "GET".
- * @param string HTML action attribute. If empty $PHP_SELF gets used.
- * @param string HTML target attribute.
* @param string Userdefined HTML added right before the closing
form-Tag
* @return string HTML form-Tag
* @global string $PHP_SELF
* @see getStart(), getFinish()
* @access public
*/
- function get($js_name = "", $method = "POST", $action = "", $target = "",
$additional_html = "") {
- return $this->getStart($js_name, $method, $action, $target) .
$this->getFinish($additional_html);
+ function get($additional_html = "") {
+ return $this->getStart() . $this->getFinish($additional_html);
} // end func get
/**
@@ -960,6 +964,19 @@
return $js;
} // end func getJS
+
+ /**
+ * Sets the "additional html" to be added before the closing [form]-tag.
+ *
+ * @param string additional hmtl
+ * @see getFinish(), Finish()
+ * @access public
+ */
+ function setAdditionalHTML($additional_html) {
+ $this->additional_html = $additional_html;
+ } // end func setAdditionalHTML
+
+
/**
* Removes tabs, spaces and newlines from the given JavaScript code.
*
Index: php-lib/php/form/form_commonobject.inc
diff -u php-lib/php/form/form_commonobject.inc:1.4
php-lib/php/form/form_commonobject.inc:1.5
--- php-lib/php/form/form_commonobject.inc:1.4 Sat May 19 20:15:01 2001
+++ php-lib/php/form/form_commonobject.inc Sat May 19 20:56:45 2001
@@ -15,7 +15,7 @@
* @var string $CR_HTML Default is "\n"
* @see CR_JS
*/
- var $CR_HTML = "";
+ var $CR_HTML = "\n";
/**
* Line break sign used whenever JavaScript code is generated
Index: php-lib/php/form/form_xmlfactory.inc
diff -u php-lib/php/form/form_xmlfactory.inc:1.6
php-lib/php/form/form_xmlfactory.inc:1.7
--- php-lib/php/form/form_xmlfactory.inc:1.6 Sun May 13 20:54:36 2001
+++ php-lib/php/form/form_xmlfactory.inc Sat May 19 20:56:45 2001
@@ -375,11 +375,11 @@
break;
case "form":
-
$js_name = (isset($attrs["jsname"])) ? $attrs["jsname"] : "";
$method = (isset($attrs["method"])) ? $attrs["method"] : "";
$action = (isset($attrs["action"])) ? $attrs["action"] : "";
$name = (isset($attrs["name"])) ? $attrs["name"] : "";
+
$this->form = new form($js_name, $method, $action, $name);
break;
@@ -486,6 +486,10 @@
if (!$this->flag_defaults)
$this->form->addElement($this->attributes);
+ break;
+
+ case "additionalhtml":
+ $this->form->setAdditionalHTML((string)$this->cdata);
break;
default:
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]