19 declare(strict_types=1);
34 protected string $mode =
'textareas';
63 $this->contextMenuItems = [
'cut',
'copy',
'paste',
'link',
'unlink',
'imagetools',
'table'];
80 string $a_module =
'',
81 bool $allowFormElements =
false,
82 ?
string $cfg_template =
null 84 if ($this->browser->isMobile()) {
95 ($cfg_template ??
"tpl.tinymce.js"),
98 "components/ILIAS/RTE" 102 if ($allowFormElements) {
125 $tpl->
setVariable(
'BUTTONS_1', self::removeRedundantSeparators($buttons_1));
126 $tpl->
setVariable(
'BUTTONS_2', self::removeRedundantSeparators($buttons_2));
127 $tpl->
setVariable(
'BUTTONS_3', self::removeRedundantSeparators($buttons_3));
129 $tpl->
setVariable(
'CONTEXT_MENU_ITEMS', implode(
' ', $this->contextMenuItems));
134 'STYLESHEET_LOCATION',
145 if (!self::$renderedToGlobalTemplate) {
146 $this->tpl->addJavaScript(
'node_modules/tinymce/tinymce.min.js');
147 $this->tpl->addOnLoadCode(
$tpl->
get());
148 self::$renderedToGlobalTemplate =
true;
156 $this->contextMenuItems[] = $item;
162 $this->contextMenuItems = [];
167 $tpl =
new ilTemplate(
'tpl.tinymce.js',
true,
true,
'components/ILIAS/RTE');
184 $tpl->
setVariable(
'BUTTONS_1', self::removeRedundantSeparators($buttons_1));
185 $tpl->
setVariable(
'BUTTONS_2', self::removeRedundantSeparators($buttons_2));
186 $tpl->
setVariable(
'BUTTONS_3', self::removeRedundantSeparators($buttons_3));
188 $tpl->
setVariable(
'CONTEXT_MENU_ITEMS', implode(
' ', $this->contextMenuItems));
201 if (!self::$renderedToGlobalTemplate) {
202 $this->tpl->addJavaScript(
'node_modules/tinymce/tinymce.min.js');
203 $this->tpl->addOnLoadCode(
$tpl->
get());
204 self::$renderedToGlobalTemplate =
true;
210 $validtags = [
"strong",
"em",
"p",
"br",
"div",
"span"];
211 $buttontags = [
'strong',
'em'];
213 $template =
new ilTemplate(
'tpl.usereditor.js',
true,
true,
'components/ILIAS/RTE');
214 $template->setCurrentBlock(
'tinymce');
216 $template->setVariable(
'SELECTOR', $editor_selector);
217 $template->setVariable(
'BLOCKFORMATS',
'');
220 $template->setVariable(
'STYLE_SELECT',
',styleselect');
224 $template->setVariable(
225 'STYLESHEET_LOCATION',
229 $template->parseCurrentBlock();
231 $this->tpl->addJavaScript(
'node_modules/tinymce/tinymce.min.js');
232 $this->tpl->addOnLoadCode($template->get());
243 $btns = explode(
' ', $btns);
248 return implode(
' ', $btns);
253 $this->styleselect = $a_styleselect;
269 if (in_array(
'p', $a_html_tags)) {
270 $blockformats[] =
'p';
272 if (in_array(
'div', $a_html_tags)) {
273 $blockformats[] =
'div';
275 if (in_array(
'pre', $a_html_tags)) {
276 $blockformats[] =
'pre';
278 if (in_array(
'code', $a_html_tags)) {
279 $blockformats[] =
'code';
281 if (in_array(
'h1', $a_html_tags)) {
282 $blockformats[] =
'h1';
284 if (in_array(
'h2', $a_html_tags)) {
285 $blockformats[] =
'h2';
287 if (in_array(
'h3', $a_html_tags)) {
288 $blockformats[] =
'h3';
290 if (in_array(
'h4', $a_html_tags)) {
291 $blockformats[] =
'h4';
293 if (in_array(
'h5', $a_html_tags)) {
294 $blockformats[] =
'h5';
296 if (in_array(
'h6', $a_html_tags)) {
297 $blockformats[] =
'h6';
299 if (count($blockformats)) {
300 return implode(
',', $blockformats);
313 $theme_advanced_buttons = [];
315 if ($a_buttons_section === 1) {
316 if (in_array(
'strong', $a_html_tags)) {
317 $theme_advanced_buttons[] =
'bold';
319 if (in_array(
'em', $a_html_tags)) {
320 $theme_advanced_buttons[] =
'italic';
322 if (in_array(
'u', $a_html_tags)) {
323 $theme_advanced_buttons[] =
'underline';
325 if (in_array(
'strike', $a_html_tags)) {
326 $theme_advanced_buttons[] =
'strikethrough';
328 if (count($theme_advanced_buttons)) {
329 $theme_advanced_buttons[] =
'|';
331 if (in_array(
'p', $a_html_tags)) {
332 $theme_advanced_buttons[] =
'alignleft';
333 $theme_advanced_buttons[] =
'aligncenter';
334 $theme_advanced_buttons[] =
'alignright';
335 $theme_advanced_buttons[] =
'alignjustify';
336 $theme_advanced_buttons[] =
'|';
339 $theme_advanced_buttons[] =
'blocks';
341 if (in_array(
'hr', $a_html_tags)) {
342 $theme_advanced_buttons[] =
'hr';
344 $theme_advanced_buttons[] =
'removeformat';
345 $theme_advanced_buttons[] =
'|';
346 if (in_array(
'sub', $a_html_tags)) {
347 $theme_advanced_buttons[] =
'subscript';
349 if (in_array(
'sup', $a_html_tags)) {
350 $theme_advanced_buttons[] =
'superscript';
352 if (in_array(
'font', $a_html_tags)) {
353 $theme_advanced_buttons[] =
'fontfamily';
354 $theme_advanced_buttons[] =
'fontsize';
356 $theme_advanced_buttons[] =
'charmap';
357 if ((in_array(
'ol', $a_html_tags)) && (in_array(
'li', $a_html_tags))) {
358 $theme_advanced_buttons[] =
'bullist';
360 if ((in_array(
'ul', $a_html_tags)) && (in_array(
'li', $a_html_tags))) {
361 $theme_advanced_buttons[] =
'numlist';
363 $theme_advanced_buttons[] =
'|';
364 if (in_array(
'cite', $a_html_tags)) {
365 $theme_advanced_buttons[] =
'blockquote';
367 if (in_array(
'abbr', $a_html_tags)) {
368 $theme_advanced_buttons[] =
'abbr';
370 if (in_array(
'acronym', $a_html_tags)) {
371 $theme_advanced_buttons[] =
'acronym';
373 if (in_array(
'del', $a_html_tags)) {
374 $theme_advanced_buttons[] =
'del';
376 if (in_array(
'ins', $a_html_tags)) {
377 $theme_advanced_buttons[] =
'ins';
379 if (in_array(
'blockquote', $a_html_tags)) {
380 $theme_advanced_buttons[] =
'indent';
381 $theme_advanced_buttons[] =
'outdent';
383 if (in_array(
'img', $a_html_tags)) {
385 $theme_advanced_buttons[] =
'image';
387 if (in_array(
'a', $a_html_tags)) {
388 $theme_advanced_buttons[] =
'link';
389 $theme_advanced_buttons[] =
'unlink';
390 $theme_advanced_buttons[] =
'anchor';
392 $theme_advanced_buttons[] =
'|';
393 $theme_advanced_buttons[] =
'undo';
394 $theme_advanced_buttons[] =
'redo';
396 if (is_array($this->buttons) && count($this->buttons)) {
397 $theme_advanced_buttons[] =
'|';
398 foreach ($this->buttons as $button) {
399 $theme_advanced_buttons[] = $button;
403 $theme_advanced_buttons[] =
'code';
404 $theme_advanced_buttons[] =
'fullscreen';
407 $theme_advanced_buttons[] =
'pasteword';
408 } elseif ($a_buttons_section === 2) {
409 $theme_advanced_buttons[] =
'cut';
410 $theme_advanced_buttons[] =
'copy';
411 $theme_advanced_buttons[] =
'paste';
412 $theme_advanced_buttons[] =
'pastetext';
418 if (is_array($remove_buttons)) {
419 foreach ($remove_buttons as $buttontext) {
420 if ((
$res = array_search($buttontext, $theme_advanced_buttons,
true)) !==
false) {
421 unset($theme_advanced_buttons[
$res]);
426 return implode(
' ', $theme_advanced_buttons);
435 $theme_advanced_buttons = [];
436 if (in_array(
'strong', $a_html_tags)) {
437 $theme_advanced_buttons[] =
'bold';
439 if (in_array(
'em', $a_html_tags)) {
440 $theme_advanced_buttons[] =
'italic';
442 if (in_array(
'u', $a_html_tags)) {
443 $theme_advanced_buttons[] =
'underline';
445 if (in_array(
'strike', $a_html_tags)) {
446 $theme_advanced_buttons[] =
'strikethrough';
448 if (in_array(
'p', $a_html_tags)) {
449 $theme_advanced_buttons[] =
'alignleft';
450 $theme_advanced_buttons[] =
'aligncenter';
451 $theme_advanced_buttons[] =
'alignright';
452 $theme_advanced_buttons[] =
'alignjustify';
455 $theme_advanced_buttons[] =
'blocks';
457 if (in_array(
'hr', $a_html_tags)) {
458 $theme_advanced_buttons[] =
'hr';
460 if (in_array(
'sub', $a_html_tags)) {
461 $theme_advanced_buttons[] =
'subscript';
463 if (in_array(
'sup', $a_html_tags)) {
464 $theme_advanced_buttons[] =
'superscript';
466 if (in_array(
'font', $a_html_tags)) {
467 $theme_advanced_buttons[] =
'fontfamily';
468 $theme_advanced_buttons[] =
'fontsize';
470 if ((in_array(
'ol', $a_html_tags)) && (in_array(
'li', $a_html_tags))) {
471 $theme_advanced_buttons[] =
'bullist';
473 if ((in_array(
'ul', $a_html_tags)) && (in_array(
'li', $a_html_tags))) {
474 $theme_advanced_buttons[] =
'numlist';
476 if (in_array(
'cite', $a_html_tags)) {
477 $theme_advanced_buttons[] =
'blockquote';
479 if (in_array(
'abbr', $a_html_tags)) {
480 $theme_advanced_buttons[] =
'abbr';
482 if (in_array(
'acronym', $a_html_tags)) {
483 $theme_advanced_buttons[] =
'acronym';
485 if (in_array(
'del', $a_html_tags)) {
486 $theme_advanced_buttons[] =
'del';
488 if (in_array(
'ins', $a_html_tags)) {
489 $theme_advanced_buttons[] =
'ins';
491 if (in_array(
'blockquote', $a_html_tags)) {
492 $theme_advanced_buttons[] =
'indent';
493 $theme_advanced_buttons[] =
'outdent';
495 if (in_array(
'img', $a_html_tags)) {
497 $theme_advanced_buttons[] =
'image';
499 if (in_array(
'a', $a_html_tags)) {
500 $theme_advanced_buttons[] =
'link';
501 $theme_advanced_buttons[] =
'unlink';
502 $theme_advanced_buttons[] =
'anchor';
506 if (is_array($remove_buttons)) {
507 foreach ($remove_buttons as $buttontext) {
508 if ((
$res = array_search($buttontext, $theme_advanced_buttons,
true)) !==
false) {
509 unset($theme_advanced_buttons[
$res]);
514 return implode(
' ', $theme_advanced_buttons);
523 $theme_advanced_buttons = [];
525 in_array(
'table', $a_html_tags,
true) &&
526 in_array(
'tr', $a_html_tags,
true) &&
527 in_array(
'td', $a_html_tags,
true)
529 $theme_advanced_buttons[] =
'table';
533 if (is_array($remove_buttons)) {
534 foreach ($remove_buttons as $buttontext) {
535 if ((
$res = array_search($buttontext, $theme_advanced_buttons,
true)) !==
false) {
536 unset($theme_advanced_buttons[
$res]);
541 return implode(
',', $theme_advanced_buttons);
566 if (is_file(
"./node_modules/tinymce/langs/$langtiny.js")) {
579 $valid_elements = [];
581 foreach ($a_html_tags as $tag) {
584 $valid_elements[] =
'a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name' 585 .
'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' 586 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev' 587 .
'|shape<circle?default?poly?rect|style|tabindex|title|target|type]';
590 $valid_elements[] =
'abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 591 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 595 $valid_elements[] =
'acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress' 596 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 600 $valid_elements[] =
'address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 601 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 602 .
'|onmouseup|style|title]';
605 $valid_elements[] =
'applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase' 606 .
'|height|hspace|id|name|object|style|title|vspace|width]';
609 $valid_elements[] =
'area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref' 610 .
'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' 611 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup' 612 .
'|shape<circle?default?poly?rect|style|tabindex|title|target]';
615 $valid_elements[] =
'base[href|target]';
618 $valid_elements[] =
'basefont[color|face|id|size]';
621 $valid_elements[] =
'bdo[class|dir<ltr?rtl|id|lang|style|title]';
624 $valid_elements[] =
'big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 625 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 629 $valid_elements[] =
'blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick' 630 .
'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' 631 .
'|onmouseover|onmouseup|style|title]';
634 $valid_elements[] =
'body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick' 635 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove' 636 .
'|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]';
639 $valid_elements[] =
'br[class|clear<all?left?none?right|id|style|title]';
642 $valid_elements[] =
'button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur' 643 .
'|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown' 644 .
'|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type' 648 $valid_elements[] =
'caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick' 649 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 650 .
'|onmouseout|onmouseover|onmouseup|style|title]';
653 $valid_elements[] =
'center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 654 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 658 $valid_elements[] =
'cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 659 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 663 $valid_elements[] =
'code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 664 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 668 $valid_elements[] =
'col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' 669 .
'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' 670 .
'|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title' 671 .
'|valign<baseline?bottom?middle?top|width]';
674 $valid_elements[] =
'colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl' 675 .
'|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' 676 .
'|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title' 677 .
'|valign<baseline?bottom?middle?top|width]';
680 $valid_elements[] =
'dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 681 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]';
684 $valid_elements[] =
'del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 685 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 686 .
'|onmouseup|style|title]';
689 $valid_elements[] =
'dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 690 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 694 $valid_elements[] =
'dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 695 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 696 .
'|onmouseup|style|title]';
699 $valid_elements[] =
'div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 700 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 701 .
'|onmouseout|onmouseover|onmouseup|style|title]';
704 $valid_elements[] =
'dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 705 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 706 .
'|onmouseup|style|title]';
709 $valid_elements[] =
'dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 710 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]';
713 $valid_elements[] =
'em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 714 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 718 $valid_elements[] =
'fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 719 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 723 $valid_elements[] =
'font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]';
726 $valid_elements[] =
'form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang' 727 .
'|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 728 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit' 729 .
'|style|title|target]';
732 $valid_elements[] =
'frame[class|frameborder|id|longdesc|marginheight|marginwidth|name' 733 .
'|noresize<noresize|scrolling<auto?no?yes|src|style|title]';
736 $valid_elements[] =
'frameset[class|cols|id|onload|onunload|rows|style|title]';
739 $valid_elements[] =
'h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 740 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 741 .
'|onmouseout|onmouseover|onmouseup|style|title]';
744 $valid_elements[] =
'h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 745 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 746 .
'|onmouseout|onmouseover|onmouseup|style|title]';
749 $valid_elements[] =
'h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 750 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 751 .
'|onmouseout|onmouseover|onmouseup|style|title]';
754 $valid_elements[] =
'h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 755 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 756 .
'|onmouseout|onmouseover|onmouseup|style|title]';
759 $valid_elements[] =
'h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 760 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 761 .
'|onmouseout|onmouseover|onmouseup|style|title]';
764 $valid_elements[] =
'h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 765 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 766 .
'|onmouseout|onmouseover|onmouseup|style|title]';
769 $valid_elements[] =
'head[dir<ltr?rtl|lang|profile]';
772 $valid_elements[] =
'hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick' 773 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 774 .
'|onmouseout|onmouseover|onmouseup|size|style|title|width]';
777 $valid_elements[] =
'html[dir<ltr?rtl|lang|version]';
780 $valid_elements[] =
'iframe[align<bottom?left?middle?right?top|class|frameborder|height|id' 781 .
'|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style' 785 $valid_elements[] =
'img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height' 786 .
'|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown' 787 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 788 .
'|onmouseup|src|style|title|usemap|vspace|width]';
791 $valid_elements[] =
'input[accept|accesskey|align<bottom?left?middle?right?top|alt' 792 .
'|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang' 793 .
'|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress' 794 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect' 795 .
'|readonly<readonly|size|src|style|tabindex|title' 796 .
'|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text' 800 $valid_elements[] =
'ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 801 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 802 .
'|onmouseup|style|title]';
805 $valid_elements[] =
'isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]';
808 $valid_elements[] =
'kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 809 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 813 $valid_elements[] =
'label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick' 814 .
'|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' 815 .
'|onmouseover|onmouseup|style|title]';
818 $valid_elements[] =
'legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang' 819 .
'|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 820 .
'|onmouseout|onmouseover|onmouseup|style|title]';
823 $valid_elements[] =
'li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 824 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type' 828 $valid_elements[] =
'link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick' 829 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 830 .
'|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]';
833 $valid_elements[] =
'map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress' 834 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 838 $valid_elements[] =
'menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 839 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 840 .
'|onmouseup|style|title]';
843 $valid_elements[] =
'meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]';
846 $valid_elements[] =
'noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 847 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 851 $valid_elements[] =
'noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 852 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 856 $valid_elements[] =
'object[align<bottom?left?middle?right?top|archive|border|class|classid' 857 .
'|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name' 858 .
'|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 859 .
'|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap' 863 $valid_elements[] =
'ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 864 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 865 .
'|onmouseup|start|style|title|type]';
868 $valid_elements[] =
'optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick' 869 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 870 .
'|onmouseout|onmouseover|onmouseup|style|title]';
873 $valid_elements[] =
'option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick' 874 .
'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' 875 .
'|onmouseover|onmouseup|selected<selected|style|title|value]';
878 $valid_elements[] =
'p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' 879 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 880 .
'|onmouseout|onmouseover|onmouseup|style|title]';
883 $valid_elements[] =
'param[id|name|type|value|valuetype<DATA?OBJECT?REF]';
889 $valid_elements[] =
'pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick' 890 .
'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' 891 .
'|onmouseover|onmouseup|style|title|width]';
894 $valid_elements[] =
'q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 895 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 899 $valid_elements[] =
's[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 900 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]';
903 $valid_elements[] =
'samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 904 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 908 $valid_elements[] =
'script[charset|defer|language|src|type]';
911 $valid_elements[] =
'select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name' 912 .
'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' 913 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style' 914 .
'|tabindex|title]';
917 $valid_elements[] =
'small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 918 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 922 $valid_elements[] =
'span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 923 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 924 .
'|onmouseup|style|title]';
927 $valid_elements[] =
'strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 928 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 929 .
'|onmouseup|style|title]';
932 $valid_elements[] =
'strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 933 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 937 $valid_elements[] =
'style[dir<ltr?rtl|lang|media|title|type]';
940 $valid_elements[] =
'sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 941 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 945 $valid_elements[] =
'sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 946 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 950 $valid_elements[] =
'table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class' 951 .
'|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress' 952 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules' 953 .
'|style|summary|title|width]';
956 $valid_elements[] =
'tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id' 957 .
'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' 958 .
'|onmousemove|onmouseout|onmouseover|onmouseup|style|title' 959 .
'|valign<baseline?bottom?middle?top]';
962 $valid_elements[] =
'td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class' 963 .
'|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick' 964 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 965 .
'|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup' 966 .
'|style|title|valign<baseline?bottom?middle?top|width]';
969 $valid_elements[] =
'textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name' 970 .
'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' 971 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect' 972 .
'|readonly<readonly|rows|style|tabindex|title]';
975 $valid_elements[] =
'tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' 976 .
'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' 977 .
'|onmousemove|onmouseout|onmouseover|onmouseup|style|title' 978 .
'|valign<baseline?bottom?middle?top]';
981 $valid_elements[] =
'th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class' 982 .
'|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick' 983 .
'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' 984 .
'|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup' 985 .
'|style|title|valign<baseline?bottom?middle?top|width]';
988 $valid_elements[] =
'thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' 989 .
'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' 990 .
'|onmousemove|onmouseout|onmouseover|onmouseup|style|title' 991 .
'|valign<baseline?bottom?middle?top]';
994 $valid_elements[] =
'title[dir<ltr?rtl|lang]';
997 $valid_elements[] =
'tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class' 998 .
'|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 999 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 1000 .
'|title|valign<baseline?bottom?middle?top]';
1003 $valid_elements[] =
'tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 1004 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]';
1007 $valid_elements[] =
'u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' 1008 .
'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]';
1012 $valid_elements[] =
'span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 1013 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 1014 .
'|onmouseup|style|title]';
1017 $valid_elements[] =
'ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' 1018 .
'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' 1019 .
'|onmouseup|style|title|type]';
1022 $valid_elements[] =
'var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' 1023 .
'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' 1029 return implode(
',', $valid_elements);
1039 while (strpos($a_string,
'| |') !==
false) {
1040 $a_string = str_replace(
'| |',
'|', $a_string);
1043 while (strpos($a_string,
',,') !==
false) {
1044 $a_string = str_replace(
',,',
',', $a_string);
1046 while (strpos($a_string,
'separator') !==
false) {
1047 $a_string = str_replace(
'separator',
'|', $a_string);
1049 while (strpos($a_string,
',') !==
false) {
1050 $a_string = str_replace(
',',
' ', $a_string);
1053 if (isset($a_string[0]) && $a_string[0] ===
',') {
1054 $a_string = (string) substr($a_string, 1);
1057 if ($a_string !==
'' && $a_string[strlen($a_string) - 1] ===
',') {
1058 $a_string = substr($a_string, 0, -1);
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
removeAllContextMenuItems()
_buildAdvancedButtonsFromHTMLTags(int $a_buttons_section, array $a_html_tags)
addRTESupport(int $obj_id, string $obj_type, string $a_module='', bool $allowFormElements=false, ?string $cfg_template=null)
setStyleSelect(bool $a_styleselect)
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
addUserTextEditor(string $editor_selector)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
touchBlock(string $block)
overwrites ITX::touchBlock.
bool $remove_img_context_menu_item
static _setRichTextEditorUserState(int $a_state)
Sets the state of the rich text editor visibility for the current user.
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
_buildButtonsFromHTMLTags(array $a_html_tags)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static getNewContentStyleSheetLocation(string $mode="output")
get full style sheet file name (path inclusive) of current user
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static bool $renderedToGlobalTemplate
Rich Text Editor base class This class provides access methods to a Rich Text Editor (RTE) integrated...
blockExists(string $block_name)
check if block exists in actual template
static removeRedundantSeparators(string $a_string)
Removes redundant seperators and removes ,, and , at the first or last position of the string...
_buildAdvancedTableButtonsFromHTMLTags(array $a_html_tags)
addContextmenuItem(string $item='')
addCustomRTESupport(int $obj_id, string $obj_type, array $tags)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
getDisabledButtons(bool $as_list=true)
Returns the disabled RTE buttons.
__construct(Container $dic, ilPlugin $plugin)
static _getRichTextEditorUserState()
Gets the state of the rich text editor visibility for the current user.
getButtonsForUserTextEditor(array $buttontags)
ilGlobalTemplateInterface $tpl
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
_getValidElementsFromHTMLTags(array $a_html_tags)
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.