24 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
43 $this->lng->loadLanguageModule(
"content");
62 case "movecopytreenode" : {
76 $source_obj->setLMId($tempobj->getId());
78 $target_obj->setLMId($tempobj->getId());
83 $this->tpl =
new ilTemplate(
"tpl.wysiwyg_popup_movecopyquestion.html",
false,
true,
"Services/COPage");
86 if ($source_obj->getType() ==
"st" && $target_obj->getType() ==
"pg") {
87 $this->tpl->setVariable(
"TXT_ST_ON_PG",$this->lng->txt(
"cont_st_on_pg"));
88 $this->tpl->setVariable(
"BTN_CLOSE2", $this->lng->txt(
"close"));
91 if (($source_obj->getType() ==
"pg" && $target_obj->getType() ==
"pg") || ($source_obj->getType() ==
"st" && $target_obj->getType() ==
"st")) {
92 $this->tpl->setVariable(
"TXT_SET_AFTER", $this->lng->txt(
"cont_set_after"));
93 $this->tpl->setVariable(
"TXT_SET_BEFORE", $this->lng->txt(
"cont_set_before"));
95 if ($source_obj->getType() ==
"st" && $target_obj->getType() ==
"st") {
96 $this->tpl->setVariable(
"TXT_SET_INTO", $this->lng->txt(
"cont_set_into"));
99 $this->tpl->setVariable(
"TXT_MOVE_OBJECT", $this->lng->txt(
"cont_move_object"));
100 $this->tpl->setVariable(
"TXT_COPY_OBJECT", $this->lng->txt(
"cont_copy_object"));
102 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"save"));
103 $this->tpl->setVariable(
"BTN_CLOSE", $this->lng->txt(
"close"));
109 $this->tpl =
new ilTemplate(
"tpl.wysiwyg_popup_xtl.html",
false,
false,
"Services/COPage");
113 $this->tpl->setVariable(
"TXT_EXTERNAL_URL", $this->lng->txt(
"cont_external_url"));
114 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"cont_title"));
115 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"save"));
116 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
117 $this->tpl->setVariable(
"BTN_CLOSE", $this->lng->txt(
"close"));
119 $this->tpl->setVariable(
"TXT_OR", $this->lng->txt(
"cont_or"));
120 $this->tpl->setVariable(
"TXT_EXAMPLE", $this->lng->txt(
"cont_e_g_example"));
122 $this->tpl->setVariable(
"DELETE_QUESTION", $this->lng->txt(
"cont_confirm_delete"));
127 $this->tpl =
new ilTemplate(
"tpl.wysiwyg_popup_itl.html",
false,
false,
"Services/COPage");
135 $this->tpl =
new ilTemplate(
"tpl.wysiwyg_popup_footnote.html",
false,
false,
"Services/COPage");
137 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET_HTMLAREA", ILIAS_HTTP_PATH.
"/Services/COPage/css/content.css" );
138 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
139 $ilCtrl->setParameterByClass(
"ilpcparagraphgui",
"ptype",
"footnote");
140 $this->tpl->setVariable(
"FOOTNOTE_TARGET",
141 $ilCtrl->getLinkTargetByClass(
"ilpcparagraphgui",
"popup"));
144 $this->tpl->setVariable(
"TXT_FOOTNOTES", $this->lng->txt(
"cont_title_footnotes"));
145 $this->tpl->setVariable(
"TXT_INSERT_NEW_FOOTNOTES", $this->lng->txt(
"cont_insert_new_footnote"));
146 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"save"));
147 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
149 $this->tpl->setVariable(
"DELETE_QUESTION", $this->lng->txt(
"cont_confirm_delete"));
150 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
169 $content = str_replace(
" ",
" ",$content);
172 $content = str_replace(
" </span>",
"</span> ",$content);
173 $content = str_replace(
"<span class=\"ilc_Strong\"></span>",
"",$content);
174 $content = str_replace(
"<span class=\"ilc_Emph\"></span>",
"",$content);
175 $content = str_replace(
"<span class=\"ilc_Quotation\"></span>",
"",$content);
176 $content = str_replace(
"<span class=\"ilc_Comment\"></span>",
"",$content);
178 $content = rawurlencode($content);
179 $content = str_replace(
"%3Cspan%20class%3D%22ilc_Strong%22%3E%20%3C%2Fspan%3E",
"%20",$content);
180 $content = str_replace(
"%3Cspan%20class%3D%22ilc_Emph%22%3E%20%3C%2Fspan%3E",
"%20",$content);
181 $content = str_replace(
"%3Cspan%20class%3D%22ilc_Quotation%22%3E%20%3C%2Fspan%3E",
"%20",$content);
182 $content = str_replace(
"%3Cspan%20class%3D%22ilc_Comment%22%3E%20%3C%2Fspan%3E",
"%20",$content);
183 $content = rawurldecode($content);
190 $content = str_replace(
"&",
"&",$content);
192 for($k=0;$k<2;$k++) {
193 $xml_parser = xml_parser_create(
"UTF-8");
194 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
195 xml_set_object($xml_parser,$this);
196 xml_set_element_handler($xml_parser,
"startElement",
"endElement");
197 xml_set_character_data_handler($xml_parser,
"characterData");
199 $xml_data =
"<xml>".$content.
"</xml>";
202 $this->
struct = array();
205 if (!xml_parse($xml_parser, $xml_data))
207 die(sprintf(
"XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)),xml_get_current_line_number($xml_parser)));
209 xml_parser_free($xml_parser);
211 $this->newXml = str_replace(
"<xml>",
"",$this->newXml);
212 $this->newXml = str_replace(
"</xml>",
"",$this->newXml);
222 $this->newXml = str_replace(
"[com][/com]",
"",$this->newXml);
223 $this->newXml = str_replace(
"[emp][/emp]",
"",$this->newXml);
224 $this->newXml = str_replace(
"[str][/str]",
"",$this->newXml);
225 $this->newXml = str_replace(
"[code][/code]",
"",$this->newXml);
226 $this->newXml = str_replace(
"[quot][/quot]",
"",$this->newXml);
228 $this->newXml = str_replace(
"</p><p>",
"\n",$this->newXml);
229 $this->newXml = str_replace(
"<p>",
"",$this->newXml);
230 $this->newXml = str_replace(
"</p>",
"",$this->newXml);
232 $this->newXml = str_replace(
"<p class=\"MsoNormal\">",
"\n",$this->newXml);
233 $this->newXml = str_replace(
"<p class=\"MsoNormal\" style=\"MARGIN: 0cm 0cm 0pt\">",
"\n",$this->newXml);
236 $this->newXml = str_replace(
"<Strong/>",
"",$this->newXml);
237 $this->newXml = str_replace(
"<Emph/>",
"",$this->newXml);
239 $this->newXml = str_replace(
"<span>",
"",$this->newXml);
240 $this->newXml = str_replace(
"</span>",
"",$this->newXml);
244 return($this->newXml);
253 $new = array(
"name" => $name,
259 $new[
"convert"] =
"<".$name;
260 if (is_array($attrs))
263 while (list ($key, $val) = each ($attrs))
265 $new[
"convert"] .=
" ".$key.
"=\"".$val.
"\"";
268 $new[
"convert"] .=
">";
269 $new[
"convert2"] =
"</".$name.
">";
272 if ($attrs[
"style"] ==
"font-style: italic;" || $name ==
"em")
274 $new[
"convert"] =
"[emp]";
275 $new[
"convert2"] =
"[/emp]";
277 if ($attrs[
"style"] ==
"font-weight: bold;" || $name ==
"strong")
279 $new[
"convert"] =
"[str]";
280 $new[
"convert2"] =
"[/str]";
284 if ($attrs[
"class"] ==
"ilc_ExtLink")
286 $new[
"convert"] =
"[xln url=\"".str_replace(
"&",
"&",$attrs[url]).
"\"]";
287 $new[
"convert2"] =
"[/xln]";
290 if ($attrs[
"class"] ==
"ilc_IntLink")
294 while (list ($key, $val) = each ($attrs))
298 $N .=
" ".$key.
"=\"".$val.
"\"";
301 $new[
"convert"] =
"[iln".$N.
"]";
302 $new[
"convert2"] =
"[/iln]";
305 if ($attrs[
"class"] ==
"ilc_Strong")
307 $new[
"convert"] =
"[str]";
308 $new[
"convert2"] =
"[/str]";
310 if ($attrs[
"class"] ==
"ilc_Comment")
312 $new[
"convert"] =
"[com]";
313 $new[
"convert2"] =
"[/com]";
315 if ($attrs[
"class"] ==
"ilc_Emph")
317 $new[
"convert"] =
"[emp]";
318 $new[
"convert2"] =
"[/emp]";
321 if ($attrs[
"class"] ==
"ilc_Quotation")
323 $new[
"convert"] =
"[quot]";
324 $new[
"convert2"] =
"[/quot]";
327 if ($attrs[
"class"] ==
"footnote")
331 $fn1 = explode(
"|**#",stripslashes($_POST[
"footnotelist"]));
332 for ($i=0;$i<count($fn1);$i++)
335 $fn2 = explode(
"|*#",$fn1[$i]);
339 if($fn2[0] == $attrs[
"value"])
341 $new[
"convert"] =
"[fn]".$fn2[1];
342 $new[
"convert2"] =
"[/fn]";
351 if ($name ==
"code") {
352 $new[
"convert"] =
"[code]";
353 $new[
"convert2"] =
"[/code]";
363 $this->newXml .= $new[
convert];
367 $this->newXml .=
"\n";
378 if (!stristr( $this->
struct[$this->depth-1][
"convert"],
"[fn]" ))
380 $this->newXml .=
$data;
392 $this->newXml .= $this->
struct[
$this->depth][
"convert2"];