ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTinyMCE Class Reference

Tiny MCE editor class. More...

+ Inheritance diagram for ilTinyMCE:
+ Collaboration diagram for ilTinyMCE:

Public Member Functions

 __construct ($a_version='')
 {} More...
 
 addPlugin ($a_plugin_name)
 {} More...
 
 removePlugin ($a_plugin_name)
 {} More...
 
 addRTESupport ($obj_id, $obj_type, $a_module="", $allowFormElements=false, $cfg_template=null, $hide_switch=false)
 {} More...
 
 addCustomRTESupport ($obj_id, $obj_type, array $tags)
 {} More...
 
 addUserTextEditor ($editor_selector)
 {} More...
 
 getStyleSelect ()
 Get Enable Style Selecttion. More...
 
 _buildAdvancedBlockformatsFromHTMLTags (array $a_html_tags)
 
 _buildAdvancedButtonsFromHTMLTags ($a_buttons_section, array $a_html_tags)
 
 _buildAdvancedTableButtonsFromHTMLTags (array $a_html_tags)
 
 _getValidElementsFromHTMLTags (array $a_html_tags)
 
 setRemoveImgContextMenuItem ($remove_img_context_menu_item)
 
 getRemoveImgContextMenuItem ()
 
- Public Member Functions inherited from ilRTE
 __construct ($a_version='')
 ilRTE constructor. More...
 
 addPlugin ($a_plugin_name)
 Adds a plugin to the plugin list. More...
 
 addButton ($a_button_name)
 Adds a button to the button list. More...
 
 removePlugin ($a_plugin_name)
 Removes a plugin from the plugin list. More...
 
 removeAllPlugins ()
 Removes all plugins from instance. More...
 
 removeButton ($a_button_name)
 Removes a button from the button list. More...
 
 addRTESupport ($obj_id, $obj_type, $a_module="", $allowFormElements=false, $cfg_template=null, $hide_switch=false)
 Adds support for an RTE in an ILIAS form. More...
 
 addUserTextEditor ($editor_selector)
 Adds support for an user text editor. More...
 
 addCustomRTESupport ($obj_id, $obj_type, array $tags)
 Adds custom support for an RTE in an ILIAS form. More...
 
 setRTERootBlockElement ($a_root_block_element)
 Setter for the RTE root block element. More...
 
 getRTERootBlockElement ()
 Getter for the RTE root block element. More...
 
 disableButtons ($a_button)
 Sets buttons which should be disabled in the RTE. More...
 
 getDisabledButtons ($as_array=true)
 Returns the disabled RTE buttons. More...
 
 getInitialWidth ()
 
 setInitialWidth ($initialWidth)
 

Static Public Member Functions

static removeRedundantSeparators ($a_string)
 Removes redundant seperators and removes ,, and , at the first or last position of the string. More...
 
- Static Public Member Functions inherited from ilRTE
static _getRTEClassname ()
 
static _cleanupMediaObjectUsage ($a_text, $a_usage_type, $a_usage_id)
 Synchronises appearances of media objects in $a_text with media object usage table. More...
 
static _replaceMediaObjectImageSrc ($a_text, $a_direction=0, $nic=IL_INST_ID)
 Replaces image source from mob image urls with the mob id or replaces mob id with the correct image source. More...
 
static _getMediaObjects ($a_text, $a_direction=0)
 Returns all media objects found in the passed string. More...
 

Protected Member Functions

 addInternalTinyMCEImageManager ()
 
 handleImagePluginsBeforeRendering (array $tags)
 
 handleIliasImageManagerAdded ()
 
 handleIliasImageManagerRemoved ()
 
 handleImgContextMenuItem (ilTemplate $tpl)
 
 getButtonsForUserTextEditor (array $buttontags)
 
 setStyleSelect ($a_styleselect)
 Set Enable Style Selecttion. More...
 
 _buildButtonsFromHTMLTags (array $a_html_tags)
 
 _getEditorLanguage ()
 

Protected Attributes

 $mode = 'textareas'
 
 $version = ''
 
 $vd = ''
 
 $styleselect = false
 
 $remove_img_context_menu_item = false
 
- Protected Attributes inherited from ilRTE
 $plugins = array()
 
 $buttons = array()
 
 $tpl
 
 $ctrl
 
 $user
 
 $lng
 
 $browser
 
 $client_init
 
 $initialWidth = null
 
 $root_block_element = null
 
 $disabled_buttons = array()
 

Additional Inherited Members

- Data Fields inherited from ilRTE
const ILIAS_IMG_MANAGER_PLUGIN = 'ilias_image_manager_plugin'
 

Detailed Description

Tiny MCE editor class.

This class provides access methods for Tiny MCE

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$ class.ilTinyMCE.php

Definition at line 15 of file class.ilTinyMCE.php.

Constructor & Destructor Documentation

