4 require_once
'Services/RTE/classes/class.ilRTE.php';
38 $a_version =
'3.5.11';
41 parent::__construct($a_version);
46 $this->version = $a_version;
47 $this->
vd =
'_' . str_replace(
'.',
'_', $a_version);
55 $this->plugins =
array(
87 if (!$this->client_init->readVariable(
'tinymce',
'use_advanced_img_mng')) {
89 parent::addButton(
'ilimgupload');
90 parent::removePlugin(
'ibrowser');
91 parent::removePlugin(
'image');
101 parent::removePlugin(
'ilimgupload');
113 if (!in_array(
'img', $tags)) {
115 parent::removePlugin(
'ilimgupload');
116 parent::removePlugin(
'ibrowser');
117 parent::removePlugin(
'image');
136 if (!$this->client_init->readVariable(
'tinymce',
'use_advanced_img_mng')) {
137 parent::removePlugin(
'ilimgupload');
140 parent::removePlugin(
'ibrowser');
150 if (self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name) {
162 if (self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name) {
165 parent::removePlugin($a_plugin_name);
172 public function addRTESupport($obj_id, $obj_type, $a_module =
"", $allowFormElements =
false, $cfg_template = null, $hide_switch =
false)
174 if ($this->browser->isMobile()) {
180 include_once
"./Services/UICore/classes/class.ilTemplate.php";
182 $tpl =
new ilTemplate(($cfg_template === null ?
"tpl.tinymce.html" : $cfg_template),
true,
true,
"Services/RTE");
186 if ($allowFormElements) {
187 $tpl->touchBlock(
"formelements");
190 $tpl->setCurrentBlock(
"initial_width");
192 $tpl->parseCurrentBlock();
194 $tpl->setCurrentBlock(
"tinymce");
195 $tpl->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce" . $this->
vd .
"/tiny_mce.js");
196 include_once
"./Services/Object/classes/class.ilObject.php";
197 $tpl->setVariable(
"OBJ_ID", $obj_id);
198 $tpl->setVariable(
"OBJ_TYPE", $obj_type);
199 $tpl->setVariable(
"CLIENT_ID", CLIENT_ID);
209 $tpl->setVariable(
'BUTTONS_1', self::removeRedundantSeparators($buttons_1));
210 $tpl->setVariable(
'BUTTONS_2', self::removeRedundantSeparators($buttons_2));
211 $tpl->setVariable(
'BUTTONS_3', self::removeRedundantSeparators($buttons_3));
213 $tpl->setVariable(
"ADDITIONAL_PLUGINS", join(
",", $this->plugins));
214 include_once
"./Services/Utilities/classes/class.ilUtil.php";
223 $tpl->parseCurrentBlock();
225 $this->tpl->setVariable(
"CONTENT_BLOCK",
$tpl->get());
235 $tpl->
touchBlock(
'remove_img_context_menu_item');
245 include_once
"./Services/UICore/classes/class.ilTemplate.php";
246 $tpl =
new ilTemplate(
"tpl.tinymce.html",
true,
true,
"Services/RTE");
248 $tpl->setCurrentBlock(
"tinymce");
249 $tpl->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce" . $this->
vd .
"/tiny_mce.js");
250 include_once
"./Services/Object/classes/class.ilObject.php";
251 $tpl->setVariable(
"OBJ_ID", $obj_id);
252 $tpl->setVariable(
"OBJ_TYPE", $obj_type);
253 $tpl->setVariable(
"CLIENT_ID", CLIENT_ID);
264 $tpl->setVariable(
'BUTTONS_1', self::removeRedundantSeparators($buttons_1));
265 $tpl->setVariable(
'BUTTONS_2', self::removeRedundantSeparators($buttons_2));
266 $tpl->setVariable(
'BUTTONS_3', self::removeRedundantSeparators($buttons_3));
268 $tpl->setVariable(
"ADDITIONAL_PLUGINS", join(
",", $this->plugins));
269 include_once
"./Services/Utilities/classes/class.ilUtil.php";
278 $tpl->parseCurrentBlock();
279 $this->tpl->setVariable(
"CONTENT_BLOCK",
$tpl->get());
287 $validtags =
array(
"strong",
"em",
"p",
"br",
"div",
"span");
288 $buttontags =
array(
"strong",
"em");
289 include_once
"./Services/UICore/classes/class.ilTemplate.php";
293 $template->setVariable(
"JAVASCRIPT_LOCATION",
"./Services/RTE/tiny_mce" . $this->
vd .
"/tiny_mce.js");
294 include_once
"./Services/Object/classes/class.ilObject.php";
295 $template->setVariable(
"SELECTOR", $editor_selector);
296 $template->setVariable(
"BLOCKFORMATS",
"");
299 $template->setVariable(
"STYLE_SELECT",
",styleselect");
302 include_once
"./Services/Utilities/classes/class.ilUtil.php";
307 $this->tpl->setCurrentBlock(
"HeadContent");
308 $this->tpl->setVariable(
"CONTENT_BLOCK",
$template->get());
309 $this->tpl->parseCurrentBlock();
320 $btns = explode(
',', $btns);
325 return implode(
',', $btns);
335 $this->styleselect = $a_styleselect;
354 $blockformats =
array();
356 if (in_array(
"p", $a_html_tags)) {
357 array_push($blockformats,
"p");
359 if (in_array(
"div", $a_html_tags)) {
360 array_push($blockformats,
"div");
362 if (in_array(
"pre", $a_html_tags)) {
363 array_push($blockformats,
"pre");
365 if (in_array(
"code", $a_html_tags)) {
366 array_push($blockformats,
"code");
368 if (in_array(
"h1", $a_html_tags)) {
369 array_push($blockformats,
"h1");
371 if (in_array(
"h2", $a_html_tags)) {
372 array_push($blockformats,
"h2");
374 if (in_array(
"h3", $a_html_tags)) {
375 array_push($blockformats,
"h3");
377 if (in_array(
"h4", $a_html_tags)) {
378 array_push($blockformats,
"h4");
380 if (in_array(
"h5", $a_html_tags)) {
381 array_push($blockformats,
"h5");
383 if (in_array(
"h6", $a_html_tags)) {
384 array_push($blockformats,
"h6");
386 if (count($blockformats)) {
387 return join(
",", $blockformats);
400 $theme_advanced_buttons =
array();
402 if ($a_buttons_section == 1) {
403 if (in_array(
"strong", $a_html_tags)) {
404 array_push($theme_advanced_buttons,
"bold");
406 if (in_array(
"em", $a_html_tags)) {
407 array_push($theme_advanced_buttons,
"italic");
409 if (in_array(
"u", $a_html_tags)) {
410 array_push($theme_advanced_buttons,
"underline");
412 if (in_array(
"strike", $a_html_tags)) {
413 array_push($theme_advanced_buttons,
"strikethrough");
415 if (count($theme_advanced_buttons)) {
416 array_push($theme_advanced_buttons,
"separator");
418 if (in_array(
"p", $a_html_tags)) {
419 array_push($theme_advanced_buttons,
"justifyleft");
420 array_push($theme_advanced_buttons,
"justifycenter");
421 array_push($theme_advanced_buttons,
"justifyright");
422 array_push($theme_advanced_buttons,
"justifyfull");
423 array_push($theme_advanced_buttons,
"separator");
426 array_push($theme_advanced_buttons,
"formatselect");
428 if (in_array(
"hr", $a_html_tags)) {
429 array_push($theme_advanced_buttons,
"hr");
431 array_push($theme_advanced_buttons,
"removeformat");
432 array_push($theme_advanced_buttons,
"separator");
433 if (in_array(
"sub", $a_html_tags)) {
434 array_push($theme_advanced_buttons,
"sub");
436 if (in_array(
"sup", $a_html_tags)) {
437 array_push($theme_advanced_buttons,
"sup");
439 if (in_array(
"font", $a_html_tags)) {
440 array_push($theme_advanced_buttons,
"fontselect");
441 array_push($theme_advanced_buttons,
"fontsizeselect");
443 array_push($theme_advanced_buttons,
"charmap");
444 if ((in_array(
"ol", $a_html_tags)) && (in_array(
"li", $a_html_tags))) {
445 array_push($theme_advanced_buttons,
"bullist");
447 if ((in_array(
"ul", $a_html_tags)) && (in_array(
"li", $a_html_tags))) {
448 array_push($theme_advanced_buttons,
"numlist");
450 array_push($theme_advanced_buttons,
"separator");
451 if (in_array(
"cite", $a_html_tags)) {
452 array_push($theme_advanced_buttons,
"cite");
454 if (in_array(
"abbr", $a_html_tags)) {
455 array_push($theme_advanced_buttons,
"abbr");
457 if (in_array(
"acronym", $a_html_tags)) {
458 array_push($theme_advanced_buttons,
"acronym");
460 if (in_array(
"del", $a_html_tags)) {
461 array_push($theme_advanced_buttons,
"del");
463 if (in_array(
"ins", $a_html_tags)) {
464 array_push($theme_advanced_buttons,
"ins");
466 if (in_array(
"blockquote", $a_html_tags)) {
467 array_push($theme_advanced_buttons,
"indent");
468 array_push($theme_advanced_buttons,
"outdent");
470 if (in_array(
"img", $a_html_tags)) {
472 array_push($theme_advanced_buttons,
"image");
473 array_push($theme_advanced_buttons,
"ibrowser");
474 array_push($theme_advanced_buttons,
"ilimgupload");
476 if (in_array(
"a", $a_html_tags)) {
477 array_push($theme_advanced_buttons,
"link");
478 array_push($theme_advanced_buttons,
"unlink");
479 array_push($theme_advanced_buttons,
"anchor");
481 array_push($theme_advanced_buttons,
"separator");
482 array_push($theme_advanced_buttons,
"undo");
483 array_push($theme_advanced_buttons,
"redo");
485 if (is_array($this->buttons) && count($this->buttons)) {
486 array_push($theme_advanced_buttons,
"separator");
487 foreach ($this->buttons as $button) {
488 array_push($theme_advanced_buttons, $button);
492 array_push($theme_advanced_buttons,
"code");
493 array_push($theme_advanced_buttons,
"fullscreen");
496 array_push($theme_advanced_buttons,
"pasteword");
497 } elseif ($a_buttons_section == 2) {
498 array_push($theme_advanced_buttons,
"cut");
499 array_push($theme_advanced_buttons,
"copy");
500 array_push($theme_advanced_buttons,
"paste");
501 array_push($theme_advanced_buttons,
"pastetext");
504 } elseif ($a_buttons_section == 3) {
508 if (is_array($remove_buttons)) {
509 foreach ($remove_buttons as $buttontext) {
510 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !==
false) {
511 unset($theme_advanced_buttons[
$res]);
516 return join(
",", $theme_advanced_buttons);
525 $theme_advanced_buttons =
array();
526 if (in_array(
"strong", $a_html_tags)) {
527 array_push($theme_advanced_buttons,
"bold");
529 if (in_array(
"em", $a_html_tags)) {
530 array_push($theme_advanced_buttons,
"italic");
532 if (in_array(
"u", $a_html_tags)) {
533 array_push($theme_advanced_buttons,
"underline");
535 if (in_array(
"strike", $a_html_tags)) {
536 array_push($theme_advanced_buttons,
"strikethrough");
538 if (in_array(
"p", $a_html_tags)) {
539 array_push($theme_advanced_buttons,
"justifyleft");
540 array_push($theme_advanced_buttons,
"justifycenter");
541 array_push($theme_advanced_buttons,
"justifyright");
542 array_push($theme_advanced_buttons,
"justifyfull");
545 array_push($theme_advanced_buttons,
"formatselect");
547 if (in_array(
"hr", $a_html_tags)) {
548 array_push($theme_advanced_buttons,
"hr");
550 if (in_array(
"sub", $a_html_tags)) {
551 array_push($theme_advanced_buttons,
"sub");
553 if (in_array(
"sup", $a_html_tags)) {
554 array_push($theme_advanced_buttons,
"sup");
556 if (in_array(
"font", $a_html_tags)) {
557 array_push($theme_advanced_buttons,
"fontselect");
558 array_push($theme_advanced_buttons,
"fontsizeselect");
560 if ((in_array(
"ol", $a_html_tags)) && (in_array(
"li", $a_html_tags))) {
561 array_push($theme_advanced_buttons,
"bullist");
563 if ((in_array(
"ul", $a_html_tags)) && (in_array(
"li", $a_html_tags))) {
564 array_push($theme_advanced_buttons,
"numlist");
566 if (in_array(
"cite", $a_html_tags)) {
567 array_push($theme_advanced_buttons,
"cite");
569 if (in_array(
"abbr", $a_html_tags)) {
570 array_push($theme_advanced_buttons,
"abbr");
572 if (in_array(
"acronym", $a_html_tags)) {
573 array_push($theme_advanced_buttons,
"acronym");
575 if (in_array(
"del", $a_html_tags)) {
576 array_push($theme_advanced_buttons,
"del");
578 if (in_array(
"ins", $a_html_tags)) {
579 array_push($theme_advanced_buttons,
"ins");
581 if (in_array(
"blockquote", $a_html_tags)) {
582 array_push($theme_advanced_buttons,
"indent");
583 array_push($theme_advanced_buttons,
"outdent");
585 if (in_array(
"img", $a_html_tags)) {
587 array_push($theme_advanced_buttons,
"image");
588 array_push($theme_advanced_buttons,
"ibrowser");
589 array_push($theme_advanced_buttons,
"ilimgupload");
591 if (in_array(
"a", $a_html_tags)) {
592 array_push($theme_advanced_buttons,
"link");
593 array_push($theme_advanced_buttons,
"unlink");
594 array_push($theme_advanced_buttons,
"anchor");
598 if (is_array($remove_buttons)) {
599 foreach ($remove_buttons as $buttontext) {
600 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !==
false) {
601 unset($theme_advanced_buttons[
$res]);
606 return join(
",", $theme_advanced_buttons);
615 $theme_advanced_buttons =
array();
616 if (in_array(
"table", $a_html_tags) && in_array(
"tr", $a_html_tags) && in_array(
"td", $a_html_tags)) {
617 array_push($theme_advanced_buttons,
"tablecontrols");
621 if (is_array($remove_buttons)) {
622 foreach ($remove_buttons as $buttontext) {
623 if ((
$res = array_search($buttontext, $theme_advanced_buttons)) !==
false) {
624 unset($theme_advanced_buttons[
$res]);
629 return join(
",", $theme_advanced_buttons);
635 if (file_exists(
"./Services/RTE/tiny_mce" . $this->
vd .
"/langs/$lang.js")) {
648 $valid_elements =
array();
649 foreach ($a_html_tags as
$tag) {
652 array_push($valid_elements,
"a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name" 653 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" 654 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev" 655 .
"|shape<circle?default?poly?rect|style|tabindex|title|target|type]");
658 array_push($valid_elements,
"abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 659 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 663 array_push($valid_elements,
"acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress" 664 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 668 array_push($valid_elements,
"address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 669 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 670 .
"|onmouseup|style|title]");
673 array_push($valid_elements,
"applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase" 674 .
"|height|hspace|id|name|object|style|title|vspace|width]");
677 array_push($valid_elements,
"area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref" 678 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" 679 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup" 680 .
"|shape<circle?default?poly?rect|style|tabindex|title|target]");
683 array_push($valid_elements,
"base[href|target]");
686 array_push($valid_elements,
"basefont[color|face|id|size]");
689 array_push($valid_elements,
"bdo[class|dir<ltr?rtl|id|lang|style|title]");
692 array_push($valid_elements,
"big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 693 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 697 array_push($valid_elements,
"blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick" 698 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" 699 .
"|onmouseover|onmouseup|style|title]");
702 array_push($valid_elements,
"body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick" 703 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove" 704 .
"|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]");
707 array_push($valid_elements,
"br[class|clear<all?left?none?right|id|style|title]");
710 array_push($valid_elements,
"button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur" 711 .
"|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown" 712 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type" 716 array_push($valid_elements,
"caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick" 717 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 718 .
"|onmouseout|onmouseover|onmouseup|style|title]");
721 array_push($valid_elements,
"center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 722 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 726 array_push($valid_elements,
"cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 727 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 731 array_push($valid_elements,
"code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 732 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 736 array_push($valid_elements,
"col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" 737 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" 738 .
"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title" 739 .
"|valign<baseline?bottom?middle?top|width]");
742 array_push($valid_elements,
"colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl" 743 .
"|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" 744 .
"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title" 745 .
"|valign<baseline?bottom?middle?top|width]");
748 array_push($valid_elements,
"dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 749 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
752 array_push($valid_elements,
"del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 753 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 754 .
"|onmouseup|style|title]");
757 array_push($valid_elements,
"dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 758 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 762 array_push($valid_elements,
"dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 763 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 764 .
"|onmouseup|style|title]");
767 array_push($valid_elements,
"div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 768 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 769 .
"|onmouseout|onmouseover|onmouseup|style|title]");
772 array_push($valid_elements,
"dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 773 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 774 .
"|onmouseup|style|title]");
777 array_push($valid_elements,
"dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 778 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
781 array_push($valid_elements,
"em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 782 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 786 array_push($valid_elements,
"fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 787 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 791 array_push($valid_elements,
"font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
794 array_push($valid_elements,
"form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang" 795 .
"|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 796 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit" 797 .
"|style|title|target]");
800 array_push($valid_elements,
"frame[class|frameborder|id|longdesc|marginheight|marginwidth|name" 801 .
"|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
804 array_push($valid_elements,
"frameset[class|cols|id|onload|onunload|rows|style|title]");
807 array_push($valid_elements,
"h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 808 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 809 .
"|onmouseout|onmouseover|onmouseup|style|title]");
812 array_push($valid_elements,
"h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 813 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 814 .
"|onmouseout|onmouseover|onmouseup|style|title]");
817 array_push($valid_elements,
"h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 818 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 819 .
"|onmouseout|onmouseover|onmouseup|style|title]");
822 array_push($valid_elements,
"h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 823 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 824 .
"|onmouseout|onmouseover|onmouseup|style|title]");
827 array_push($valid_elements,
"h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 828 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 829 .
"|onmouseout|onmouseover|onmouseup|style|title]");
832 array_push($valid_elements,
"h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 833 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 834 .
"|onmouseout|onmouseover|onmouseup|style|title]");
837 array_push($valid_elements,
"head[dir<ltr?rtl|lang|profile]");
840 array_push($valid_elements,
"hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick" 841 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 842 .
"|onmouseout|onmouseover|onmouseup|size|style|title|width]");
845 array_push($valid_elements,
"html[dir<ltr?rtl|lang|version]");
848 array_push($valid_elements,
"iframe[align<bottom?left?middle?right?top|class|frameborder|height|id" 849 .
"|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style" 853 array_push($valid_elements,
"img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height" 854 .
"|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown" 855 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 856 .
"|onmouseup|src|style|title|usemap|vspace|width]");
859 array_push($valid_elements,
"input[accept|accesskey|align<bottom?left?middle?right?top|alt" 860 .
"|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang" 861 .
"|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress" 862 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect" 863 .
"|readonly<readonly|size|src|style|tabindex|title" 864 .
"|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text" 868 array_push($valid_elements,
"ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 869 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 870 .
"|onmouseup|style|title]");
873 array_push($valid_elements,
"isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
876 array_push($valid_elements,
"kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 877 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 881 array_push($valid_elements,
"label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick" 882 .
"|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" 883 .
"|onmouseover|onmouseup|style|title]");
886 array_push($valid_elements,
"legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang" 887 .
"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 888 .
"|onmouseout|onmouseover|onmouseup|style|title]");
891 array_push($valid_elements,
"li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 892 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type" 896 array_push($valid_elements,
"link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick" 897 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 898 .
"|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]");
901 array_push($valid_elements,
"map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress" 902 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 906 array_push($valid_elements,
"menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 907 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 908 .
"|onmouseup|style|title]");
911 array_push($valid_elements,
"meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
914 array_push($valid_elements,
"noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 915 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 919 array_push($valid_elements,
"noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 920 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 924 array_push($valid_elements,
"object[align<bottom?left?middle?right?top|archive|border|class|classid" 925 .
"|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name" 926 .
"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 927 .
"|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap" 931 array_push($valid_elements,
"ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 932 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 933 .
"|onmouseup|start|style|title|type]");
936 array_push($valid_elements,
"optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick" 937 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 938 .
"|onmouseout|onmouseover|onmouseup|style|title]");
941 array_push($valid_elements,
"option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick" 942 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" 943 .
"|onmouseover|onmouseup|selected<selected|style|title|value]");
946 array_push($valid_elements,
"p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" 947 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 948 .
"|onmouseout|onmouseover|onmouseup|style|title]");
951 array_push($valid_elements,
"param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
957 array_push($valid_elements,
"pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick" 958 .
"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" 959 .
"|onmouseover|onmouseup|style|title|width]");
962 array_push($valid_elements,
"q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 963 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 967 array_push($valid_elements,
"s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 968 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
971 array_push($valid_elements,
"samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 972 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 976 array_push($valid_elements,
"script[charset|defer|language|src|type]");
979 array_push($valid_elements,
"select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name" 980 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" 981 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style" 982 .
"|tabindex|title]");
985 array_push($valid_elements,
"small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 986 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 990 array_push($valid_elements,
"span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 991 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 992 .
"|onmouseup|style|title]");
995 array_push($valid_elements,
"strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 996 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 997 .
"|onmouseup|style|title]");
1000 array_push($valid_elements,
"strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1001 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 1005 array_push($valid_elements,
"style[dir<ltr?rtl|lang|media|title|type]");
1008 array_push($valid_elements,
"sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1009 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 1013 array_push($valid_elements,
"sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1014 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 1018 array_push($valid_elements,
"table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class" 1019 .
"|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1020 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules" 1021 .
"|style|summary|title|width]");
1024 array_push($valid_elements,
"tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id" 1025 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" 1026 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" 1027 .
"|valign<baseline?bottom?middle?top]");
1030 array_push($valid_elements,
"td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class" 1031 .
"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick" 1032 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 1033 .
"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup" 1034 .
"|style|title|valign<baseline?bottom?middle?top|width]");
1037 array_push($valid_elements,
"textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name" 1038 .
"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" 1039 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect" 1040 .
"|readonly<readonly|rows|style|tabindex|title]");
1043 array_push($valid_elements,
"tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" 1044 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" 1045 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" 1046 .
"|valign<baseline?bottom?middle?top]");
1049 array_push($valid_elements,
"th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class" 1050 .
"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick" 1051 .
"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" 1052 .
"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup" 1053 .
"|style|title|valign<baseline?bottom?middle?top|width]");
1056 array_push($valid_elements,
"thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" 1057 .
"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" 1058 .
"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" 1059 .
"|valign<baseline?bottom?middle?top]");
1062 array_push($valid_elements,
"title[dir<ltr?rtl|lang]");
1065 array_push($valid_elements,
"tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class" 1066 .
"|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1067 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 1068 .
"|title|valign<baseline?bottom?middle?top]");
1071 array_push($valid_elements,
"tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 1072 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1075 array_push($valid_elements,
"u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" 1076 .
"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1080 array_push($valid_elements,
"span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 1081 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 1082 .
"|onmouseup|style|title]");
1085 array_push($valid_elements,
"ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" 1086 .
"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" 1087 .
"|onmouseup|style|title|type]");
1090 array_push($valid_elements,
"var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" 1091 .
"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" 1096 return join(
",", $valid_elements);
1106 while (strpos($a_string,
'separator,separator') !==
false) {
1107 $a_string = str_replace(
'separator,separator',
'separator', $a_string);
1110 while (strpos($a_string,
',,') !==
false) {
1111 $a_string = str_replace(
',,',
',', $a_string);
1114 if ($a_string{0} ==
',') {
1115 $a_string = (
string) substr($a_string, 1);
1118 if (strlen($a_string) && $a_string{strlen($a_string) - 1} ==
',') {
1119 $a_string = substr($a_string, 0, strlen($a_string) - 1);
addUserTextEditor($editor_selector)
{}
vd()
shortcut for var_dump with enhanced debug information
_buildAdvancedButtonsFromHTMLTags($a_buttons_section, array $a_html_tags)
addPlugin(PluginInterface $plugin)
Register a plugin.
handleImagePluginsBeforeRendering(array $tags)
setStyleSelect($a_styleselect)
Set Enable Style Selecttion.
getStyleSelect()
Get Enable Style Selecttion.
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user
addCustomRTESupport($obj_id, $obj_type, array $tags)
{}
removePlugin($a_plugin_name)
{}
_buildButtonsFromHTMLTags(array $a_html_tags)
static _setRichTextEditorUserState($a_state)
Sets the state of the rich text editor visibility for the current user.
static removeRedundantSeparators($a_string)
Removes redundant seperators and removes ,, and , at the first or last position of the string...
__construct($a_version='')
{}
handleIliasImageManagerAdded()
Rich Text Editor base class This class provides access methods to a Rich Text Editor (RTE) integrated...
foreach($_POST as $key=> $value) $res
touchBlock($block)
overwrites ITX::touchBlock.
_buildAdvancedTableButtonsFromHTMLTags(array $a_html_tags)
special template class to simplify handling of ITX/PEAR
addPlugin($a_plugin_name)
{}
addRTESupport($obj_id, $obj_type, $a_module="", $allowFormElements=false, $cfg_template=null, $hide_switch=false)
{}
Create styles array
The data for the language used.
blockExists($a_blockname)
check if block exists in actual template private
addInternalTinyMCEImageManager()
getRTERootBlockElement()
Getter for the RTE root block element.
static _getRichTextEditorUserState()
Gets the state of the rich text editor visibility for the current user.
getButtonsForUserTextEditor(array $buttontags)
handleImgContextMenuItem(ilTemplate $tpl)
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
getRemoveImgContextMenuItem()
handleIliasImageManagerRemoved()
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
_getValidElementsFromHTMLTags(array $a_html_tags)
$remove_img_context_menu_item
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
setRemoveImgContextMenuItem($remove_img_context_menu_item)