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

Source for file HTMLButton.class.php

Documentation is available at HTMLButton.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/ABSTHTMLFormItem.class.php" );
  22.  
  23. /**
  24.  * Creating HTML-Buttons
  25.  *
  26.  * @package    forms
  27.  * @subpackage items
  28.  * @version    0.1.62
  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) 2004 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. class HTMLButton extends ABSTHTMLFormItem
  50. {
  51.    /**
  52.     * @var    string $mouseup 
  53.     * @access public
  54.     */
  55.    var $mouseup;
  56.  
  57.  
  58.     /**
  59.     * Constructor.
  60.     *
  61.     * @version 1.1
  62.     * @since   0.1.0
  63.     * @author  Daniel Plücken <daniel@debakel.net>
  64.     * @access  public
  65.     * @param   string $name      The value of the name-attribute of this button.
  66.     * @param   string $value     The label of this buton.
  67.     * @param   string $onMouseup The value of the onMouseup-attribute of this
  68.     *                             button.
  69.     * @return  void 
  70.     */
  71.     function HTMLButton(
  72.                          $name      "",
  73.                          $value     "",
  74.                          $onMouseup ""
  75.                        )
  76.     {
  77.       $this->name    = $name;
  78.       $this->id      = $name;
  79.       $this->value   = $value;
  80.       $this->mouseup = $onMouseup;
  81.     }
  82.  
  83.  
  84.  
  85.    /**
  86.     * Blind method cause other objects will invoke it.
  87.     *
  88.     * @version 1.0
  89.     * @since   0.1.2
  90.     * @author  Daniel Plücken <daniel@debakel.net>
  91.     * @access  public
  92.     * @param   string  $formname 
  93.     * @return  boolean (false)
  94.     */
  95.    function getCheckOrder$formname )
  96.    return false}
  97.  
  98.  
  99.  
  100.    /**
  101.     * Blind method cause other objects will invoke it.
  102.     *
  103.     * @version 1.0
  104.     * @since   0.1.2
  105.     * @author  Daniel Plücken <daniel@debakel.net>
  106.     * @access  public
  107.     * @param   string  $formname 
  108.     * @return  boolean (false)
  109.     */
  110.    function getValidationOrder$formname )
  111.    return false}
  112.  
  113.  
  114.  
  115.    /**
  116.     * Returns a generated string based on the attributes of this object.
  117.     *
  118.     * @version 1.22
  119.     * @since   0.1.0
  120.     * @author  Daniel Plücken <daniel@debakel.net>
  121.     * @access  public
  122.     * @return  string 
  123.     */
  124.    function get()
  125.    {
  126.       $this->idExists$this->idtrue );
  127.  
  128.       $out  "<!--\r\n"
  129.              ."--><input type=\"button\"\r\n"
  130.              ."          name=\"".$this->name."\"\r\n"
  131.              ."          id=\"".$this->id."\"\r\n";
  132.       $out .= !empty$this->style_class )
  133.               ? "          class=\"".$this->style_class."\"\r\n"
  134.               : "";
  135.       $out .= !empty$this->freestyle )
  136.               ? "          style=\"".$this->freestyle."\"\r\n"
  137.               : "";
  138.       $out .= !empty$this->blur )
  139.               ? "          onBlur=\"".$this->blur."\"\r\n"
  140.               : "";
  141.       $out .= !empty$this->focus )
  142.               ? "          onFocus=\"".$this->focus."\"\r\n"
  143.               : "";
  144.       $out .= !empty$this->click )
  145.               ? "          onClick=\"".$this->click."\"\r\n"
  146.               : "";
  147.       $out .= !empty$this->mouseup )
  148.               ? "          onMouseup=\"".$this->mouseup."\"\r\n"
  149.               : "";
  150.       $out .= !empty$this->mouseover )
  151.               ? "          onMouseover=\"".$this->mouseover."\"\r\n"
  152.               : "";
  153.       $out .= !empty$this->mouseout )
  154.               ? "          onMouseout=\"".$this->mouseout."\"\r\n"
  155.               : "";
  156.       $out .= !empty$this->mousemove )
  157.               ? "          onMousemove=\"".$this->mousemove."\"\r\n"
  158.               : "";
  159.       $out .= !empty$this->value )
  160.               ? "          value=\"".$this->value."\""
  161.               : "";
  162.       $out .= $this->enabled
  163.               ? ""
  164.               : "          disabled=\"disabled\"";
  165.       $out .= " />";
  166.  
  167.       return $out;
  168.    }
  169. // END of class HTMLButton
  170. ?>

Documentation generated on Thu, 05 Jun 2008 19:11:56 +0200 by phpDocumentor 1.4.1