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

Source for file Frame.class.php

Documentation is available at Frame.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.  * @subpackage components
  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 of all HTML-tags.
  20.  */
  21. require_onceCLASSPATH."html/HTMLLayer.class.php" );
  22.  
  23. /**
  24.  * 
  25.  */
  26. require_onceCLASSPATH."html/JavaScript.class.php" );
  27.  
  28.  
  29. /**
  30.  * A class to generate "<div>"-Layer based inline Window.
  31.  *
  32.  * @package    html
  33.  * @subpackage components
  34.  * @version    0.1.0
  35.  * @since      0.9.0.7
  36.  * @author     Daniel Plücken <daniel@debakel.net>
  37.  * @license    http://www.gnu.org/copyleft/lesser.html
  38.  *              GNU Lesser General Public License
  39.  * @copyright  Copyright (c) 2006 Daniel Plücken <daniel@debakel.net>
  40.  *
  41.  *  This library is free software; you can redistribute it and/or
  42.  *  modify it under the terms of the GNU Lesser General Public
  43.  *  License as published by the Free Software Foundation; either
  44.  *  version 2.1 of the License.
  45.  *
  46.  *  This library is distributed in the hope that it will be useful,
  47.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  48.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  49.  *  GNU Lesser General Public License for more details.
  50.  *
  51.  *  You should have received a copy of the GNU Lesser General
  52.  *  Public License along with this library; if not, write to the
  53.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  54.  *  Boston, MA 02111-1307 USA
  55.  */
  56. class Frame extends HTMLLayer
  57. {
  58.   /**
  59.    * @var    HTMLLayer $title_layer 
  60.    * @access public
  61.    */
  62.   var $title_layer;
  63.   /**
  64.    * @var    HTMLLayer $content_layer 
  65.    * @access public
  66.    */
  67.   var $content_layer;
  68.   /**
  69.    * @var    boolean $bool_hold_centred 
  70.    * @access public
  71.    */
  72.   var $bool_hold_centred = false;
  73.  
  74.  
  75.  
  76.   /**
  77.    * Constructor.
  78.    *
  79.    * @version 1.0
  80.    * @since   0.1.0
  81.    * @author  Daniel Plücken <daniel@debakel.net>
  82.    * @access  public
  83.    * @param   string $title   The value of the name- and id-attribute of this
  84.    *                           layer.
  85.    * @param   string $content The content of the frame body.
  86.    * @return  void 
  87.    */
  88.   function Frame$title$content )
  89.   {
  90.     $this->title_layer =new HTMLLayer();
  91.     $this->title_layer->setTop);
  92.     $this->title_layer->setLeft);
  93.     $this->title_layer->setBody$title );
  94.     $this->title_layer->setVisible();
  95.     
  96.     $this->content_layer =new HTMLLayer();
  97.     $this->content_layer->setLeft);
  98.     $this->content_layer->setBody$content );
  99.     $this->content_layer->setVisible();
  100.   }
  101.  
  102.  
  103.   /**
  104.    * Sets the height of this title layer.
  105.    *
  106.    * @version 1.0
  107.    * @since   0.1.0
  108.    * @author  Daniel Plücken <daniel@debakel.net>
  109.    * @access  public
  110.    * @param   integer $int 
  111.    * @return  void 
  112.    */
  113.   function setTitleHeight$int )
  114.   $this->title_layer->setHeight$int )}
  115.  
  116.  
  117.  
  118.   /**
  119.    * Sets the background color of the title layer.
  120.    *
  121.    * @version 1.0
  122.    * @since   0.1.0
  123.    * @author  Daniel Plücken <daniel@debakel.net>
  124.    * @access  public
  125.    * @param   string $string 
  126.    * @return  void 
  127.    */
  128.   function setTitleBGColor$string )
  129.   $this->title_layer->setBGColor$string )
  130.  
  131.  
  132.  
  133.   /**
  134.    * Set the value of style definitions in the title layer that are not handled
  135.    * by implemented methods.
  136.    *
  137.    * @version 1.0
  138.    * @since   0.1.0
  139.    * @author  Daniel Plücken <daniel@debakel.net>
  140.    * @access  public
  141.    * @param   string $string 
  142.    * @return  void 
  143.    */
  144.   function setTitleFreeStyle$string )
  145.   $this->title_layer->setFreeStyle$string )}
  146.   
  147.  
  148.  
  149.   /**
  150.    * Sets the height of this body layer.
  151.    *
  152.    * @version 1.0
  153.    * @since   0.1.0
  154.    * @author  Daniel Plücken <daniel@debakel.net>
  155.    * @access  public
  156.    * @param   integer $int 
  157.    * @return  void 
  158.    */
  159.   function setBodyHeight$int )
  160.   $this->content_layer->setHeight$int )}
  161.  
  162.  
  163.  
  164.   /**
  165.    * Sets the background color of the body layer.
  166.    *
  167.    * @version 1.0
  168.    * @since   0.1.0
  169.    * @author  Daniel Plücken <daniel@debakel.net>
  170.    * @access  public
  171.    * @param   string $string 
  172.    * @return  void 
  173.    */
  174.   function setBodyBGColor$string )
  175.   $this->content_layer->setBGColor$string )}
  176.  
  177.  
  178.  
  179.   /**
  180.    * Set the value of style definitions in the body layer that are not handled
  181.    * by implemented methods.
  182.    *
  183.    * @version 1.0
  184.    * @since   0.1.0
  185.    * @author  Daniel Plücken <daniel@debakel.net>
  186.    * @access  public
  187.    * @param   string $string 
  188.    * @return  void 
  189.    */
  190.   function setBodyFreeStyle$string )
  191.   $this->content_layer->setFreeStyle$string )}
  192.  
  193.  
  194.  
  195.   /**
  196.    * Set the flag to hold the frame in the middle of the browser window.
  197.    *
  198.    * @version 1.0
  199.    * @since   0.1.0
  200.    * @author  Daniel Plücken <daniel@debakel.net>
  201.    * @access  public
  202.    * @param   boolean $bool 
  203.    * @return  void 
  204.    */
  205.   function holdCentred$bool true )
  206.   $this->bool_hold_centred = $bool}
  207.  
  208.  
  209.  
  210.   /**
  211.    * Returns a generated string based on the attributes of this object.
  212.    *
  213.    * @version 1.0
  214.    * @since   0.1.0
  215.    * @author  Daniel Plücken <daniel@debakel.net>
  216.    * @access  public
  217.    * @return  string 
  218.    */
  219.   function get()
  220.   {
  221.     $this->idExists$this->idtrue );
  222.     
  223.     if $this->bool_hold_centred )
  224.     {
  225.        $str_js = <<<JSCODE
  226.   function holdJSCODE$this->id<<<JSCODEOnCenter()
  227.   {
  228.   }
  229.   
  230.   setInteval( "holdJSCODE$this->id<<<JSCODEOnCenter()", 1 );
  231. JSCODE;
  232.        
  233.        $js_obj =new JavaScript();
  234.        $js_obj->add$str_js );
  235.     }
  236.     
  237.     $this->title_layer->freestyle .= "cursor: move";
  238.     
  239.     $this->body = $this->title_layer->get()
  240.                  .$this->content_layer->get();
  241.     
  242.     return parent::get();
  243.   }
  244. // End of class Frame
  245. ?>

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