phpDocumentor SForm
Elements
[ class tree: SForm ] [ index: SForm ] [ all elements ]

Source for file Header.php

Documentation is available at Header.php

  1. <?php
  2. /**
  3.  * <b>License</b>:
  4.  * 
  5.  * Copyright (c) 2006, Seth Price <{@link mailto:seth@pricepages.org seth@pricepages.org}> All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  12.  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  13.  * - The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
  14.  *
  15.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  16.  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  17.  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  18.  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  19.  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  20.  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21.  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  22.  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  23.  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24.  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25.  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26.  *
  27.  * @copyright    Copyright (c) 2006, Seth Price
  28.  * @author        Seth Price <seth@pricepages.org>
  29.  * @license        http://opensource.org/licenses/bsd-license.php New BSD License
  30.  * @access        public
  31.  * @package        SForm
  32.  * @see            SForm::__construct()
  33.  * @version        0.1
  34.  * @subpackage    Elements
  35.  */
  36.  
  37. /**
  38.  * A header element
  39.  * 
  40.  * The header element simply puts a header on the page. It is here for QuickForm
  41.  * compatability; Really though, SForm isn't a templating engine. You should
  42.  * find a more appropriate method for placing a header on the page.
  43.  * 
  44.  * @package        SForm
  45.  * @subpackage    Elements
  46.  * @deprecated
  47.  */
  48. class SForm_Elm_Header extends SForm_Element {
  49.     
  50.     /**
  51.      * It's a header
  52.      * 
  53.      * @var        string 
  54.      */
  55.     protected $tag = 'h1';
  56.     
  57.     /**
  58.      * It contains text
  59.      * 
  60.      * @var        boolean 
  61.      */
  62.     protected $emptyTag = false;
  63.  
  64.     /**
  65.      * Don't add the name attribute
  66.      * 
  67.      * @var        boolean 
  68.      */
  69.     protected $addName = false;
  70.     
  71.     /**
  72.      * Disable the label
  73.      */
  74.     public function getLabel(){return '';}
  75.     public function getLabelHtml($ak true){return '';}
  76.     
  77.     /**
  78.      * Return the header
  79.      * 
  80.      * @return    string    The header
  81.      */
  82.     public function toString(){
  83.         return $this->toHtml();
  84.     }
  85.     
  86.     /**
  87.      * Return the header
  88.      * 
  89.      * @return    string    The header
  90.      */
  91.     public function toHtml(){
  92.         $this->freeze(false)// Prevent recursion through toString()
  93.         return parent::toHtml().parent::getLabel().parent::toHtmlFin();
  94.     }
  95. }
  96. ?>

Documentation generated on Mon, 09 Apr 2007 19:06:50 -0500 by phpDocumentor 1.3.0