24include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
25include_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);
An exception for terminatinating execution or to throw for unit testing.
static _getRTEClassname()
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
setMinNumOfChars($a_number)
Set Minimum number of characters allowed.
setInitialRteWidth($initial_rte_width)
addButton($a_button)
Add RTE button.
setMaxNumOfChars($a_number)
Set Maximum number of characters allowed.
setUseRte($a_usert, $version='')
Set Use Rich Text Editing.
setRteTagSet($a_set_name)
Set Set of Valid RTE Tags.
setRTESupport($obj_id, $obj_type, $module, $cfg_template=null, $hide_switch=false, $version=null)
Set RTE support for a special module.
removeRTESupport()
Remove RTE support for a special module.
disableButtons($a_button)
Sets buttons which should be disabled in TinyMCE.
getUseTagsForRteOnly()
Get use tags for RTE only (default is true)
setPurifier(ilHtmlPurifierInterface $Purifier)
Setter for the html purifier.
setValue($a_value)
Set Value.
insert($a_tpl)
Insert property html.
getRteTagSet($a_set_name)
Get Set of Valid RTE Tags.
getPurifier()
Getter for the html purifier.
setRTERootBlockElement($a_root_block_element)
Setter for the TinyMCE root block element.
removePlugin($a_plugin)
Remove RTE plugin.
getRTERootBlockElement()
Getter for the TinyMCE root block element.
getMinNumOfChars()
Get Minimum number of characters allowed.
getRteTagString()
RTE Tag string.
getMaxNumOfChars()
Get Maximum number of characters allowed.
setValueByArray($a_values)
Set value by array.
setRows($a_rows)
Set Rows.
removeButton($a_button)
Remove RTE button.
usePurifier($a_flag=null)
Setter/Getter for the html purifier usage.
getDisabledButtons($as_array=true)
Returns the disabled TinyMCE buttons.
setRteTags($a_rtetags)
Set Valid RTE Tags.
setUseTagsForRteOnly($a_val)
Set use tags for RTE only (default is true)
addPlugin($a_plugin)
Add RTE plugin.
checkInput()
Check input, strip slashes etc.
setCols($a_cols)
Set Cols.
__construct($a_title="", $a_postvar="")
Constructor.
getUseRte()
Get Use Rich Text Editing.
getRteTags()
Get Valid RTE Tags.
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
Interface for html sanitizing functionality.
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
if($modEnd===false) $module