◆ __construct()

ilTinyMCE::__construct (   $a_version = '')

{}

Definition at line 35 of file class.ilTinyMCE.php.

References addInternalTinyMCEImageManager(), setStyleSelect(), and vd().

36  {
37  if (!$a_version) {
38  $a_version = '3.5.11';
39  }
40 
41  parent::__construct($a_version);
42 
43  switch ($a_version) {
44  case '3.4.7':
45  case '3.5.11':
46  $this->version = $a_version;
47  $this->vd = '_' . str_replace('.', '_', $a_version);
48  break;
49 
50  default:
51  // unknown/unsupported version?
52  break;
53  }
54 
55  $this->plugins = array(
56  'xhtmlxtras',
57  'style',
58  'layer',
59  'table',
60  'save',
61  'advhr',
62  'advlink',
63  'emotions',
64  'iespell',
65  'insertdatetime',
66  'preview',
67  'searchreplace',
68  'print',
69  'contextmenu',
70  'paste',
71  'directionality',
72  'fullscreen',
73  'nonbreaking',
74  'noneditable',
75  'style'
76  );
77 
78  $this->setStyleSelect(false);
80  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
setStyleSelect($a_styleselect)
Set Enable Style Selecttion.
addInternalTinyMCEImageManager()
+ Here is the call graph for this function:

Member Function Documentation

◆ _buildAdvancedBlockformatsFromHTMLTags()

ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags ( array  $a_html_tags)
Parameters
array$a_html_tags
Returns
string

Definition at line 352 of file class.ilTinyMCE.php.

Referenced by _buildAdvancedButtonsFromHTMLTags(), _buildButtonsFromHTMLTags(), addCustomRTESupport(), and addRTESupport().

353  {
354  $blockformats = array();
355 
356  if (in_array("p", $a_html_tags)) {
357  array_push($blockformats, "p");
358  }
359  if (in_array("div", $a_html_tags)) {
360  array_push($blockformats, "div");
361  }
362  if (in_array("pre", $a_html_tags)) {
363  array_push($blockformats, "pre");
364  }
365  if (in_array("code", $a_html_tags)) {
366  array_push($blockformats, "code");
367  }
368  if (in_array("h1", $a_html_tags)) {
369  array_push($blockformats, "h1");
370  }
371  if (in_array("h2", $a_html_tags)) {
372  array_push($blockformats, "h2");
373  }
374  if (in_array("h3", $a_html_tags)) {
375  array_push($blockformats, "h3");
376  }
377  if (in_array("h4", $a_html_tags)) {
378  array_push($blockformats, "h4");
379  }
380  if (in_array("h5", $a_html_tags)) {
381  array_push($blockformats, "h5");
382  }
383  if (in_array("h6", $a_html_tags)) {
384  array_push($blockformats, "h6");
385  }
386  if (count($blockformats)) {
387  return join(",", $blockformats);
388  } else {
389  return "";
390  }
391  }
+ Here is the caller graph for this function:

◆ _buildAdvancedButtonsFromHTMLTags()

ilTinyMCE::_buildAdvancedButtonsFromHTMLTags (   $a_buttons_section,
array  $a_html_tags 
)
Parameters
int$a_buttons_section
array$a_html_tags
Returns
string

Definition at line 398 of file class.ilTinyMCE.php.

References $res, _buildAdvancedBlockformatsFromHTMLTags(), and ilRTE\getDisabledButtons().

Referenced by addCustomRTESupport(), and addRTESupport().

399  {
400  $theme_advanced_buttons = array();
401 
402  if ($a_buttons_section == 1) {
403  if (in_array("strong", $a_html_tags)) {
404  array_push($theme_advanced_buttons, "bold");
405  }
406  if (in_array("em", $a_html_tags)) {
407  array_push($theme_advanced_buttons, "italic");
408  }
409  if (in_array("u", $a_html_tags)) {
410  array_push($theme_advanced_buttons, "underline");
411  }
412  if (in_array("strike", $a_html_tags)) {
413  array_push($theme_advanced_buttons, "strikethrough");
414  }
415  if (count($theme_advanced_buttons)) {
416  array_push($theme_advanced_buttons, "separator");
417  }
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");
424  }
425  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags))) {
426  array_push($theme_advanced_buttons, "formatselect");
427  }
428  if (in_array("hr", $a_html_tags)) {
429  array_push($theme_advanced_buttons, "hr");
430  }
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");
435  }
436  if (in_array("sup", $a_html_tags)) {
437  array_push($theme_advanced_buttons, "sup");
438  }
439  if (in_array("font", $a_html_tags)) {
440  array_push($theme_advanced_buttons, "fontselect");
441  array_push($theme_advanced_buttons, "fontsizeselect");
442  }
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");
446  }
447  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags))) {
448  array_push($theme_advanced_buttons, "numlist");
449  }
450  array_push($theme_advanced_buttons, "separator");
451  if (in_array("cite", $a_html_tags)) {
452  array_push($theme_advanced_buttons, "cite");
453  }
454  if (in_array("abbr", $a_html_tags)) {
455  array_push($theme_advanced_buttons, "abbr");
456  }
457  if (in_array("acronym", $a_html_tags)) {
458  array_push($theme_advanced_buttons, "acronym");
459  }
460  if (in_array("del", $a_html_tags)) {
461  array_push($theme_advanced_buttons, "del");
462  }
463  if (in_array("ins", $a_html_tags)) {
464  array_push($theme_advanced_buttons, "ins");
465  }
466  if (in_array("blockquote", $a_html_tags)) {
467  array_push($theme_advanced_buttons, "indent");
468  array_push($theme_advanced_buttons, "outdent");
469  }
470  if (in_array("img", $a_html_tags)) {
471  //array_push($theme_advanced_buttons, "advimage");
472  array_push($theme_advanced_buttons, "image");
473  array_push($theme_advanced_buttons, "ibrowser");
474  array_push($theme_advanced_buttons, "ilimgupload");
475  }
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");
480  }
481  array_push($theme_advanced_buttons, "separator");
482  array_push($theme_advanced_buttons, "undo");
483  array_push($theme_advanced_buttons, "redo");
484 
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);
489  }
490  }
491 
492  array_push($theme_advanced_buttons, "code");
493  array_push($theme_advanced_buttons, "fullscreen");
494 
495  // Changed in elba2 branch, adopted change for 4.2.x due to manits bug #8147
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");
502  // Changed in elba2 branch, adopted change for 4.2.x due to manits bug #8147
503  //array_push($theme_advanced_buttons, "pasteword");
504  } elseif ($a_buttons_section == 3) {
505  }
506 
507  $remove_buttons = $this->getDisabledButtons();
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]);
512  }
513  }
514  }
515 
516  return join(",", $theme_advanced_buttons);
517  }
foreach($_POST as $key=> $value) $res
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _buildAdvancedTableButtonsFromHTMLTags()

