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  /*
3  +----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +----------------------------------------------------------------------------+
22 */
23 
24 include_once "./Services/RTE/classes/class.ilRTE.php";
25 
35 class ilTinyMCE extends ilRTE
36 {
37  function ilTinyMCE()
38  {
39  parent::ilRTE();
40 
41  $this->plugins = array(
42  "ibrowser",
43  "xhtmlxtras",
44  "style",
45  "layer",
46  "table",
47  "save",
48  "advhr",
49  "advlink",
50  "emotions",
51  "iespell",
52  "insertdatetime",
53  "preview",
54  "searchreplace",
55  "print",
56  "contextmenu",
57  "paste",
58  "directionality",
59  "fullscreen",
60  "nonbreaking",
61  "noneditable",
62  "style"
63  );
64 
65  $this->setStyleSelect(false);
66  }
67 
75  protected $root_block_element = null;
76 
85  protected $disabled_buttons = array();
86 
95  /* moved to ilUtil::getNewContentStyleSheetLocation()
96  function getContentCSS()
97  {
98  global $ilias;
99 
100  if(defined("ILIAS_MODULE"))
101  {
102  $dir = ".";
103  }
104  else
105  {
106  $dir = "";
107  }
108  $in_style = "./templates/".$ilias->account->skin."/".$ilias->account->prefs["style"]."_cont.css";
109  //$in_skin = "./templates/".$ilias->account->skin."/tiny.css";
110  $default = "./templates/default/delos_cont.css";
111  if(@is_file($in_style))
112  {
113  return $dir.$in_style;
114  }
115  else
116  {
117  if (@is_file($in_skin))
118  {
119  return $dir.$in_skin;
120  }
121  else
122  {
123  return $dir.$default;
124  }
125  }
126  }*/
127 
136  function addRTESupport($obj_id, $obj_type, $a_module = "", $allowFormElements = FALSE, $cfg_template = null)
137  {
138  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
139  if (array_key_exists("show_rte", $_POST))
140  {
142  }
143 
144  include_once "./classes/class.ilTemplate.php";
146  {
147  $tpl = new ilTemplate(($cfg_template === null ? "tpl.tinymce.html" : $cfg_template), true, true, "Services/RTE");
148  $tags =& ilObjAdvancedEditing::_getUsedHTMLTags($a_module);
149  if ($allowFormElements)
150  {
151  $tpl->touchBlock("formelements");
152  }
153  $tpl->setCurrentBlock("tinymce");
154  $tpl->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce/tiny_mce.js");
155  include_once "./classes/class.ilObject.php";
156  $tpl->setVariable("OBJ_ID", $obj_id);
157  $tpl->setVariable("OBJ_TYPE", $obj_type);
158  $tpl->setVariable("CLIENT_ID", CLIENT_ID);
159  $tpl->setVariable("SESSION_ID", $_COOKIE["PHPSESSID"]);
160  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
161  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
162 
163  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
164  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
165  . ','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
166  . ($this->getStyleSelect() ? ',styleselect' : '');
167  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
168  $tpl->setVariable('BUTTONS_1', self::_removeRedundantSeparators($buttons_1));
169  $tpl->setVariable('BUTTONS_2', self::_removeRedundantSeparators($buttons_2));
170  $tpl->setVariable('BUTTONS_3', self::_removeRedundantSeparators($buttons_3));
171 
172  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
173  include_once "./Services/Utilities/classes/class.ilUtil.php";
174  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
175  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
176  $tpl->setVariable("LANG", $this->_getEditorLanguage());
177 
178  if($this->getRTERootBlockElement() !== null)
179  {
180  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
181  }
182 
183  $tpl->parseCurrentBlock();
184 
185  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
186  }
187 
188  if (strcmp(ilObjAdvancedEditing::_getRichTextEditor(), "0") != 0)
189  {
190  $tpl = new ilTemplate("tpl.rte.switch.html", true, true, "Services/RTE");
191  $tpl->setVariable("FORMACTION", $this->ctrl->getFormActionByClass($this->ctrl->getCmdClass()), $this->ctrl->getCmd());
192  $tpl->setVariable("TEXT_SET_MODE", $this->lng->txt("set_edit_mode"));
193  $tpl->setVariable("TEXT_ENABLED", $this->lng->txt("rte_editor_enabled"));
194  $tpl->setVariable("TEXT_DISABLED", $this->lng->txt("rte_editor_disabled"));
196  {
197  $tpl->setVariable("SELECTED_ENABLED", " selected=\"selected\"");
198  }
199  $tpl->setVariable("BTN_COMMAND", $this->ctrl->getCmd());
200 
201  $this->tpl->setVariable("RTE_SWITCH", $tpl->get());
202  }
203  }
204 
212  function addCustomRTESupport($obj_id, $obj_type, $tags)
213  {
214  include_once "./classes/class.ilTemplate.php";
215  $tpl = new ilTemplate("tpl.tinymce.html", true, true, "Services/RTE");
216  $tpl->setCurrentBlock("tinymce");
217  $tpl->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce/tiny_mce.js");
218  include_once "./classes/class.ilObject.php";
219  $tpl->setVariable("OBJ_ID", $obj_id);
220  $tpl->setVariable("OBJ_TYPE", $obj_type);
221  $tpl->setVariable("CLIENT_ID", CLIENT_ID);
222  $tpl->setVariable("SESSION_ID", $_COOKIE["PHPSESSID"]);
223  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
224  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
225 
226  $this->disableButtons('charmap');
227  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
228  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
229  . ','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
230  . ($this->getStyleSelect() ? ',styleselect' : '');
231  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
232  $tpl->setVariable('BUTTONS_1', self::_removeRedundantSeparators($buttons_1));
233  $tpl->setVariable('BUTTONS_2', self::_removeRedundantSeparators($buttons_2));
234  $tpl->setVariable('BUTTONS_3', self::_removeRedundantSeparators($buttons_3));
235 
236  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
237  include_once "./Services/Utilities/classes/class.ilUtil.php";
238  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
239  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation());
240  $tpl->setVariable("LANG", $this->_getEditorLanguage());
241 
242  if($this->getRTERootBlockElement() !== null)
243  {
244  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
245  }
246 
247  $tpl->parseCurrentBlock();
248  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
249  }
250 
259  function addUserTextEditor($editor_selector)
260  {
261  $validtags = array("strong","em","p", "br", "div", "span");
262  $buttontags = array("strong","em");
263  include_once "./classes/class.ilTemplate.php";
264  $template = new ilTemplate("tpl.usereditor.html", true, true, "Services/RTE");
265  $template->setCurrentBlock("tinymce");
266  $template->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce/tiny_mce.js");
267  include_once "./classes/class.ilObject.php";
268  $template->setVariable("SELECTOR", $editor_selector);
269  $template->setVariable("BLOCKFORMATS", "");
270  $template->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($validtags));
271  if ($this->getStyleSelect())
272  {
273  $template->setVariable("STYLE_SELECT", ",styleselect");
274  }
275  $template->setVariable("BUTTONS", $this->_buildButtonsFromHTMLTags($buttontags) . ",backcolor,removeformat");
276  include_once "./Services/Utilities/classes/class.ilUtil.php";
277  //$template->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
278  $template->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
279  $template->setVariable("LANG", $this->_getEditorLanguage());
280  $template->parseCurrentBlock();
281  $this->tpl->setCurrentBlock("HeadContent");
282  $this->tpl->setVariable("CONTENT_BLOCK", $template->get());
283  $this->tpl->parseCurrentBlock();
284  }
285 
291  function setStyleSelect($a_styleselect)
292  {
293  $this->styleselect = $a_styleselect;
294  }
295 
301  function getStyleSelect()
302  {
303  return $this->styleselect;
304  }
305 
306 
308  {
309  $blockformats = array();
310 
311  if (in_array("p", $a_html_tags))
312  {
313  array_push($blockformats, "p");
314  }
315  if (in_array("div", $a_html_tags))
316  {
317  array_push($blockformats, "div");
318  }
319  if (in_array("pre", $a_html_tags))
320  {
321  array_push($blockformats, "pre");
322  }
323  if (in_array("code", $a_html_tags))
324  {
325  array_push($blockformats, "code");
326  }
327  if (in_array("h1", $a_html_tags))
328  {
329  array_push($blockformats, "h1");
330  }
331  if (in_array("h2", $a_html_tags))
332  {
333  array_push($blockformats, "h2");
334  }
335  if (in_array("h3", $a_html_tags))
336  {
337  array_push($blockformats, "h3");
338  }
339  if (in_array("h4", $a_html_tags))
340  {
341  array_push($blockformats, "h4");
342  }
343  if (in_array("h5", $a_html_tags))
344  {
345  array_push($blockformats, "h5");
346  }
347  if (in_array("h6", $a_html_tags))
348  {
349  array_push($blockformats, "h6");
350  }
351  if (count($blockformats))
352  {
353  return join(",", $blockformats);
354  }
355  else
356  {
357  return "";
358  }
359  }
360 
361  function _buildAdvancedButtonsFromHTMLTags($a_buttons_section, $a_html_tags)
362  {
363  $theme_advanced_buttons = array();
364 
365  if($a_buttons_section == 1)
366  {
367  if (in_array("strong", $a_html_tags))
368  {
369  array_push($theme_advanced_buttons, "bold");
370  }
371  if (in_array("em", $a_html_tags))
372  {
373  array_push($theme_advanced_buttons, "italic");
374  }
375  if (in_array("u", $a_html_tags))
376  {
377  array_push($theme_advanced_buttons, "underline");
378  }
379  if (in_array("strike", $a_html_tags))
380  {
381  array_push($theme_advanced_buttons, "strikethrough");
382  }
383  if (count($theme_advanced_buttons))
384  {
385  array_push($theme_advanced_buttons, "separator");
386  }
387  if (in_array("p", $a_html_tags))
388  {
389  array_push($theme_advanced_buttons, "justifyleft");
390  array_push($theme_advanced_buttons, "justifycenter");
391  array_push($theme_advanced_buttons, "justifyright");
392  array_push($theme_advanced_buttons, "justifyfull");
393  array_push($theme_advanced_buttons, "separator");
394  }
395  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags)))
396  {
397  array_push($theme_advanced_buttons, "formatselect");
398  }
399  if (in_array("hr", $a_html_tags))
400  {
401  array_push($theme_advanced_buttons, "hr");
402  }
403  array_push($theme_advanced_buttons, "removeformat");
404  array_push($theme_advanced_buttons, "separator");
405  if (in_array("sub", $a_html_tags))
406  {
407  array_push($theme_advanced_buttons, "sub");
408  }
409  if (in_array("sup", $a_html_tags))
410  {
411  array_push($theme_advanced_buttons, "sup");
412  }
413  if (in_array("font", $a_html_tags))
414  {
415  array_push($theme_advanced_buttons, "fontselect");
416  array_push($theme_advanced_buttons, "fontsizeselect");
417  }
418  array_push($theme_advanced_buttons, "charmap");
419  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags)))
420  {
421  array_push($theme_advanced_buttons, "bullist");
422  }
423  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags)))
424  {
425  array_push($theme_advanced_buttons, "numlist");
426  }
427  array_push($theme_advanced_buttons, "separator");
428  if (in_array("cite", $a_html_tags))
429  {
430  array_push($theme_advanced_buttons, "cite");
431  }
432  if (in_array("abbr", $a_html_tags))
433  {
434  array_push($theme_advanced_buttons, "abbr");
435  }
436  if (in_array("acronym", $a_html_tags))
437  {
438  array_push($theme_advanced_buttons, "acronym");
439  }
440  if (in_array("del", $a_html_tags))
441  {
442  array_push($theme_advanced_buttons, "del");
443  }
444  if (in_array("ins", $a_html_tags))
445  {
446  array_push($theme_advanced_buttons, "ins");
447  }
448  if (in_array("blockquote", $a_html_tags))
449  {
450  array_push($theme_advanced_buttons, "indent");
451  array_push($theme_advanced_buttons, "outdent");
452  }
453  if (in_array("img", $a_html_tags))
454  {
455  //array_push($theme_advanced_buttons, "advimage");
456  array_push($theme_advanced_buttons, "image");
457  array_push($theme_advanced_buttons, "ibrowser");
458  }
459  if (in_array("a", $a_html_tags))
460  {
461  array_push($theme_advanced_buttons, "link");
462  array_push($theme_advanced_buttons, "unlink");
463  array_push($theme_advanced_buttons, "anchor");
464  }
465  array_push($theme_advanced_buttons, "separator");
466  array_push($theme_advanced_buttons, "undo");
467  array_push($theme_advanced_buttons, "redo");
468 
469  if(is_array($this->buttons) && count($this->buttons))
470  {
471  array_push($theme_advanced_buttons, "separator");
472  foreach($this->buttons as $button)
473  {
474  array_push($theme_advanced_buttons, $button);
475  }
476  }
477 
478  array_push($theme_advanced_buttons, "code");
479  array_push($theme_advanced_buttons, "fullscreen");
480  }
481  else if($a_buttons_section == 2)
482  {
483  array_push($theme_advanced_buttons, "cut");
484  array_push($theme_advanced_buttons, "copy");
485  array_push($theme_advanced_buttons, "paste");
486  array_push($theme_advanced_buttons, "pastetext");
487  array_push($theme_advanced_buttons, "pasteword");
488  }
489  else if($a_buttons_section == 3)
490  {
491  }
492 
493  $remove_buttons = $this->getDisabledButtons();
494  if (is_array($remove_buttons))
495  {
496  foreach ($remove_buttons as $buttontext)
497  {
498  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
499  {
500  unset($theme_advanced_buttons[$res]);
501  }
502  }
503  }
504 
505  return join(",", $theme_advanced_buttons);
506  }
507 
508  function _buildButtonsFromHTMLTags($a_html_tags)
509  {
510  $theme_advanced_buttons = array();
511  if (in_array("strong", $a_html_tags))
512  {
513  array_push($theme_advanced_buttons, "bold");
514  }
515  if (in_array("em", $a_html_tags))
516  {
517  array_push($theme_advanced_buttons, "italic");
518  }
519  if (in_array("u", $a_html_tags))
520  {
521  array_push($theme_advanced_buttons, "underline");
522  }
523  if (in_array("strike", $a_html_tags))
524  {
525  array_push($theme_advanced_buttons, "strikethrough");
526  }
527  if (in_array("p", $a_html_tags))
528  {
529  array_push($theme_advanced_buttons, "justifyleft");
530  array_push($theme_advanced_buttons, "justifycenter");
531  array_push($theme_advanced_buttons, "justifyright");
532  array_push($theme_advanced_buttons, "justifyfull");
533  }
534  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags)))
535  {
536  array_push($theme_advanced_buttons, "formatselect");
537  }
538  if (in_array("hr", $a_html_tags))
539  {
540  array_push($theme_advanced_buttons, "hr");
541  }
542  if (in_array("sub", $a_html_tags))
543  {
544  array_push($theme_advanced_buttons, "sub");
545  }
546  if (in_array("sup", $a_html_tags))
547  {
548  array_push($theme_advanced_buttons, "sup");
549  }
550  if (in_array("font", $a_html_tags))
551  {
552  array_push($theme_advanced_buttons, "fontselect");
553  array_push($theme_advanced_buttons, "fontsizeselect");
554  }
555  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags)))
556  {
557  array_push($theme_advanced_buttons, "bullist");
558  }
559  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags)))
560  {
561  array_push($theme_advanced_buttons, "numlist");
562  }
563  if (in_array("cite", $a_html_tags))
564  {
565  array_push($theme_advanced_buttons, "cite");
566  }
567  if (in_array("abbr", $a_html_tags))
568  {
569  array_push($theme_advanced_buttons, "abbr");
570  }
571  if (in_array("acronym", $a_html_tags))
572  {
573  array_push($theme_advanced_buttons, "acronym");
574  }
575  if (in_array("del", $a_html_tags))
576  {
577  array_push($theme_advanced_buttons, "del");
578  }
579  if (in_array("ins", $a_html_tags))
580  {
581  array_push($theme_advanced_buttons, "ins");
582  }
583  if (in_array("blockquote", $a_html_tags))
584  {
585  array_push($theme_advanced_buttons, "indent");
586  array_push($theme_advanced_buttons, "outdent");
587  }
588  if (in_array("img", $a_html_tags))
589  {
590  //array_push($theme_advanced_buttons, "advimage");
591  array_push($theme_advanced_buttons, "image");
592  array_push($theme_advanced_buttons, "ibrowser");
593  }
594  if (in_array("a", $a_html_tags))
595  {
596  array_push($theme_advanced_buttons, "link");
597  array_push($theme_advanced_buttons, "unlink");
598  array_push($theme_advanced_buttons, "anchor");
599  }
600 
601  $remove_buttons = $this->getDisabledButtons();
602  if (is_array($remove_buttons))
603  {
604  foreach ($remove_buttons as $buttontext)
605  {
606  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
607  {
608  unset($theme_advanced_buttons[$res]);
609  }
610  }
611  }
612 
613  return join(",", $theme_advanced_buttons);
614  }
615 
617  {
618  $theme_advanced_buttons = array();
619  if (in_array("table", $a_html_tags) && in_array("tr", $a_html_tags) && in_array("td", $a_html_tags))
620  {
621  array_push($theme_advanced_buttons, "tablecontrols");
622  }
623 
624  $remove_buttons = $this->getDisabledButtons();
625  if (is_array($remove_buttons))
626  {
627  foreach ($remove_buttons as $buttontext)
628  {
629  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
630  {
631  unset($theme_advanced_buttons[$res]);
632  }
633  }
634  }
635 
636  return join(",", $theme_advanced_buttons);
637  }
638 
640  {
641  global $ilUser;
642  $lang = $ilUser->getLanguage();
643  if (file_exists("./Services/RTE/tiny_mce/langs/$lang.js"))
644  {
645  return "$lang";
646  }
647  else
648  {
649  return "en";
650  }
651  }
652 
653  function _getValidElementsFromHTMLTags($a_html_tags)
654  {
655  $valid_elements = array();
656  foreach ($a_html_tags as $tag)
657  {
658  switch ($tag)
659  {
660  case "a":
661  array_push($valid_elements, "a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name"
662  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
663  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev"
664  ."|shape<circle?default?poly?rect|style|tabindex|title|target|type]");
665  break;
666  case "abbr":
667  array_push($valid_elements, "abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
668  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
669  ."|title]");
670  break;
671  case "acronym":
672  array_push($valid_elements, "acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress"
673  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
674  ."|title]");
675  break;
676  case "address":
677  array_push($valid_elements, "address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
678  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
679  ."|onmouseup|style|title]");
680  break;
681  case "applet":
682  array_push($valid_elements, "applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase"
683  ."|height|hspace|id|name|object|style|title|vspace|width]");
684  break;
685  case "area":
686  array_push($valid_elements, "area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref"
687  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
688  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup"
689  ."|shape<circle?default?poly?rect|style|tabindex|title|target]");
690  break;
691  case "base":
692  array_push($valid_elements, "base[href|target]");
693  break;
694  case "basefont":
695  array_push($valid_elements, "basefont[color|face|id|size]");
696  break;
697  case "bdo":
698  array_push($valid_elements, "bdo[class|dir<ltr?rtl|id|lang|style|title]");
699  break;
700  case "big":
701  array_push($valid_elements, "big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
702  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
703  ."|title]");
704  break;
705  case "blockquote":
706  array_push($valid_elements, "blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
707  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
708  ."|onmouseover|onmouseup|style|title]");
709  break;
710  case "body":
711  array_push($valid_elements, "body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick"
712  ."|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove"
713  ."|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]");
714  break;
715  case "br":
716  array_push($valid_elements, "br[class|clear<all?left?none?right|id|style|title]");
717  break;
718  case "button":
719  array_push($valid_elements, "button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur"
720  ."|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown"
721  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type"
722  ."|value]");
723  break;
724  case "caption":
725  array_push($valid_elements, "caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick"
726  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
727  ."|onmouseout|onmouseover|onmouseup|style|title]");
728  break;
729  case "center":
730  array_push($valid_elements, "center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
731  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
732  ."|title]");
733  break;
734  case "cite":
735  array_push($valid_elements, "cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
736  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
737  ."|title]");
738  break;
739  case "code":
740  array_push($valid_elements, "code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
741  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
742  ."|title]");
743  break;
744  case "col":
745  array_push($valid_elements, "col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
746  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
747  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
748  ."|valign<baseline?bottom?middle?top|width]");
749  break;
750  case "colgroup":
751  array_push($valid_elements, "colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl"
752  ."|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
753  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
754  ."|valign<baseline?bottom?middle?top|width]");
755  break;
756  case "dd":
757  array_push($valid_elements, "dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
758  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
759  break;
760  case "del":
761  array_push($valid_elements, "del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
762  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
763  ."|onmouseup|style|title]");
764  break;
765  case "dfn":
766  array_push($valid_elements, "dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
767  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
768  ."|title]");
769  break;
770  case "dir":
771  array_push($valid_elements, "dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
772  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
773  ."|onmouseup|style|title]");
774  break;
775  case "div":
776  array_push($valid_elements, "div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
777  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
778  ."|onmouseout|onmouseover|onmouseup|style|title]");
779  break;
780  case "dl":
781  array_push($valid_elements, "dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
782  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
783  ."|onmouseup|style|title]");
784  break;
785  case "dt":
786  array_push($valid_elements, "dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
787  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
788  break;
789  case "em":
790  array_push($valid_elements, "em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
791  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
792  ."|title]");
793  break;
794  case "fieldset":
795  array_push($valid_elements, "fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
796  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
797  ."|title]");
798  break;
799  case "font":
800  array_push($valid_elements, "font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
801  break;
802  case "form":
803  array_push($valid_elements, "form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang"
804  ."|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
805  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit"
806  ."|style|title|target]");
807  break;
808  case "frame":
809  array_push($valid_elements, "frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
810  ."|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
811  break;
812  case "frameset":
813  array_push($valid_elements, "frameset[class|cols|id|onload|onunload|rows|style|title]");
814  break;
815  case "h1":
816  array_push($valid_elements, "h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
817  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
818  ."|onmouseout|onmouseover|onmouseup|style|title]");
819  break;
820  case "h2":
821  array_push($valid_elements, "h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
822  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
823  ."|onmouseout|onmouseover|onmouseup|style|title]");
824  break;
825  case "h3":
826  array_push($valid_elements, "h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
827  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
828  ."|onmouseout|onmouseover|onmouseup|style|title]");
829  break;
830  case "h4":
831  array_push($valid_elements, "h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
832  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
833  ."|onmouseout|onmouseover|onmouseup|style|title]");
834  break;
835  case "h5":
836  array_push($valid_elements, "h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
837  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
838  ."|onmouseout|onmouseover|onmouseup|style|title]");
839  break;
840  case "h6":
841  array_push($valid_elements, "h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
842  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
843  ."|onmouseout|onmouseover|onmouseup|style|title]");
844  break;
845  case "head":
846  array_push($valid_elements, "head[dir<ltr?rtl|lang|profile]");
847  break;
848  case "hr":
849  array_push($valid_elements, "hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick"
850  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
851  ."|onmouseout|onmouseover|onmouseup|size|style|title|width]");
852  break;
853  case "html":
854  array_push($valid_elements, "html[dir<ltr?rtl|lang|version]");
855  break;
856  case "iframe":
857  array_push($valid_elements, "iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"
858  ."|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"
859  ."|title|width]");
860  break;
861  case "img":
862  array_push($valid_elements, "img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
863  ."|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
864  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
865  ."|onmouseup|src|style|title|usemap|vspace|width]");
866  break;
867  case "input":
868  array_push($valid_elements, "input[accept|accesskey|align<bottom?left?middle?right?top|alt"
869  ."|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang"
870  ."|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress"
871  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
872  ."|readonly<readonly|size|src|style|tabindex|title"
873  ."|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text"
874  ."|usemap|value]");
875  break;
876  case "ins":
877  array_push($valid_elements, "ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
878  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
879  ."|onmouseup|style|title]");
880  break;
881  case "isindex":
882  array_push($valid_elements, "isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
883  break;
884  case "kbd":
885  array_push($valid_elements, "kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
886  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
887  ."|title]");
888  break;
889  case "label":
890  array_push($valid_elements, "label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick"
891  ."|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
892  ."|onmouseover|onmouseup|style|title]");
893  break;
894  case "legend":
895  array_push($valid_elements, "legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang"
896  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
897  ."|onmouseout|onmouseover|onmouseup|style|title]");
898  break;
899  case "li":
900  array_push($valid_elements, "li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
901  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type"
902  ."|value]");
903  break;
904  case "link":
905  array_push($valid_elements, "link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick"
906  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
907  ."|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]");
908  break;
909  case "map":
910  array_push($valid_elements, "map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress"
911  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
912  ."|title]");
913  break;
914  case "menu":
915  array_push($valid_elements, "menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
916  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
917  ."|onmouseup|style|title]");
918  break;
919  case "meta":
920  array_push($valid_elements, "meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
921  break;
922  case "noframes":
923  array_push($valid_elements, "noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
924  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
925  ."|title]");
926  break;
927  case "noscript":
928  array_push($valid_elements, "noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
929  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
930  ."|title]");
931  break;
932  case "object":
933  array_push($valid_elements, "object[align<bottom?left?middle?right?top|archive|border|class|classid"
934  ."|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name"
935  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
936  ."|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap"
937  ."|vspace|width]");
938  break;
939  case "ol":
940  array_push($valid_elements, "ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
941  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
942  ."|onmouseup|start|style|title|type]");
943  break;
944  case "optgroup":
945  array_push($valid_elements, "optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick"
946  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
947  ."|onmouseout|onmouseover|onmouseup|style|title]");
948  break;
949  case "option":
950  array_push($valid_elements, "option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick"
951  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
952  ."|onmouseover|onmouseup|selected<selected|style|title|value]");
953  break;
954  case "p":
955  array_push($valid_elements, "p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
956  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
957  ."|onmouseout|onmouseover|onmouseup|style|title]");
958  break;
959  case "param":
960  array_push($valid_elements, "param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
961  break;
962  case "pre":
963  case "listing":
964  case "plaintext":
965  case "xmp":
966  array_push($valid_elements, "pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
967  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
968  ."|onmouseover|onmouseup|style|title|width]");
969  break;
970  case "q":
971  array_push($valid_elements, "q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
972  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
973  ."|title]");
974  break;
975  case "s":
976  array_push($valid_elements, "s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
977  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
978  break;
979  case "samp":
980  array_push($valid_elements, "samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
981  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
982  ."|title]");
983  break;
984  case "script":
985  array_push($valid_elements, "script[charset|defer|language|src|type]");
986  break;
987  case "select":
988  array_push($valid_elements, "select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name"
989  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
990  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style"
991  ."|tabindex|title]");
992  break;
993  case "small":
994  array_push($valid_elements, "small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
995  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
996  ."|title]");
997  break;
998  case "span":
999  array_push($valid_elements, "span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1000  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1001  ."|onmouseup|style|title]");
1002  break;
1003  case "strike":
1004  array_push($valid_elements, "strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1005  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1006  ."|onmouseup|style|title]");
1007  break;
1008  case "strong":
1009  array_push($valid_elements, "strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1010  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1011  ."|title]");
1012  break;
1013  case "style":
1014  array_push($valid_elements, "style[dir<ltr?rtl|lang|media|title|type]");
1015  break;
1016  case "sub":
1017  array_push($valid_elements, "sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1018  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1019  ."|title]");
1020  break;
1021  case "sup":
1022  array_push($valid_elements, "sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1023  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1024  ."|title]");
1025  break;
1026  case "table":
1027  array_push($valid_elements, "table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class"
1028  ."|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1029  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules"
1030  ."|style|summary|title|width]");
1031  break;
1032  case "tbody":
1033  array_push($valid_elements, "tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id"
1034  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1035  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1036  ."|valign<baseline?bottom?middle?top]");
1037  break;
1038  case "td":
1039  array_push($valid_elements, "td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1040  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1041  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1042  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1043  ."|style|title|valign<baseline?bottom?middle?top|width]");
1044  break;
1045  case "textarea":
1046  array_push($valid_elements, "textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name"
1047  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
1048  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
1049  ."|readonly<readonly|rows|style|tabindex|title]");
1050  break;
1051  case "tfoot":
1052  array_push($valid_elements, "tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1053  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1054  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1055  ."|valign<baseline?bottom?middle?top]");
1056  break;
1057  case "th":
1058  array_push($valid_elements, "th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1059  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1060  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1061  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1062  ."|style|title|valign<baseline?bottom?middle?top|width]");
1063  break;
1064  case "thead":
1065  array_push($valid_elements, "thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1066  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1067  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1068  ."|valign<baseline?bottom?middle?top]");
1069  break;
1070  case "title":
1071  array_push($valid_elements, "title[dir<ltr?rtl|lang]");
1072  break;
1073  case "tr":
1074  array_push($valid_elements, "tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class"
1075  ."|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1076  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1077  ."|title|valign<baseline?bottom?middle?top]");
1078  break;
1079  case "tt":
1080  array_push($valid_elements, "tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1081  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1082  break;
1083  case "u":
1084  array_push($valid_elements, "u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1085  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1086 
1087  // Bugfix #5945: Necessary because TinyMCE does not use the "u"
1088  // html element but <span style="text-decoration: underline">E</span>
1089  array_push($valid_elements, "span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1090  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1091  ."|onmouseup|style|title]");
1092  break;
1093  case "ul":
1094  array_push($valid_elements, "ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1095  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1096  ."|onmouseup|style|title|type]");
1097  break;
1098  case "var":
1099  array_push($valid_elements, "var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1100  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1101  ."|title]");
1102  break;
1103  }
1104  }
1105  return join(",", $valid_elements);
1106  }
1107 
1115  public function setRTERootBlockElement($a_root_block_element)
1116  {
1117  $this->root_block_element = $a_root_block_element;
1118  return $this;
1119  }
1120 
1127  public function getRTERootBlockElement()
1128  {
1130  }
1131 
1140  public function disableButtons($a_button)
1141  {
1142  if(is_array($a_button))
1143  {
1144  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
1145  }
1146  else
1147  {
1148  $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
1149  }
1150 
1151  return $this;
1152  }
1153 
1162  public function getDisabledButtons($as_array = true)
1163  {
1164  if(!$as_array)
1165  {
1166  return implode(',', $this->disabled_buttons);
1167  }
1168  else
1169  {
1170  return $this->disabled_buttons;
1171  }
1172  }
1173 
1183  public static function _removeRedundantSeparators($a_string)
1184  {
1185  while(strpos($a_string, 'separator,separator') !== false)
1186  {
1187  $a_string = str_replace('separator,separator', 'separator', $a_string);
1188  }
1189 
1190  while(strpos($a_string, ',,') !== false)
1191  {
1192  $a_string = str_replace(',,', ',', $a_string);
1193  }
1194 
1195  if($a_string{0} == ',')
1196  {
1197  $a_string = (string)substr($a_string, 1);
1198  }
1199 
1200  if(strlen($a_string) && $a_string{strlen($a_string) - 1} == ',')
1201  {
1202  $a_string = substr($a_string, 0, strlen($a_string) - 1);
1203  }
1204 
1205  return $a_string;
1206  }
1207 }
1208 ?>