Renderer.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * An abstract base class for QuickForm renderers
  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$
  20. * @link http://pear.php.net/package/HTML_QuickForm
  21. */
  22. /**
  23. * An abstract base class for QuickForm renderers
  24. *
  25. * The class implements a Visitor design pattern
  26. *
  27. * @category HTML
  28. * @package HTML_QuickForm
  29. * @author Alexey Borzov <avb@php.net>
  30. * @version Release: 3.2.11
  31. * @since 3.0
  32. * @abstract
  33. */
  34. class HTML_QuickForm_Renderer
  35. {
  36. /**
  37. * Constructor
  38. *
  39. * @access public
  40. */
  41. public function __construct()
  42. {
  43. } // end constructor
  44. /**
  45. * Called when visiting a form, before processing any form elements
  46. *
  47. * @param HTML_QuickForm a form being visited
  48. * @access public
  49. * @return void
  50. * @abstract
  51. */
  52. function startForm(&$form)
  53. {
  54. return;
  55. } // end func startForm
  56. /**
  57. * Called when visiting a form, after processing all form elements
  58. *
  59. * @param HTML_QuickForm a form being visited
  60. * @access public
  61. * @return void
  62. * @abstract
  63. */
  64. function finishForm(&$form)
  65. {
  66. return;
  67. } // end func finishForm
  68. /**
  69. * Called when visiting a header element
  70. *
  71. * @param HTML_QuickForm_header a header element being visited
  72. * @access public
  73. * @return void
  74. * @abstract
  75. */
  76. function renderHeader(&$header)
  77. {
  78. return;
  79. } // end func renderHeader
  80. /**
  81. * Called when visiting an element
  82. *
  83. * @param HTML_QuickForm_element form element being visited
  84. * @param bool Whether an element is required
  85. * @param string An error message associated with an element
  86. * @access public
  87. * @return void
  88. * @abstract
  89. */
  90. function renderElement(&$element, $required, $error)
  91. {
  92. return;
  93. } // end func renderElement
  94. /**
  95. * Called when visiting a hidden element
  96. *
  97. * @param HTML_QuickForm_element a hidden element being visited
  98. * @access public
  99. * @return void
  100. * @abstract
  101. */
  102. function renderHidden(&$element)
  103. {
  104. return;
  105. } // end func renderHidden
  106. /**
  107. * Called when visiting a raw HTML/text pseudo-element
  108. *
  109. * Only implemented in Default renderer. Usage of 'html' elements is
  110. * discouraged, templates should be used instead.
  111. *
  112. * @param HTML_QuickForm_html a 'raw html' element being visited
  113. * @access public
  114. * @return void
  115. * @abstract
  116. */
  117. function renderHtml(&$data)
  118. {
  119. return;
  120. } // end func renderHtml
  121. /**
  122. * Called when visiting a group, before processing any group elements
  123. *
  124. * @param HTML_QuickForm_group A group being visited
  125. * @param bool Whether a group is required
  126. * @param string An error message associated with a group
  127. * @access public
  128. * @return void
  129. * @abstract
  130. */
  131. function startGroup(&$group, $required, $error)
  132. {
  133. return;
  134. } // end func startGroup
  135. /**
  136. * Called when visiting a group, after processing all group elements
  137. *
  138. * @param HTML_QuickForm_group A group being visited
  139. * @access public
  140. * @return void
  141. * @abstract
  142. */
  143. function finishGroup(&$group)
  144. {
  145. return;
  146. }
  147. }