ilTinyMCE::_buildAdvancedTableButtonsFromHTMLTags ( array  $a_html_tags)
Parameters
array$a_html_tags
Returns
string

Definition at line 613 of file class.ilTinyMCE.php.

References $res, and ilRTE\getDisabledButtons().

Referenced by addCustomRTESupport(), and addRTESupport().

614  {
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");
618  }
619 
620  $remove_buttons = $this->getDisabledButtons();
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]);
625  }
626  }
627  }
628 
629  return join(",", $theme_advanced_buttons);
630  }
foreach($_POST as $key=> $value) $res
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _buildButtonsFromHTMLTags()

ilTinyMCE::_buildButtonsFromHTMLTags ( array  $a_html_tags)
protected
Parameters
array$a_html_tags
Returns
string

Definition at line 523 of file class.ilTinyMCE.php.

References $res, _buildAdvancedBlockformatsFromHTMLTags(), and ilRTE\getDisabledButtons().

Referenced by getButtonsForUserTextEditor().

524  {
525  $theme_advanced_buttons = array();
526  if (in_array("strong", $a_html_tags)) {
527  array_push($theme_advanced_buttons, "bold");
528  }
529  if (in_array("em", $a_html_tags)) {
530  array_push($theme_advanced_buttons, "italic");
531  }
532  if (in_array("u", $a_html_tags)) {
533  array_push($theme_advanced_buttons, "underline");
534  }
535  if (in_array("strike", $a_html_tags)) {
536  array_push($theme_advanced_buttons, "strikethrough");
537  }
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");
543  }
544  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags))) {
545  array_push($theme_advanced_buttons, "formatselect");
546  }
547  if (in_array("hr", $a_html_tags)) {
548  array_push($theme_advanced_buttons, "hr");
549  }
550  if (in_array("sub", $a_html_tags)) {
551  array_push($theme_advanced_buttons, "sub");
552  }
553  if (in_array("sup", $a_html_tags)) {
554  array_push($theme_advanced_buttons, "sup");
555  }
556  if (in_array("font", $a_html_tags)) {
557  array_push($theme_advanced_buttons, "fontselect");
558  array_push($theme_advanced_buttons, "fontsizeselect");
559  }
560  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags))) {
561  array_push($theme_advanced_buttons, "bullist");
562  }
563  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags))) {
564  array_push($theme_advanced_buttons, "numlist");
565  }
566  if (in_array("cite", $a_html_tags)) {
567  array_push($theme_advanced_buttons, "cite");
568  }
569  if (in_array("abbr", $a_html_tags)) {
570  array_push($theme_advanced_buttons, "abbr");
571  }
572  if (in_array("acronym", $a_html_tags)) {
573  array_push($theme_advanced_buttons, "acronym");
574  }
575  if (in_array("del", $a_html_tags)) {
576  array_push($theme_advanced_buttons, "del");
577  }
578  if (in_array("ins", $a_html_tags)) {
579  array_push($theme_advanced_buttons, "ins");
580  }
581  if (in_array("blockquote", $a_html_tags)) {
582  array_push($theme_advanced_buttons, "indent");
583  array_push($theme_advanced_buttons, "outdent");
584  }
585  if (in_array("img", $a_html_tags)) {
586  //array_push($theme_advanced_buttons, "advimage");
587  array_push($theme_advanced_buttons, "image");
588  array_push($theme_advanced_buttons, "ibrowser");
589  array_push($theme_advanced_buttons, "ilimgupload");
590  }
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");
595  }
596 
597  $remove_buttons = $this->getDisabledButtons();
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]);
602  }
603  }
604  }
605 
606  return join(",", $theme_advanced_buttons);
607  }
foreach($_POST as $key=> $value) $res
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getEditorLanguage()

