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>"))) {
432 $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(
' ',
'',
"_",
"_",
"_");
455 #20630 mbstring extension is mandatory for 5.4 456 $chars_entered = mb_strlen(strip_tags(str_replace($to_replace, $replace_to,
$_POST[$this->
getPostVar()])));
481 $ttpl =
new ilTemplate(
"tpl.prop_textarea.html",
true,
true,
"Services/Form");
485 $ttpl->setCurrentBlock(
"disabled_rte");
486 $ttpl->setVariable(
"DR_VAL", $this->
getValue());
487 $ttpl->parseCurrentBlock();
491 include_once
"./Services/RTE/classes/class.$rtestring.php";
492 $rte =
new $rtestring($this->rteSupport[
'version']);
497 $rte->addPlugin(
"emotions");
498 foreach ($this->plugins as $plugin) {
499 if (strlen($plugin)) {
500 $rte->addPlugin($plugin);
503 foreach ($this->removeplugins as $plugin) {
504 if (strlen($plugin)) {
505 $rte->removePlugin($plugin);
509 foreach ($this->buttons as $button) {
510 if (strlen($button)) {
511 $rte->addButton($button);
521 if (count($this->rteSupport) >= 3) {
522 $rte->addRTESupport($this->rteSupport[
"obj_id"], $this->rteSupport[
"obj_type"], $this->rteSupport[
"module"],
false, $this->rteSupport[
'cfg_template'], $this->rteSupport[
'hide_switch']);
526 $rte->removeAllPlugins();
529 $rte->addPlugin(
"paste");
532 $rte->disableButtons(array(
"anchor",
"justifyleft",
"justifycenter",
533 "justifyright",
"justifyfull",
"formatselect",
"removeformat",
534 "cut",
"copy",
"paste",
"pastetext"));
537 $rte->addCustomRTESupport(0,
"", $this->
getRteTags());
540 $ttpl->touchBlock(
"prop_ta_w");
541 $ttpl->setCurrentBlock(
"prop_textarea");
542 $ttpl->setVariable(
"ROWS", $this->
getRows());
544 $ttpl->touchBlock(
"no_rteditor");
547 $ttpl->setCurrentBlock(
"prop_ta_c");
548 $ttpl->setVariable(
"COLS", $this->
getCols());
549 $ttpl->parseCurrentBlock();
551 $ttpl->touchBlock(
"prop_ta_w");
554 $ttpl->setCurrentBlock(
"prop_textarea");
555 $ttpl->setVariable(
"ROWS", $this->
getRows());
563 $ttpl->setVariable(
"ID", $this->
getFieldId());
565 $ttpl->setVariable(
'DISABLED',
'disabled="disabled" ');
570 $ttpl->setVariable(
"REQUIRED",
"required=\"required\"");
577 $lng->toJS(
"form_chars_remaining");
580 $ttpl->parseCurrentBlock();
585 $ttpl->setVariable(
"FEEDBACK_ID", $this->
getFieldId());
586 $ttpl->setVariable(
"CHARS_REMAINING",
$lng->txt(
"form_chars_remaining"));
595 $a_tpl->setCurrentBlock(
"prop_generic");
596 $a_tpl->setVariable(
"PROP_GENERIC", $ttpl->get());
597 $a_tpl->parseCurrentBlock();
609 if (null === $a_flag) {
650 $this->root_block_element = $a_root_block_element;
675 if (is_array($a_button)) {
676 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
678 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
695 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.
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.