24 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
25 include_once
"./Services/RTE/classes/class.ilRTE.php";
94 "mini" =>
array(
"strong",
"em",
"u",
"ol",
"li",
"ul",
"blockquote",
"a",
"p",
"span",
"br"),
95 "standard" =>
array(
"strong",
"em",
"u",
"ol",
"li",
"ul",
"p",
"div",
96 "i",
"b",
"code",
"sup",
"sub",
"pre",
"strike",
"gap"),
98 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
99 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
100 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
102 "extended_img" =>
array(
103 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
104 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
105 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
107 "extended_table" =>
array(
108 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
109 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
110 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
111 "tr",
"u",
"ul",
"i",
"b",
"gap"),
112 "extended_table_img" =>
array(
113 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
114 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
115 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
116 "tr",
"u",
"ul",
"i",
"b",
"gap"),
118 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
119 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
120 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
121 "tr",
"u",
"ul",
"ruby",
"rbc",
"rtc",
"rb",
"rt",
"rp",
"i",
"b",
"gap"));
134 $this->lng = $DIC->language();
135 parent::__construct($a_title, $a_postvar);
138 $this->plugins =
array();
139 $this->removeplugins =
array();
140 $this->buttons =
array();
141 $this->rteSupport =
array();
151 $this->value = $a_value;
173 $this->cols = $a_cols;
193 $this->
rows = $a_rows;
213 $this->max_num_chars = $a_number;
231 $this->min_num_chars = $a_number;
250 $this->usert = $a_usert;
253 $this->rteSupport[
'version'] =
$version;
274 $this->plugins[$a_plugin] = $a_plugin;
284 $this->removeplugins[$a_plugin] = $a_plugin;
294 $this->buttons[$a_button] = $a_button;
304 unset($this->buttons[$a_button]);
316 $this->rteSupport =
array(
"obj_id" => $obj_id,
"obj_type" => $obj_type,
"module" =>
$module,
'cfg_template' => $cfg_template,
'hide_switch' => $hide_switch,
'version' =>
$version);
324 $this->rteSupport =
array();
334 $this->rtetags = $a_rtetags;
355 $this->
setRteTags($this->rte_tag_set[$a_set_name]);
366 return $this->rte_tag_set[$a_set_name];
389 $this->use_tags_for_rte_only = $a_val;
412 $item->setValueByArray($a_values);
424 include_once(
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
431 if ($this->plugins[
"latex"] ==
"latex" && !is_int(strpos($allowed,
"<span>"))) {
449 $ascii_whitespaces = chr(194) . chr(160);
450 $ascii_breaklines = chr(13) . chr(10);
452 $to_replace =
array($ascii_whitespaces, $ascii_breaklines,
"<",
">",
"&");
453 $replace_to =
array(
' ',
'',
"_",
"_",
"_");
456 if (function_exists(
'mb_strlen')) {
457 $chars_entered = mb_strlen(strip_tags(str_replace($to_replace, $replace_to,
$_POST[$this->
getPostVar()])));
459 $chars_entered = strlen(strip_tags(str_replace($to_replace, $replace_to,
$_POST[$this->
getPostVar()])));
485 $ttpl =
new ilTemplate(
"tpl.prop_textarea.html",
true,
true,
"Services/Form");
489 $ttpl->setCurrentBlock(
"disabled_rte");
490 $ttpl->setVariable(
"DR_VAL", $this->
getValue());
491 $ttpl->parseCurrentBlock();
495 include_once
"./Services/RTE/classes/class.$rtestring.php";
496 $rte =
new $rtestring($this->rteSupport[
'version']);
501 $rte->addPlugin(
"emotions");
502 foreach ($this->plugins as $plugin) {
503 if (strlen($plugin)) {
504 $rte->addPlugin($plugin);
507 foreach ($this->removeplugins as $plugin) {
508 if (strlen($plugin)) {
509 $rte->removePlugin($plugin);
513 foreach ($this->buttons as $button) {
514 if (strlen($button)) {
515 $rte->addButton($button);
525 if (count($this->rteSupport) >= 3) {
526 $rte->addRTESupport($this->rteSupport[
"obj_id"], $this->rteSupport[
"obj_type"], $this->rteSupport[
"module"],
false, $this->rteSupport[
'cfg_template'], $this->rteSupport[
'hide_switch']);
530 $rte->removeAllPlugins();
533 $rte->addPlugin(
"paste");
536 $rte->disableButtons(
array(
"anchor",
"justifyleft",
"justifycenter",
537 "justifyright",
"justifyfull",
"formatselect",
"removeformat",
538 "cut",
"copy",
"paste",
"pastetext"));
541 $rte->addCustomRTESupport(0,
"", $this->
getRteTags());
544 $ttpl->touchBlock(
"prop_ta_w");
545 $ttpl->setCurrentBlock(
"prop_textarea");
546 $ttpl->setVariable(
"ROWS", $this->
getRows());
548 $ttpl->touchBlock(
"no_rteditor");
551 $ttpl->setCurrentBlock(
"prop_ta_c");
552 $ttpl->setVariable(
"COLS", $this->
getCols());
553 $ttpl->parseCurrentBlock();
555 $ttpl->touchBlock(
"prop_ta_w");
558 $ttpl->setCurrentBlock(
"prop_textarea");
559 $ttpl->setVariable(
"ROWS", $this->
getRows());
567 $ttpl->setVariable(
"ID", $this->
getFieldId());
569 $ttpl->setVariable(
'DISABLED',
'disabled="disabled" ');
574 $ttpl->setVariable(
"REQUIRED",
"required=\"required\"");
581 $lng->toJS(
"form_chars_remaining");
584 $ttpl->parseCurrentBlock();
589 $ttpl->setVariable(
"FEEDBACK_ID", $this->
getFieldId());
590 $ttpl->setVariable(
"CHARS_REMAINING",
$lng->txt(
"form_chars_remaining"));
599 $a_tpl->setCurrentBlock(
"prop_generic");
600 $a_tpl->setVariable(
"PROP_GENERIC", $ttpl->get());
601 $a_tpl->parseCurrentBlock();
613 if (null === $a_flag) {
654 $this->root_block_element = $a_root_block_element;
679 if (is_array($a_button)) {
680 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
682 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons,
array($a_button)));
699 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
setMinNumOfChars($a_number)
Set Minimum number of characters allowed.
setRteTagSet($a_set_name)
Set Set of Valid RTE Tags.
setUseRte($a_usert, $version='')
Set Use Rich Text Editing.
setMaxNumOfChars($a_number)
Set Maximum number of characters allowed.
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
if($modEnd===false) $module
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
getMinNumOfChars()
Get Minimum number of characters allowed.
Create styles array
The data for the language used.
setInitialRteWidth($initial_rte_width)
usePurifier($a_flag=null)
Setter/Getter for the html purifier usage.
addButton($a_button)
Add RTE button.
getMaxNumOfChars()
Get Maximum number of characters allowed.
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.
insert($a_tpl)
Insert property html.
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
getDisabledButtons($as_array=true)
Returns the disabled TinyMCE buttons.
getPurifier()
Getter for the html purifier.