/source/Plug-in/xajax/xajax_controls/content.inc.php

http://prosporous.googlecode.com/ · PHP · 283 lines · 215 code · 38 blank · 30 comment · 1 complexity · 6bd6989bdd81a9857a4d5ff52bd78cf2 MD5 · raw file

  1. <?php
  2. /*
  3. File: content.inc.php
  4. HTML Control Library - Content Level Tags
  5. Title: xajax HTML control class library
  6. Please see <copyright.inc.php> for a detailed description, copyright
  7. and license information.
  8. */
  9. /*
  10. @package xajax
  11. @version $Id: content.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
  12. @copyright Copyright (c) 2005-2006 by Jared White & J. Max Wilson
  13. @license http://www.xajaxproject.org/bsd_license.txt BSD License
  14. */
  15. /*
  16. Section: Description
  17. This file contains class declarations for the following HTML tags:
  18. - literal
  19. - br, hr
  20. - sub, sup, q, em, strong, cite, dfn, code, samp, kbd, var, abbr, acronym, tt, i, b, big, small, ins, del
  21. - h1 ... h6, address, p, blockquote, pre
  22. The following tags are deprecated as of HTML 4.01 and therefore they are not supported.
  23. - font, strike, s, u, center
  24. */
  25. class clsLiteral extends xajaxControl
  26. {
  27. function clsLiteral($sText)
  28. {
  29. xajaxControl::xajaxControl('CDATA');
  30. $this->sClass = '%inline';
  31. $this->sText = $sText;
  32. }
  33. function printHTML($sIndent='')
  34. {
  35. echo $this->sText;
  36. }
  37. }
  38. class clsBr extends xajaxControl
  39. {
  40. function clsBr($aConfiguration=array())
  41. {
  42. xajaxControl::xajaxControl('br', $aConfiguration);
  43. $this->sClass = '%inline';
  44. $this->sEndTag = 'optional';
  45. }
  46. }
  47. class clsHr extends xajaxControl
  48. {
  49. function clsHr($aConfiguration=array())
  50. {
  51. xajaxControl::xajaxControl('hr', $aConfiguration);
  52. $this->sClass = '%inline';
  53. $this->sEndTag = 'optional';
  54. }
  55. }
  56. class clsInlineContainer extends xajaxControlContainer
  57. {
  58. function clsInlineContainer($sTag, $aConfiguration)
  59. {
  60. xajaxControlContainer::xajaxControlContainer($sTag, $aConfiguration);
  61. $this->sClass = '%inline';
  62. $this->sEndTag = 'required';
  63. }
  64. }
  65. class clsSub extends clsInlineContainer
  66. {
  67. function clsSub($aConfiguration=array())
  68. {
  69. clsInlineContainer::clsInlineContainer('sub', $aConfiguration);
  70. }
  71. }
  72. class clsSup extends xajaxControlContainer
  73. {
  74. function clsSup($aConfiguration=array())
  75. {
  76. clsInlineContainer::clsInlineContainer('sup', $aConfiguration);
  77. }
  78. }
  79. class clsEm extends clsInlineContainer
  80. {
  81. function clsEm($aConfiguration=array())
  82. {
  83. clsInlineContainer::clsInlineContainer('em', $aConfiguration);
  84. }
  85. }
  86. class clsStrong extends clsInlineContainer
  87. {
  88. function clsStrong($aConfiguration=array())
  89. {
  90. clsInlineContainer::clsInlineContainer('strong', $aConfiguration);
  91. }
  92. }
  93. class clsCite extends clsInlineContainer
  94. {
  95. function clsCite($aConfiguration=array())
  96. {
  97. clsInlineContainer::clsInlineContainer('cite', $aConfiguration);
  98. }
  99. }
  100. class clsDfn extends clsInlineContainer
  101. {
  102. function clsDfn($aConfiguration=array())
  103. {
  104. clsInlineContainer::clsInlineContainer('dfn', $aConfiguration);
  105. }
  106. }
  107. class clsCode extends clsInlineContainer
  108. {
  109. function clsCode($aConfiguration=array())
  110. {
  111. clsInlineContainer::clsInlineContainer('code', $aConfiguration);
  112. }
  113. }
  114. class clsSamp extends clsInlineContainer
  115. {
  116. function clsSamp($aConfiguration=array())
  117. {
  118. clsInlineContainer::clsInlineContainer('samp', $aConfiguration);
  119. }
  120. }
  121. class clsKbd extends clsInlineContainer
  122. {
  123. function clsKbd($aConfiguration=array())
  124. {
  125. clsInlineContainer::clsInlineContainer('kbd', $aConfiguration);
  126. }
  127. }
  128. class clsVar extends clsInlineContainer
  129. {
  130. function clsVar($aConfiguration=array())
  131. {
  132. clsInlineContainer::clsInlineContainer('var', $aConfiguration);
  133. }
  134. }
  135. class clsAbbr extends clsInlineContainer
  136. {
  137. function clsAbbr($aConfiguration=array())
  138. {
  139. clsInlineContainer::clsInlineContainer('abbr', $aConfiguration);
  140. }
  141. }
  142. class clsAcronym extends clsInlineContainer
  143. {
  144. function clsAcronym($aConfiguration=array())
  145. {
  146. clsInlineContainer::clsInlineContainer('acronym', $aConfiguration);
  147. }
  148. }
  149. class clsTt extends clsInlineContainer
  150. {
  151. function clsTt($aConfiguration=array())
  152. {
  153. clsInlineContainer::clsInlineContainer('tt', $aConfiguration);
  154. }
  155. }
  156. class clsItalic extends clsInlineContainer
  157. {
  158. function clsItalic($aConfiguration=array())
  159. {
  160. clsInlineContainer::clsInlineContainer('i', $aConfiguration);
  161. }
  162. }
  163. class clsBold extends clsInlineContainer
  164. {
  165. function clsBold($aConfiguration=array())
  166. {
  167. clsInlineContainer::clsInlineContainer('b', $aConfiguration);
  168. }
  169. }
  170. class clsBig extends clsInlineContainer
  171. {
  172. function clsBig($aConfiguration=array())
  173. {
  174. clsInlineContainer::clsInlineContainer('big', $aConfiguration);
  175. }
  176. }
  177. class clsSmall extends clsInlineContainer
  178. {
  179. function clsSmall($aConfiguration=array())
  180. {
  181. clsInlineContainer::clsInlineContainer('small', $aConfiguration);
  182. }
  183. }
  184. class clsIns extends clsInlineContainer
  185. {
  186. function clsIns($aConfiguration=array())
  187. {
  188. clsInlineContainer::clsInlineContainer('ins', $aConfiguration);
  189. }
  190. }
  191. class clsDel extends clsInlineContainer
  192. {
  193. function clsDel($aConfiguration=array())
  194. {
  195. clsInlineContainer::clsInlineContainer('del', $aConfiguration);
  196. }
  197. }
  198. class clsHeadline extends xajaxControlContainer
  199. {
  200. function clsHeadline($sType, $aConfiguration=array())
  201. {
  202. if (0 < strpos($sType, '123456'))
  203. trigger_error('Invalid type for headline control; should be 1,2,3,4,5 or 6.'
  204. . $this->backtrace(),
  205. E_USER_ERROR
  206. );
  207. xajaxControlContainer::xajaxControlContainer('h' . $sType, $aConfiguration);
  208. $this->sClass = '%inline';
  209. }
  210. }
  211. class clsAddress extends clsInlineContainer
  212. {
  213. function clsAddress($aConfiguration=array())
  214. {
  215. clsInlineContainer::clsInlineContainer('address', $aConfiguration);
  216. }
  217. }
  218. class clsParagraph extends clsInlineContainer
  219. {
  220. function clsParagraph($aConfiguration=array())
  221. {
  222. clsInlineContainer::clsInlineContainer('p', $aConfiguration);
  223. }
  224. }
  225. class clsBlockquote extends clsInlineContainer
  226. {
  227. function clsBlockquote($aConfiguration=array())
  228. {
  229. clsInlineContainer::clsInlineContainer('blockquote', $aConfiguration);
  230. }
  231. }
  232. class clsPre extends clsInlineContainer
  233. {
  234. function clsPre($aConfiguration=array())
  235. {
  236. clsInlineContainer::clsInlineContainer('pre', $aConfiguration);
  237. }
  238. }