Renderer.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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: Renderer.php 6184 2005-09-07 10:08:17Z bmol $
  20. /**
  21. * An abstract base class for QuickForm renderers
  22. *
  23. * The class implements a Visitor design pattern
  24. *
  25. * @abstract
  26. * @author Alexey Borzov <borz_off@cs.msu.su>
  27. */
  28. class HTML_QuickForm_Renderer
  29. {
  30. /**
  31. * Constructor
  32. *
  33. * @access public
  34. */
  35. function HTML_QuickForm_Renderer()
  36. {
  37. } // end constructor
  38. /**
  39. * Called when visiting a form, before processing any form elements
  40. *
  41. * @param object An HTML_QuickForm object being visited
  42. * @access public
  43. * @return void
  44. * @abstract
  45. */
  46. function startForm(&$form)
  47. {
  48. return;
  49. } // end func startForm
  50. /**
  51. * Called when visiting a form, after processing all form elements
  52. *
  53. * @param object An HTML_QuickForm object being visited
  54. * @access public
  55. * @return void
  56. * @abstract
  57. */
  58. function finishForm(&$form)
  59. {
  60. return;
  61. } // end func finishForm
  62. /**
  63. * Called when visiting a header element
  64. *
  65. * @param object An HTML_QuickForm_header element being visited
  66. * @access public
  67. * @return void
  68. * @abstract
  69. */
  70. function renderHeader(&$header)
  71. {
  72. return;
  73. } // end func renderHeader
  74. /**
  75. * Called when visiting an element
  76. *
  77. * @param object An HTML_QuickForm_element object being visited
  78. * @param bool Whether an element is required
  79. * @param string An error message associated with an element
  80. * @access public
  81. * @return void
  82. * @abstract
  83. */
  84. function renderElement(&$element, $required, $error)
  85. {
  86. return;
  87. } // end func renderElement
  88. /**
  89. * Called when visiting a hidden element
  90. *
  91. * @param object An HTML_QuickForm_hidden object being visited
  92. * @access public
  93. * @return void
  94. * @abstract
  95. */
  96. function renderHidden(&$element)
  97. {
  98. return;
  99. } // end func renderHidden
  100. /**
  101. * Called when visiting a raw HTML/text pseudo-element
  102. *
  103. * Seems that this should not be used when using a template-based renderer
  104. *
  105. * @param object An HTML_QuickForm_html element being visited
  106. * @access public
  107. * @return void
  108. * @abstract
  109. */
  110. function renderHtml(&$data)
  111. {
  112. return;
  113. } // end func renderHtml
  114. /**
  115. * Called when visiting a group, before processing any group elements
  116. *
  117. * @param object An HTML_QuickForm_group object being visited
  118. * @param bool Whether a group is required
  119. * @param string An error message associated with a group
  120. * @access public
  121. * @return void
  122. * @abstract
  123. */
  124. function startGroup(&$group, $required, $error)
  125. {
  126. return;
  127. } // end func startGroup
  128. /**
  129. * Called when visiting a group, after processing all group elements
  130. *
  131. * @param object An HTML_QuickForm_group object being visited
  132. * @access public
  133. * @return void
  134. * @abstract
  135. */
  136. function finishGroup(&$group)
  137. {
  138. return;
  139. } // end func finishGroup
  140. } // end class HTML_QuickForm_Renderer
  141. ?>