24 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
25 include_once
"./Services/RTE/classes/class.ilRTE.php";
87 "mini" => array(
"strong",
"em",
"u",
"ol",
"li",
"ul",
"blockquote",
"a",
"p",
"span"),
88 "standard" => array (
"strong",
"em",
"u",
"ol",
"li",
"ul",
"p",
"div",
89 "i",
"b",
"code",
"sup",
"sub",
"pre",
"strike",
"gap"),
91 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
92 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
93 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
95 "extended_img" => array (
96 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
97 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
98 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
100 "extended_table" => array (
101 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
102 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
103 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
104 "tr",
"u",
"ul",
"i",
"b",
"gap"),
105 "extended_table_img" => array (
106 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
107 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
108 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
109 "tr",
"u",
"ul",
"i",
"b",
"gap"),
111 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
112 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
113 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
114 "tr",
"u",
"ul",
"ruby",
"rbc",
"rtc",
"rb",
"rt",
"rp",
"i",
"b",
"gap"));
125 parent::__construct($a_title, $a_postvar);
128 $this->plugins = array();
129 $this->removeplugins = array();
130 $this->buttons = array();
131 $this->rteSupport = array();
141 $this->value = $a_value;
161 $this->cols = $a_cols;
181 $this->rows = $a_rows;
202 $this->usert = $a_usert;
206 $this->rteSupport[
'version'] = $version;
227 $this->plugins[$a_plugin] = $a_plugin;
237 $this->removeplugins[$a_plugin] = $a_plugin;
247 $this->buttons[$a_button] = $a_button;
257 unset($this->buttons[$a_button]);
267 function setRTESupport($obj_id, $obj_type, $module, $cfg_template = null, $hide_switch =
false, $version = null)
269 $this->rteSupport = array(
"obj_id" => $obj_id,
"obj_type" => $obj_type,
"module" => $module,
'cfg_template' => $cfg_template,
'hide_switch' => $hide_switch,
'version' => $version);
277 $this->rteSupport = array();
287 $this->rtetags = $a_rtetags;
308 $this->
setRteTags($this->rte_tag_set[$a_set_name]);
319 return $this->rte_tag_set[$a_set_name];
343 $this->use_tags_for_rte_only = $a_val;
367 $item->setValueByArray($a_values);
379 include_once(
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
389 if ($this->plugins[
"latex"] ==
"latex" && !is_int(strpos($allowed,
"<span>")))
400 $this->
setAlert($lng->txt(
"msg_input_is_required"));
414 $ttpl =
new ilTemplate(
"tpl.prop_textarea.html",
true,
true,
"Services/Form");
419 $ttpl->setCurrentBlock(
"disabled_rte");
420 $ttpl->setVariable(
"DR_VAL", $this->
getValue());
421 $ttpl->parseCurrentBlock();
428 include_once
"./Services/RTE/classes/class.$rtestring.php";
429 $rte =
new $rtestring($this->rteSupport[
'version']);
432 $rte->addPlugin(
"emotions");
433 foreach ($this->plugins as $plugin)
437 $rte->addPlugin($plugin);
440 foreach ($this->removeplugins as $plugin)
444 $rte->removePlugin($plugin);
448 foreach ($this->buttons as $button)
452 $rte->addButton($button);
463 if (count($this->rteSupport) >= 3)
465 $rte->addRTESupport($this->rteSupport[
"obj_id"], $this->rteSupport[
"obj_type"], $this->rteSupport[
"module"],
false, $this->rteSupport[
'cfg_template'], $this->rteSupport[
'hide_switch']);
472 $rte->removeAllPlugins();
475 $rte->addPlugin(
"paste");
478 $rte->disableButtons(array(
"anchor",
"justifyleft",
"justifycenter",
479 "justifyright",
"justifyfull",
"formatselect",
"removeformat",
480 "cut",
"copy",
"paste",
"pastetext"));
483 $rte->addCustomRTESupport(0,
"", $this->
getRteTags());
486 $ttpl->touchBlock(
"prop_ta_w");
487 $ttpl->setCurrentBlock(
"prop_textarea");
488 $ttpl->setVariable(
"ROWS", $this->
getRows());
492 $ttpl->touchBlock(
"no_rteditor");
496 $ttpl->setCurrentBlock(
"prop_ta_c");
497 $ttpl->setVariable(
"COLS", $this->
getCols());
498 $ttpl->parseCurrentBlock();
502 $ttpl->touchBlock(
"prop_ta_w");
505 $ttpl->setCurrentBlock(
"prop_textarea");
506 $ttpl->setVariable(
"ROWS", $this->
getRows());
510 $ttpl->setVariable(
"POST_VAR",
513 $ttpl->setVariable(
"ID", $this->
getFieldId());
516 $ttpl->setVariable(
'DISABLED',
'disabled="disabled" ');
519 $ttpl->parseCurrentBlock();
524 $ttpl->setVariable(
"HIDDEN_INPUT",
529 $a_tpl->setCurrentBlock(
"prop_generic");
530 $a_tpl->setVariable(
"PROP_GENERIC", $ttpl->get());
531 $a_tpl->parseCurrentBlock();
586 $this->root_block_element = $a_root_block_element;
611 if(is_array($a_button))
613 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
617 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
635 return implode(
',', $this->disabled_buttons);
static _getRTEClassname()
setRTESupport($obj_id, $obj_type, $module, $cfg_template=null, $hide_switch=false, $version=null)
Set RTE support for a special module.
setValueByArray($a_values)
Set value by array.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
insert(&$a_tpl)
Insert property html.
setRteTagSet($a_set_name)
Set Set of Valid RTE Tags.
setUseRte($a_usert, $version='')
Set Use Rich Text Editing.
setValue($a_value)
Set Value.
setUseTagsForRteOnly($a_val)
Set use tags for RTE only (default is true)
removePlugin($a_plugin)
Remove RTE plugin.
setRteTags($a_rtetags)
Set Valid RTE Tags.
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
setRTERootBlockElement($a_root_block_element)
Setter for the TinyMCE root block element.
removeButton($a_button)
Remove RTE button.
removeRTESupport()
Remove RTE support for a special module.
__construct($a_title="", $a_postvar="")
Constructor.
getRteTags()
Get Valid RTE Tags.
getRteTagString()
RTE Tag string.
Interface for html sanitizing functionality.
disableButtons($a_button)
Sets buttons which should be disabled in TinyMCE.
getRTERootBlockElement()
Getter for the TinyMCE root block element.
getRteTagSet($a_set_name)
Get Set of Valid RTE Tags.
special template class to simplify handling of ITX/PEAR
setCols($a_cols)
Set Cols.
getUseRte()
Get Use Rich Text Editing.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
usePurifier($a_flag=null)
Setter/Getter for the html purifier usage.
addButton($a_button)
Add RTE button.
setRows($a_rows)
Set Rows.
This class represents a text area property in a property form.
addPlugin($a_plugin)
Add RTE plugin.
setPurifier(ilHtmlPurifierInterface $Purifier)
Setter for the html purifier.
getUseTagsForRteOnly()
Get use tags for RTE only (default is true)
checkInput()
Check input, strip slashes etc.
getDisabledButtons($as_array=true)
Returns the disabled TinyMCE buttons.
getPurifier()
Getter for the html purifier.