forms
[ class tree: forms ] [ index: forms ] [ all elements ]

Source for file HTMLForm.class.php

Documentation is available at HTMLForm.class.php

  1. <?php
  2. /**
  3.  * Note: If you include a html form, you don't need to include any form item
  4.  * classes! They will be all included.
  5.  *
  6.  * For including this file you have to define the constant "CLASSPATH".
  7.  * Because every include in the framework depends on the CLASSPATH definition.
  8.  * The CLASSPATH means the relative path to the folder that contains the
  9.  * framework GilliGan.
  10.  *
  11.  * @package forms
  12.  */
  13. if !defined"CLASSPATH" ) )
  14. {
  15.    echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
  16.    echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
  17.    exit();
  18. }
  19.  
  20. if defined"LANG" ) )
  21.    /**
  22.     * Including language specific messages.
  23.     */
  24.    include CLASSPATH."/forms/error_messages/HTMLForm/".LANG.".inc.php";
  25. else
  26. {
  27.    echo "<h3>You have to define the constant LANG!</h3>\r\n";
  28.    echo "Example for german: define( 'LANG', 'de' );\r\n";
  29.    exit();
  30. }
  31.  
  32.  
  33. /**
  34.  *
  35.  */
  36. include_once CLASSPATH."html/ABSTHTMLTag.class.php";
  37.  
  38. /**
  39.  * Including the class to define html tables for layouting the form.
  40.  */
  41. include_once CLASSPATH."html/HTMLTable.class.php";
  42. /**
  43.  * Including various functions to manipulate arrays.
  44.  */
  45. include_once CLASSPATH."core/Arrays.class.php";
  46.  
  47. /**
  48.  * Class to create labels for form items.
  49.  */
  50.  include_once CLASSPATH."forms/HTMLLabel.class.php";
  51.  
  52. /**
  53.  *
  54.  */
  55. include_once CLASSPATH."forms/items/HTMLButton.class.php";
  56. /**
  57.  *
  58.  */
  59. include_once CLASSPATH."forms/items/HTMLCheckBox.class.php";
  60. /**
  61.  *
  62.  */
  63. include_once CLASSPATH."forms/items/HTMLPasswordInput.class.php";
  64. /**
  65.  *
  66.  */
  67. include_once CLASSPATH."forms/items/HTMLRadioGroup.class.php";
  68. /**
  69.  *
  70.  */
  71. include_once CLASSPATH."forms/items/HTMLRadioButton.class.php";
  72. /**
  73.  *
  74.  */
  75. include_once CLASSPATH."forms/items/DBKeyRadioGroup.class.php";
  76. /**
  77.  *
  78.  */
  79. include_once CLASSPATH."forms/items/HTMLTextArea.class.php";
  80. /**
  81.  *
  82.  */
  83. include_once CLASSPATH."forms/items/HTMLTextInput.class.php";
  84. /**
  85.  *
  86.  */
  87. include_once CLASSPATH."forms/items/HTMLFileInput.class.php";
  88.  
  89. /**
  90.  *
  91.  */
  92. include_once CLASSPATH."forms/items/FileSelect.class.php";
  93. /**
  94.  *
  95.  */
  96. include_once CLASSPATH."forms/items/DateSelect.class.php";
  97. /**
  98.  *
  99.  */
  100. include_once CLASSPATH."forms/items/DBKeySelect.class.php";
  101. /**
  102.  *
  103.  */
  104. include_once CLASSPATH."forms/items/BirthdayDateTextInput.class.php";
  105. /**
  106.  *
  107.  */
  108. include_once CLASSPATH."forms/items/ColorInput.class.php";
  109. /**
  110.  *
  111.  */
  112. include_once CLASSPATH."forms/items/EMailTextInput.class.php";
  113. /**
  114.  *
  115.  */
  116. include_once CLASSPATH."forms/items/NumberTextInput.class.php";
  117. /**
  118.  *
  119.  */
  120. include_once CLASSPATH."forms/items/MultiRelationSelect.class.php";
  121. /**
  122.  *
  123.  */
  124. include_once CLASSPATH."forms/items/ResetSubmitButton.class.php";
  125. /**
  126.  *
  127.  */
  128. include_once CLASSPATH."forms/items/SubmitCancelButton.class.php";
  129. /**
  130.  *
  131.  */
  132. include_once CLASSPATH."forms/items/URLTextInput.class.php";
  133. /**
  134.  *
  135.  */
  136. include_once CLASSPATH."forms/items/TimeTextInput.class.php";
  137.  
  138. /**
  139.  *
  140.  */
  141. include_once CLASSPATH."forms/items/HTMLHiddenInput.class.php";
  142.  
  143. /**
  144.  * A class to generate forms.
  145.  *
  146.  * @package   forms
  147.  * @version   0.5.22
  148.  * @since     0.3.0.6
  149.  * @author    Daniel Plücken <daniel@debakel.net>
  150.  * @license   http://www.gnu.org/copyleft/lesser.html
  151.  *             GNU Lesser General Public License
  152.  * @copyright Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>
  153.  *
  154.  *  This library is free software; you can redistribute it and/or
  155.  *  modify it under the terms of the GNU Lesser General Public
  156.  *  License as published by the Free Software Foundation; either
  157.  *  version 2.1 of the License.
  158.  *
  159.  *  This library is distributed in the hope that it will be useful,
  160.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  161.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  162.  *  GNU Lesser General Public License for more details.
  163.  *
  164.  *  You should have received a copy of the GNU Lesser General
  165.  *  Public License along with this library; if not, write to the
  166.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  167.  *  Boston, MA 02111-1307 USA
  168.  */
  169. class HTMLForm extends ABSTHTMLTag
  170. {
  171.    /**
  172.     * The name of this form.
  173.     *
  174.     * @var    string $name 
  175.     * @access public
  176.     */
  177.    var $name = "DP_form";
  178.    /**
  179.     * The id of this form.
  180.     *
  181.     * @var    string $id 
  182.     * @access public
  183.     */
  184.    var $id = "DP_form";
  185.    /**
  186.     * The data target of this form.
  187.     *
  188.     * @var    string $targetFile 
  189.     * @access public
  190.     */
  191.    var $targetFile;
  192.    /**
  193.     * The target frame in a frameset for example.
  194.     *
  195.     * @var    string $targetFrame 
  196.     * @access public
  197.     */
  198.    var $targetFrame;
  199.    /**
  200.     * The javascript that should be execute before submitting the form.
  201.     *
  202.     * @var    string $onSubmitOrder 
  203.     * @access public
  204.     */
  205.    var $onSubmitOrder;
  206.    /**
  207.     * The method in which kind the data should be send.
  208.     *
  209.     * @var    string  $method 
  210.     * @access private
  211.     */
  212.    var $method = "POST";
  213.    /**
  214.     * The error that should be alert if some information is missing.
  215.     *
  216.     * @var    string $js_err_msg 
  217.     * @access public
  218.     */
  219.    var $js_err_msg;
  220.  
  221.    /**
  222.     * Carries the beginning of the form.
  223.     *
  224.     * @var    string  $formInTag 
  225.     * @access private
  226.     */
  227.    var $formInTag;
  228.    /**
  229.     * The content of the form.
  230.     *
  231.     * @var    string  $form_body 
  232.     * @access private
  233.     */
  234.    var $form_body;
  235.    /**
  236.     * The text content before all items.
  237.     *
  238.     * @var    string  $textBeforeItems 
  239.     * @access private
  240.     */
  241.    var $textBeforeItems;
  242.    /**
  243.     * The text content behind all items.
  244.     *
  245.     * @var    string  $textBehindItems 
  246.     * @access private
  247.     */
  248.    var $textBehindItems;
  249.  
  250.    /**
  251.     * References to the form's items.
  252.     *
  253.     * @var    array   $formItems 
  254.     * @access private
  255.     */
  256.    var $formItems;
  257.    /**
  258.     * Stores names of dummy items.
  259.     *
  260.     * @var    array   $dummy_item_arr 
  261.     * @access private
  262.     */
  263.    var $dummy_item_arr;
  264.    /**
  265.     * References to the form's items that are required for a complete set of
  266.     * information.
  267.     *
  268.     * @var    array   $requiredItems 
  269.     * @access private
  270.     */
  271.    var $requiredItems;
  272.    /**
  273.     * Carries the error output for each required item.
  274.     *
  275.     * @var array $requiredItemOutputs 
  276.     */
  277.  
  278.    /**
  279.     * References to the hidden form's items.
  280.     *
  281.     * @var    array   $hiddenFormItems 
  282.     * @access private
  283.     */
  284.    var $hiddenFormItems;
  285.  
  286.    /**
  287.     * References to the hidden form's items.
  288.     *
  289.     * @var    boolean $no_format 
  290.     * @access private
  291.     */
  292.    var $no_format = false;
  293.  
  294.    /**
  295.     * @var    HTMLTable  $layout_table 
  296.     * @access private
  297.     */
  298.    var $layout_table;
  299.  
  300.    /**
  301.     * @var    strint  $str_layout 
  302.     * @access public
  303.     */
  304.    var $str_layout;
  305.  
  306.    /**
  307.     * @var    boolean $multipart 
  308.     * @access private
  309.     */
  310.    var $multipart = false;
  311.  
  312.  
  313.    /**
  314.     * Constructor
  315.     *
  316.     * @version 1.3
  317.     * @since   0.1.0
  318.     * @author  Daniel Plücken <daniel@debakel.net>
  319.     * @access  public
  320.     * @param   string $name 
  321.     * @param   string $onSubmitOrder 
  322.     * @param   string $targetFile 
  323.     * @param   string $method 
  324.     * @return  void 
  325.     */
  326.    function HTMLForm(
  327.                        $name          "DP_form",
  328.                        $onSubmitOrder "",
  329.                        $targetFile    "",
  330.                        $method        "POST"
  331.                     )
  332.    {
  333.       global $SCRIPT_NAME;
  334.       $this->js_err_msg = JS_ERR_MISSING;
  335.  
  336.       if!empty$name ) )
  337.       {
  338.         $this->name = $name;
  339.         $this->id   = $name;
  340.       }
  341.  
  342.       $this->onSubmitOrder = $onSubmitOrder;
  343.  
  344.       if!empty$targetFile ) )
  345.         $this->targetFile = $targetFile;
  346.       else
  347.         $this->targetFile = ".".substr(
  348.                                         $SCRIPT_NAME,
  349.                                         strrpos$SCRIPT_NAME'/' )
  350.                                       );
  351.       if!empty$method ) )
  352.         $this->method = $method;
  353.    }
  354.  
  355.  
  356.  
  357.    /**
  358.     * Returns the name of this form.
  359.     *
  360.     * @version 1.0
  361.     * @since   0.1.1
  362.     * @author  Daniel Plücken <daniel@debakel.net>
  363.     * @access  public
  364.     * @return  string 
  365.     */
  366.    function getName()
  367.    return $this->name}
  368.  
  369.  
  370.  
  371.    /**
  372.     * Returns the javascript that should execute on form submit.
  373.     *
  374.     * @version 1.0
  375.     * @since   0.1.1
  376.     * @author  Daniel Plücken <daniel@debakel.net>
  377.     * @access  public
  378.     * @return  string 
  379.     */
  380.    function getSubmitOrder()
  381.    return $this->onSubmitOrder}
  382.  
  383.  
  384.  
  385.  
  386.    /**
  387.     * Returns the action-attribute of this form.
  388.     *
  389.     * @version 1.0
  390.     * @since   0.1.1
  391.     * @author  Daniel Plücken <daniel@debakel.net>
  392.     * @access  public
  393.     * @return  string 
  394.     */
  395.    function getTargetFile()
  396.    return $this->targetFile}
  397.  
  398.  
  399.  
  400.    /**
  401.     * Returns the method-attribute of this form.
  402.     *
  403.     * @version 1.0
  404.     * @since   0.1.1
  405.     * @author  Daniel Plücken <daniel@debakel.net>
  406.     * @access  public
  407.     * @return  string 
  408.     */
  409.    function getMethod()
  410.    return $this->method}
  411.  
  412.  
  413.  
  414.    /**
  415.     * Builds the tag to introduce the html form.
  416.     *
  417.     * @version 1.3
  418.     * @since   0.1.0
  419.     * @author  Daniel Plücken <daniel@debakel.net>
  420.     * @access  private
  421.     * @return  string 
  422.     */
  423.    function getFormInTag()
  424.    {
  425.        $tmp  $this->no_format ? "" "  ";
  426.        $tmp .= "<form name=\"".$this->name."\" "
  427.                     ."id=\"".$this->id."\" "
  428.                     ."action=\"".$this->targetFile."\"";
  429.        $tmp .= !empty$this->onSubmitOrder )
  430.                ? " onSubmit=\"".$this->onSubmitOrder."\""
  431.                : "";
  432.        $tmp .= " method=\"".$this->method."\"";
  433.        $tmp .= !empty$this->targetFrame )
  434.                ? " target=\"".$this->targetFrame."\""
  435.                : "";
  436.        $tmp .= $this->multipart
  437.                ? " enctype=\"multipart/form-data\""
  438.                : "";
  439.        $tmp .= !empty$this->freestyle )
  440.                ? " style=\"".$this->freestyle."\""
  441.                : "";
  442.        $tmp .= ">";
  443.        $tmp .= $this->no_format ? "" "\r\n";
  444.  
  445.        return $tmp;
  446.    }
  447.  
  448.  
  449.  
  450.    /**
  451.     * Adds the table by dint of the form should be formatted.
  452.     *
  453.     * @version 1.0
  454.     * @since   0.2.0
  455.     * @author  Daniel Plücken <daniel@debakel.net>
  456.     * @access  public
  457.     * @param   string|object $name 
  458.     * @param   string        $value 
  459.     * @return  void 
  460.     */
  461.    function setLayoutTable&$ref )
  462.    $this->layout_table =$ref}
  463.  
  464.  
  465.  
  466.    /**
  467.     * Adds the string by dint of the form should be formatted.
  468.     *
  469.     * @version 1.01
  470.     * @since   0.4.7
  471.     * @author  Daniel Plücken <daniel@debakel.net>
  472.     * @access  public
  473.     * @param   string|object $name 
  474.     * @param   string        $value 
  475.     * @return  void 
  476.     */
  477.    function setLayoutString$string )
  478.    $this->str_layout = $string}
  479.  
  480.  
  481.  
  482.    /**
  483.     * Adds references of form-items to this object.
  484.     *
  485.     * @static
  486.     * @version 1.33
  487.     * @since   0.4.0
  488.     * @author  Daniel Plücken <daniel@debakel.net>
  489.     * @access  public
  490.     * @param   object &$ref 
  491.     * @param   string $no_debug 
  492.     * @return  void 
  493.     */
  494.    function isFormItem&$ref$no_debug false )
  495.    {
  496.         if is_subclass_of$ref"ABSTHTMLFormItem" ) )
  497.            return true;
  498.         else
  499.         if (
  500.              !$no_debug
  501.           && (
  502.                defined"DEBUG" )
  503.             || SCRIPTDEBUGGING
  504.              )
  505.            )
  506.         {
  507.            if get_class$ref == "stdClass" )
  508.            {
  509.               echo "Check whether you had add enough items to your "
  510.                   ."form.<br />";
  511.            }
  512.            else
  513.            {
  514.               $debugArr debug_backtrace();
  515.               echo "There is no valid item-object reference.<br />\r\n";
  516.               if empty$ref ) )
  517.                  echo "Proof whether you have defined enough form-items "
  518.                      ."to operate the given template of the form!<br />\r\n"
  519.                      ."The items which are add to the form have to have the "
  520.                      ."same count of the items which are defined in the "
  521.                      ."form-template.<br />\r\n";
  522.  
  523.               echo "The content of variable:<br />\r\n";
  524.               echo "<pre>\r\n";
  525.               print_r$ref );
  526.               echo "</pre>\r\n";
  527.               echo "<br /><br />\r\n";
  528.               echo "<b>BACKTRACE DEBUG:</b><br />\r\n";
  529.               echo "<pre>\r\n";
  530.               print_r$debugArr );
  531.               echo "</pre>\r\n";
  532.               exit();
  533.            }
  534.         }
  535.  
  536.         return false;
  537.    }
  538.  
  539.  
  540.  
  541.    /**
  542.     * Returns raw data from a given request variable; Removes escapings if magic
  543.     * quotes is enabled.
  544.     *
  545.     * @version 1.0
  546.     * @since   0.5.17
  547.     * @author  Daniel Plücken <daniel@debakel.net>
  548.     * @access  public
  549.     * @static
  550.     * @param   string $request_input The data to be correct.
  551.     * @return  array 
  552.     */
  553.    function getRightRequestData$request_input )
  554.    {
  555.         if get_magic_quotes_gpc() )
  556.            return stripslashes$request_input );
  557.         else
  558.            return $request_input;
  559.    }
  560.  
  561.  
  562.  
  563.    /**
  564.     * Returns the fieldnames and values of the form by a two dimensional array.
  565.     *
  566.     * @version 1.77
  567.     * @since   0.4.2
  568.     * @author  Daniel Plücken <daniel@debakel.net>
  569.     * @access  public
  570.     * @param   array  $matching_field_arr Only fields who are in this array
  571.     *                                      will be returned. If this parameter
  572.     *                                      isn't set, all fields and their values
  573.     *                                      will be returned.
  574.     * @return  array 
  575.     */
  576.    function getFieldsAndValues$matching_field_arr "" )
  577.    {
  578.      $output["fields"array();
  579.      for $i 0$i count$this->formItems )$i++ )
  580.        if (
  581.             $this->formItems[$i]->enabled
  582.          && (
  583.               !is_array$matching_field_arr )
  584.            || in_array$this->formItems[$i]->name$matching_field_arr )
  585.             )
  586.          && !in_array$this->formItems[$i]->name$output["fields")
  587.           )
  588.        {
  589.            $tmp $this->formItems[$i]->name;
  590.            if (
  591.                 !is_a$this->formItems[$i]"HTMLPasswordInput" )
  592.              || !empty$_REQUEST[$tmp)
  593.               )
  594.            {
  595.                if // Fieldnames and their values except the listed ones
  596.                     !is_a$this->formItems[$i]"DateSelect" )
  597.                  && !is_a$this->formItems[$i]"NumberTextInput" )
  598.                  && !is_a$this->formItems[$i]"HTMLFileInput" )
  599.                  && !is_a$this->formItems[$i]"BirthdayDateTextInput" )
  600.                  && !is_a$this->formItems[$i]"TimeTextInput" )
  601.                   )
  602.                {
  603.                   $output["fields"][$tmp;
  604.  
  605.                   if strtoupper$this->method == "POST" )
  606.                      $output["values"][HTMLForm
  607.                                          ::getRightRequestData$_POST[$tmp);
  608.                   else
  609.                   if strtoupper$this->method == "GET" )
  610.                      $output["values"][HTMLForm
  611.                                          ::getRightRequestData$_GET[$tmp);
  612.  
  613.                   continue;
  614.                }
  615.                else
  616.                if is_a$this->formItems[$i]"HTMLFileInput" ) )
  617.                {
  618.                   if !empty$_FILES[$tmp]["name") )
  619.                   {
  620.                      $output["fields"][$tmp;
  621.                      $output["values"][$_FILES[$tmp]["name"];
  622.                   }
  623.  
  624.                   continue;
  625.                }
  626.                else
  627.                if is_a$this->formItems[$i]"BirthdayDateTextInput" ) )
  628.                {
  629.                   $output["fields"][$tmp;
  630.                   $output["values"][$this->formItems[$i]->getISODate();
  631.  
  632.                   continue;
  633.                }
  634.                else
  635.                if is_a$this->formItems[$i]"TimeTextInput" ) )
  636.                {
  637.                   $output["fields"][$tmp;
  638.                   $output["values"][$this->formItems[$i]->getISOTime();
  639.  
  640.                   continue;
  641.                }
  642.                else
  643.                if is_a$this->formItems[$i]"NumberTextInput" ) )
  644.                {
  645.                   $output["fields"][$tmp;
  646.  
  647.                   if strtoupper$this->method == "POST" )
  648.                   {
  649.                      $tmp_val str_replace(
  650.                                    $this->formItems[$i]->thousandseperatorchar,
  651.                                    "",
  652.                                    HTMLForm::getRightRequestData$_POST[$tmp)
  653.                                            );
  654.                      $tmp_val str_replace(
  655.                                    $this->formItems[$i]->decimalchar,
  656.                                    "."$tmp_val
  657.                                            );
  658.                      $output["values"][$tmp_val;
  659.                   }
  660.                   else
  661.                   if strtoupper$this->method == "GET" )
  662.                   {
  663.                     $_GET[$tmpstr_replace(
  664.                                    $this->formItems[$i]->thousandseperatorchar,
  665.                                    "",
  666.                                    HTMLForm::getRightRequestData$_GET[$tmp)
  667.                                              );
  668.                     $_GET[$tmpstr_replace(
  669.                                    $this->formItems[$i]->decimalchar,
  670.                                    "."$_GET[$tmp]
  671.                                              );
  672.                     $output["values"][$_GET[$tmp];
  673.                   }
  674.  
  675.                   continue;
  676.                }
  677.                else
  678.                {
  679.                   // DateSelect is an exception.
  680.                   $tmp $this->formItems[$i]->SETTING["instance"];
  681.                   $output["fields"][$tmp;
  682.  
  683.                   $secondVar "second".$tmp;
  684.                   $minuteVar "minute".$tmp;
  685.                   $hourVar   "hour".$tmp;
  686.                   $dayVar    "day".$tmp;
  687.                   $monthVar  "month".$tmp;
  688.                   $yearVar   "year".$tmp;
  689.  
  690.                   if strtoupper$this->method == "POST" )
  691.                   {
  692.                      $second $this->formItems[$i]
  693.                              ->SETTING["implementedSelects"]["SECOND"]
  694.                                ? $_POST[$secondVar0;
  695.                      $minute $this->formItems[$i]
  696.                              ->SETTING["implementedSelects"]["MINUTE"]
  697.                                ? $_POST[$minuteVar0;
  698.                      $hour   $this->formItems[$i]
  699.                              ->SETTING["implementedSelects"]["HOUR"]
  700.                                ? $_POST[$hourVar0;
  701.                      $day    $this->formItems[$i]
  702.                              ->SETTING["implementedSelects"]["DAY"]
  703.                                ? $_POST[$dayVar1;
  704.                      $month  $this->formItems[$i]
  705.                              ->SETTING["implementedSelects"]["MONTH"]
  706.                                ? $_POST[$monthVar1;
  707.                      $year   $this->formItems[$i]
  708.                              ->SETTING["implementedSelects"]["YEAR"]
  709.                                ? $_POST[$yearVar1970;
  710.                   }
  711.                   else
  712.                   if strtoupper$this->method == "GET" )
  713.                   {
  714.                      $second $this->formItems[$i]
  715.                              ->SETTING["implementedSelects"]["SECOND"]
  716.                                ? $_GET[$secondVar0;
  717.                      $minute $this->formItems[$i]
  718.                              ->SETTING["implementedSelects"]["MINUTE"]
  719.                                ? $_GET[$minuteVar0;
  720.                      $hour   $this->formItems[$i]
  721.                              ->SETTING["implementedSelects"]["HOUR"]
  722.                                ? $_GET[$hourVar0;
  723.                      $day    $this->formItems[$i]
  724.                              ->SETTING["implementedSelects"]["DAY"]
  725.                                ? $_GET[$dayVar]  1;
  726.                      $month  $this->formItems[$i]
  727.                              ->SETTING["implementedSelects"]["MONTH"]
  728.                                ? $_GET[$monthVar1;
  729.                      $year   $this->formItems[$i]
  730.                              ->SETTING["implementedSelects"]["YEAR"]
  731.                                ? $_GET[$yearVar1970;
  732.                   }
  733.  
  734.                   if (
  735.                        preg_match(
  736.                            "!^ISO!i"$this->formItems[$i]->standard_date_format
  737.                                  )
  738.                      )
  739.                      $output["values"][$year."-".$month."-".$day." "
  740.                                           .$hour.":".$minute.":".$second;
  741.                   else
  742.                      $output["values"][mktime(
  743.                                                    $hour$minute$second,
  744.                                                    $month$day$year
  745.                                                  );
  746.  
  747.                   continue;
  748.                }
  749.            }
  750.        // for/if
  751.  
  752.  
  753.        // hidden fields
  754.        for $i 0$i count$this->hiddenFormItems )$i++ )
  755.          if (
  756.               $this->hiddenFormItems[$i]->enabled
  757.            && !in_array$this->hiddenFormItems[$i]->name$output["fields")
  758.             )
  759.          {
  760.             // store grabbed vars
  761.             $tmp $this->hiddenFormItems[$i]->name;
  762.             $agv .= ";".$tmp.";";
  763.             $output["fields"][$tmp;
  764.  
  765.             if strtoupper$this->method == "POST" )
  766.                $output["values"][HTMLForm
  767.                                    ::getRightRequestData$_POST[$tmp);
  768.             else
  769.             if strtoupper$this->method == "GET" )
  770.                $output["values"][HTMLForm
  771.                                    ::getRightRequestData$_GET[$tmp);
  772.          }
  773.  
  774.  
  775.        // dummy fields
  776.        for $i 0$i count$this->dummy_item_arr )$i++ )
  777.          if (
  778.               !empty$this->dummy_item_arr )
  779.            && !in_array$this->dummy_item_arr[$i]->name$output["fields")
  780.             )
  781.          {
  782.             // store grabbed vars
  783.             $agv .= ";".$this->dummy_item_arr[$i].";";
  784.             $output["fields"][$this->dummy_item_arr[$i];
  785.  
  786.             if strtoupper$this->method == "POST" )
  787.                $output["values"][HTMLForm::getRightRequestData(
  788.                                            $_POST[$this->dummy_item_arr[$i]]
  789.                                                                   );
  790.             else
  791.             if strtoupper$this->method == "GET" )
  792.                $output["values"][HTMLForm::getRightRequestData(
  793.                                            $_GET[$this->dummy_item_arr[$i]]
  794.                                                                   );
  795.          }
  796.  
  797.        return $output;
  798.    }
  799.  
  800.  
  801.  
  802.    /**
  803.     * Builds the content of this Form andstores it in the attribute form_body.
  804.     *
  805.     * @version 1.21
  806.     * @since   0.1.0
  807.     * @author  Daniel Plücken <daniel@debakel.net>
  808.     * @access  public
  809.     * @param   HTMLTable $obj_ref  A reference of a table by dint of the form
  810.     *                               should be formatted. The form items will be
  811.     *                               placed in the table where the string "[item]"
  812.     *                               appears.
  813.     * @param   boolean   $php_code Is this parameter true, the form items will
  814.     *                               be stored as the source-php-code of this
  815.     *                               object.
  816.     * @return  void 
  817.     */
  818.    function setFormBody$obj_ref ""$php_code false )
  819.    {
  820.       $obj_ref &func_get_args ();
  821.       if (
  822.            @is_a$obj_ref[0]"HTMLTable" )
  823.         || @is_subclass_of$obj_ref[0]"HTMLTable" )
  824.          )
  825.          $this->layout_table = &$obj_ref[0];
  826.       else
  827.       if (
  828.            is_string$obj_ref[0)
  829.         && !empty$obj_ref[0)
  830.          )
  831.          $this->str_layout = $obj_ref[0];
  832.  
  833.  
  834.       $this->form_body = "";
  835.       if (
  836.            !is_a$this->layout_table"HTMLTable" )
  837.         && !is_subclass_of$this->layout_table"HTMLTable" )
  838.         && !(
  839.               is_string$this->str_layout )
  840.            && !empty$this->str_layout )
  841.             )
  842.          )
  843.       {
  844.         for $i 0$i count$this->formItems )$i++ )
  845.         {
  846.            if (
  847.                !is_a$this->layout_table"DateSelect" )
  848.             && !is_subclass_of$this->layout_table"DateSelect" )
  849.               )
  850.               $this->form_body .= $this->formItems[$i]->get();
  851.            else
  852.               $this->form_body .= $this->formItems[$i]->get$php_code );
  853.  
  854.            $this->form_body .= "\r\n<br>\r\n";
  855.         }
  856.       }
  857.       else
  858.       if (
  859.            is_string$this->str_layout )
  860.         && !empty$this->str_layout )
  861.          )
  862.       {
  863.          $itemCount 0;
  864.          $tempCont =$this->str_layout;
  865.          while (
  866.            ($tempPos strposstrtoupper$tempCont )"[ITEM]" )) !== false
  867.         && $itemCount <= count$this->formItems )
  868.         && HTMLForm::isFormItem$this->formItems[$itemCount)
  869.                )
  870.          {
  871.            if (
  872.                !is_a$this->layout_table"DateSelect" )
  873.             && !is_subclass_of$this->layout_table"DateSelect" )
  874.               )
  875.               $tempCont substr$tempCont0$tempPos )
  876.                          .$this->formItems[$itemCount]->get()
  877.                          .substr$tempCont$tempPos+);
  878.            else
  879.               $tempCont substr$tempCont0$tempPos )
  880.                          .$this->formItems[$itemCount]->get$php_code )
  881.                          .substr$tempCont$tempPos+);
  882.  
  883.             $itemCount++;
  884.          }
  885.  
  886.          $this->form_body .= $tempCont;
  887.       }
  888.       else
  889.       // If the layout table is set.
  890.       {
  891.         $itemCount 0;
  892.         for $i 0$i count$this->layout_table->contentArr )$i++ )
  893.           for $j 0$j count$this->layout_table->contentArr[$i)$j++ )
  894.           {
  895.              $tempCont $this->layout_table->contentArr[$i][$j];
  896.              $tempPos  strposstrtoupper$tempCont )"[ITEM]" );
  897.              while (
  898.                      $tempPos !== false
  899.                   && $itemCount <= count$this->formItems )
  900.                   && HTMLForm::isFormItem$this->formItems[$itemCount)
  901.                    )
  902.              {
  903.                 if (
  904.                     !is_a$this->layout_table"DateSelect" )
  905.                  && !is_subclass_of$this->layout_table"DateSelect" )
  906.                    )
  907.                    $this->layout_table
  908.                    ->contentArr[$i][$j=  substr$tempCont0$tempPos )
  909.                                           .$this->formItems[$itemCount]
  910.                                            ->get().substr(
  911.                                                            $tempCont,
  912.                                                            $tempPos 6
  913.                                                          );
  914.                 else
  915.                    $this->layout_table
  916.                    ->contentArr[$i][$j=  substr$tempCont0$tempPos )
  917.                                           .$this->formItems[$itemCount]
  918.                                            ->get$php_code ).substr(
  919.                                                                   $tempCont,
  920.                                                                   $tempPos 6
  921.                                                                     );
  922.  
  923.                 $tempCont $this->layout_table->contentArr[$i][$j];
  924.                 $tempPos strposstrtoupper$tempCont )"[ITEM]" );
  925.                 $itemCount++;
  926.              }
  927.  
  928.              if (
  929.                   strlen$tempCont 80
  930.                || (
  931.                     preg_match"!<.*?=.*?>!"$tempCont )
  932.                 && !preg_match"!\n!"$tempCont )
  933.                   )
  934.                 )
  935.                 $this->layout_table->no_format_arr[$i][$jtrue;
  936.           }
  937.  
  938.         $this->form_body .= $this->layout_table->get();
  939.       }
  940.  
  941.       # Hidden items
  942.       for $i 0$i count$this->hiddenFormItems )$i++ )
  943.         $this->form_body .= $this->hiddenFormItems[$i]->get$php_code )."\r\n";
  944.    }
  945.  
  946.  
  947.  
  948.     /**
  949.      * Sets the name of this form.
  950.      *
  951.      * @version 1.0
  952.      * @since   0.1.0
  953.      * @access  public
  954.      * @author  Daniel Plücken <daniel@debakel.net>
  955.      * @return  void 
  956.      */
  957.     function setName$string )
  958.     $this->name = $string}
  959.  
  960.  
  961.  
  962.     /**
  963.      * Sets the javascript that should execute on submit.
  964.      *
  965.      * @version 1.0
  966.      * @since   0.1.0
  967.      * @access  public
  968.      * @author  Daniel Plücken <daniel@debakel.net>
  969.      * @return  void 
  970.      */
  971.     function setSubmitOrder$string )
  972.     $this->onSubmitOrder = $string}
  973.  
  974.  
  975.  
  976.     /**
  977.      * Sets the target script of the data; The "action"-attribute.
  978.      *
  979.      * @version 1.0
  980.      * @since   0.1.0
  981.      * @access  public
  982.      * @author  Daniel Plücken <daniel@debakel.net>
  983.      * @return  void 
  984.      */
  985.     function setTargetFile$string )
  986.     $this->targetFile = $string}
  987.  
  988.  
  989.  
  990.     /**
  991.      * Sets the target frame where the target script should appear; The
  992.      * "target"-attribute.
  993.      *
  994.      * @version 1.0
  995.      * @since   0.1.0
  996.      * @access  public
  997.      * @author  Daniel Plücken <daniel@debakel.net>
  998.      * @return  void 
  999.      */
  1000.     function setTargetFrame$string )
  1001.     $this->targetFrame = $string}
  1002.  
  1003.  
  1004.  
  1005.     /**
  1006.      * Sets the method, how the data should be send; POST or GET.
  1007.      *
  1008.      * @version 1.0
  1009.      * @since   0.1.0
  1010.      * @access  public
  1011.      * @author  Daniel Plücken <daniel@debakel.net>
  1012.      * @return  void 
  1013.      */
  1014.     function setMethod$string )
  1015.     $this->method = $string}
  1016.  
  1017.  
  1018.  
  1019.     /**
  1020.      * Sets the javascript error message that appears if user information is
  1021.      * missing.
  1022.      *
  1023.      * @version 1.0
  1024.      * @since   0.1.1
  1025.      * @access  public
  1026.      * @author  Daniel Plücken <daniel@debakel.net>
  1027.      * @param   $string 
  1028.      * @return  void 
  1029.      */
  1030.     function setJSerrorMessage$string )
  1031.     $this->js_err_msg = $string}
  1032.  
  1033.  
  1034.  
  1035.     /**
  1036.      * Overides the body of the form with the given custom string.
  1037.      *
  1038.      * @version 1.0
  1039.      * @since   0.1.5
  1040.      * @author  Daniel Plücken <daniel@debakel.net>
  1041.      * @access  public
  1042.      * @param   boolean $bool 
  1043.      * @return  void 
  1044.      */
  1045.     function overrideWholeFormBody$string )
  1046.     $this->form_body = $string}
  1047.  
  1048.  
  1049.  
  1050.     /**
  1051.      * Stores that the HTML-elements should not format by "\r\n" in the source.
  1052.      *
  1053.      * @version 1.0
  1054.      * @since   0.1.2
  1055.      * @author  Daniel Plücken <daniel@debakel.net>
  1056.      * @access  public
  1057.      * @param   boolean $bool 
  1058.      * @return  void 
  1059.      */
  1060.     function setNoFormat$bool true )
  1061.     $this->no_format = $bool}
  1062.  
  1063.  
  1064.  
  1065.     /**
  1066.      * Adds text into the form.
  1067.      *
  1068.      * @version 1.1
  1069.      * @since   0.2.4
  1070.      * @author  Daniel Plücken <daniel@debakel.net>
  1071.      * @access  public
  1072.      * @param   string $text 
  1073.      * @param   string $where Possible values are:
  1074.      *                         - BEFOREITEMS
  1075.      *                         - BEHINDITEMS
  1076.      * @return  void 
  1077.      */
  1078.     function addFormBodyText$text$where "BEFOREITEMS" )
  1079.     {
  1080.       if strtoupper$where == "BEFOREITEMS" )
  1081.          $this->textBeforeItems .= $text;
  1082.       else
  1083.          $this->textBehindItems .= $text;
  1084.     }
  1085.  
  1086.  
  1087.  
  1088.     /**
  1089.      * Adds references of form-items to this object.
  1090.      *
  1091.      * @version 1.23
  1092.      * @since   0.1.0
  1093.      * @author  Daniel Plücken <daniel@debakel.net>
  1094.      * @access  public
  1095.      * @param   object $item 
  1096.      * @param   string $requireJSOutput 
  1097.      * @return  mixed  The reference to the added form item.
  1098.      */
  1099.     function &addFormItem&$item$requireJSOutput "" )
  1100.     {
  1101.       if !HTMLForm::isFormItem $itemtrue ) )
  1102.       {
  1103.          if (
  1104.               defined"DEBUG" )
  1105.            || SCRIPTDEBUGGING
  1106.             )
  1107.          {
  1108.             $debug_arr debug_backtrace();
  1109.             $last_debug_index 0;
  1110.             if empty$item ) )
  1111.                echo "You add an empty variable to a form in the script "
  1112.                    .$debug_arr[$last_debug_index]["file"]." at line "
  1113.                    .$debug_arr[$last_debug_index]["line"]."!<br />";
  1114.             else
  1115.                echo "You add not a valid form item to a form in the script "
  1116.                    .$debug_arr[$last_debug_index]["file"]." at line "
  1117.                    .$debug_arr[$last_debug_index]["line"]."!<br />";
  1118.          }
  1119.       }
  1120.       else
  1121.       {
  1122.          $item->parentform  &$this;
  1123.          $this->formItems[$item;
  1124.  
  1125.          if !empty$requireJSOutput ) )
  1126.          {
  1127.             $this->requiredItems[$item;
  1128.             $this->requiredItemOutputs[$requireJSOutput;
  1129.          }
  1130.  
  1131.          if (
  1132.               is_a$item"HTMLFileInput" )
  1133.            || is_subclass_of$item"HTMLFileInput" )
  1134.             )
  1135.             $this->multipart = true;
  1136.       }
  1137.  
  1138.       return $this->formItemscount($this->formItems)-];
  1139.     }
  1140.  
  1141.  
  1142.  
  1143.     /**
  1144.      * Adds hidden-form-items to this object.
  1145.      *
  1146.      * @version 1.4
  1147.      * @since   0.1.0
  1148.      * @author  Daniel Plücken <daniel@debakel.net>
  1149.      * @access  public
  1150.      * @param   string|object $name 
  1151.      * @param   string        $value 
  1152.      * @return  void 
  1153.      */
  1154.     function addHiddenFormItem$name$value "" )
  1155.     {
  1156.       if (
  1157.            is_a$name"HTMLHiddenInput" )
  1158.         || @is_subclass_of$name"HTMLHiddenInput" )
  1159.          )
  1160.          $this->hiddenFormItems[$name;
  1161.       else
  1162.       {
  1163.         if (
  1164.              $value === ""
  1165.           && (
  1166.                $_REQUEST[$name== $_POST[$name]
  1167.             || $_REQUEST[$name== $_GET[$name]
  1168.              )
  1169.            )
  1170.            $value $_REQUEST[$name];
  1171.  
  1172.         for $i 0$i count$this->hiddenFormItems )$i++ )
  1173.           if $this->hiddenFormItems[$i]->name == $name )
  1174.           {
  1175.              $this->hiddenFormItems[$i]->value $value;
  1176.              return;
  1177.           }
  1178.  
  1179.         // Add a new item if there is not an item
  1180.         // with the same name as the given one.
  1181.         $this->hiddenFormItems[new HTMLHiddenInput(
  1182.                                                          $name,
  1183.                                                          $value
  1184.                                                       );
  1185.       }
  1186.     }
  1187.  
  1188.  
  1189.  
  1190.     /**
  1191.      * Adds dummy-form-item to this object. It doesn't apear on the website.
  1192.      * It is only to inform the form about a custum generatet input field, for
  1193.      * example to add the FCKeditor to the form.
  1194.      *
  1195.      * @version 1.0
  1196.      * @since   0.4.1
  1197.      * @author  Daniel Plücken <daniel@debakel.net>
  1198.      * @access  public
  1199.      * @param   string|object $name 
  1200.      * @return  void 
  1201.      */
  1202.     function addDummyItem$name )
  1203.     $this->dummy_item_arr[$name}
  1204.  
  1205.  
  1206.  
  1207.     /**
  1208.      * Removes the hidden item with the given name.
  1209.      *
  1210.      * @version 1.0
  1211.      * @since   0.3.9
  1212.      * @author  Daniel Plücken <daniel@debakel.net>
  1213.      * @access  public
  1214.      * @param  string $name 
  1215.      * @return void 
  1216.      */
  1217.     function removeHiddenFormItem$name )
  1218.     {
  1219.       if !empty$name ) )
  1220.       {
  1221.         for $i 0$i count$this->hiddenFormItems )$i++ )
  1222.           if $this->hiddenFormItems[$i]->getName(== $name )
  1223.              $this->hiddenFormItems = Arrays
  1224.                                    ::deleteRecord$i$this->hiddenFormItems );
  1225.       }
  1226.     }
  1227.  
  1228.  
  1229.  
  1230.     /**
  1231.      * Changes the value of the hidden form item with the given namen.
  1232.      *
  1233.      * @version 1.0
  1234.      * @since   0.1.2
  1235.      * @author  Daniel Plücken <daniel@debakel.net
  1236.      * @access  public
  1237.      * @return  void 
  1238.      */
  1239.     function changeHiddenFormItem$name$value )
  1240.     {
  1241.       if !empty$name ) )
  1242.       {
  1243.          for $i 0$i count$this->hiddenFormItems )$i++ )
  1244.            if $this->hiddenFormItems[$i]->getName(== $name )
  1245.               $this->hiddenFormItems[$i]->setValue$value );
  1246.       }
  1247.     }
  1248.  
  1249.  
  1250.  
  1251.    /**
  1252.     * Disables all formitems.
  1253.     *
  1254.     * @version 1.0
  1255.     * @since   0.4.9
  1256.     * @author  Daniel Plücken <daniel@debakel.net>
  1257.     * @access  public
  1258.     * @return  void 
  1259.     */
  1260.    function disableAllFormItems()
  1261.    {
  1262.       for $i 0$i count$this->formItems )$i++ )
  1263.         $this->formItems[$i]->setDisabled();
  1264.    }
  1265.  
  1266.  
  1267.  
  1268.    /**
  1269.     * Disables all formitems. This function is an alias for the function
  1270.     * disableAllFormItems()
  1271.     *
  1272.     * @version 1.0
  1273.     * @since   0.4.9
  1274.     * @author  Daniel Plücken <daniel@debakel.net>
  1275.     * @access  public
  1276.     * @return  void 
  1277.     */
  1278.    function disable()
  1279.    $this->disableAllFormItems()}
  1280.  
  1281.  
  1282.  
  1283.    /**
  1284.     * Disables all formitems. This function is an alias for the function
  1285.     * disableAllFormItems()
  1286.     *
  1287.     * @version 1.0
  1288.     * @since   0.4.9
  1289.     * @author  Daniel Plücken <daniel@debakel.net>
  1290.     * @access  public
  1291.     * @return  void 
  1292.     */
  1293.    function setDisabled()
  1294.    $this->disableAllFormItems()}
  1295.  
  1296.  
  1297.  
  1298.    /**
  1299.     * Returns the count of items of this form.
  1300.     *
  1301.     * @version 1.0
  1302.     * @since   0.1.9
  1303.     * @author  Daniel Plücken <daniel@debakel.net>
  1304.     * @access  public
  1305.     * @return  integer 
  1306.     */
  1307.    function getFormItemCount()
  1308.    return count$this->formItems )}
  1309.  
  1310.  
  1311.  
  1312.    /**
  1313.     * Returns a javascript to validate the input of the form.
  1314.     *
  1315.     * @version 1.0
  1316.     * @since   0.1.7
  1317.     * @author  Daniel Plücken <daniel@debakel.net>
  1318.     * @access  public
  1319.     * @return  string 
  1320.     */
  1321.    function getJScheckData()
  1322.    {
  1323.       $out  "\r\n  <script type=\"text/javascript\">\r\n";
  1324.       $out .= "  <!--\r\n\r\n";
  1325.       $out .= "  function checkData()\r\n";
  1326.       $out .= "  {\r\n";
  1327.       $out .= "    errMSG = \"\";\r\n";
  1328.  
  1329.       for $i 0$i count$this->requiredItems )$i++ )
  1330.       {
  1331.         # Verification of fields that have to be filled
  1332.         $tmp $this->requiredItems[$i]->getValidationOrder();
  1333.         if $tmp )
  1334.         {
  1335.            $out .= "    if( !".$tmp." )\r\n";
  1336.            $out .= "      return false;\r\n\r\n";
  1337.         }
  1338.  
  1339.         # Javascript to probe the fields that have to be filled
  1340.         $tmp $this->requiredItems[$i]->getCheckOrder();
  1341.         if $tmp )
  1342.         {
  1343.            $out .= "    if( ".$tmp." )\r\n";
  1344.            $out .= "      errMSG += \""
  1345.                           .$this->requiredItemOutputs[$i]."\\r\\n\";\r\n\r\n";
  1346.         }
  1347.       }
  1348.  
  1349.       $out .= "    if( errMSG == \"\" )\r\n";
  1350.       $out .= "      return true;\r\n";
  1351.       $out .= "    else\r\n";
  1352.       $out .= "    {\r\n";
  1353.       $out .= "      alert( unescape( '".$this->js_err_msg."' + errMSG ) );\r\n";
  1354.       $out .= "      return false;\r\n";
  1355.       $out .= "    }\r\n";
  1356.       $out .= "  }\r\n\r\n";
  1357.       $out .= "  // -->\r\n";
  1358.       $out .= "  </script>\r\n\r\n";
  1359.  
  1360.  
  1361.       return $out;
  1362.    }
  1363.  
  1364.  
  1365.  
  1366.    /**
  1367.     * Generates the sourcecode to build this object and returns it.
  1368.     *
  1369.     * @version 1.0
  1370.     * @since   0.2.0
  1371.     * @author  Daniel Plücken <daniel@debakel.net>
  1372.     * @access  public
  1373.     * @return  string 
  1374.     */
  1375.    function getItemPHPSource()
  1376.    {
  1377.       $out "";
  1378.       if !empty$this->layout_table ) )
  1379.               if !empty$this->layout_table ) )
  1380.          $out .= "\x24form->setLayoutTable( \x24table );\r\n";
  1381.  
  1382.  
  1383.       for $i 0$i count$this->formItems )$i++ )
  1384.       {
  1385.         $match false;
  1386.         for $j 0$j count$this->requiredItems )$j++ )
  1387.           if $this->requiredItems[$j]->name == $this->formItems[$i]->name )
  1388.           {
  1389.               $match true;
  1390.               $pos   $j;
  1391.               break;
  1392.           }
  1393.  
  1394.         if $match )
  1395.           $out .= "\x24form->addFormItem( \x24input[".$i."], "
  1396.                        ."\"".$this->requiredItemOutputs[$pos]."\" );\r\n";
  1397.         else
  1398.            $out .= "\x24form->addFormItem( \x24input[".$i."] );\r\n";
  1399.       }
  1400.  
  1401.       return $out"\x24form->setLayoutTable( \x24table );\r\n";
  1402.    }
  1403.  
  1404.  
  1405.  
  1406.    /**
  1407.     * Generates the sourcecode to build this object and returns it.
  1408.     *
  1409.     * @version 1.1
  1410.     * @since   0.1.8
  1411.     * @author  Daniel Plücken <daniel@debakel.net>
  1412.     * @access  public
  1413.     * @return  string 
  1414.     */
  1415.    function getPHPSource()
  1416.    {
  1417.       # Setting layout table
  1418.       if !empty$this->layout_table ) )
  1419.          $out $this->layout_table->getPHPSource()."\r\n\r\n";
  1420.  
  1421.       # Setting form fields
  1422.       for $i 0$i count$this->formItems )$i++ )
  1423.          $out .= $this->formItems[$i]->getPHPSource()."\r\n\r\n";
  1424.  
  1425.       $out .= "\x24formname      = \"".$this->getName()."\";\r\n";
  1426.       $out .= !empty$this->onSubmitOrder )
  1427.               ? "\x24onSubmitOrder = \"".$this->getSubmitOrder()."\";\r\n"
  1428.               : "";
  1429.       $out .= !empty$this->targetFile )
  1430.               ? "\x24targetFile    = \"".$this->getTargetFile()."\";\r\n"
  1431.               : "";
  1432.       $out .= !empty$this->method )
  1433.               ? "\x24method        = \"".$this->getMethod()."\";\r\n"
  1434.               : "";
  1435.  
  1436.       $out .= "\x24form = new HTMLForm(\r\n"
  1437.                    ."                       \x24formname,\r\n"
  1438.                    ."                       \x24onSubmitOrder,\r\n"
  1439.                    ."                       \x24targetFile,\r\n"
  1440.                    ."                       \x24method \r\n"
  1441.                    ."                    );\r\n\r\n";
  1442.       $out .= $this->getItemPHPSource();
  1443.  
  1444.       return $out;
  1445.    }
  1446.  
  1447.  
  1448.  
  1449.    /**
  1450.     * Returns a generated string based on the Attributes of this HTML-Object.
  1451.     *
  1452.     * @version 1.1
  1453.     * @since   0.1.0
  1454.     * @author  Daniel Plücken <daniel@debakel.net>
  1455.     * @access  public
  1456.     * @param   HTMLTable $obj_ref  A reference of a table by dint of the form
  1457.     *                               should be formatted. The form items will be
  1458.     *                               placed in the table where the string "[item]"
  1459.     *                               appears.
  1460.     * @param   boolean   $php_code Is this parameter true, the form will be
  1461.     *                               returned as the source-php-code of this
  1462.     *                               object.
  1463.     * @return  string 
  1464.     */
  1465.    function get$obj_ref ""$php_code false )
  1466.    {
  1467.       $obj_ref &func_get_args();
  1468.  
  1469.       if count$this->requiredItemOutputs )
  1470.       {
  1471.          $this->onSubmitOrder = "return checkData()".$this->onSubmitOrder;
  1472.          $out $this->getJScheckData();
  1473.       }
  1474.       else
  1475.         $out "";
  1476.  
  1477.       if empty$this->form_body ) )
  1478.          $this->setFormBody$obj_ref[0]$php_code );
  1479.  
  1480.       $out .= $this->getFormInTag();
  1481.       $out .= $this->textBeforeItems;
  1482.  
  1483.       if $this->no_format )
  1484.          $out .= $this->form_body;
  1485.       else
  1486.          $out .= PlainTextFormatter::indentText$this->form_body);
  1487.  
  1488.       $out .= $this->textBehindItems;
  1489.       $out .= $this->no_format
  1490.               ? "</form>"
  1491.               : "  </form>\r\n";
  1492.  
  1493.       return $out;
  1494.    }
  1495. // End of class HTMLForm
  1496. ?>

Documentation generated on Thu, 05 Jun 2008 19:12:21 +0200 by phpDocumentor 1.4.1