[phplib-dev] cvs commit From: uw (phplib-dev <email protected>)
Date: 05/19/01

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)
 *
 *  <email protected> Ulf Wendel <ulf.wendel <email protected>>
-*  <email protected> $Id: form.inc,v 1.30 2001/05/19 18:15:00 uw Exp $
+*  <email protected> $Id: form.inc,v 1.31 2001/05/19 18:56:44 uw Exp $
 *  <email protected> public
 *  <email protected> Form
 */
@@ -190,7 +190,15 @@
   */
   var $target = "_self";
   
+ /**
+ * Additional html to be added before the closing form tag
+ *
+ *  <email protected> string
+ *  <email protected> 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.
         *
- *  <email protected> string JavaScript form name. If empty no JavaScript validation will be done.
- *  <email protected> string HTML method attribute: "POST" or "GET".
- *  <email protected> string HTML action attribute. If empty $PHP_SELF gets used.
- *  <email protected> string HTML target attribute.
         *  <email protected> string Userdefined HTML added right before the closing form-Tag
         *  <email protected> string HTML form-Tag
         *  <email protected> string $PHP_SELF
         *  <email protected> getStart(), getFinish()
         *  <email protected> 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.
+ *
+ *  <email protected> string additional hmtl
+ *  <email protected> getFinish(), Finish()
+ *  <email protected> 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 @@
         *  <email protected> string $CR_HTML Default is "\n"
         *  <email protected> 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: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>