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

Source for file HTMLSpan.class.php

Documentation is available at HTMLSpan.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 html
  9.  */
  10. if!defined"CLASSPATH" ) )
  11. {
  12.   echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
  13.   echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
  14.   exit();
  15. }
  16.  
  17. /**
  18.  * Including the basic class.
  19.  */
  20. require_onceCLASSPATH."html/HTMLLayer.class.php" );
  21.  
  22. /**
  23.  * A class to generate "<div>"-Layer.
  24.  *
  25.  * @package   html
  26.  * @version   0.2.1
  27.  * @author    Daniel Plücken <daniel@debakel.net>
  28.  * @license   http://www.gnu.org/copyleft/lesser.html
  29.  *             GNU Lesser General Public License
  30.  * @copyright Copyright (c) 2004 Daniel Plücken <daniel@debakel.net>
  31.  *
  32.  *  This library is free software; you can redistribute it and/or
  33.  *  modify it under the terms of the GNU Lesser General Public
  34.  *  License as published by the Free Software Foundation; either
  35.  *  version 2.1 of the License.
  36.  *
  37.  *  This library is distributed in the hope that it will be useful,
  38.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  39.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40.  *  GNU Lesser General Public License for more details.
  41.  *
  42.  *  You should have received a copy of the GNU Lesser General
  43.  *  Public License along with this library; if not, write to the
  44.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  45.  *  Boston, MA 02111-1307 USA
  46.  */
  47. class HTMLSpan extends HTMLLayer
  48. {
  49.    /**
  50.     * Constructor.
  51.     *
  52.     * @version 1.1
  53.     * @since   0.1.0
  54.     * @author  Daniel Plücken <daniel@debakel.net>
  55.     * @access  public
  56.     * @param   $name The value of the name- and id-attribute of this layer.
  57.     * @return  void 
  58.     */
  59.    function HTMLSpan$name "" )
  60.    {
  61.      $this->name = $name;
  62.      $this->id   = $name;
  63.    }
  64.  
  65.  
  66.  
  67.    /**
  68.     * Returns a generated string based on the attributes of this HTML-Object.
  69.     *
  70.     * @version 1.5
  71.     * @since   0.1.0
  72.     * @author  Daniel Plücken <daniel@debakel.net>
  73.     * @access  public
  74.     * @return  string 
  75.     */
  76.    function get()
  77.    {
  78.      $this->idExists$this->idtrue );
  79.  
  80.      $newline $this->no_format
  81.                 ? ""
  82.                 : "\r\n";
  83.  
  84.      $outputstr  "<!--\r\n"
  85.                   ."--><span id=\"".$this->id."\"\r\n"
  86.                   ."         style=\"z-index:".$this->z_index.";"
  87.                                    ."visibility:".$this->visible.";"
  88.                                    .(
  89.                                        !empty$this->bgcolor )
  90.                                        ? "background-color:".$this->bgcolor.";"
  91.                                        : ""
  92.                                     )
  93.                                    .(
  94.                                        !empty$this->position )
  95.                                        ? "position:".$this->position.";"
  96.                                        : ""
  97.                                     )
  98.                                    .(
  99.                                        preg_match"!\d+!"$this->top )
  100.                                        ? "top:".$this->top.(
  101.                                             strpos$this->top"%" )
  102.                                             ? ";"
  103.                                             : "px;"
  104.                                                            )
  105.                                        : ""
  106.                                     )
  107.                                    .(
  108.                                        preg_match"!\d+!"$this->left )
  109.                                        ? "left:".$this->left.(
  110.                                             strpos$this->left"%" )
  111.                                             ? ";"
  112.                                             : "px;"
  113.                                                              )
  114.                                        : ""
  115.                                     )
  116.                                    .(
  117.                                        preg_match"!\d+!"$this->width )
  118.                                        ? "width:".$this->width.(
  119.                                             strpos$this->width"%" )
  120.                                             ? ";"
  121.                                             : "px;"
  122.                                                                )
  123.                                        : ""
  124.                                     )
  125.                                    .(
  126.                                        preg_match"!\d+!"$this->height )
  127.                                        ? "height:".$this->height.(
  128.                                             strpos$this->height"%" )
  129.                                             ? ";"
  130.                                             : "px;"
  131.                                                                  )
  132.                                        : ""
  133.                                     )
  134.                                    .(
  135.                                        !empty$this->freestyle )
  136.                                        ? $this->freestyle
  137.                                        : ""
  138.                                     )
  139.                                    ."\"\r\n"
  140.                   .(
  141.                      !empty$this->name )
  142.                      ? "         name=\"".$this->name."\"\r\n"
  143.                      : ""
  144.                    )
  145.                   .(
  146.                      !empty$this->style_class )
  147.                      ? "         class=\"".$this->style_class."\"\r\n"
  148.                      : ""
  149.                    )
  150.                   .(
  151.                      !empty$this->mouseup )
  152.                      ? "         onMouseup=\"".$this->mouseup."\"\r\n"
  153.                      : ""
  154.                    )
  155.                   .(
  156.                      !empty$this->mouseout )
  157.                      ? "         onMouseout=\"".$this->mouseout."\"\r\n"
  158.                      : ""
  159.                    )
  160.                   .(
  161.                      !empty$this->mouseover )
  162.                      ? "         onMouseover=\"".$this->mouseover."\"\r\n"
  163.                      : ""
  164.                    )
  165.                   .(
  166.                      !empty$this->mousemove )
  167.                      ? "         onMousemove=\"".$this->mousemove."\"\r\n"
  168.                      : ""
  169.                    )
  170.                   .(
  171.                      !empty$this->other_attributes )
  172.                      ? "         ".$this->other_attributes."\r\n"
  173.                      : ""
  174.                    )
  175.                   ."   >";
  176.      $outputstr .= $this->body;
  177.      $outputstr .= "<!--\r\n"
  178.                   ."--></span>";
  179.  
  180.      return $outputstr;
  181.    }
  182. // END of class HTMLSpan
  183. ?>

Documentation generated on Thu, 05 Jun 2008 19:13:06 +0200 by phpDocumentor 1.4.1