Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.
   1  <?php
   2  /* vim: set expandtab tabstop=4 shiftwidth=4: */
   3  // +----------------------------------------------------------------------+
   4  // | PHP version 4.0                                                      |
   5  // +----------------------------------------------------------------------+
   6  // | Copyright (c) 1997-2003 The PHP Group                                |
   7  // +----------------------------------------------------------------------+
   8  // | This source file is subject to version 2.0 of the PHP license,       |
   9  // | that is bundled with this package in the file LICENSE, and is        |
  10  // | available at through the world-wide-web at                           |
  11  // | http://www.php.net/license/2_02.txt.                                 |
  12  // | If you did not receive a copy of the PHP license and are unable to   |
  13  // | obtain it through the world-wide-web, please send a note to          |
  14  // | license@php.net so we can mail you a copy immediately.               |
  15  // +----------------------------------------------------------------------+
  16  // | Author: Alexey Borzov <borz_off@cs.msu.su>                           |
  17  // +----------------------------------------------------------------------+
  18  //
  19  // $Id$
  20  
  21  require_once 'HTML/QuickForm/static.php';
  22  
  23  /**
  24   * A pseudo-element used for adding headers to form
  25   *
  26   * @author Alexey Borzov <borz_off@cs.msu.su>
  27   * @access public
  28   */
  29  class HTML_QuickForm_header extends HTML_QuickForm_static
  30  {
  31      // {{{ constructor
  32  
  33     /**
  34      * Class constructor
  35      *
  36      * @param string $elementName    Header name
  37      * @param string $text           Header text
  38      * @access public
  39      * @return void
  40      */
  41      public function __construct($elementName = null, $text = null) {
  42          parent::__construct($elementName, null, $text);
  43          $this->_type = 'header';
  44      }
  45  
  46      /**
  47       * Old syntax of class constructor. Deprecated in PHP7.
  48       *
  49       * @deprecated since Moodle 3.1
  50       */
  51      public function HTML_QuickForm_header($elementName = null, $text = null) {
  52          debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
  53          self::__construct($elementName, $text);
  54      }
  55  
  56      // }}}
  57      // {{{ accept()
  58  
  59     /**
  60      * Accepts a renderer
  61      *
  62      * @param object     An HTML_QuickForm_Renderer object
  63      * @access public
  64      * @return void
  65      */
  66      function accept(&$renderer, $required=false, $error=null)
  67      {
  68          $renderer->renderHeader($this);
  69      } // end func accept
  70  
  71      // }}}
  72  
  73  } //end class HTML_QuickForm_header
  74  ?>