ilTinyMCE::_getEditorLanguage ( )
protected

Definition at line 632 of file class.ilTinyMCE.php.

References $lang, user(), and vd().

Referenced by addCustomRTESupport(), addRTESupport(), and addUserTextEditor().

633  {
634  $lang = $this->user->getLanguage();
635  if (file_exists("./Services/RTE/tiny_mce" . $this->vd . "/langs/$lang.js")) {
636  return "$lang";
637  } else {
638  return "en";
639  }
640  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
user()
Definition: user.php:4
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getValidElementsFromHTMLTags()

ilTinyMCE::_getValidElementsFromHTMLTags ( array  $a_html_tags)
Parameters
array$a_html_tags
Returns
string

Definition at line 646 of file class.ilTinyMCE.php.

References $tag.

Referenced by addCustomRTESupport(), addRTESupport(), and addUserTextEditor().

647  {
648  $valid_elements = array();
649  foreach ($a_html_tags as $tag) {
650  switch ($tag) {
651  case "a":
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]");
656  break;
657  case "abbr":
658  array_push($valid_elements, "abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
659  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
660  . "|title]");
661  break;
662  case "acronym":
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"
665  . "|title]");
666  break;
667  case "address":
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]");
671  break;
672  case "applet":
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]");
675  break;
676  case "area":
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]");
681  break;
682  case "base":
683  array_push($valid_elements, "base[href|target]");
684  break;
685  case "basefont":
686  array_push($valid_elements, "basefont[color|face|id|size]");
687  break;
688  case "bdo":
689  array_push($valid_elements, "bdo[class|dir<ltr?rtl|id|lang|style|title]");
690  break;
691  case "big":
692  array_push($valid_elements, "big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
693  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
694  . "|title]");
695  break;
696  case "blockquote":
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]");
700  break;
701  case "body":
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]");
705  break;
706  case "br":
707  array_push($valid_elements, "br[class|clear<all?left?none?right|id|style|title]");
708  break;
709  case "button":
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"
713  . "|value]");
714  break;
715  case "caption":
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]");
719  break;
720  case "center":
721  array_push($valid_elements, "center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
722  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
723  . "|title]");
724  break;
725  case "cite":
726  array_push($valid_elements, "cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
727  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
728  . "|title]");
729  break;
730  case "code":
731  array_push($valid_elements, "code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
732  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
733  . "|title]");
734  break;
735  case "col":
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]");
740  break;
741  case "colgroup":
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]");
746  break;
747  case "dd":
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]");
750  break;
751  case "del":
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]");
755  break;
756  case "dfn":
757  array_push($valid_elements, "dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
758  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
759  . "|title]");
760  break;
761  case "dir":
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]");
765  break;
766  case "div":
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]");
770  break;
771  case "dl":
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]");
775  break;
776  case "dt":
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]");
779  break;
780  case "em":
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"
783  . "|title]");
784  break;
785  case "fieldset":
786  array_push($valid_elements, "fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
787  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
788  . "|title]");
789  break;
790  case "font":
791  array_push($valid_elements, "font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
792  break;
793  case "form":
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]");
798  break;
799  case "frame":
800  array_push($valid_elements, "frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
801  . "|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
802  break;
803  case "frameset":
804  array_push($valid_elements, "frameset[class|cols|id|onload|onunload|rows|style|title]");
805  break;
806  case "h1":
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]");
810  break;
811  case "h2":
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]");
815  break;
816  case "h3":
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]");
820  break;
821  case "h4":
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]");
825  break;
826  case "h5":
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]");
830  break;
831  case "h6":
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]");
835  break;
836  case "head":
837  array_push($valid_elements, "head[dir<ltr?rtl|lang|profile]");
838  break;
839  case "hr":
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]");
843  break;
844  case "html":
845  array_push($valid_elements, "html[dir<ltr?rtl|lang|version]");
846  break;
847  case "iframe":
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"
850  . "|title|width]");
851  break;
852  case "img":
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]");
857  break;
858  case "input":
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"
865  . "|usemap|value]");
866  break;
867  case "ins":
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]");
871  break;
872  case "isindex":
873  array_push($valid_elements, "isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
874  break;
875  case "kbd":
876  array_push($valid_elements, "kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
877  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
878  . "|title]");
879  break;
880  case "label":
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]");
884  break;
885  case "legend":
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]");
889  break;
890  case "li":
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"
893  . "|value]");
894  break;
895  case "link":
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]");
899  break;
900  case "map":
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"
903  . "|title]");
904  break;
905  case "menu":
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]");
909  break;
910  case "meta":
911  array_push($valid_elements, "meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
912  break;
913  case "noframes":
914  array_push($valid_elements, "noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
915  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
916  . "|title]");
917  break;
918  case "noscript":
919  array_push($valid_elements, "noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
920  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
921  . "|title]");
922  break;
923  case "object":
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"
928  . "|vspace|width]");
929  break;
930  case "ol":
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]");
934  break;
935  case "optgroup":
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]");
939  break;
940  case "option":
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]");
944  break;
945  case "p":
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]");
949  break;
950  case "param":
951  array_push($valid_elements, "param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
952  break;
953  case "pre":
954  case "listing":
955  case "plaintext":
956  case "xmp":
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]");
960  break;
961  case "q":
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"
964  . "|title]");
965  break;
966  case "s":
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]");
969  break;
970  case "samp":
971  array_push($valid_elements, "samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
972  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
973  . "|title]");
974  break;
975  case "script":
976  array_push($valid_elements, "script[charset|defer|language|src|type]");
977  break;
978  case "select":
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]");
983  break;
984  case "small":
985  array_push($valid_elements, "small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
986  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
987  . "|title]");
988  break;
989  case "span":
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]");
993  break;
994  case "strike":
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]");
998  break;
999  case "strong":
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"
1002  . "|title]");
1003  break;
1004  case "style":
1005  array_push($valid_elements, "style[dir<ltr?rtl|lang|media|title|type]");
1006  break;
1007  case "sub":
1008  array_push($valid_elements, "sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1009  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1010  . "|title]");
1011  break;
1012  case "sup":
1013  array_push($valid_elements, "sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1014  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1015  . "|title]");
1016  break;
1017  case "table":
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]");
1022  break;
1023  case "tbody":
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]");
1028  break;
1029  case "td":
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]");
1035  break;
1036  case "textarea":
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]");
1041  break;
1042  case "tfoot":
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]");
1047  break;
1048  case "th":
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]");
1054  break;
1055  case "thead":
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]");
1060  break;
1061  case "title":
1062  array_push($valid_elements, "title[dir<ltr?rtl|lang]");
1063  break;
1064  case "tr":
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]");
1069  break;
1070  case "tt":
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]");
1073  break;
1074  case "u":
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]");
1077 
1078  // Bugfix #5945: Necessary because TinyMCE does not use the "u"
1079  // html element but <span style="text-decoration: underline">E</span>
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]");
1083  break;
1084  case "ul":
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]");
1088  break;
1089  case "var":
1090  array_push($valid_elements, "var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1091  . "|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1092  . "|title]");
1093  break;
1094  }
1095  }
1096  return join(",", $valid_elements);
1097  }
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
+ Here is the caller graph for this function:

