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

Source for file HTMLPasswordInput.class.php

Documentation is available at HTMLPasswordInput.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.  *
  20.  */
  21. require_onceCLASSPATH."forms/items/ABSTHTMLTextInput.class.php" );
  22.  
  23. /**
  24.  * A class to generate text input fields.
  25.  *
  26.  * @package    forms
  27.  * @subpackage items
  28.  * @version    0.1.0
  29.  * @author     Daniel Plücken <daniel@debakel.net>
  30.  * @license    http://www.gnu.org/copyleft/lesser.html
  31.  *              GNU Lesser General Public License
  32.  * @copyright  Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>
  33.  *
  34.  *  This library is free software; you can redistribute it and/or
  35.  *  modify it under the terms of the GNU Lesser General Public
  36.  *  License as published by the Free Software Foundation; either
  37.  *  version 2.1 of the License.
  38.  *
  39.  *  This library is distributed in the hope that it will be useful,
  40.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  41.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  42.  *  GNU Lesser General Public License for more details.
  43.  *
  44.  *  You should have received a copy of the GNU Lesser General
  45.  *  Public License along with this library; if not, write to the
  46.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  47.  *  Boston, MA 02111-1307 USA
  48.  */
  49. {
  50.    /**
  51.     * Constructor
  52.     *
  53.     * @version 1.0
  54.     * @since   0.1.0
  55.     * @author  Daniel Plücken <daniel@debakel.net>
  56.     * @access  public
  57.     * @param   string  $name* 
  58.     * @param   string  $value* 
  59.     * @param   integer $size* 
  60.     * @param   integer $maxchar* 
  61.     * @param   string  $style_class* 
  62.     * @param   string  $other_attributes* 
  63.     */
  64.    function HTMLPasswordInput(
  65.                                $name             "",
  66.                                $size             0,
  67.                                $maxchars         0,
  68.                                $style_class      "",
  69.                                $other_attributes ""
  70.                              )
  71.    {
  72.       parent :: __constructor(
  73.                                $name,
  74.                                $size,
  75.                                $maxchars,
  76.                                $style_class,
  77.                                $other_attributes
  78.                              );
  79.    }
  80.  
  81.  
  82.  
  83.    /**
  84.     * Makes a clone of this object an returns a reference to this clone.
  85.     *
  86.     * @version 1.1
  87.     * @since   0.1.0
  88.     * @author  Daniel Plücken <daniel@debakel.net>
  89.     * @access  public
  90.     * @param   string  $newName 
  91.     * @param   integer $maxchars* 
  92.     * @param   integer $size* 
  93.     * @return  object 
  94.     */
  95.    function getClone(
  96.                        $newName,
  97.                        $maxchars      0// zero means no limit.
  98.                        $size          0// zero means no limit.
  99.                        $selectedValue ""
  100.                     )
  101.    {
  102.       $maxchars      preg_match"^\d*$"$maxchars )
  103.                        ? $maxchars
  104.                        : $this->maxchars;
  105.       $size          preg_match"^\d*$"$size )
  106.                        ? $size
  107.                        : $this->size;
  108.       $selectedValue !empty$selectedValue )
  109.                        ? $selectedValue
  110.                        : $this->value;
  111.  
  112.       $newInstance new HTMLPasswordInput(
  113.                                             $newName,
  114.                                             $selectedValue,
  115.                                             $size,
  116.                                             $maxchars
  117.                                           );
  118.  
  119.       if!empty$this->onBlur ) )
  120.         $newInstance->setOnBlur$this->onBlur );
  121.  
  122.       if!empty$this->style_class ) )
  123.         $newInstance->setStyle$this->style_class );
  124.  
  125.       if!empty$this->other_attributes ) )
  126.         $newInstance->setAttributes$this->other_attributes );
  127.  
  128.       return $newInstance;
  129.    }
  130.  
  131.  
  132.  
  133.    /**
  134.     * Generates the sourcecode to build this object and returns it.
  135.     *
  136.     * @version 1.0
  137.     * @since   0.1.0
  138.     * @author  Daniel Plücken <daniel@debakel.net>
  139.     * @access  public
  140.     * @return  string 
  141.     */
  142.    function getPHPSource$type )
  143.    return parent :: getPHPSource"HTMLPasswordInput" )}
  144.  
  145.  
  146.  
  147.    /**
  148.     * Returns a generated string based on the attributes of this object.
  149.     *
  150.     * @version 1.0
  151.     * @since   0.1.0
  152.     * @author  Daniel Plücken <daniel@debakel.net>
  153.     * @access  public
  154.     * @return  string 
  155.     */
  156.    function get()
  157.    return parent :: get"password" )}
  158. // ENDE class HTMLPasswordInput
  159. ?>

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