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

Source for file ABSTHTMLFormItem.class.php

Documentation is available at ABSTHTMLFormItem.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. if!defined"CLASSPATH" ) )
  12. {
  13.   echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
  14.   echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
  15.   exit();
  16. }
  17.  
  18. /**
  19.  * Including the basic class for html-tags.
  20.  */
  21. require_onceCLASSPATH."html/ABSTHTMLTag.class.php" );
  22.  
  23. /**
  24.  * An abstract class as base for classes to create form items.
  25.  *
  26.  * @package    forms
  27.  * @subpackage items
  28.  * @abstract
  29.  * @version    0.1.71
  30.  * @author     Daniel Plücken <daniel@debakel.net>
  31.  * @license    http://www.gnu.org/copyleft/lesser.html
  32.  *              GNU Lesser General Public License
  33.  * @copyright  Copyright (c) 2004 Daniel Plücken <daniel@debakel.net>
  34.  *
  35.  *  This library is free software; you can redistribute it and/or
  36.  *  modify it under the terms of the GNU Lesser General Public
  37.  *  License as published by the Free Software Foundation; either
  38.  *  version 2.1 of the License.
  39.  *
  40.  *  This library is distributed in the hope that it will be useful,
  41.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  42.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  43.  *  GNU Lesser General Public License for more details.
  44.  *
  45.  *  You should have received a copy of the GNU Lesser General
  46.  *  Public License along with this library; if not, write to the
  47.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  48.  *  Boston, MA 02111-1307 USA
  49.  */
  50. class ABSTHTMLFormItem extends ABSTHTMLTag
  51. {
  52.    /**
  53.     * The value of the "value"-attribute of this form item object.
  54.     *
  55.     * @var    string  $value 
  56.     * @access public
  57.     */
  58.    var $value = "";
  59.    /**
  60.     * @var    boolean $enabled 
  61.     * @access public
  62.     */
  63.    var $enabled = true;
  64.    /**
  65.     * @var    boolean $manipulateable 
  66.     * @access public
  67.     */
  68.    var $manipulateable = true;
  69.    /**
  70.     * A reference to a label object, which carries information for this input
  71.     * object.
  72.     *
  73.     * @var    HTMLLabel $label_obj 
  74.     * @access public
  75.     */
  76.    var $label_obj = null;
  77.    /**
  78.     * A reference to the form that contains this input object.
  79.     *
  80.     * @var    object  $parentform 
  81.     * @access private
  82.     */
  83.    var $parentform = null;
  84.  
  85.  
  86.  
  87.    /**
  88.     * Constructor
  89.     *
  90.     * @version 1.0
  91.     * @since   0.1.1
  92.     * @author  Daniel Plücken <daniel@debakel.net>
  93.     * @access  public
  94.     * @return  void 
  95.     */
  96.    function HTMLFormItem()
  97.    {
  98.      die(
  99.           "ABSTHTMLFormItem is an abstract class. "
  100.          ."You cannot get an instance of it."
  101.         );
  102.    }
  103.  
  104.  
  105.  
  106.    /**
  107.     * Stores the value of this item's "value"-attribute.
  108.     *
  109.     * @version 1.0
  110.     * @since   0.1.5
  111.     * @author  Daniel Plücken <daniel@debakel.net>
  112.     * @access  public
  113.     * @param   void 
  114.     */
  115.    function setValue$string )
  116.    $this->value = $string}
  117.  
  118.  
  119.  
  120.    /**
  121.     * Concats the given string to the value of this item's "value"-attribute.
  122.     *
  123.     * @version 1.0
  124.     * @since   0.1.5
  125.     * @author  Daniel Plücken <daniel@debakel.net>
  126.     * @access  public
  127.     * @param   void 
  128.     */
  129.    function addValue$string )
  130.    $this->value .= $string}
  131.  
  132.  
  133.  
  134.    /**
  135.     * Returns the value of this item's "value"-attribute.
  136.     *
  137.     * @version 1.0
  138.     * @since   0.1.5
  139.     * @author  Daniel Plücken <daniel@debakel.net>
  140.     * @access  public
  141.     * @return  string 
  142.     */
  143.    function getValue()
  144.    return $this->value}
  145.  
  146.  
  147.  
  148.    /**
  149.     * Disables this item.
  150.     *
  151.     * @version 1.0
  152.     * @since   0.1.2
  153.     * @author  Daniel Plücken <daniel@debakel.net>
  154.     * @access  public
  155.     * @return  void 
  156.     */
  157.    function setDisabled()
  158.    $this->enabled = false}
  159.  
  160.  
  161.  
  162.    /**
  163.     * Disables this item. This method is an alias for the method setDisabled().
  164.     *
  165.     * @version 1.0
  166.     * @since   0.1.4
  167.     * @author  Daniel Plücken <daniel@debakel.net>
  168.     * @access  public
  169.     * @return  void 
  170.     */
  171.    function disable()
  172.    $this->setDisabled()}
  173.  
  174.  
  175.  
  176.    /**
  177.     * Enables this item.
  178.     *
  179.     * @version 1.0
  180.     * @since   0.1.2
  181.     * @author  Daniel Plücken <daniel@debakel.net>
  182.     * @access  public
  183.     * @return  void 
  184.     */
  185.    function setEnabled()
  186.    $this->enabled = true}
  187.  
  188.  
  189.  
  190.    /**
  191.     * Enables this item. This method is an alias for the method setDisabled().
  192.     *
  193.     * @version 1.0
  194.     * @since   0.1.4
  195.     * @author  Daniel Plücken <daniel@debakel.net>
  196.     * @access  public
  197.     * @return  void 
  198.     */
  199.    function enable()
  200.    $this->setEnabled()}
  201.  
  202.  
  203.  
  204.    /**
  205.     * Makes sure that this item is not manipulateable by the user, but carrys
  206.     * the value trough the form.
  207.     *
  208.     * @version 1.0
  209.     * @since   0.1.41
  210.     * @author  Daniel Plücken <daniel@debakel.net>
  211.     * @access  public
  212.     * @return  void 
  213.     */
  214.    function setNotManipulateable()
  215.    {
  216.        $this->manipulateable = false;
  217.        $this->enabled = true;
  218.    }
  219.  
  220.  
  221.  
  222.    /**
  223.     * Makes sure that this item is manipulateable by the user.
  224.     *
  225.     * @version 1.0
  226.     * @since   0.1.41
  227.     * @author  Daniel Plücken <daniel@debakel.net>
  228.     * @access  public
  229.     * @return  void 
  230.     */
  231.    function setManipulateable()
  232.    {
  233.        $this->manipulateable = true;
  234.        $this->enabled = true;
  235.    }
  236.  
  237.  
  238.  
  239.    /**
  240.     * Stores a reference to the form-object that contains this item-object.
  241.     *
  242.     * @version 1.0
  243.     * @since   0.1.1
  244.     * @author  Daniel Plücken <daniel@debakel.net>
  245.     * @access  public
  246.     * @param   object 
  247.     * @return  void 
  248.     */
  249.    function setParentForm&$formobj )
  250.    $this->parentform = $formobj}
  251.  
  252.  
  253.  
  254.    /**
  255.     * Stores the given label object to the extended underlying form component.
  256.     *
  257.     * @version 1.0
  258.     * @since   0.1.7
  259.     * @author  Daniel Plücken <daniel@debakel.net>
  260.     * @access  public
  261.     * @param   object 
  262.     * @return  void 
  263.     */
  264.    function setLabel&$lab_obj )
  265.    $this->label_obj = $lab_obj}
  266.  
  267.  
  268.  
  269.    /**
  270.     * Blind method cause other objects will invoke it.
  271.     *
  272.     * @version 1.0
  273.     * @since   0.1.3
  274.     * @author  Daniel Plücken <daniel@debakel.net>
  275.     * @access  public
  276.     * @return  string 
  277.     */
  278.    function getCheckOrder()
  279.    return false}
  280.  
  281.  
  282.  
  283.    /**
  284.     * Blind method cause other objects will invoke it.
  285.     *
  286.     * @version 1.0
  287.     * @since   0.1.2
  288.     * @author  Daniel Plücken <daniel@debakel.net>
  289.     * @access  public
  290.     * @return  string 
  291.     */
  292.    function getValidationOrder()
  293.    return false}
  294.  
  295.  
  296.  
  297.    /**
  298.     * Returns the label to the extended extended underlying form component as
  299.     * string.
  300.     *
  301.     * @version 1.0
  302.     * @since   0.1.6
  303.     * @author  Daniel Plücken <daniel@debakel.net>
  304.     * @access  public
  305.     * @return  string 
  306.     */
  307.    function getLabel()
  308.    {
  309.      $out "";
  310.      if (
  311.          !function_exists"is_a" )
  312.       && (
  313.            get_class$this->label_obj == "htmllabel"
  314.         || get_parent_class$this->label_obj == "htmllabel"
  315.          )
  316.        )
  317.        $out $this->label_obj->get();
  318.     else
  319.     if (
  320.          function_exists"is_a" )
  321.       && (
  322.            is_a$this->label_obj"HTMLLabel" )
  323.         || is_subclass_of$this->label_obj"htmllabel" )
  324.          )
  325.        )
  326.        $out $this->label_obj->get();
  327.  
  328.      return $out;
  329.    }
  330. // End of class HTMLFormItem
  331. ?>

Documentation generated on Thu, 05 Jun 2008 19:09:47 +0200 by phpDocumentor 1.4.1