24 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
25 include_once
"./Services/RTE/classes/class.ilRTE.php";
92 "mini" => array(
"strong",
"em",
"u",
"ol",
"li",
"ul",
"blockquote",
"a",
"p",
"span"),
93 "standard" => array (
"strong",
"em",
"u",
"ol",
"li",
"ul",
"p",
"div",
94 "i",
"b",
"code",
"sup",
"sub",
"pre",
"strike",
"gap"),
96 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
97 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
98 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
100 "extended_img" => array (
101 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
102 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
103 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"u",
"ul",
105 "extended_table" => array (
106 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
107 "h4",
"h5",
"h6",
"hr",
"li",
"ol",
"p",
108 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
109 "tr",
"u",
"ul",
"i",
"b",
"gap"),
110 "extended_table_img" => array (
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",
"i",
"b",
"gap"),
116 "a",
"blockquote",
"br",
"cite",
"code",
"div",
"em",
"h1",
"h2",
"h3",
117 "h4",
"h5",
"h6",
"hr",
"img",
"li",
"ol",
"p",
118 "pre",
"span",
"strike",
"strong",
"sub",
"sup",
"table",
"td",
119 "tr",
"u",
"ul",
"ruby",
"rbc",
"rtc",
"rb",
"rt",
"rp",
"i",
"b",
"gap"));
133 $this->plugins = array();
134 $this->removeplugins = array();
135 $this->buttons = array();
136 $this->rteSupport = array();
146 $this->value = $a_value;
168 $this->cols = $a_cols;
188 $this->rows = $a_rows;
209 $this->usert = $a_usert;
213 $this->rteSupport[
'version'] = $version;
234 $this->plugins[$a_plugin] = $a_plugin;
244 $this->removeplugins[$a_plugin] = $a_plugin;
254 $this->buttons[$a_button] = $a_button;
264 unset($this->buttons[$a_button]);
274 function setRTESupport($obj_id, $obj_type, $module, $cfg_template = null, $hide_switch =
false, $version = null)
276 $this->rteSupport = array(
"obj_id" => $obj_id,
"obj_type" => $obj_type,
"module" => $module,
'cfg_template' => $cfg_template,
'hide_switch' => $hide_switch,
'version' => $version);
284 $this->rteSupport = array();
294 $this->rtetags = $a_rtetags;
315 $this->
setRteTags($this->rte_tag_set[$a_set_name]);
326 return $this->rte_tag_set[$a_set_name];
350 $this->use_tags_for_rte_only = $a_val;
374 $item->setValueByArray($a_values);
386 include_once(
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
396 if ($this->plugins[
"latex"] ==
"latex" && !is_int(strpos($allowed,
"<span>")))
407 $this->
setAlert($lng->txt(
"msg_input_is_required"));
421 $ttpl =
new ilTemplate(
"tpl.prop_textarea.html",
true,
true,
"Services/Form");
426 $ttpl->setCurrentBlock(
"disabled_rte");
427 $ttpl->setVariable(
"DR_VAL", $this->
getValue());
428 $ttpl->parseCurrentBlock();
435 include_once
"./Services/RTE/classes/class.$rtestring.php";
436 $rte =
new $rtestring($this->rteSupport[
'version']);
441 $rte->addPlugin(
"emotions");
442 foreach ($this->plugins as $plugin)
446 $rte->addPlugin($plugin);
449 foreach ($this->removeplugins as $plugin)
453 $rte->removePlugin($plugin);
457 foreach ($this->buttons as $button)
461 $rte->addButton($button);
472 if (count($this->rteSupport) >= 3)
474 $rte->addRTESupport($this->rteSupport[
"obj_id"], $this->rteSupport[
"obj_type"], $this->rteSupport[
"module"],
false, $this->rteSupport[
'cfg_template'], $this->rteSupport[
'hide_switch']);
481 $rte->removeAllPlugins();
484 $rte->addPlugin(
"paste");
487 $rte->disableButtons(array(
"anchor",
"justifyleft",
"justifycenter",
488 "justifyright",
"justifyfull",
"formatselect",
"removeformat",
489 "cut",
"copy",
"paste",
"pastetext"));
492 $rte->addCustomRTESupport(0,
"", $this->
getRteTags());
495 $ttpl->touchBlock(
"prop_ta_w");
496 $ttpl->setCurrentBlock(
"prop_textarea");
497 $ttpl->setVariable(
"ROWS", $this->
getRows());
501 $ttpl->touchBlock(
"no_rteditor");
505 $ttpl->setCurrentBlock(
"prop_ta_c");
506 $ttpl->setVariable(
"COLS", $this->
getCols());
507 $ttpl->parseCurrentBlock();
511 $ttpl->touchBlock(
"prop_ta_w");
514 $ttpl->setCurrentBlock(
"prop_textarea");
515 $ttpl->setVariable(
"ROWS", $this->
getRows());
519 $ttpl->setVariable(
"POST_VAR",
522 $ttpl->setVariable(
"ID", $this->
getFieldId());
525 $ttpl->setVariable(
'DISABLED',
'disabled="disabled" ');
528 $ttpl->parseCurrentBlock();
533 $ttpl->setVariable(
"HIDDEN_INPUT",
538 $a_tpl->setCurrentBlock(
"prop_generic");
539 $a_tpl->setVariable(
"PROP_GENERIC", $ttpl->get());
540 $a_tpl->parseCurrentBlock();
595 $this->root_block_element = $a_root_block_element;
620 if(is_array($a_button))
622 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
626 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, array($a_button)));
644 return implode(
',', $this->disabled_buttons);