◆ addCustomRTESupport()

ilTinyMCE::addCustomRTESupport (   $obj_id,
  $obj_type,
array  $tags 
)

{}

Definition at line 242 of file class.ilTinyMCE.php.

References $_COOKIE, ilRTE\$tpl, _buildAdvancedBlockformatsFromHTMLTags(), _buildAdvancedButtonsFromHTMLTags(), _buildAdvancedTableButtonsFromHTMLTags(), _getEditorLanguage(), _getValidElementsFromHTMLTags(), ilRTE\disableButtons(), ilUtil\getNewContentStyleSheetLocation(), ilRTE\getRTERootBlockElement(), getStyleSelect(), handleImagePluginsBeforeRendering(), handleImgContextMenuItem(), and vd().

243  {
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);
254  $tpl->setVariable("SESSION_ID", $_COOKIE[session_name()]);
255  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
256  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
257 
258  $this->disableButtons('charmap');
259  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
260  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
262  . ($this->getStyleSelect() ? ',styleselect' : '');
263  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
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));
267 
268  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
269  include_once "./Services/Utilities/classes/class.ilUtil.php";
270  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
271  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation());
272  $tpl->setVariable("LANG", $this->_getEditorLanguage());
273 
274  if ($this->getRTERootBlockElement() !== null) {
275  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
276  }
277 
278  $tpl->parseCurrentBlock();
279  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
280  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
_buildAdvancedButtonsFromHTMLTags($a_buttons_section, array $a_html_tags)
$_COOKIE['client_id']
Definition: server.php:9
handleImagePluginsBeforeRendering(array $tags)
getStyleSelect()
Get Enable Style Selecttion.
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user
_buildAdvancedTableButtonsFromHTMLTags(array $a_html_tags)
$tags
Definition: croninfo.php:19
special template class to simplify handling of ITX/PEAR
getRTERootBlockElement()
Getter for the RTE root block element.
handleImgContextMenuItem(ilTemplate $tpl)
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
_getValidElementsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:

