ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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(), array, setStyleSelect(), and vd().

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

References array.

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

378  {
379  $blockformats = array();
380 
381  if (in_array("p", $a_html_tags))
382  {
383  array_push($blockformats, "p");
384  }
385  if (in_array("div", $a_html_tags))
386  {
387  array_push($blockformats, "div");
388  }
389  if (in_array("pre", $a_html_tags))
390  {
391  array_push($blockformats, "pre");
392  }
393  if (in_array("code", $a_html_tags))
394  {
395  array_push($blockformats, "code");
396  }
397  if (in_array("h1", $a_html_tags))
398  {
399  array_push($blockformats, "h1");
400  }
401  if (in_array("h2", $a_html_tags))
402  {
403  array_push($blockformats, "h2");
404  }
405  if (in_array("h3", $a_html_tags))
406  {
407  array_push($blockformats, "h3");
408  }
409  if (in_array("h4", $a_html_tags))
410  {
411  array_push($blockformats, "h4");
412  }
413  if (in_array("h5", $a_html_tags))
414  {
415  array_push($blockformats, "h5");
416  }
417  if (in_array("h6", $a_html_tags))
418  {
419  array_push($blockformats, "h6");
420  }
421  if (count($blockformats))
422  {
423  return join(",", $blockformats);
424  }
425  else
426  {
427  return "";
428  }
429  }
Create styles array
The data for the language used.
+ 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 436 of file class.ilTinyMCE.php.

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

Referenced by addCustomRTESupport(), and addRTESupport().

437  {
438  $theme_advanced_buttons = array();
439 
440  if($a_buttons_section == 1)
441  {
442  if (in_array("strong", $a_html_tags))
443  {
444  array_push($theme_advanced_buttons, "bold");
445  }
446  if (in_array("em", $a_html_tags))
447  {
448  array_push($theme_advanced_buttons, "italic");
449  }
450  if (in_array("u", $a_html_tags))
451  {
452  array_push($theme_advanced_buttons, "underline");
453  }
454  if (in_array("strike", $a_html_tags))
455  {
456  array_push($theme_advanced_buttons, "strikethrough");
457  }
458  if (count($theme_advanced_buttons))
459  {
460  array_push($theme_advanced_buttons, "separator");
461  }
462  if (in_array("p", $a_html_tags))
463  {
464  array_push($theme_advanced_buttons, "justifyleft");
465  array_push($theme_advanced_buttons, "justifycenter");
466  array_push($theme_advanced_buttons, "justifyright");
467  array_push($theme_advanced_buttons, "justifyfull");
468  array_push($theme_advanced_buttons, "separator");
469  }
470  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags)))
471  {
472  array_push($theme_advanced_buttons, "formatselect");
473  }
474  if (in_array("hr", $a_html_tags))
475  {
476  array_push($theme_advanced_buttons, "hr");
477  }
478  array_push($theme_advanced_buttons, "removeformat");
479  array_push($theme_advanced_buttons, "separator");
480  if (in_array("sub", $a_html_tags))
481  {
482  array_push($theme_advanced_buttons, "sub");
483  }
484  if (in_array("sup", $a_html_tags))
485  {
486  array_push($theme_advanced_buttons, "sup");
487  }
488  if (in_array("font", $a_html_tags))
489  {
490  array_push($theme_advanced_buttons, "fontselect");
491  array_push($theme_advanced_buttons, "fontsizeselect");
492  }
493  array_push($theme_advanced_buttons, "charmap");
494  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags)))
495  {
496  array_push($theme_advanced_buttons, "bullist");
497  }
498  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags)))
499  {
500  array_push($theme_advanced_buttons, "numlist");
501  }
502  array_push($theme_advanced_buttons, "separator");
503  if (in_array("cite", $a_html_tags))
504  {
505  array_push($theme_advanced_buttons, "cite");
506  }
507  if (in_array("abbr", $a_html_tags))
508  {
509  array_push($theme_advanced_buttons, "abbr");
510  }
511  if (in_array("acronym", $a_html_tags))
512  {
513  array_push($theme_advanced_buttons, "acronym");
514  }
515  if (in_array("del", $a_html_tags))
516  {
517  array_push($theme_advanced_buttons, "del");
518  }
519  if (in_array("ins", $a_html_tags))
520  {
521  array_push($theme_advanced_buttons, "ins");
522  }
523  if (in_array("blockquote", $a_html_tags))
524  {
525  array_push($theme_advanced_buttons, "indent");
526  array_push($theme_advanced_buttons, "outdent");
527  }
528  if (in_array("img", $a_html_tags))
529  {
530  //array_push($theme_advanced_buttons, "advimage");
531  array_push($theme_advanced_buttons, "image");
532  array_push($theme_advanced_buttons, "ibrowser");
533  array_push($theme_advanced_buttons, "ilimgupload");
534  }
535  if (in_array("a", $a_html_tags))
536  {
537  array_push($theme_advanced_buttons, "link");
538  array_push($theme_advanced_buttons, "unlink");
539  array_push($theme_advanced_buttons, "anchor");
540  }
541  array_push($theme_advanced_buttons, "separator");
542  array_push($theme_advanced_buttons, "undo");
543  array_push($theme_advanced_buttons, "redo");
544 
545  if(is_array($this->buttons) && count($this->buttons))
546  {
547  array_push($theme_advanced_buttons, "separator");
548  foreach($this->buttons as $button)
549  {
550  array_push($theme_advanced_buttons, $button);
551  }
552  }
553 
554  array_push($theme_advanced_buttons, "code");
555  array_push($theme_advanced_buttons, "fullscreen");
556 
557  // Changed in elba2 branch, adopted change for 4.2.x due to manits bug #8147
558  array_push($theme_advanced_buttons, "pasteword");
559  }
560  else if($a_buttons_section == 2)
561  {
562  array_push($theme_advanced_buttons, "cut");
563  array_push($theme_advanced_buttons, "copy");
564  array_push($theme_advanced_buttons, "paste");
565  array_push($theme_advanced_buttons, "pastetext");
566  // Changed in elba2 branch, adopted change for 4.2.x due to manits bug #8147
567  //array_push($theme_advanced_buttons, "pasteword");
568  }
569  else if($a_buttons_section == 3)
570  {
571  }
572 
573  $remove_buttons = $this->getDisabledButtons();
574  if (is_array($remove_buttons))
575  {
576  foreach ($remove_buttons as $buttontext)
577  {
578  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
579  {
580  unset($theme_advanced_buttons[$res]);
581  }
582  }
583  }
584 
585  return join(",", $theme_advanced_buttons);
586  }
Create styles array
The data for the language used.
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 705 of file class.ilTinyMCE.php.

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

