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

Source for file ResetSubmitButton.class.php

Documentation is available at ResetSubmitButton.class.php

  1. <?php
  2. /**
  3.  * For including this file you have to define the constant "CLASSPATH".
  4.  * Because every include in the framework depends on the CLASSPATH definition.
  5.  * The CLASSPATH means the relative path to the folder that contains the
  6.  * framework GilliGan.
  7.  *
  8.  * @package    forms
  9.  * @subpackage items
  10.  */
  11.  
  12. if!defined"CLASSPATH" ) )
  13. {
  14.   echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
  15.   echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
  16.   exit();
  17. }
  18.  
  19. /**
  20.  *
  21.  */
  22. require_once CLASSPATH."forms/items/HTMLResetButton.class.php";
  23. /**
  24.  *
  25.  */
  26. require_once CLASSPATH."forms/items/HTMLSubmitButton.class.php";
  27.  
  28. /**
  29.  * A class to create a reset and a buton to submit forms.
  30.  *
  31.  * @package    forms
  32.  * @subpackage items
  33.  * @version    0.1.31
  34.  * @author     Daniel Plücken <daniel@debakel.net>
  35.  * @license    http://www.gnu.org/copyleft/lesser.html
  36.  *              GNU Lesser General Public License
  37.  * @copyright  Copyright (C) 2003 Daniel Pluecken <daniel@debakel.net>
  38.  *
  39.  *  This library is free software; you can redistribute it and/or
  40.  *  modify it under the terms of the GNU Lesser General Public
  41.  *  License as published by the Free Software Foundation; either
  42.  *  version 2.1 of the License.
  43.  *
  44.  *  This library is distributed in the hope that it will be useful,
  45.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  46.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  47.  *  GNU Lesser General Public License for more details.
  48.  *
  49.  *  You should have received a copy of the GNU Lesser General
  50.  *  Public License along with this library; if not, write to the
  51.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  52.  *  Boston, MA 02111-1307 USA
  53.  */
  54. {
  55.    /**
  56.     * @var object 
  57.     *  access private
  58.     */
  59.    var $rstbt;
  60.    /**
  61.     * @var object 
  62.     *  access private
  63.     */
  64.    var $sbtbt;
  65.  
  66.  
  67.  
  68.    /**
  69.     * Constructor
  70.     *
  71.     * @version 1.0
  72.     * @since   0.1.0
  73.     * @author  Daniel Plücken <daniel@debakel.net>
  74.     * @access  public
  75.     * @param   string  $labelRstBt  Label for the reset button.
  76.     * @param   string  $labelSbtBt  Label for the submit button.
  77.     */
  78.    function ResetSubmitButton()
  79.    {
  80.       $param func_get_args();
  81.  
  82.       $labelRstBt empty$param[0)
  83.                     ? "Zurücksetzen"
  84.                     : $param[0];
  85.       $labelSbtBt empty$param[1)
  86.                     ? "Senden"
  87.                     : $param[1];
  88.       $this->rstbt =new HTMLResetButton"reset"$labelRstBt );
  89.       $this->sbtbt =new HTMLSubmitButton"formsent"$labelSbtBt );
  90.    }
  91.  
  92.  
  93.  
  94.   /**
  95.    * Sets the label of the reset button.
  96.    *
  97.    * @version 1.0
  98.    * @since   0.1.0
  99.    * @author  Daniel Plücken <daniel@debakel.net>
  100.    * @access  public
  101.    * @param   string  $string  The text how the reset button should be labled.
  102.    */
  103.    function setLabelOfResetButton$string )
  104.    {
  105.      ifget_class$this->rstbt == "htmlresetbutton" )
  106.        $this->rstbt->setValue$string );
  107.    }
  108.  
  109.  
  110.  
  111.   /**
  112.    * Sets the label of the submit button.
  113.    *
  114.    * @version 1.0
  115.    * @since   0.1.0
  116.    * @author  Daniel Plücken <daniel@debakel.net>
  117.    * @access  public
  118.    * @param   string  $string  The text how the submit button should be labled.
  119.    */
  120.    function setLabelOfSubmitButton$string )
  121.    {
  122.      ifget_class$this->sbtbt == "htmlsubmitbutton" )
  123.        $this->sbtbt->setValue$string );
  124.    }
  125.  
  126.  
  127.  
  128.    /**
  129.     * Returns the name of the submit button.
  130.     *
  131.     * @version 1.0
  132.     * @since   0.1.0
  133.     * @author  Daniel Plücken <daniel@debakel.net>
  134.     * @access  public
  135.     * @param   object This object's parent object.
  136.     */
  137.    function setParentForm&$formobj )
  138.    {
  139.       $this->rstbt->parentform =$formobj;
  140.       $this->sbtbt->parentform =$formobj;
  141.    }
  142.  
  143.  
  144.  
  145.    /**
  146.     * Blind method cause other objects will invoke it.
  147.     *
  148.     * @version 1.0
  149.     * @since   0.1.0
  150.     * @author  Daniel Plücken <daniel@debakel.net>
  151.     * @access  public
  152.     * @return  string 
  153.     */
  154.    function getName()
  155.    return ""}
  156.  
  157.  
  158.  
  159.    /**
  160.     * Returns the name of the reset button.
  161.     *
  162.     * @version 1.0
  163.     * @since   0.1.0
  164.     * @author  Daniel Plücken <daniel@debakel.net>
  165.     * @access  public
  166.     * @return  string 
  167.     */
  168.    function getNameOfResetButton()
  169.    return $this->rstbt->getName()}
  170.  
  171.  
  172.  
  173.    /**
  174.     * Returns the label of the submit button.
  175.     *
  176.     * @version 1.0
  177.     * @since   0.1.0
  178.     * @author  Daniel Plücken <daniel@debakel.net>
  179.     * @access  public
  180.     * @return  string 
  181.     */
  182.    function getLabelOfResetButton()
  183.    {
  184.      ifget_class$this->rstbt == "htmlresetbutton" )
  185.        return $this->rstbt->getValue();
  186.      else
  187.        return false;
  188.    }
  189.  
  190.  
  191.  
  192.    /**
  193.     * Returns the name of the submit button.
  194.     *
  195.     * @version 1.0
  196.     * @since   0.1.0
  197.     * @author  Daniel Plücken <daniel@debakel.net>
  198.     * @access  public
  199.     * @return  string 
  200.     */
  201.    function getNameOfSubmitButton()
  202.    return $this->sbtbt->getName()}
  203.  
  204.  
  205.  
  206.    /**
  207.     * Returns the label of the submit button.
  208.     *
  209.     * @version 1.0
  210.     * @since   0.1.0
  211.     * @author  Daniel Plücken <daniel@debakel.net>
  212.     * @access  public
  213.     * @return  string 
  214.     */
  215.    function getLabelOfSubmitButton()
  216.    {
  217.      ifget_class$this->sbtbt == "htmlsubmitbutton" )
  218.        return $this->sbtbt->getValue();
  219.      else
  220.        return false;
  221.    }
  222.  
  223.  
  224.  
  225.    /**
  226.     * Blind method cause other objects will invoke it.
  227.     *
  228.     * @version 1.0
  229.     * @since   0.1.0
  230.     * @author  Daniel Plücken <daniel@debakel.net>
  231.     * @access  public
  232.     * @return  boolean 
  233.     */
  234.    function getCheckOrder$formName )
  235.    return false}
  236.  
  237.  
  238.  
  239.    /**
  240.     * Blind method cause other objects will invoke it.
  241.     *
  242.     * @version 1.0
  243.     * @since   0.1.0
  244.     * @author  Daniel Plücken <daniel@debakel.net>
  245.     * @access  public
  246.     * @return  boolean 
  247.     */
  248.    function getValidationOrder$formName )
  249.    return false}
  250.  
  251.  
  252.  
  253.   /**
  254.    * Generates the sourcecode to build this object and returns it.
  255.    *
  256.    * @version 1.0
  257.    * @since   0.1.0
  258.    * @author  Daniel Plücken <daniel@debakel.net>
  259.    * @access  public
  260.    * @return  string 
  261.    */
  262.    function getPHPSource()
  263.    {
  264.       $outputstr "\x24input[] = new ResetSubmitButton(\n"
  265.                   ."                                   \""
  266.                   .$this->getLabelOfResetButton()."\",\n"
  267.                   ."                                   \""
  268.                   .$this->getLabelOfSubmitButton()."\"\n"
  269.                   ."                                );\n";
  270.  
  271.       return $outputstr;
  272.    }
  273.  
  274.  
  275.  
  276.    /**
  277.     * Returns a generated string based on the attributes of this HTML-Object.
  278.     *
  279.     * @version 1.0
  280.     * @since   0.1.0
  281.     * @author  Daniel Plücken <daniel@debakel.net>
  282.     * @access  public
  283.     * @return  string 
  284.     */
  285.    function get()
  286.    {
  287.      return $this->rstbt->get()."\n"
  288.            .$this->sbtbt->get();
  289.    }
  290. // End of class SubmitCanelButton
  291. ?>

Documentation generated on Thu, 05 Jun 2008 19:14:52 +0200 by phpDocumentor 1.4.1