◆ addInternalTinyMCEImageManager()

ilTinyMCE::addInternalTinyMCEImageManager ( )
protected

Definition at line 85 of file class.ilTinyMCE.php.

References League\Flysystem\Plugin\addPlugin(), ilRTE\disableButtons(), and setRemoveImgContextMenuItem().

Referenced by __construct(), and handleIliasImageManagerAdded().

86  {
87  if (!$this->client_init->readVariable('tinymce', 'use_advanced_img_mng')) {
88  parent::addPlugin('ilimgupload');
89  parent::addButton('ilimgupload');
90  parent::removePlugin('ibrowser');
91  parent::removePlugin('image');
92 
93  $this->disableButtons(array(
94  'ibrowser',
95  'image'
96  ));
97 
98  $this->setRemoveImgContextMenuItem(true);
99  } else {
100  parent::addPlugin('ibrowser');
101  parent::removePlugin('ilimgupload');
102  $this->disableButtons('ilimgupload');
103 
104  $this->setRemoveImgContextMenuItem(false);
105  }
106  }
addPlugin(PluginInterface $plugin)
Register a plugin.
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
setRemoveImgContextMenuItem($remove_img_context_menu_item)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPlugin()

ilTinyMCE::addPlugin (   $a_plugin_name)

{}

Definition at line 148 of file class.ilTinyMCE.php.

References League\Flysystem\Plugin\addPlugin(), and handleIliasImageManagerAdded().

149  {
150  if (self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name) {
152  } else {
153  parent::addPlugin($a_plugin_name);
154  }
155  }
addPlugin(PluginInterface $plugin)
Register a plugin.
handleIliasImageManagerAdded()
+ Here is the call graph for this function:

◆ addRTESupport()

ilTinyMCE::addRTESupport (   $obj_id,
  $obj_type,
  $a_module = "",
  $allowFormElements = false,
  $cfg_template = null,
  $hide_switch = false 
)

{}

Definition at line 172 of file class.ilTinyMCE.php.

References $_COOKIE, $tags, ilRTE\$tpl, _buildAdvancedBlockformatsFromHTMLTags(), _buildAdvancedButtonsFromHTMLTags(), _buildAdvancedTableButtonsFromHTMLTags(), _getEditorLanguage(), ilObjAdvancedEditing\_getRichTextEditor(), ilObjAdvancedEditing\_getRichTextEditorUserState(), ilObjAdvancedEditing\_getUsedHTMLTags(), _getValidElementsFromHTMLTags(), ilObjAdvancedEditing\_setRichTextEditorUserState(), ilRTE\getInitialWidth(), ilUtil\getNewContentStyleSheetLocation(), ilRTE\getRTERootBlockElement(), getStyleSelect(), ilUtil\getStyleSheetLocation(), handleImagePluginsBeforeRendering(), handleImgContextMenuItem(), and vd().

173  {
174  if ($this->browser->isMobile()) {
176  } else {
178  }
179 
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");
188  }
189  if ($this->getInitialWidth() !== null && $tpl->blockExists('initial_width')) {
190  $tpl->setCurrentBlock("initial_width");
191  $tpl->setVariable('INITIAL_WIDTH', $this->getInitialWidth());
192  $tpl->parseCurrentBlock();
193  }
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);
200  $tpl->setVariable("SESSION_ID", $_COOKIE[session_name()]);
201  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
202  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
203 
204  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
205  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
207  . ($this->getStyleSelect() ? ',styleselect' : '');
208  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
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));
212 
213  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
214  include_once "./Services/Utilities/classes/class.ilUtil.php";
215  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
216  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
217  $tpl->setVariable("LANG", $this->_getEditorLanguage());
218 
219  if ($this->getRTERootBlockElement() !== null) {
220  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
221  }
222 
223  $tpl->parseCurrentBlock();
224 
225  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
226  }
227  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
_buildAdvancedButtonsFromHTMLTags($a_buttons_section, array $a_html_tags)
$_COOKIE['client_id']
Definition: server.php:9
handleImagePluginsBeforeRendering(array $tags)
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
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
static _setRichTextEditorUserState($a_state)
Sets the state of the rich text editor visibility for the current user.
getInitialWidth()
_buildAdvancedTableButtonsFromHTMLTags(array $a_html_tags)
$tags
Definition: croninfo.php:19
special template class to simplify handling of ITX/PEAR
getRTERootBlockElement()
Getter for the RTE root block element.
static _getRichTextEditorUserState()
Gets the state of the rich text editor visibility for the current user.
handleImgContextMenuItem(ilTemplate $tpl)
_buildAdvancedBlockformatsFromHTMLTags(array $a_html_tags)
_getValidElementsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:

