ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTinyMCE.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
14 class ilTinyMCE
15 {
16  function ilTinyMCE ()
17  {
18  return;
19  }
20 
22  {
23  $blockformats = array();
24 
25  if (in_array("p", $a_html_tags))
26  {
27  array_push($blockformats, "p");
28  }
29  if (in_array("div", $a_html_tags))
30  {
31  array_push($blockformats, "div");
32  }
33  if (in_array("pre", $a_html_tags))
34  {
35  array_push($blockformats, "pre");
36  }
37  if (in_array("code", $a_html_tags))
38  {
39  array_push($blockformats, "code");
40  }
41  if (in_array("h1", $a_html_tags))
42  {
43  array_push($blockformats, "h1");
44  }
45  if (in_array("h2", $a_html_tags))
46  {
47  array_push($blockformats, "h2");
48  }
49  if (in_array("h3", $a_html_tags))
50  {
51  array_push($blockformats, "h3");
52  }
53  if (in_array("h4", $a_html_tags))
54  {
55  array_push($blockformats, "h4");
56  }
57  if (in_array("h5", $a_html_tags))
58  {
59  array_push($blockformats, "h5");
60  }
61  if (in_array("h6", $a_html_tags))
62  {
63  array_push($blockformats, "h6");
64  }
65  if (count($blockformats))
66  {
67  return join(",", $blockformats);
68  }
69  else
70  {
71  return "";
72  }
73  }
74 
75  function _buildAdvancedButtonsFromHTMLTags($a_html_tags)
76  {
77  $theme_advanced_buttons = array();
78  if (in_array("strong", $a_html_tags))
79  {
80  array_push($theme_advanced_buttons, "bold");
81  }
82  if (in_array("em", $a_html_tags))
83  {
84  array_push($theme_advanced_buttons, "italic");
85  }
86  if (in_array("u", $a_html_tags))
87  {
88  array_push($theme_advanced_buttons, "underline");
89  }
90  if (in_array("strike", $a_html_tags))
91  {
92  array_push($theme_advanced_buttons, "strikethrough");
93  }
94  if (count($theme_advanced_buttons))
95  {
96  array_push($theme_advanced_buttons, "separator");
97  }
98  if (in_array("p", $a_html_tags))
99  {
100  array_push($theme_advanced_buttons, "justifyleft");
101  array_push($theme_advanced_buttons, "justifycenter");
102  array_push($theme_advanced_buttons, "justifyright");
103  array_push($theme_advanced_buttons, "justifyfull");
104  array_push($theme_advanced_buttons, "separator");
105  }
106  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags)))
107  {
108  array_push($theme_advanced_buttons, "formatselect");
109  }
110  if (in_array("hr", $a_html_tags))
111  {
112  array_push($theme_advanced_buttons, "hr");
113  }
114  array_push($theme_advanced_buttons, "removeformat");
115  array_push($theme_advanced_buttons, "separator");
116  if (in_array("sub", $a_html_tags))
117  {
118  array_push($theme_advanced_buttons, "sub");
119  }
120  if (in_array("sup", $a_html_tags))
121  {
122  array_push($theme_advanced_buttons, "sup");
123  }
124  array_push($theme_advanced_buttons, "charmap");
125  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags)))
126  {
127  array_push($theme_advanced_buttons, "bullist");
128  }
129  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags)))
130  {
131  array_push($theme_advanced_buttons, "numlist");
132  }
133  array_push($theme_advanced_buttons, "separator");
134  if (in_array("cite", $a_html_tags))
135  {
136  array_push($theme_advanced_buttons, "cite");
137  }
138  if (in_array("abbr", $a_html_tags))
139  {
140  array_push($theme_advanced_buttons, "abbr");
141  }
142  if (in_array("acronym", $a_html_tags))
143  {
144  array_push($theme_advanced_buttons, "acronym");
145  }
146  if (in_array("del", $a_html_tags))
147  {
148  array_push($theme_advanced_buttons, "del");
149  }
150  if (in_array("ins", $a_html_tags))
151  {
152  array_push($theme_advanced_buttons, "ins");
153  }
154  if (in_array("blockquote", $a_html_tags))
155  {
156  array_push($theme_advanced_buttons, "indent");
157  array_push($theme_advanced_buttons, "outdent");
158  }
159  if (in_array("a", $a_html_tags))
160  {
161  array_push($theme_advanced_buttons, "link");
162  array_push($theme_advanced_buttons, "unlink");
163  array_push($theme_advanced_buttons, "anchor");
164  }
165  array_push($theme_advanced_buttons, "separator");
166  array_push($theme_advanced_buttons, "undo");
167  array_push($theme_advanced_buttons, "redo");
168  return join(",", $theme_advanced_buttons);
169  }
170 
172  {
173  global $ilUser;
174  $lang = $ilUser->getLanguage();
175  //if (file_exists(ilUtil::getJSPath("tiny_mce/langs/$lang.js")))
176  //{
177  // return "$lang";
178  //}
179  //else
180  //{
181  return "en";
182  //}
183  }
184 
185  function _getValidElementsFromHTMLTags($a_html_tags)
186  {
187  $valid_elements = array();
188  foreach ($a_html_tags as $tag)
189  {
190  switch ($tag)
191  {
192  case "a":
193  array_push($valid_elements, "a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name"
194  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
195  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev"
196  ."|shape<circle?default?poly?rect|style|tabindex|title|target|type]");
197  break;
198  case "abbr":
199  array_push($valid_elements, "abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
200  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
201  ."|title]");
202  break;
203  case "acronym":
204  array_push($valid_elements, "acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress"
205  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
206  ."|title]");
207  break;
208  case "address":
209  array_push($valid_elements, "address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
210  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
211  ."|onmouseup|style|title]");
212  break;
213  case "applet":
214  array_push($valid_elements, "applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase"
215  ."|height|hspace|id|name|object|style|title|vspace|width]");
216  break;
217  case "area":
218  array_push($valid_elements, "area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref"
219  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
220  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup"
221  ."|shape<circle?default?poly?rect|style|tabindex|title|target]");
222  break;
223  case "base":
224  array_push($valid_elements, "base[href|target]");
225  break;
226  case "basefont":
227  array_push($valid_elements, "basefont[color|face|id|size]");
228  break;
229  case "bdo":
230  array_push($valid_elements, "bdo[class|dir<ltr?rtl|id|lang|style|title]");
231  break;
232  case "big":
233  array_push($valid_elements, "big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
234  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
235  ."|title]");
236  break;
237  case "blockquote":
238  array_push($valid_elements, "blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
239  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
240  ."|onmouseover|onmouseup|style|title]");
241  break;
242  case "body":
243  array_push($valid_elements, "body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick"
244  ."|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove"
245  ."|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]");
246  break;
247  case "br":
248  array_push($valid_elements, "br[class|clear<all?left?none?right|id|style|title]");
249  break;
250  case "button":
251  array_push($valid_elements, "button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur"
252  ."|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown"
253  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type"
254  ."|value]");
255  break;
256  case "caption":
257  array_push($valid_elements, "caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick"
258  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
259  ."|onmouseout|onmouseover|onmouseup|style|title]");
260  break;
261  case "center":
262  array_push($valid_elements, "center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
263  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
264  ."|title]");
265  break;
266  case "cite":
267  array_push($valid_elements, "cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
268  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
269  ."|title]");
270  break;
271  case "code":
272  array_push($valid_elements, "code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
273  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
274  ."|title]");
275  break;
276  case "col":
277  array_push($valid_elements, "col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
278  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
279  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
280  ."|valign<baseline?bottom?middle?top|width]");
281  break;
282  case "colgroup":
283  array_push($valid_elements, "colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl"
284  ."|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
285  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
286  ."|valign<baseline?bottom?middle?top|width]");
287  break;
288  case "dd":
289  array_push($valid_elements, "dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
290  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
291  break;
292  case "del":
293  array_push($valid_elements, "del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
294  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
295  ."|onmouseup|style|title]");
296  break;
297  case "dfn":
298  array_push($valid_elements, "dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
299  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
300  ."|title]");
301  break;
302  case "dir":
303  array_push($valid_elements, "dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
304  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
305  ."|onmouseup|style|title]");
306  break;
307  case "div":
308  array_push($valid_elements, "div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
309  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
310  ."|onmouseout|onmouseover|onmouseup|style|title]");
311  break;
312  case "dl":
313  array_push($valid_elements, "dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
314  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
315  ."|onmouseup|style|title]");
316  break;
317  case "dt":
318  array_push($valid_elements, "dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
319  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
320  break;
321  case "em":
322  array_push($valid_elements, "em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
323  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
324  ."|title]");
325  break;
326  case "fieldset":
327  array_push($valid_elements, "fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
328  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
329  ."|title]");
330  break;
331  case "font":
332  array_push($valid_elements, "font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
333  break;
334  case "form":
335  array_push($valid_elements, "form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang"
336  ."|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
337  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit"
338  ."|style|title|target]");
339  break;
340  case "frame":
341  array_push($valid_elements, "frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
342  ."|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
343  break;
344  case "frameset":
345  array_push($valid_elements, "frameset[class|cols|id|onload|onunload|rows|style|title]");
346  break;
347  case "h1":
348  array_push($valid_elements, "h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
349  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
350  ."|onmouseout|onmouseover|onmouseup|style|title]");
351  break;
352  case "h2":
353  array_push($valid_elements, "h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
354  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
355  ."|onmouseout|onmouseover|onmouseup|style|title]");
356  break;
357  case "h3":
358  array_push($valid_elements, "h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
359  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
360  ."|onmouseout|onmouseover|onmouseup|style|title]");
361  break;
362  case "h4":
363  array_push($valid_elements, "h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
364  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
365  ."|onmouseout|onmouseover|onmouseup|style|title]");
366  break;
367  case "h5":
368  array_push($valid_elements, "h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
369  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
370  ."|onmouseout|onmouseover|onmouseup|style|title]");
371  break;
372  case "h6":
373  array_push($valid_elements, "h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
374  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
375  ."|onmouseout|onmouseover|onmouseup|style|title]");
376  break;
377  case "head":
378  array_push($valid_elements, "head[dir<ltr?rtl|lang|profile]");
379  break;
380  case "hr":
381  array_push($valid_elements, "hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick"
382  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
383  ."|onmouseout|onmouseover|onmouseup|size|style|title|width]");
384  break;
385  case "html":
386  array_push($valid_elements, "html[dir<ltr?rtl|lang|version]");
387  break;
388  case "iframe":
389  array_push($valid_elements, "iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"
390  ."|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"
391  ."|title|width]");
392  break;
393  case "img":
394  array_push($valid_elements, "img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
395  ."|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
396  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
397  ."|onmouseup|src|style|title|usemap|vspace|width]");
398  break;
399  case "input":
400  array_push($valid_elements, "input[accept|accesskey|align<bottom?left?middle?right?top|alt"
401  ."|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang"
402  ."|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress"
403  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
404  ."|readonly<readonly|size|src|style|tabindex|title"
405  ."|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text"
406  ."|usemap|value]");
407  break;
408  case "ins":
409  array_push($valid_elements, "ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
410  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
411  ."|onmouseup|style|title]");
412  break;
413  case "isindex":
414  array_push($valid_elements, "isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
415  break;
416  case "kbd":
417  array_push($valid_elements, "kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
418  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
419  ."|title]");
420  break;
421  case "label":
422  array_push($valid_elements, "label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick"
423  ."|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
424  ."|onmouseover|onmouseup|style|title]");
425  break;
426  case "legend":
427  array_push($valid_elements, "legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang"
428  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
429  ."|onmouseout|onmouseover|onmouseup|style|title]");
430  break;
431  case "li":
432  array_push($valid_elements, "li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
433  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type"
434  ."|value]");
435  break;
436  case "link":
437  array_push($valid_elements, "link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick"
438  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
439  ."|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]");
440  break;
441  case "map":
442  array_push($valid_elements, "map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress"
443  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
444  ."|title]");
445  break;
446  case "menu":
447  array_push($valid_elements, "menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
448  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
449  ."|onmouseup|style|title]");
450  break;
451  case "meta":
452  array_push($valid_elements, "meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
453  break;
454  case "noframes":
455  array_push($valid_elements, "noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
456  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
457  ."|title]");
458  break;
459  case "noscript":
460  array_push($valid_elements, "noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
461  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
462  ."|title]");
463  break;
464  case "object":
465  array_push($valid_elements, "object[align<bottom?left?middle?right?top|archive|border|class|classid"
466  ."|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name"
467  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
468  ."|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap"
469  ."|vspace|width]");
470  break;
471  case "ol":
472  array_push($valid_elements, "ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
473  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
474  ."|onmouseup|start|style|title|type]");
475  break;
476  case "optgroup":
477  array_push($valid_elements, "optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick"
478  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
479  ."|onmouseout|onmouseover|onmouseup|style|title]");
480  break;
481  case "option":
482  array_push($valid_elements, "option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick"
483  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
484  ."|onmouseover|onmouseup|selected<selected|style|title|value]");
485  break;
486  case "p":
487  array_push($valid_elements, "p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
488  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
489  ."|onmouseout|onmouseover|onmouseup|style|title]");
490  break;
491  case "param":
492  array_push($valid_elements, "param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
493  break;
494  case "pre":
495  case "listing":
496  case "plaintext":
497  case "xmp":
498  array_push($valid_elements, "pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
499  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
500  ."|onmouseover|onmouseup|style|title|width]");
501  break;
502  case "q":
503  array_push($valid_elements, "q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
504  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
505  ."|title]");
506  break;
507  case "s":
508  array_push($valid_elements, "s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
509  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
510  break;
511  case "samp":
512  array_push($valid_elements, "samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
513  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
514  ."|title]");
515  break;
516  case "script":
517  array_push($valid_elements, "script[charset|defer|language|src|type]");
518  break;
519  case "select":
520  array_push($valid_elements, "select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name"
521  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
522  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style"
523  ."|tabindex|title]");
524  break;
525  case "small":
526  array_push($valid_elements, "small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
527  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
528  ."|title]");
529  break;
530  case "span":
531  array_push($valid_elements, "span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
532  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
533  ."|onmouseup|style|title]");
534  break;
535  case "strike":
536  array_push($valid_elements, "strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
537  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
538  ."|onmouseup|style|title]");
539  break;
540  case "strong":
541  array_push($valid_elements, "strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
542  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
543  ."|title]");
544  break;
545  case "style":
546  array_push($valid_elements, "style[dir<ltr?rtl|lang|media|title|type]");
547  break;
548  case "sub":
549  array_push($valid_elements, "sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
550  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
551  ."|title]");
552  break;
553  case "sup":
554  array_push($valid_elements, "sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
555  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
556  ."|title]");
557  break;
558  case "table":
559  array_push($valid_elements, "table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class"
560  ."|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress"
561  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules"
562  ."|style|summary|title|width]");
563  break;
564  case "tbody":
565  array_push($valid_elements, "tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id"
566  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
567  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
568  ."|valign<baseline?bottom?middle?top]");
569  break;
570  case "td":
571  array_push($valid_elements, "td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
572  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
573  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
574  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
575  ."|style|title|valign<baseline?bottom?middle?top|width]");
576  break;
577  case "textarea":
578  array_push($valid_elements, "textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name"
579  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
580  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
581  ."|readonly<readonly|rows|style|tabindex|title]");
582  break;
583  case "tfoot":
584  array_push($valid_elements, "tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
585  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
586  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
587  ."|valign<baseline?bottom?middle?top]");
588  break;
589  case "th":
590  array_push($valid_elements, "th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
591  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
592  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
593  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
594  ."|style|title|valign<baseline?bottom?middle?top|width]");
595  break;
596  case "thead":
597  array_push($valid_elements, "thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
598  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
599  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
600  ."|valign<baseline?bottom?middle?top]");
601  break;
602  case "title":
603  array_push($valid_elements, "title[dir<ltr?rtl|lang]");
604  break;
605  case "tr":
606  array_push($valid_elements, "tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class"
607  ."|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
608  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
609  ."|title|valign<baseline?bottom?middle?top]");
610  break;
611  case "tt":
612  array_push($valid_elements, "tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
613  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
614  break;
615  case "u":
616  array_push($valid_elements, "u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
617  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
618  break;
619  case "ul":
620  array_push($valid_elements, "ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
621  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
622  ."|onmouseup|style|title|type]");
623  break;
624  case "var":
625  array_push($valid_elements, "var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
626  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
627  ."|title]");
628  break;
629  }
630  }
631  return join(",", $valid_elements);
632  }
633 }
634 ?>