706  {
707  $theme_advanced_buttons = array();
708  if (in_array("table", $a_html_tags) && in_array("tr", $a_html_tags) && in_array("td", $a_html_tags))
709  {
710  array_push($theme_advanced_buttons, "tablecontrols");
711  }
712 
713  $remove_buttons = $this->getDisabledButtons();
714  if (is_array($remove_buttons))
715  {
716  foreach ($remove_buttons as $buttontext)
717  {
718  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
719  {
720  unset($theme_advanced_buttons[$res]);
721  }
722  }
723  }
724 
725  return join(",", $theme_advanced_buttons);
726  }
Create styles array
The data for the language used.
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
+ Here is the call graph for this function:

◆ _buildButtonsFromHTMLTags()

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

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

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

Referenced by getButtonsForUserTextEditor().

593  {
594  $theme_advanced_buttons = array();
595  if (in_array("strong", $a_html_tags))
596  {
597  array_push($theme_advanced_buttons, "bold");
598  }
599  if (in_array("em", $a_html_tags))
600  {
601  array_push($theme_advanced_buttons, "italic");
602  }
603  if (in_array("u", $a_html_tags))
604  {
605  array_push($theme_advanced_buttons, "underline");
606  }
607  if (in_array("strike", $a_html_tags))
608  {
609  array_push($theme_advanced_buttons, "strikethrough");
610  }
611  if (in_array("p", $a_html_tags))
612  {
613  array_push($theme_advanced_buttons, "justifyleft");
614  array_push($theme_advanced_buttons, "justifycenter");
615  array_push($theme_advanced_buttons, "justifyright");
616  array_push($theme_advanced_buttons, "justifyfull");
617  }
618  if (strlen(ilTinyMCE::_buildAdvancedBlockformatsFromHTMLTags($a_html_tags)))
619  {
620  array_push($theme_advanced_buttons, "formatselect");
621  }
622  if (in_array("hr", $a_html_tags))
623  {
624  array_push($theme_advanced_buttons, "hr");
625  }
626  if (in_array("sub", $a_html_tags))
627  {
628  array_push($theme_advanced_buttons, "sub");
629  }
630  if (in_array("sup", $a_html_tags))
631  {
632  array_push($theme_advanced_buttons, "sup");
633  }
634  if (in_array("font", $a_html_tags))
635  {
636  array_push($theme_advanced_buttons, "fontselect");
637  array_push($theme_advanced_buttons, "fontsizeselect");
638  }
639  if ((in_array("ol", $a_html_tags)) && (in_array("li", $a_html_tags)))
640  {
641  array_push($theme_advanced_buttons, "bullist");
642  }
643  if ((in_array("ul", $a_html_tags)) && (in_array("li", $a_html_tags)))
644  {
645  array_push($theme_advanced_buttons, "numlist");
646  }
647  if (in_array("cite", $a_html_tags))
648  {
649  array_push($theme_advanced_buttons, "cite");
650  }
651  if (in_array("abbr", $a_html_tags))
652  {
653  array_push($theme_advanced_buttons, "abbr");
654  }
655  if (in_array("acronym", $a_html_tags))
656  {
657  array_push($theme_advanced_buttons, "acronym");
658  }
659  if (in_array("del", $a_html_tags))
660  {
661  array_push($theme_advanced_buttons, "del");
662  }
663  if (in_array("ins", $a_html_tags))
664  {
665  array_push($theme_advanced_buttons, "ins");
666  }
667  if (in_array("blockquote", $a_html_tags))
668  {
669  array_push($theme_advanced_buttons, "indent");
670  array_push($theme_advanced_buttons, "outdent");
671  }
672  if (in_array("img", $a_html_tags))
673  {
674  //array_push($theme_advanced_buttons, "advimage");
675  array_push($theme_advanced_buttons, "image");
676  array_push($theme_advanced_buttons, "ibrowser");
677  array_push($theme_advanced_buttons, "ilimgupload");
678  }
679  if (in_array("a", $a_html_tags))
680  {
681  array_push($theme_advanced_buttons, "link");
682  array_push($theme_advanced_buttons, "unlink");
683  array_push($theme_advanced_buttons, "anchor");
684  }
685 
686  $remove_buttons = $this->getDisabledButtons();
687  if (is_array($remove_buttons))
688  {
689  foreach ($remove_buttons as $buttontext)
690  {
691  if (($res = array_search($buttontext, $theme_advanced_buttons)) !== FALSE)
692  {
693  unset($theme_advanced_buttons[$res]);
694  }
695  }
696  }
697 
698  return join(",", $theme_advanced_buttons);
699  }
Create styles array
The data for the language used.
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 728 of file class.ilTinyMCE.php.

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

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