◆ addUserTextEditor()

ilTinyMCE::addUserTextEditor (   $editor_selector)

{}

Definition at line 285 of file class.ilTinyMCE.php.

References $template, _getEditorLanguage(), _getValidElementsFromHTMLTags(), getButtonsForUserTextEditor(), ilUtil\getNewContentStyleSheetLocation(), getStyleSelect(), ilUtil\getStyleSheetLocation(), handleImgContextMenuItem(), and vd().

286  {
287  $validtags = array("strong","em","p", "br", "div", "span");
288  $buttontags = array("strong","em");
289  include_once "./Services/UICore/classes/class.ilTemplate.php";
290  $template = new ilTemplate("tpl.usereditor.html", true, true, "Services/RTE");
292  $template->setCurrentBlock("tinymce");
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", "");
297  $template->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($validtags));
298  if ($this->getStyleSelect()) {
299  $template->setVariable("STYLE_SELECT", ",styleselect");
300  }
301  $template->setVariable("BUTTONS", $this->getButtonsForUserTextEditor($buttontags) . ",backcolor,removeformat");
302  include_once "./Services/Utilities/classes/class.ilUtil.php";
303  //$template->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
304  $template->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
305  $template->setVariable("LANG", $this->_getEditorLanguage());
306  $template->parseCurrentBlock();
307  $this->tpl->setCurrentBlock("HeadContent");
308  $this->tpl->setVariable("CONTENT_BLOCK", $template->get());
309  $this->tpl->parseCurrentBlock();
310  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
getStyleSelect()
Get Enable Style Selecttion.
$template
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user
special template class to simplify handling of ITX/PEAR
getButtonsForUserTextEditor(array $buttontags)
handleImgContextMenuItem(ilTemplate $tpl)
_getValidElementsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:

◆ getButtonsForUserTextEditor()

ilTinyMCE::getButtonsForUserTextEditor ( array  $buttontags)
protected
Parameters
array$buttontags
Returns
string

Definition at line 316 of file class.ilTinyMCE.php.

References _buildButtonsFromHTMLTags().

Referenced by addUserTextEditor().

317  {
318  $btns = $this->_buildButtonsFromHTMLTags($buttontags);
319 
320  $btns = explode(',', $btns);
321 
322  $btns[] = 'undo';
323  $btns[] = 'redo';
324 
325  return implode(',', $btns);
326  }
_buildButtonsFromHTMLTags(array $a_html_tags)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveImgContextMenuItem()

ilTinyMCE::getRemoveImgContextMenuItem ( )
Returns
boolean

Definition at line 1136 of file class.ilTinyMCE.php.

References $remove_img_context_menu_item.

Referenced by handleImgContextMenuItem().

1137  {
1139  }
$remove_img_context_menu_item
+ Here is the caller graph for this function:

◆ getStyleSelect()

ilTinyMCE::getStyleSelect ( )

Get Enable Style Selecttion.

Returns
boolean Enable Style Selecttion

Definition at line 343 of file class.ilTinyMCE.php.

References $styleselect.

Referenced by addCustomRTESupport(), addRTESupport(), and addUserTextEditor().

344  {
345  return $this->styleselect;
346  }
+ Here is the caller graph for this function:

◆ handleIliasImageManagerAdded()

ilTinyMCE::handleIliasImageManagerAdded ( )
protected

Definition at line 129 of file class.ilTinyMCE.php.

References addInternalTinyMCEImageManager().

Referenced by addPlugin().

130  {
132  }
addInternalTinyMCEImageManager()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleIliasImageManagerRemoved()

ilTinyMCE::handleIliasImageManagerRemoved ( )
protected

Definition at line 134 of file class.ilTinyMCE.php.

References ilRTE\disableButtons().

Referenced by removePlugin().

135  {
136  if (!$this->client_init->readVariable('tinymce', 'use_advanced_img_mng')) {
137  parent::removePlugin('ilimgupload');
138  $this->disableButtons('ilimgupload');
139  } else {
140  parent::removePlugin('ibrowser');
141  $this->disableButtons('ibrowser');
142  }
143  }
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleImagePluginsBeforeRendering()

ilTinyMCE::handleImagePluginsBeforeRendering ( array  $tags)
protected
Parameters
array$tags

