24 include_once
"./Services/RTE/classes/class.ilRTE.php";
56 $this->version = $a_version;
57 $this->
vd =
"_3_3_9_2";
61 $this->version = $a_version;
66 $this->plugins = array(
90 $this->addInternalTinyMCEImageManager();
96 public function addInternalTinyMCEImageManager()
101 global $ilClientIniFile;
103 if(!$ilClientIniFile->readVariable(
'tinymce',
'use_advanced_img_mng'))
133 $this->addInternalTinyMCEImageManager();
136 protected function handleIliasImageManagerRemoved()
141 global $ilClientIniFile;
143 if(!$ilClientIniFile->readVariable(
'tinymce',
'use_advanced_img_mng'))
160 if(self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name)
175 if(self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name)
177 $this->handleIliasImageManagerRemoved();
254 function addRTESupport($obj_id, $obj_type, $a_module =
"", $allowFormElements = FALSE, $cfg_template = null, $hide_switch =
false)
258 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
266 if($ilBrowser->isMobile())
275 include_once
"./Services/UICore/classes/class.ilTemplate.php";
278 $tpl =
new ilTemplate(($cfg_template === null ?
"tpl.tinymce.html" : $cfg_template),
true,
true,
"Services/RTE");
281 if ($allowFormElements)
283 $tpl->touchBlock(
"formelements");
285 $tpl->setCurrentBlock(
"tinymce");
286 $tpl->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce".$this->
vd.
"/tiny_mce.js");
287 include_once
"./Services/Object/classes/class.ilObject.php";
288 $tpl->setVariable(
"OBJ_ID", $obj_id);
289 $tpl->setVariable(
"OBJ_TYPE", $obj_type);
290 $tpl->setVariable(
"CLIENT_ID", CLIENT_ID);
297 .
','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
300 $tpl->setVariable(
'BUTTONS_1', self::_removeRedundantSeparators($buttons_1));
301 $tpl->setVariable(
'BUTTONS_2', self::_removeRedundantSeparators($buttons_2));
302 $tpl->setVariable(
'BUTTONS_3', self::_removeRedundantSeparators($buttons_3));
304 $tpl->setVariable(
"ADDITIONAL_PLUGINS", join(
",", $this->plugins));
305 include_once
"./Services/Utilities/classes/class.ilUtil.php";
315 $tpl->parseCurrentBlock();
317 $this->tpl->setVariable(
"CONTENT_BLOCK",
$tpl->get());
343 $tpl->touchBlock(remove_img_context_menu_item);
356 include_once
"./Services/UICore/classes/class.ilTemplate.php";
357 $tpl =
new ilTemplate(
"tpl.tinymce.html",
true,
true,
"Services/RTE");
359 $tpl->setCurrentBlock(
"tinymce");
360 $tpl->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce".$this->
vd.
"/tiny_mce.js");
361 include_once
"./Services/Object/classes/class.ilObject.php";
362 $tpl->setVariable(
"OBJ_ID", $obj_id);
363 $tpl->setVariable(
"OBJ_TYPE", $obj_type);
364 $tpl->setVariable(
"CLIENT_ID", CLIENT_ID);
372 .
','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
375 $tpl->setVariable(
'BUTTONS_1', self::_removeRedundantSeparators($buttons_1));
376 $tpl->setVariable(
'BUTTONS_2', self::_removeRedundantSeparators($buttons_2));
377 $tpl->setVariable(
'BUTTONS_3', self::_removeRedundantSeparators($buttons_3));
379 $tpl->setVariable(
"ADDITIONAL_PLUGINS", join(
",", $this->plugins));
380 include_once
"./Services/Utilities/classes/class.ilUtil.php";
390 $tpl->parseCurrentBlock();
391 $this->tpl->setVariable(
"CONTENT_BLOCK",
$tpl->get());
404 $validtags = array(
"strong",
"em",
"p",
"br",
"div",
"span");
405 $buttontags = array(
"strong",
"em");
406 include_once
"./Services/UICore/classes/class.ilTemplate.php";
407 $template =
new ilTemplate(
"tpl.usereditor.html",
true,
true,
"Services/RTE");
409 $template->setCurrentBlock(
"tinymce");
410 $template->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce".$this->
vd.
"/tiny_mce.js");
411 include_once
"./Services/Object/classes/class.ilObject.php";
412 $template->setVariable(
"SELECTOR", $editor_selector);
413 $template->setVariable(
"BLOCKFORMATS",
"");
417 $template->setVariable(
"STYLE_SELECT",
",styleselect");
420 include_once
"./Services/Utilities/classes/class.ilUtil.php";
424 $template->parseCurrentBlock();
425 $this->tpl->setCurrentBlock(
"HeadContent");
426 $this->tpl->setVariable(
"CONTENT_BLOCK", $template->get());
427 $this->tpl->parseCurrentBlock();
437 $this->styleselect = $a_styleselect;
447 return $this->styleselect;
453 $blockformats = array();
455 if (in_array(
"p", $a_html_tags))
457 array_push($blockformats,
"p");
459 if (in_array(
"div", $a_html_tags))
461 array_push($blockformats,
"div");
463 if (in_array(
"pre", $a_html_tags))
465 array_push($blockformats,
"pre");
467 if (in_array(
"code", $a_html_tags))
469 array_push($blockformats,
"code");
471 if (in_array(
"h1", $a_html_tags))
473 array_push($blockformats,
"h1");
475 if (in_array(
"h2", $a_html_tags))
477 array_push($blockformats,
"h2");
479 if (in_array(
"h3", $a_html_tags))
481 array_push($blockformats,
"h3");
483 if (in_array(
"h4", $a_html_tags))
485 array_push($blockformats,
"h4");
487 if (in_array(
"h5", $a_html_tags))
489 array_push($blockformats,
"h5");
491 if (in_array(
"h6", $a_html_tags))
493 array_push($blockformats,
"h6");
495 if (count($blockformats))
497 return join(
",", $blockformats);
507 $theme_advanced_buttons = array();
509 if($a_buttons_section == 1)
511 if (in_array(
"strong", $a_html_tags))
513 array_push($theme_advanced_buttons,
"bold");
515 if (in_array(
"em", $a_html_tags))
517 array_push($theme_advanced_buttons,
"italic");
519 if (in_array(
"u", $a_html_tags))
521 array_push($theme_advanced_buttons,
"underline");
523 if (in_array(
"strike", $a_html_tags))
525 array_push($theme_advanced_buttons,
"strikethrough");
527 if (count($theme_advanced_buttons))
529 array_push($theme_advanced_buttons,
"separator");
531 if (in_array(
"p", $a_html_tags))
533 array_push($theme_advanced_buttons,
"justifyleft");
534 array_push($theme_advanced_buttons,
"justifycenter");
535 array_push($theme_advanced_buttons,
"justifyright");
536 array_push($theme_advanced_buttons,
"justifyfull");
537 array_push($theme_advanced_buttons,
"separator");
541 array_push($theme_advanced_buttons,
"formatselect");
543 if (in_array(
"hr", $a_html_tags))
545 array_push($theme_advanced_buttons,
"hr");
547 array_push($theme_advanced_buttons,
"removeformat");
548 array_push($theme_advanced_buttons,
"separator");
549 if (in_array(
"sub", $a_html_tags))
551 array_push($theme_advanced_buttons,
"sub");
553 if (in_array(
"sup", $a_html_tags))
555 array_push($theme_advanced_buttons,
"sup");
557 if (in_array(
"font", $a_html_tags))
559 array_push($theme_advanced_buttons,
"fontselect");
560 array_push($theme_advanced_buttons,
"fontsizeselect");
562 array_push($theme_advanced_buttons,
"charmap");
563 if ((in_array(
"ol", $a_html_tags)) && (in_array(
"li", $a_html_tags)))
565 array_push($theme_advanced_buttons,
"bullist");
567 if ((in_array(
"ul", $a_html_tags)) && (in_array(
"li", $a_html_tags)))
569 array_push($theme_advanced_buttons,
"numlist");
571 array_push($theme_advanced_buttons,
"separator");
572 if (in_array(
"cite", $a_html_tags))
574 array_push($theme_advanced_buttons,
"cite");
576 if (in_array(
"abbr", $a_html_tags))
578 array_push($theme_advanced_buttons,
"abbr");
580 if (in_array(
"acronym", $a_html_tags))
582 array_push($theme_advanced_buttons,
"acronym");
584 if (in_array(
"del", $a_html_tags))
586 array_push($theme_advanced_buttons,
"del");
588 if (in_array(
"ins", $a_html_tags))
590 array_push($theme_advanced_buttons,
"ins");
592 if (in_array(
"blockquote", $a_html_tags))
594 array_push($theme_advanced_buttons,
"indent");
595 array_push($theme_advanced_buttons,
"outdent");
597 if (in_array(
"img", $a_html_tags))
600 array_push($theme_advanced_buttons,
"image");
601 array_push($theme_advanced_buttons,
"ibrowser");
602 array_push($theme_advanced_buttons,
"ilimgupload");
604 if (in_array(
"a", $a_html_tags))
606 array_push($theme_advanced_buttons,
"link");
607 array_push($theme_advanced_buttons,
"unlink");
608 array_push($theme_advanced_buttons,
"anchor");
610 array_push($theme_advanced_buttons,
"separator");
611 array_push($theme_advanced_buttons,
"undo");
612 array_push($theme_advanced_buttons,
"redo");
614 if(is_array($this->buttons) && count($this->buttons))
616 array_push($theme_advanced_buttons,
"separator");
617 foreach($this->buttons as $button)
619 array_push($theme_advanced_buttons, $button);
623 array_push($theme_advanced_buttons,
"code");
624 array_push($theme_advanced_buttons,
"fullscreen");
627 array_push($theme_advanced_buttons,
"pasteword");
629 else if($a_buttons_section == 2)
631 array_push($theme_advanced_buttons,
"cut");
632 array_push($theme_advanced_buttons,
"copy");
633 array_push($theme_advanced_buttons,
"paste");
634 array_push($theme_advanced_buttons,
"pastetext");
638 else if($a_buttons_section == 3)
643 if (is_array($remove_buttons))
645 foreach ($remove_buttons as $buttontext)
647 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
649 unset($theme_advanced_buttons[
$res]);
654 return join(
",", $theme_advanced_buttons);
659 $theme_advanced_buttons = array();
660 if (in_array(
"strong", $a_html_tags))
662 array_push($theme_advanced_buttons,
"bold");
664 if (in_array(
"em", $a_html_tags))
666 array_push($theme_advanced_buttons,
"italic");
668 if (in_array(
"u", $a_html_tags))
670 array_push($theme_advanced_buttons,
"underline");
672 if (in_array(
"strike", $a_html_tags))
674 array_push($theme_advanced_buttons,
"strikethrough");
676 if (in_array(
"p", $a_html_tags))
678 array_push($theme_advanced_buttons,
"justifyleft");
679 array_push($theme_advanced_buttons,
"justifycenter");
680 array_push($theme_advanced_buttons,
"justifyright");
681 array_push($theme_advanced_buttons,
"justifyfull");
685 array_push($theme_advanced_buttons,
"formatselect");
687 if (in_array(
"hr", $a_html_tags))
689 array_push($theme_advanced_buttons,
"hr");
691 if (in_array(
"sub", $a_html_tags))
693 array_push($theme_advanced_buttons,
"sub");
695 if (in_array(
"sup", $a_html_tags))
697 array_push($theme_advanced_buttons,
"sup");
699 if (in_array(
"font", $a_html_tags))
701 array_push($theme_advanced_buttons,
"fontselect");
702 array_push($theme_advanced_buttons,
"fontsizeselect");
704 if ((in_array(
"ol", $a_html_tags)) && (in_array(
"li", $a_html_tags)))
706 array_push($theme_advanced_buttons,
"bullist");
708 if ((in_array(
"ul", $a_html_tags)) && (in_array(
"li", $a_html_tags)))
710 array_push($theme_advanced_buttons,
"numlist");
712 if (in_array(
"cite", $a_html_tags))
714 array_push($theme_advanced_buttons,
"cite");
716 if (in_array(
"abbr", $a_html_tags))
718 array_push($theme_advanced_buttons,
"abbr");
720 if (in_array(
"acronym", $a_html_tags))
722 array_push($theme_advanced_buttons,
"acronym");
724 if (in_array(
"del", $a_html_tags))
726 array_push($theme_advanced_buttons,
"del");
728 if (in_array(
"ins", $a_html_tags))
730 array_push($theme_advanced_buttons,
"ins");
732 if (in_array(
"blockquote", $a_html_tags))
734 array_push($theme_advanced_buttons,
"indent");
735 array_push($theme_advanced_buttons,
"outdent");
737 if (in_array(
"img", $a_html_tags))
740 array_push($theme_advanced_buttons,
"image");
741 array_push($theme_advanced_buttons,
"ibrowser");
742 array_push($theme_advanced_buttons,
"ilimgupload");
744 if (in_array(
"a", $a_html_tags))
746 array_push($theme_advanced_buttons,
"link");
747 array_push($theme_advanced_buttons,
"unlink");
748 array_push($theme_advanced_buttons,
"anchor");
752 if (is_array($remove_buttons))
754 foreach ($remove_buttons as $buttontext)
756 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
758 unset($theme_advanced_buttons[
$res]);
763 return join(
",", $theme_advanced_buttons);
768 $theme_advanced_buttons = array();
769 if (in_array(
"table", $a_html_tags) && in_array(
"tr", $a_html_tags) && in_array(
"td", $a_html_tags))
771 array_push($theme_advanced_buttons,
"tablecontrols");
775 if (is_array($remove_buttons))
777 foreach ($remove_buttons as $buttontext)
779 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
781 unset($theme_advanced_buttons[
$res]);
786 return join(
",", $theme_advanced_buttons);
792 $lang = $ilUser->getLanguage();
793 if (file_exists(
"./Services/RTE/tiny_mce".$this->
vd.
"/langs/$lang.js"))
805 $valid_elements = array();
806 foreach ($a_html_tags as $tag)
811 array_push($valid_elements,
"a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name"
812 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
813 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev"
814 .
"|shape<circle?default?poly?rect|style|tabindex|title|target|type]");
817 array_push($valid_elements,
"abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
818 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
822 array_push($valid_elements,
"acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress"
823 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
827 array_push($valid_elements,
"address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
828 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
829 .
"|onmouseup|style|title]");
832 array_push($valid_elements,
"applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase"
833 .
"|height|hspace|id|name|object|style|title|vspace|width]");
836 array_push($valid_elements,
"area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref"
837 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
838 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup"
839 .
"|shape<circle?default?poly?rect|style|tabindex|title|target]");
842 array_push($valid_elements,
"base[href|target]");
845 array_push($valid_elements,
"basefont[color|face|id|size]");
848 array_push($valid_elements,
"bdo[class|dir<ltr?rtl|id|lang|style|title]");
851 array_push($valid_elements,
"big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
852 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
856 array_push($valid_elements,
"blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
857 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
858 .
"|onmouseover|onmouseup|style|title]");
861 array_push($valid_elements,
"body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick"
862 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove"
863 .
"|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]");
866 array_push($valid_elements,
"br[class|clear<all?left?none?right|id|style|title]");
869 array_push($valid_elements,
"button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur"
870 .
"|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown"
871 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type"
875 array_push($valid_elements,
"caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick"
876 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
877 .
"|onmouseout|onmouseover|onmouseup|style|title]");
880 array_push($valid_elements,
"center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
881 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
885 array_push($valid_elements,
"cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
886 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
890 array_push($valid_elements,
"code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
891 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
895 array_push($valid_elements,
"col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
896 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
897 .
"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
898 .
"|valign<baseline?bottom?middle?top|width]");
901 array_push($valid_elements,
"colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl"
902 .
"|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
903 .
"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
904 .
"|valign<baseline?bottom?middle?top|width]");
907 array_push($valid_elements,
"dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
908 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
911 array_push($valid_elements,
"del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
912 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
913 .
"|onmouseup|style|title]");
916 array_push($valid_elements,
"dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
917 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
921 array_push($valid_elements,
"dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
922 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
923 .
"|onmouseup|style|title]");
926 array_push($valid_elements,
"div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
927 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
928 .
"|onmouseout|onmouseover|onmouseup|style|title]");
931 array_push($valid_elements,
"dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
932 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
933 .
"|onmouseup|style|title]");
936 array_push($valid_elements,
"dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
937 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
940 array_push($valid_elements,
"em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
941 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
945 array_push($valid_elements,
"fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
946 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
950 array_push($valid_elements,
"font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
953 array_push($valid_elements,
"form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang"
954 .
"|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
955 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit"
956 .
"|style|title|target]");
959 array_push($valid_elements,
"frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
960 .
"|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
963 array_push($valid_elements,
"frameset[class|cols|id|onload|onunload|rows|style|title]");
966 array_push($valid_elements,
"h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
967 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
968 .
"|onmouseout|onmouseover|onmouseup|style|title]");
971 array_push($valid_elements,
"h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
972 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
973 .
"|onmouseout|onmouseover|onmouseup|style|title]");
976 array_push($valid_elements,
"h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
977 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
978 .
"|onmouseout|onmouseover|onmouseup|style|title]");
981 array_push($valid_elements,
"h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
982 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
983 .
"|onmouseout|onmouseover|onmouseup|style|title]");
986 array_push($valid_elements,
"h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
987 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
988 .
"|onmouseout|onmouseover|onmouseup|style|title]");
991 array_push($valid_elements,
"h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
992 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
993 .
"|onmouseout|onmouseover|onmouseup|style|title]");
996 array_push($valid_elements,
"head[dir<ltr?rtl|lang|profile]");
999 array_push($valid_elements,
"hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick"
1000 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1001 .
"|onmouseout|onmouseover|onmouseup|size|style|title|width]");
1004 array_push($valid_elements,
"html[dir<ltr?rtl|lang|version]");
1007 array_push($valid_elements,
"iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"
1008 .
"|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"
1012 array_push($valid_elements,
"img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
1013 .
"|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
1014 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1015 .
"|onmouseup|src|style|title|usemap|vspace|width]");
1018 array_push($valid_elements,
"input[accept|accesskey|align<bottom?left?middle?right?top|alt"
1019 .
"|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang"
1020 .
"|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress"
1021 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
1022 .
"|readonly<readonly|size|src|style|tabindex|title"
1023 .
"|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text"
1027 array_push($valid_elements,
"ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1028 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1029 .
"|onmouseup|style|title]");
1032 array_push($valid_elements,
"isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
1035 array_push($valid_elements,
"kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1036 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1040 array_push($valid_elements,
"label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick"
1041 .
"|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
1042 .
"|onmouseover|onmouseup|style|title]");
1045 array_push($valid_elements,
"legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang"
1046 .
"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1047 .
"|onmouseout|onmouseover|onmouseup|style|title]");
1050 array_push($valid_elements,
"li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1051 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type"
1055 array_push($valid_elements,
"link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick"
1056 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1057 .
"|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]");
1060 array_push($valid_elements,
"map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress"
1061 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1065 array_push($valid_elements,
"menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1066 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1067 .
"|onmouseup|style|title]");
1070 array_push($valid_elements,
"meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
1073 array_push($valid_elements,
"noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1074 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1078 array_push($valid_elements,
"noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1079 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1083 array_push($valid_elements,
"object[align<bottom?left?middle?right?top|archive|border|class|classid"
1084 .
"|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name"
1085 .
"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1086 .
"|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap"
1090 array_push($valid_elements,
"ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1091 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1092 .
"|onmouseup|start|style|title|type]");
1095 array_push($valid_elements,
"optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick"
1096 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1097 .
"|onmouseout|onmouseover|onmouseup|style|title]");
1100 array_push($valid_elements,
"option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick"
1101 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
1102 .
"|onmouseover|onmouseup|selected<selected|style|title|value]");
1105 array_push($valid_elements,
"p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
1106 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1107 .
"|onmouseout|onmouseover|onmouseup|style|title]");
1110 array_push($valid_elements,
"param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
1116 array_push($valid_elements,
"pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
1117 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
1118 .
"|onmouseover|onmouseup|style|title|width]");
1121 array_push($valid_elements,
"q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1122 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1126 array_push($valid_elements,
"s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1127 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1130 array_push($valid_elements,
"samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1131 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1135 array_push($valid_elements,
"script[charset|defer|language|src|type]");
1138 array_push($valid_elements,
"select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name"
1139 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
1140 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style"
1141 .
"|tabindex|title]");
1144 array_push($valid_elements,
"small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1145 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1149 array_push($valid_elements,
"span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1150 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1151 .
"|onmouseup|style|title]");
1154 array_push($valid_elements,
"strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1155 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1156 .
"|onmouseup|style|title]");
1159 array_push($valid_elements,
"strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1160 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1164 array_push($valid_elements,
"style[dir<ltr?rtl|lang|media|title|type]");
1167 array_push($valid_elements,
"sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1168 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1172 array_push($valid_elements,
"sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1173 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1177 array_push($valid_elements,
"table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class"
1178 .
"|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1179 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules"
1180 .
"|style|summary|title|width]");
1183 array_push($valid_elements,
"tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id"
1184 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1185 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1186 .
"|valign<baseline?bottom?middle?top]");
1189 array_push($valid_elements,
"td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1190 .
"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1191 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1192 .
"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1193 .
"|style|title|valign<baseline?bottom?middle?top|width]");
1196 array_push($valid_elements,
"textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name"
1197 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
1198 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
1199 .
"|readonly<readonly|rows|style|tabindex|title]");
1202 array_push($valid_elements,
"tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1203 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1204 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1205 .
"|valign<baseline?bottom?middle?top]");
1208 array_push($valid_elements,
"th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1209 .
"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1210 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1211 .
"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1212 .
"|style|title|valign<baseline?bottom?middle?top|width]");
1215 array_push($valid_elements,
"thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1216 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1217 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1218 .
"|valign<baseline?bottom?middle?top]");
1221 array_push($valid_elements,
"title[dir<ltr?rtl|lang]");
1224 array_push($valid_elements,
"tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class"
1225 .
"|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1226 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1227 .
"|title|valign<baseline?bottom?middle?top]");
1230 array_push($valid_elements,
"tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1231 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1234 array_push($valid_elements,
"u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1235 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1239 array_push($valid_elements,
"span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1240 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1241 .
"|onmouseup|style|title]");
1244 array_push($valid_elements,
"ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1245 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1246 .
"|onmouseup|style|title|type]");
1249 array_push($valid_elements,
"var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1250 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1255 return join(
",", $valid_elements);
1267 $this->root_block_element = $a_root_block_element;
1292 if(is_array($a_button))
1294 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
1298 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
1316 return implode(
',', $this->disabled_buttons);
1335 while(strpos($a_string,
'separator,separator') !==
false)
1337 $a_string = str_replace(
'separator,separator',
'separator', $a_string);
1340 while(strpos($a_string,
',,') !==
false)
1342 $a_string = str_replace(
',,',
',', $a_string);
1345 if($a_string{0} ==
',')
1347 $a_string = (string)substr($a_string, 1);
1350 if(strlen($a_string) && $a_string{strlen($a_string) - 1} ==
',')
1352 $a_string = substr($a_string, 0, strlen($a_string) - 1);