PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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