Definition at line 111 of file class.ilTinyMCE.php.

References ilRTE\disableButtons(), and setRemoveImgContextMenuItem().

Referenced by addCustomRTESupport(), and addRTESupport().

112  {
113  if (!in_array('img', $tags)) {
114  $this->setRemoveImgContextMenuItem(true);
115  parent::removePlugin('ilimgupload');
116  parent::removePlugin('ibrowser');
117  parent::removePlugin('image');
118  $this->disableButtons(array(
119  'ibrowser',
120  'image',
121  'ilimgupload'
122  ));
123  }
124  }
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
$tags
Definition: croninfo.php:19
setRemoveImgContextMenuItem($remove_img_context_menu_item)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleImgContextMenuItem()

ilTinyMCE::handleImgContextMenuItem ( ilTemplate  $tpl)
protected
Parameters
ilTemplate$tpl

Definition at line 232 of file class.ilTinyMCE.php.

References ilTemplate\blockExists(), getRemoveImgContextMenuItem(), and ilTemplate\touchBlock().

Referenced by addCustomRTESupport(), addRTESupport(), and addUserTextEditor().

233  {
234  if ($this->getRemoveImgContextMenuItem() && $tpl->blockExists('remove_img_context_menu_item')) {
235  $tpl->touchBlock('remove_img_context_menu_item');
236  }
237  }
touchBlock($block)
overwrites ITX::touchBlock.
blockExists($a_blockname)
check if block exists in actual template private
getRemoveImgContextMenuItem()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removePlugin()

ilTinyMCE::removePlugin (   $a_plugin_name)

{}

Definition at line 160 of file class.ilTinyMCE.php.

References handleIliasImageManagerRemoved().

161  {
162  if (self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name) {
164  } else {
165  parent::removePlugin($a_plugin_name);
166  }
167  }
handleIliasImageManagerRemoved()
+ Here is the call graph for this function:

◆ removeRedundantSeparators()

static ilTinyMCE::removeRedundantSeparators (   $a_string)
static

Removes redundant seperators and removes ,, and , at the first or last position of the string.

Parameters
string$a_stringA string
Returns
string

Definition at line 1104 of file class.ilTinyMCE.php.

Referenced by ilSurveyPageGUI\renderPage().

1105  {
1106  while (strpos($a_string, 'separator,separator') !== false) {
1107  $a_string = str_replace('separator,separator', 'separator', $a_string);
1108  }
1109 
1110  while (strpos($a_string, ',,') !== false) {
1111  $a_string = str_replace(',,', ',', $a_string);
1112  }
1113 
1114  if ($a_string[0] == ',') {
1115  $a_string = (string) substr($a_string, 1);
1116  }
1117 
1118  if (strlen($a_string) && $a_string[strlen($a_string) - 1] == ',') {
1119  $a_string = substr($a_string, 0, strlen($a_string) - 1);
1120  }
1121 
1122  return $a_string;
1123  }
+ Here is the caller graph for this function:

◆ setRemoveImgContextMenuItem()

ilTinyMCE::setRemoveImgContextMenuItem (   $remove_img_context_menu_item)
Parameters
boolean$remove_img_context_menu_item

Definition at line 1128 of file class.ilTinyMCE.php.

References $remove_img_context_menu_item.

Referenced by addInternalTinyMCEImageManager(), and handleImagePluginsBeforeRendering().

1129  {
1130  $this->remove_img_context_menu_item = $remove_img_context_menu_item;
1131  }
$remove_img_context_menu_item
+ Here is the caller graph for this function:

◆ setStyleSelect()

ilTinyMCE::setStyleSelect (   $a_styleselect)
protected

Set Enable Style Selecttion.

boolean $a_styleselect Enable Style Selecttion

Definition at line 333 of file class.ilTinyMCE.php.

Referenced by __construct().

334  {
335  $this->styleselect = $a_styleselect;
336  }
+ Here is the caller graph for this function:

Field Documentation

◆ $mode

ilTinyMCE::$mode = 'textareas'
protected

Definition at line 17 of file class.ilTinyMCE.php.

◆ $remove_img_context_menu_item

ilTinyMCE::$remove_img_context_menu_item = false
protected

Definition at line 30 of file class.ilTinyMCE.php.

Referenced by getRemoveImgContextMenuItem(), and setRemoveImgContextMenuItem().

◆ $styleselect

ilTinyMCE::$styleselect = false
protected

Definition at line 24 of file class.ilTinyMCE.php.

Referenced by getStyleSelect().

◆ $vd

ilTinyMCE::$vd = ''
protected

Definition at line 19 of file class.ilTinyMCE.php.

◆ $version

ilTinyMCE::$version = ''
protected

Definition at line 18 of file class.ilTinyMCE.php.


The documentation for this class was generated from the following file: