Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.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 raw HTML to form
  25   *
  26   * Intended for use with the default renderer only, template-based
  27   * ones may (and probably will) completely ignore this
  28   *
  29   * @author Alexey Borzov <borz_off@cs.msu.su>
  30   * @access public
  31   */
  32  class HTML_QuickForm_html extends HTML_QuickForm_static
  33  {
  34      // {{{ constructor
  35  
  36     /**
  37      * Class constructor
  38      *
  39      * @param string $text   raw HTML to add
  40      * @access public
  41      * @return void
  42      */
  43      public function __construct($text = null) {
  44          parent::__construct(null, null, $text);
  45          $this->_type = 'html';
  46      }
  47  
  48      /**
  49       * Old syntax of class constructor. Deprecated in PHP7.
  50       *
  51       * @deprecated since Moodle 3.1
  52       */
  53      public function HTML_QuickForm_html($text = null) {
  54          debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
  55          self::__construct($text);
  56      }
  57  
  58      // }}}
  59      // {{{ accept()
  60  
  61     /**
  62      * Accepts a renderer
  63      *
  64      * @param object     An HTML_QuickForm_Renderer object
  65      * @access public
  66      * @return void
  67      */
  68      function accept(&$renderer, $required=false, $error=null)
  69      {
  70          $renderer->renderHtml($this);
  71      } // end func accept
  72  
  73      // }}}
  74  
  75  } //end class HTML_QuickForm_header
  76  ?>