729  {
730  $lang = $this->user->getLanguage();
731  if(file_exists("./Services/RTE/tiny_mce" . $this->vd . "/langs/$lang.js"))
732  {
733  return "$lang";
734  }
735  else
736  {
737  return "en";
738  }
739  }
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 745 of file class.ilTinyMCE.php.

References array.

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

746  {
747  $valid_elements = array();
748  foreach($a_html_tags as $tag)
749  {
750  switch ($tag)
751  {
752  case "a":
753  array_push($valid_elements, "a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name"
754  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
755  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev"
756  ."|shape<circle?default?poly?rect|style|tabindex|title|target|type]");
757  break;
758  case "abbr":
759  array_push($valid_elements, "abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
760  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
761  ."|title]");
762  break;
763  case "acronym":
764  array_push($valid_elements, "acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress"
765  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
766  ."|title]");
767  break;
768  case "address":
769  array_push($valid_elements, "address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
770  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
771  ."|onmouseup|style|title]");
772  break;
773  case "applet":
774  array_push($valid_elements, "applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase"
775  ."|height|hspace|id|name|object|style|title|vspace|width]");
776  break;
777  case "area":
778  array_push($valid_elements, "area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref"
779  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
780  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup"
781  ."|shape<circle?default?poly?rect|style|tabindex|title|target]");
782  break;
783  case "base":
784  array_push($valid_elements, "base[href|target]");
785  break;
786  case "basefont":
787  array_push($valid_elements, "basefont[color|face|id|size]");
788  break;
789  case "bdo":
790  array_push($valid_elements, "bdo[class|dir<ltr?rtl|id|lang|style|title]");
791  break;
792  case "big":
793  array_push($valid_elements, "big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
794  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
795  ."|title]");
796  break;
797  case "blockquote":
798  array_push($valid_elements, "blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
799  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
800  ."|onmouseover|onmouseup|style|title]");
801  break;
802  case "body":
803  array_push($valid_elements, "body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick"
804  ."|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove"
805  ."|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]");
806  break;
807  case "br":
808  array_push($valid_elements, "br[class|clear<all?left?none?right|id|style|title]");
809  break;
810  case "button":
811  array_push($valid_elements, "button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur"
812  ."|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown"
813  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type"
814  ."|value]");
815  break;
816  case "caption":
817  array_push($valid_elements, "caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick"
818  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
819  ."|onmouseout|onmouseover|onmouseup|style|title]");
820  break;
821  case "center":
822  array_push($valid_elements, "center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
823  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
824  ."|title]");
825  break;
826  case "cite":
827  array_push($valid_elements, "cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
828  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
829  ."|title]");
830  break;
831  case "code":
832  array_push($valid_elements, "code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
833  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
834  ."|title]");
835  break;
836  case "col":
837  array_push($valid_elements, "col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
838  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
839  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
840  ."|valign<baseline?bottom?middle?top|width]");
841  break;
842  case "colgroup":
843  array_push($valid_elements, "colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl"
844  ."|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
845  ."|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
846  ."|valign<baseline?bottom?middle?top|width]");
847  break;
848  case "dd":
849  array_push($valid_elements, "dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
850  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
851  break;
852  case "del":
853  array_push($valid_elements, "del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
854  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
855  ."|onmouseup|style|title]");
856  break;
857  case "dfn":
858  array_push($valid_elements, "dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
859  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
860  ."|title]");
861  break;
862  case "dir":
863  array_push($valid_elements, "dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
864  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
865  ."|onmouseup|style|title]");
866  break;
867  case "div":
868  array_push($valid_elements, "div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
869  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
870  ."|onmouseout|onmouseover|onmouseup|style|title]");
871  break;
872  case "dl":
873  array_push($valid_elements, "dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
874  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
875  ."|onmouseup|style|title]");
876  break;
877  case "dt":
878  array_push($valid_elements, "dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
879  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
880  break;
881  case "em":
882  array_push($valid_elements, "em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
883  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
884  ."|title]");
885  break;
886  case "fieldset":
887  array_push($valid_elements, "fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
888  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
889  ."|title]");
890  break;
891  case "font":
892  array_push($valid_elements, "font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]");
893  break;
894  case "form":
895  array_push($valid_elements, "form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang"
896  ."|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
897  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit"
898  ."|style|title|target]");
899  break;
900  case "frame":
901  array_push($valid_elements, "frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
902  ."|noresize<noresize|scrolling<auto?no?yes|src|style|title]");
903  break;
904  case "frameset":
905  array_push($valid_elements, "frameset[class|cols|id|onload|onunload|rows|style|title]");
906  break;
907  case "h1":
908  array_push($valid_elements, "h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
909  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
910  ."|onmouseout|onmouseover|onmouseup|style|title]");
911  break;
912  case "h2":
913  array_push($valid_elements, "h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
914  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
915  ."|onmouseout|onmouseover|onmouseup|style|title]");
916  break;
917  case "h3":
918  array_push($valid_elements, "h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
919  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
920  ."|onmouseout|onmouseover|onmouseup|style|title]");
921  break;
922  case "h4":
923  array_push($valid_elements, "h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
924  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
925  ."|onmouseout|onmouseover|onmouseup|style|title]");
926  break;
927  case "h5":
928  array_push($valid_elements, "h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
929  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
930  ."|onmouseout|onmouseover|onmouseup|style|title]");
931  break;
932  case "h6":
933  array_push($valid_elements, "h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
934  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
935  ."|onmouseout|onmouseover|onmouseup|style|title]");
936  break;
937  case "head":
938  array_push($valid_elements, "head[dir<ltr?rtl|lang|profile]");
939  break;
940  case "hr":
941  array_push($valid_elements, "hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick"
942  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
943  ."|onmouseout|onmouseover|onmouseup|size|style|title|width]");
944  break;
945  case "html":
946  array_push($valid_elements, "html[dir<ltr?rtl|lang|version]");
947  break;
948  case "iframe":
949  array_push($valid_elements, "iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"
950  ."|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"
951  ."|title|width]");
952  break;
953  case "img":
954  array_push($valid_elements, "img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
955  ."|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
956  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
957  ."|onmouseup|src|style|title|usemap|vspace|width]");
958  break;
959  case "input":
960  array_push($valid_elements, "input[accept|accesskey|align<bottom?left?middle?right?top|alt"
961  ."|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang"
962  ."|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress"
963  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
964  ."|readonly<readonly|size|src|style|tabindex|title"
965  ."|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text"
966  ."|usemap|value]");
967  break;
968  case "ins":
969  array_push($valid_elements, "ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
970  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
971  ."|onmouseup|style|title]");
972  break;
973  case "isindex":
974  array_push($valid_elements, "isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]");
975  break;
976  case "kbd":
977  array_push($valid_elements, "kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
978  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
979  ."|title]");
980  break;
981  case "label":
982  array_push($valid_elements, "label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick"
983  ."|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
984  ."|onmouseover|onmouseup|style|title]");
985  break;
986  case "legend":
987  array_push($valid_elements, "legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang"
988  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
989  ."|onmouseout|onmouseover|onmouseup|style|title]");
990  break;
991  case "li":
992  array_push($valid_elements, "li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
993  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type"
994  ."|value]");
995  break;
996  case "link":
997  array_push($valid_elements, "link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick"
998  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
999  ."|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]");
1000  break;
1001  case "map":
1002  array_push($valid_elements, "map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress"
1003  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1004  ."|title]");
1005  break;
1006  case "menu":
1007  array_push($valid_elements, "menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1008  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1009  ."|onmouseup|style|title]");
1010  break;
1011  case "meta":
1012  array_push($valid_elements, "meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]");
1013  break;
1014  case "noframes":
1015  array_push($valid_elements, "noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1016  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1017  ."|title]");
1018  break;
1019  case "noscript":
1020  array_push($valid_elements, "noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1021  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1022  ."|title]");
1023  break;
1024  case "object":
1025  array_push($valid_elements, "object[align<bottom?left?middle?right?top|archive|border|class|classid"
1026  ."|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name"
1027  ."|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1028  ."|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap"
1029  ."|vspace|width]");
1030  break;
1031  case "ol":
1032  array_push($valid_elements, "ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1033  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1034  ."|onmouseup|start|style|title|type]");
1035  break;
1036  case "optgroup":
1037  array_push($valid_elements, "optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick"
1038  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1039  ."|onmouseout|onmouseover|onmouseup|style|title]");
1040  break;
1041  case "option":
1042  array_push($valid_elements, "option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick"
1043  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
1044  ."|onmouseover|onmouseup|selected<selected|style|title|value]");
1045  break;
1046  case "p":
1047  array_push($valid_elements, "p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
1048  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1049  ."|onmouseout|onmouseover|onmouseup|style|title]");
1050  break;
1051  case "param":
1052  array_push($valid_elements, "param[id|name|type|value|valuetype<DATA?OBJECT?REF]");
1053  break;
1054  case "pre":
1055  case "listing":
1056  case "plaintext":
1057  case "xmp":
1058  array_push($valid_elements, "pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
1059  ."|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
1060  ."|onmouseover|onmouseup|style|title|width]");
1061  break;
1062  case "q":
1063  array_push($valid_elements, "q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1064  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1065  ."|title]");
1066  break;
1067  case "s":
1068  array_push($valid_elements, "s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1069  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1070  break;
1071  case "samp":
1072  array_push($valid_elements, "samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1073  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1074  ."|title]");
1075  break;
1076  case "script":
1077  array_push($valid_elements, "script[charset|defer|language|src|type]");
1078  break;
1079  case "select":
1080  array_push($valid_elements, "select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name"
1081  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
1082  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style"
1083  ."|tabindex|title]");
1084  break;
1085  case "small":
1086  array_push($valid_elements, "small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1087  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1088  ."|title]");
1089  break;
1090  case "span":
1091  array_push($valid_elements, "span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1092  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1093  ."|onmouseup|style|title]");
1094  break;
1095  case "strike":
1096  array_push($valid_elements, "strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1097  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1098  ."|onmouseup|style|title]");
1099  break;
1100  case "strong":
1101  array_push($valid_elements, "strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1102  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1103  ."|title]");
1104  break;
1105  case "style":
1106  array_push($valid_elements, "style[dir<ltr?rtl|lang|media|title|type]");
1107  break;
1108  case "sub":
1109  array_push($valid_elements, "sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1110  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1111  ."|title]");
1112  break;
1113  case "sup":
1114  array_push($valid_elements, "sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1115  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1116  ."|title]");
1117  break;
1118  case "table":
1119  array_push($valid_elements, "table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class"
1120  ."|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1121  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules"
1122  ."|style|summary|title|width]");
1123  break;
1124  case "tbody":
1125  array_push($valid_elements, "tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id"
1126  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1127  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1128  ."|valign<baseline?bottom?middle?top]");
1129  break;
1130  case "td":
1131  array_push($valid_elements, "td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1132  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1133  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1134  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1135  ."|style|title|valign<baseline?bottom?middle?top|width]");
1136  break;
1137  case "textarea":
1138  array_push($valid_elements, "textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name"
1139  ."|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
1140  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
1141  ."|readonly<readonly|rows|style|tabindex|title]");
1142  break;
1143  case "tfoot":
1144  array_push($valid_elements, "tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1145  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1146  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1147  ."|valign<baseline?bottom?middle?top]");
1148  break;
1149  case "th":
1150  array_push($valid_elements, "th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
1151  ."|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
1152  ."|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
1153  ."|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
1154  ."|style|title|valign<baseline?bottom?middle?top|width]");
1155  break;
1156  case "thead":
1157  array_push($valid_elements, "thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
1158  ."|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
1159  ."|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
1160  ."|valign<baseline?bottom?middle?top]");
1161  break;
1162  case "title":
1163  array_push($valid_elements, "title[dir<ltr?rtl|lang]");
1164  break;
1165  case "tr":
1166  array_push($valid_elements, "tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class"
1167  ."|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1168  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1169  ."|title|valign<baseline?bottom?middle?top]");
1170  break;
1171  case "tt":
1172  array_push($valid_elements, "tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1173  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1174  break;
1175  case "u":
1176  array_push($valid_elements, "u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
1177  ."|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]");
1178 
1179  // Bugfix #5945: Necessary because TinyMCE does not use the "u"
1180  // html element but <span style="text-decoration: underline">E</span>
1181  array_push($valid_elements, "span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1182  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1183  ."|onmouseup|style|title]");
1184  break;
1185  case "ul":
1186  array_push($valid_elements, "ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
1187  ."|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
1188  ."|onmouseup|style|title|type]");
1189  break;
1190  case "var":
1191  array_push($valid_elements, "var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
1192  ."|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
1193  ."|title]");
1194  break;
1195  }
1196  }
1197  return join(",", $valid_elements);
1198  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addCustomRTESupport()

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

{}

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

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

266  {
267  $this->handleImagePluginsBeforeRendering($tags);
268  include_once "./Services/UICore/classes/class.ilTemplate.php";
269  $tpl = new ilTemplate("tpl.tinymce.html", true, true, "Services/RTE");
271  $tpl->setCurrentBlock("tinymce");
272  $tpl->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce".$this->vd."/tiny_mce.js");
273  include_once "./Services/Object/classes/class.ilObject.php";
274  $tpl->setVariable("OBJ_ID", $obj_id);
275  $tpl->setVariable("OBJ_TYPE", $obj_type);
276  $tpl->setVariable("CLIENT_ID", CLIENT_ID);
277  $tpl->setVariable("SESSION_ID", $_COOKIE["PHPSESSID"]);
278  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
279  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
280 
281  $this->disableButtons('charmap');
282  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
283  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
284  . ','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
285  . ($this->getStyleSelect() ? ',styleselect' : '');
286  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
287  $tpl->setVariable('BUTTONS_1', self::removeRedundantSeparators($buttons_1));
288  $tpl->setVariable('BUTTONS_2', self::removeRedundantSeparators($buttons_2));
289  $tpl->setVariable('BUTTONS_3', self::removeRedundantSeparators($buttons_3));
290 
291  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
292  include_once "./Services/Utilities/classes/class.ilUtil.php";
293  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
294  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation());
295  $tpl->setVariable("LANG", $this->_getEditorLanguage());
296 
297  if($this->getRTERootBlockElement() !== null)
298  {
299  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
300  }
301 
302  $tpl->parseCurrentBlock();
303  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
304  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
_buildAdvancedButtonsFromHTMLTags($a_buttons_section, array $a_html_tags)
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
special template class to simplify handling of ITX/PEAR
getRTERootBlockElement()
Getter for the RTE root block element.
handleImgContextMenuItem(ilTemplate $tpl)
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
_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 87 of file class.ilTinyMCE.php.

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

Referenced by __construct(), and handleIliasImageManagerAdded().

88  {
89  if(!$this->client_init->readVariable('tinymce', 'use_advanced_img_mng'))
90  {
91  parent::addPlugin('ilimgupload');
92  parent::addButton('ilimgupload');
93  parent::removePlugin('ibrowser');
94  parent::removePlugin('image');
95 
96  $this->disableButtons(array(
97  'ibrowser',
98  'image'
99  ));
100 
101  $this->setRemoveImgContextMenuItem(true);
102  }
103  else
104  {
105  parent::addPlugin('ibrowser');
106  parent::removePlugin('ilimgupload');
107  $this->disableButtons('ilimgupload');
108 
109  $this->setRemoveImgContextMenuItem(false);
110  }
111  }
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
Create styles array
The data for the language used.
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 157 of file class.ilTinyMCE.php.

References handleIliasImageManagerAdded().

158  {
159  if(self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name)
160  {
162  }
163  else
164  {
165  parent::addPlugin($a_plugin_name);
166  }
167  }
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 187 of file class.ilTinyMCE.php.

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

188  {
189  if($this->browser->isMobile())
190  {
192  }
193  else
194  {
196  }
197 
198  include_once "./Services/UICore/classes/class.ilTemplate.php";
200  {
201  $tpl = new ilTemplate(($cfg_template === null ? "tpl.tinymce.html" : $cfg_template), true, true, "Services/RTE");
203  $tags = ilObjAdvancedEditing::_getUsedHTMLTags($a_module);
204  $this->handleImagePluginsBeforeRendering($tags);
205  if ($allowFormElements)
206  {
207  $tpl->touchBlock("formelements");
208  }
209  if($this->getInitialWidth() !== null && $tpl->blockExists('initial_width'))
210  {
211  $tpl->setCurrentBlock("initial_width");
212  $tpl->setVariable('INITIAL_WIDTH', $this->getInitialWidth());
213  $tpl->parseCurrentBlock();
214  }
215  $tpl->setCurrentBlock("tinymce");
216  $tpl->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce".$this->vd."/tiny_mce.js");
217  include_once "./Services/Object/classes/class.ilObject.php";
218  $tpl->setVariable("OBJ_ID", $obj_id);
219  $tpl->setVariable("OBJ_TYPE", $obj_type);
220  $tpl->setVariable("CLIENT_ID", CLIENT_ID);
221  $tpl->setVariable("SESSION_ID", $_COOKIE["PHPSESSID"]);
222  $tpl->setVariable("BLOCKFORMATS", $this->_buildAdvancedBlockformatsFromHTMLTags($tags));
223  $tpl->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($tags));
224 
225  $buttons_1 = $this->_buildAdvancedButtonsFromHTMLTags(1, $tags);
226  $buttons_2 = $this->_buildAdvancedButtonsFromHTMLTags(2, $tags)
227  . ','.$this->_buildAdvancedTableButtonsFromHTMLTags($tags)
228  . ($this->getStyleSelect() ? ',styleselect' : '');
229  $buttons_3 = $this->_buildAdvancedButtonsFromHTMLTags(3, $tags);
230  $tpl->setVariable('BUTTONS_1', self::removeRedundantSeparators($buttons_1));
231  $tpl->setVariable('BUTTONS_2', self::removeRedundantSeparators($buttons_2));
232  $tpl->setVariable('BUTTONS_3', self::removeRedundantSeparators($buttons_3));
233 
234  $tpl->setVariable("ADDITIONAL_PLUGINS", join(",", $this->plugins));
235  include_once "./Services/Utilities/classes/class.ilUtil.php";
236  //$tpl->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
237  $tpl->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
238  $tpl->setVariable("LANG", $this->_getEditorLanguage());
239 
240  if($this->getRTERootBlockElement() !== null)
241  {
242  $tpl->setVariable('FORCED_ROOT_BLOCK', $this->getRTERootBlockElement());
243  }
244 
245  $tpl->parseCurrentBlock();
246 
247  $this->tpl->setVariable("CONTENT_BLOCK", $tpl->get());
248  }
249  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
_buildAdvancedButtonsFromHTMLTags($a_buttons_section, array $a_html_tags)
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()
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)
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
_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 309 of file class.ilTinyMCE.php.

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

310  {
311  $validtags = array("strong","em","p", "br", "div", "span");
312  $buttontags = array("strong","em");
313  include_once "./Services/UICore/classes/class.ilTemplate.php";
314  $template = new ilTemplate("tpl.usereditor.html", true, true, "Services/RTE");
315  $this->handleImgContextMenuItem($template);
316  $template->setCurrentBlock("tinymce");
317  $template->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce".$this->vd."/tiny_mce.js");
318  include_once "./Services/Object/classes/class.ilObject.php";
319  $template->setVariable("SELECTOR", $editor_selector);
320  $template->setVariable("BLOCKFORMATS", "");
321  $template->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($validtags));
322  if ($this->getStyleSelect())
323  {
324  $template->setVariable("STYLE_SELECT", ",styleselect");
325  }
326  $template->setVariable("BUTTONS", $this->getButtonsForUserTextEditor($buttontags) . ",backcolor,removeformat");
327  include_once "./Services/Utilities/classes/class.ilUtil.php";
328  //$template->setVariable("STYLESHEET_LOCATION", $this->getContentCSS());
329  $template->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css"));
330  $template->setVariable("LANG", $this->_getEditorLanguage());
331  $template->parseCurrentBlock();
332  $this->tpl->setCurrentBlock("HeadContent");
333  $this->tpl->setVariable("CONTENT_BLOCK", $template->get());
334  $this->tpl->parseCurrentBlock();
335  }
vd()
shortcut for var_dump with enhanced debug information
Definition: inc.debug.php:42
getStyleSelect()
Get Enable Style Selecttion.
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
Create styles array
The data for the language used.
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 341 of file class.ilTinyMCE.php.

References _buildButtonsFromHTMLTags().

Referenced by addUserTextEditor().

342  {
343  $btns = $this->_buildButtonsFromHTMLTags($buttontags);
344 
345  $btns = explode(',', $btns);
346 
347  $btns[] = 'undo';
348  $btns[] = 'redo';
349 
350  return implode(',', $btns);
351  }
_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 1241 of file class.ilTinyMCE.php.

References $remove_img_context_menu_item.

Referenced by handleImgContextMenuItem().

1242  {
1244  }
$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 368 of file class.ilTinyMCE.php.

References $styleselect.

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

369  {
370  return $this->styleselect;
371  }
+ Here is the caller graph for this function:

◆ handleIliasImageManagerAdded()

ilTinyMCE::handleIliasImageManagerAdded ( )
protected

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

References addInternalTinyMCEImageManager().

Referenced by addPlugin().

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

◆ handleIliasImageManagerRemoved()

ilTinyMCE::handleIliasImageManagerRemoved ( )
protected

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

References ilRTE\disableButtons().

Referenced by removePlugin().

141  {
142  if(!$this->client_init->readVariable('tinymce', 'use_advanced_img_mng'))
143  {
144  parent::removePlugin('ilimgupload');
145  $this->disableButtons('ilimgupload');
146  }
147  else
148  {
149  parent::removePlugin('ibrowser');
150  $this->disableButtons('ibrowser');
151  }
152  }
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 116 of file class.ilTinyMCE.php.

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

Referenced by addCustomRTESupport(), and addRTESupport().

117  {
118  if(!in_array('img', $tags))
119  {
120  $this->setRemoveImgContextMenuItem(true);
121  parent::removePlugin('ilimgupload');
122  parent::removePlugin('ibrowser');
123  parent::removePlugin('image');
124  $this->disableButtons(array(
125  'ibrowser',
126  'image',
127  'ilimgupload'
128  ));
129  }
130  }
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
Create styles array
The data for the language used.
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 254 of file class.ilTinyMCE.php.

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

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

255  {
256  if($this->getRemoveImgContextMenuItem() && $tpl->blockExists('remove_img_context_menu_item'))
257  {
258  $tpl->touchBlock('remove_img_context_menu_item');
259  }
260  }
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 172 of file class.ilTinyMCE.php.

References handleIliasImageManagerRemoved().

173  {
174  if(self::ILIAS_IMG_MANAGER_PLUGIN == $a_plugin_name)
175  {
177  }
178  else
179  {
180  parent::removePlugin($a_plugin_name);
181  }
182  }
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 1205 of file class.ilTinyMCE.php.

References string.

Referenced by ilSurveyPageGUI\renderPage().

1206  {
1207  while(strpos($a_string, 'separator,separator') !== false)
1208  {
1209  $a_string = str_replace('separator,separator', 'separator', $a_string);
1210  }
1211 
1212  while(strpos($a_string, ',,') !== false)
1213  {
1214  $a_string = str_replace(',,', ',', $a_string);
1215  }
1216 
1217  if($a_string{0} == ',')
1218  {
1219  $a_string = (string)substr($a_string, 1);
1220  }
1221 
1222  if(strlen($a_string) && $a_string{strlen($a_string) - 1} == ',')
1223  {
1224  $a_string = substr($a_string, 0, strlen($a_string) - 1);
1225  }
1226 
1227  return $a_string;
1228  }
Add rich text string
The name of the decorator.
+ 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 1233 of file class.ilTinyMCE.php.

References $remove_img_context_menu_item.

Referenced by addInternalTinyMCEImageManager(), and handleImagePluginsBeforeRendering().

1234  {
1235  $this->remove_img_context_menu_item = $remove_img_context_menu_item;
1236  }
$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 358 of file class.ilTinyMCE.php.

Referenced by __construct().

359  {
360  $this->styleselect = $a_styleselect;
361  }
+ 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: