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

Source for file ABSTHTMLTag.class.php

Documentation is available at ABSTHTMLTag.class.php

  1. <?php
  2. /**
  3.  * All prefixes like "ABST" for classname means that the class is abstract.
  4.  *
  5.  * @package html
  6.  */
  7.  
  8. /**
  9.  *
  10.  */
  11. include_once CLASSPATH."data_structures/ABSTObject.class.php";
  12.  
  13. /**
  14.  * An abstract class to create HTML-Tags.
  15.  *
  16.  * @abstract
  17.  * @package   html
  18.  * @version   0.1.82
  19.  *
  20.  * @author    Daniel Plücken <daniel@debakel.net>
  21.  *
  22.  * @license   http://www.gnu.org/copyleft/lesser.html
  23.  *             GNU Lesser General Public License
  24.  * @copyright Copyright (c) 2004 Daniel Plücken <daniel@debakel.net>
  25.  *
  26.  *  This library is free software; you can redistribute it and/or
  27.  *  modify it under the terms of the GNU Lesser General Public
  28.  *  License as published by the Free Software Foundation; either
  29.  *  version 2.1 of the License.
  30.  *
  31.  *  This library is distributed in the hope that it will be useful,
  32.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  33.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34.  *  GNU Lesser General Public License for more details.
  35.  *
  36.  *  You should have received a copy of the GNU Lesser General
  37.  *  Public License along with this library; if not, write to the
  38.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  39.  *  Boston, MA 02111-1307 USA
  40.  */
  41. class ABSTHTMLTag extends ABSTObject
  42. {
  43.    /**
  44.     * The value of the "name"-attribute of this item.
  45.     * @var    string $name 
  46.     * @access public
  47.     */
  48.    var $name;
  49.    /**
  50.     * The value of the "id"-attribute of this item.
  51.     *
  52.     * @var    string  $id 
  53.     * @access private
  54.     */
  55.    var $id;
  56.    /**
  57.     * The value of the "class"-attribute of this item.
  58.     *
  59.     * @var    string $style_class 
  60.     * @access public
  61.     */
  62.    var $style_class;
  63.    /**
  64.     * Can filled with attributes who where not a standard for this item-tag.
  65.     *
  66.     * @var    string $other_attributes 
  67.     * @access public
  68.     */
  69.    var $other_attributes;
  70.    /**
  71.     * Can filled with styledefinitions that were not handled by an implemented
  72.     * method.
  73.     *
  74.     * @var    string $freestyle 
  75.     * @access public
  76.     */
  77.    var $freestyle;
  78.    /**
  79.     * @var    string $focus 
  80.     * @access public
  81.     */
  82.    var $focus;
  83.    /**
  84.     * @var    string $blur 
  85.     * @access public
  86.     */
  87.    var $blur;
  88.    /**
  89.     * @var    string $mouseup 
  90.     * @access public
  91.     */
  92.    var $mouseup;
  93.    /**
  94.     * @var    string $click 
  95.     * @access public
  96.     */
  97.    var $click;
  98.    /**
  99.     * @var    string $mouseover 
  100.     * @access public
  101.     */
  102.    var $mouseover;
  103.    /**
  104.     * @var    string $mouseout 
  105.     * @access public
  106.     */
  107.    var $mouseout;
  108.    /**
  109.     * @var    string $mousemove 
  110.     * @access public
  111.     */
  112.    var $mousemove;
  113.    /**
  114.     * Stores whether the HTML-elements should format by "\r\n" in the source.
  115.     *
  116.     * @var    boolean $no_format 
  117.     * @access public
  118.     */
  119.    var $no_format = false;
  120.  
  121.  
  122.  
  123.    /**
  124.     * The Constructor let the script die, cause this is an abstract class!
  125.     *
  126.     * @version 1.0
  127.     * @since   0.1.2
  128.     * @author  Daniel Plücken <daniel@debakel.net>
  129.     * @access  public
  130.     * @return  void 
  131.     */
  132.    function HTMLTag()
  133.    die"HTMLTag is an abstract class. You cannot get an instance of it." )}
  134.  
  135.  
  136.  
  137.    /**
  138.     * Returns the value of this tag's "name"-attribute.
  139.     *
  140.     * @version 1.0
  141.     * @since   0.1.0
  142.     * @author  Daniel Plücken <daniel@debakel.net>
  143.     * @access  public
  144.     * @return  string 
  145.     */
  146.    function getName()
  147.    return $this->name}
  148.  
  149.  
  150.  
  151.    /**
  152.     * Returns the value of this tag's "id"-attribute.
  153.     *
  154.     * @version 1.0
  155.     * @since   0.1.0
  156.     * @author  Daniel Plücken <daniel@debakel.net>
  157.     * @access  public
  158.     * @return  string 
  159.     */
  160.    function getId()
  161.    return $this->id}
  162.  
  163.  
  164.  
  165.    /**
  166.     * Stores all used ids and makes sure that every id in the document is
  167.     * unique. It should called in every get method of classes in the packages
  168.     * forms and html.
  169.     *
  170.     * @version 1.0
  171.     * @since   0.1.7
  172.     * @author  Daniel Plücken <daniel@debakel.net>
  173.     * @access  public
  174.     * @param   string  $str_id 
  175.     * @param   boolean $bool_store 
  176.     * @return  boolean 
  177.     */
  178.    function idExists$str_id$bool_store false )
  179.    {
  180.       static $id_arr array();
  181.  
  182.       $out false;
  183.       if in_array$str_id$id_arr ) )
  184.       {
  185.          $out true;
  186.  
  187.          if $bool_store )
  188.          {
  189.             $match_arr array();
  190.             if preg_match"!^(.+)\_(\d+)?$!"$str_id$match_arr ) )
  191.             {
  192.                 $start  intval$match_arr[21;
  193.                 $helper $match_arr[1];
  194.             }
  195.             else
  196.             {
  197.                 $start 1;
  198.                 $match_arr[1$helper $str_id;
  199.             }
  200.  
  201.             for $i $startin_array$helper$id_arr )$i++ )
  202.                 $helper $match_arr[1]."_".$i;
  203.  
  204.             $str_id $helper;
  205.          }
  206.       }
  207.  
  208.       if $bool_store )
  209.           $this->id $id_arr[$str_id;
  210.  
  211.       return $out;
  212.    }
  213.  
  214.  
  215.  
  216.    /**
  217.     * Stores the value of this tag's "name"-attribute.
  218.     *
  219.     * @version 1.0
  220.     * @since   0.1.0
  221.     * @author  Daniel Plücken <daniel@debakel.net>
  222.     * @access  public
  223.     * @param   string $string 
  224.     * @return  void 
  225.     */
  226.    function setName$string )
  227.    $this->name $string}
  228.  
  229.  
  230.  
  231.    /**
  232.     * Stores the value of this item's "id"-attribute.
  233.     *
  234.     * @version 1.0
  235.     * @since   0.1.0
  236.     * @author  Daniel Plücken <daniel@debakel.net>
  237.     * @access  public
  238.     * @param   string $string 
  239.     * @return  void 
  240.     */
  241.    function setId$string )
  242.    $this->id $string}
  243.  
  244.  
  245.  
  246.    /**
  247.     * Set the value of the class-attribute of this tag.
  248.     *
  249.     * @version 1.0
  250.     * @since   0.1.3
  251.     * @author  Daniel Plücken <daniel@debakel.net>
  252.     * @access  public
  253.     * @param   string $string 
  254.     * @return  void 
  255.     */
  256.    function setStyle$string )
  257.    $this->style_class $string}
  258.  
  259.  
  260.  
  261.    /**
  262.     * Set the value of style definitions that are not handled by implemented
  263.     * methods.
  264.     *
  265.     * @version 1.0
  266.     * @since   0.1.1
  267.     * @author  Daniel Plücken <daniel@debakel.net>
  268.     * @access  public
  269.     * @param   string $string 
  270.     * @return  void 
  271.     */
  272.    function setFreeStyle$string )
  273.    $this->freestyle $string}
  274.  
  275.  
  276.  
  277.    /**
  278.     * This method allows to set the attributes of the tag that are not handled
  279.     * by other methods.
  280.     *
  281.     * @version 1.0
  282.     * @since   0.1.4
  283.     * @author  Daniel Plücken <daniel@debakel.net>
  284.     * @access  public
  285.     * @param   string $string 
  286.     * @return  void 
  287.     */
  288.    function setAttributes$string )
  289.    $this->other_attributes $string}
  290.  
  291.  
  292.  
  293.    /**
  294.     * Sets the value of the focus-attribute of this html-tag.
  295.     *
  296.     * @version 1.0
  297.     * @since   0.1.75
  298.     * @author  Daniel Plücken <daniel@debakel.net>
  299.     * @access  public
  300.     * @param   string $string 
  301.     * @return  void 
  302.     */
  303.    function setOnFocus$string )
  304.    $this->focus $string}
  305.  
  306.  
  307.  
  308.    /**
  309.     * Sets the value of the blur-attribute of this html-tag.
  310.     *
  311.     * @version 1.0
  312.     * @since   0.1.8
  313.     * @author  Daniel Plücken <daniel@debakel.net>
  314.     * @access  public
  315.     * @param   string $string 
  316.     * @return  void 
  317.     */
  318.    function setOnBlur$string )
  319.    $this->blur $string}
  320.  
  321.  
  322.  
  323.    /**
  324.     * Sets the value of the click-attribute of this html-tag.
  325.     *
  326.     * @version 1.0
  327.     * @since   0.1.6
  328.     * @author  Daniel Plücken <daniel@debakel.net>
  329.     * @access  public
  330.     * @param   string $string 
  331.     * @return  void 
  332.     */
  333.    function setOnClick$string )
  334.    $this->click $string}
  335.  
  336.  
  337.  
  338.    /**
  339.     * Sets the value of the mouseup-attribute of this html-tag.
  340.     *
  341.     * @version 1.0
  342.     * @since   0.1.4
  343.     * @author  Daniel Plücken <daniel@debakel.net>
  344.     * @access  public
  345.     * @param   string $string 
  346.     * @return  void 
  347.     */
  348.    function setOnMouseUp$string )
  349.    $this->mouseup $string}
  350.  
  351.  
  352.  
  353.    /**
  354.     * Sets the value of the mouseover-attribute of this html-tag.
  355.     *
  356.     * @version 1.0
  357.     * @since   0.1.2
  358.     * @author  Daniel Plücken <daniel@debakel.net>
  359.     * @access  public
  360.     * @param   string $string 
  361.     * @return  void 
  362.     */
  363.    function setOnMouseOver$string )
  364.    $this->mouseover $string}
  365.  
  366.  
  367.  
  368.    /**
  369.     * Sets the value of the mouseout-attribute of this html-tag.
  370.     *
  371.     * @version 1.0
  372.     * @since   0.1.2
  373.     * @author  Daniel Plücken <daniel@debakel.net>
  374.     * @access  public
  375.     * @param   string $string 
  376.     * @return  void 
  377.     */
  378.    function setOnMouseOut$string )
  379.    $this->mouseout $string}
  380.  
  381.  
  382.  
  383.    /**
  384.     * Sets the value of the mousemove-attribute of this html-tag.
  385.     *
  386.     * @version 1.0
  387.     * @since   0.1.5
  388.     * @author  Daniel Plücken <daniel@debakel.net>
  389.     * @access  public
  390.     * @param   string $string 
  391.     * @return  void 
  392.     */
  393.    function setOnMouseMove$string )
  394.    $this->mousemove $string}
  395.  
  396.  
  397.  
  398.    /**
  399.     * Stores that the HTML-elements should not format by "\r\n" in the source.
  400.     *
  401.     * @version 1.0
  402.     * @since   0.1.0
  403.     * @author  Daniel Plücken <daniel@debakel.net>
  404.     * @access  public
  405.     * @param   boolean $bool 
  406.     * @return  void 
  407.     */
  408.    function setNoFormat$bool true )
  409.    $this->no_format $bool}
  410.  
  411. // End of class HTMLTag
  412. ?>

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