header.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * A pseudo-element used for adding headers to form
  5. *
  6. * PHP versions 4 and 5
  7. *
  8. * LICENSE: This source file is subject to version 3.01 of the PHP license
  9. * that is available through the world-wide-web at the following URI:
  10. * http://www.php.net/license/3_01.txt If you did not receive a copy of
  11. * the PHP License and are unable to obtain it through the web, please
  12. * send a note to license@php.net so we can mail you a copy immediately.
  13. *
  14. * @category HTML
  15. * @package HTML_QuickForm
  16. * @author Alexey Borzov <avb@php.net>
  17. * @copyright 2001-2009 The PHP Group
  18. * @license http://www.php.net/license/3_01.txt PHP License 3.01
  19. * @version CVS: $Id: header.php,v 1.3 2009/04/04 21:34:03 avb Exp $
  20. * @link http://pear.php.net/package/HTML_QuickForm
  21. */
  22. /**
  23. * A pseudo-element used for adding headers to form
  24. *
  25. * @category HTML
  26. * @package HTML_QuickForm
  27. * @author Alexey Borzov <avb@php.net>
  28. * @version Release: 3.2.11
  29. * @since 3.0
  30. */
  31. class HTML_QuickForm_header extends HTML_QuickForm_static
  32. {
  33. // {{{ constructor
  34. /**
  35. * Class constructor
  36. *
  37. * @param string $elementName Header name
  38. * @param string $text Header text
  39. * @access public
  40. * @return void
  41. */
  42. public function __construct($elementName = null, $text = null)
  43. {
  44. if (!empty($elementName)) {
  45. $text = $elementName;
  46. }
  47. parent::__construct($elementName, null, $text);
  48. $this->_type = 'header';
  49. }
  50. // }}}
  51. // {{{ accept()
  52. /**
  53. * Accepts a renderer
  54. *
  55. * @param HTML_QuickForm_Renderer renderer object
  56. * @access public
  57. * @return void
  58. */
  59. function accept(&$renderer, $required=false, $error=null)
  60. {
  61. $renderer->renderHeader($this);
  62. } // end func accept
  63. // }}}
  64. } //end class HTML_QuickForm_header
  65. ?>