4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
37 "quot" =>
"Quotation",
47 $this->
user = $DIC->user();
58 return self::$bb_tags;
68 return array_flip(self::$bb_tags);
80 parent::setNode($a_node);
82 $childs = $a_node->child_nodes();
83 for (
$i = 0;
$i < count($childs);
$i++) {
84 if ($childs[
$i]->node_name() ==
"Paragraph") {
85 $this->par_node = $childs[
$i];
99 $this->par_node = $this->dom->create_element(
"Paragraph");
100 $this->par_node = $this->node->append_child($this->par_node);
101 $this->par_node->set_attribute(
"Language",
"");
102 $node->append_child($this->node);
113 $this->par_node = $this->dom->create_element(
"Paragraph");
114 $this->par_node = $this->node->append_child($this->par_node);
115 $this->par_node->set_attribute(
"Language",
"");
128 if ($succ_node =
$node->next_sibling()) {
129 $this->node = $succ_node->insert_before($this->node, $succ_node);
131 $parent_node =
$node->parent_node();
132 $this->node = $parent_node->append_child($this->node);
134 $this->par_node = $this->dom->create_element(
"Paragraph");
135 $this->par_node = $this->node->append_child($this->par_node);
136 $this->par_node->set_attribute(
"Language",
"");
146 public function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
150 $this->node = $this->dom->create_element(
"PageContent");
153 $a_pg_obj->insertContent($this, $a_hier_id,
IL_INSERT_AFTER, $a_pc_id);
155 $this->par_node = $this->dom->create_element(
"Paragraph");
156 $this->par_node = $this->node->append_child($this->par_node);
157 $this->par_node->set_attribute(
"Language",
"");
166 public function setText($a_text, $a_auto_split =
false)
168 if (!is_array($a_text)) {
169 $text = array(array(
"level" => 0,
"text" => $a_text));
181 $check .=
"<Paragraph>" . $t[
"text"] .
"</Paragraph>";
186 '<?xml version="1.0" encoding="UTF-8"?><Paragraph>' . $check .
'</Paragraph>',
195 '<?xml version="1.0" encoding="UTF-8"?><Paragraph>' .
$text[0][
"text"] .
'</Paragraph>',
201 $children = $this->par_node->child_nodes();
202 for (
$i = 0;
$i < count($children);
$i++) {
203 $this->par_node->remove_child($children[
$i]);
208 $path =
"//Paragraph";
210 if (count(
$res->nodeset) == 1) {
211 $new_par_node =
$res->nodeset[0];
212 $new_childs = $new_par_node->child_nodes();
214 for (
$i = 0;
$i < count($new_childs);
$i++) {
215 $cloned_child = $new_childs[
$i]->clone_node(
true);
216 $this->par_node->append_child($cloned_child);
222 if ((count(
$text) > 1) && (substr($orig_characteristic, 0, 8) ==
"Headline")) {
223 $orig_characteristic =
"";
225 if (
$text[0][
"level"] > 0) {
226 $this->par_node->set_attribute(
"Characteristic",
'Headline' .
$text[0][
"level"]);
237 $next_par->createAfter($c_node);
240 $next_par->setCharacteristic(
"Headline" .
$text[
$i][
"level"]);
242 $next_par->setCharacteristic($orig_characteristic);
244 $ok = $next_par->setText(
$text[
$i][
"text"],
false);
245 $c_node = $next_par->node;
252 $text = str_replace(
"<br>",
"\n", $check);
255 $text = str_replace(
"</SimpleListItem>",
"</SimpleListItem>\n",
$text);
256 $text = str_replace(
"<SimpleBulletList>",
"\n<SimpleBulletList>",
$text);
257 $text = str_replace(
"<SimpleNumberedList>",
"\n<SimpleNumberedList>",
$text);
258 $text = str_replace(
"<Paragraph>\n",
"<Paragraph>",
$text);
259 $text = str_replace(
"</Paragraph>",
"</Paragraph>\n",
$text);
260 include_once(
"./Services/Dom/classes/class.ilDomDocument.php");
261 $doc =
new ilDOMDocument();
262 $text =
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>' .
$text .
'</Paragraph>';
265 $error = $doc->errors;
267 foreach ($error as $e) {
268 $e = str_replace(
" in Entity",
"", $e);
269 $estr .= $e .
"<br />";
272 $estr .=
"<br />" .
$text;
284 public function getText($a_short_mode =
false)
286 if (is_object($this->par_node)) {
288 $childs = $this->par_node->child_nodes();
289 for (
$i = 0;
$i < count($childs);
$i++) {
290 $content .= $this->dom->dump_node($childs[
$i]);
303 $childs = $this->par_node->parent_node()->parent_node()->child_nodes();
309 for (
$i = 0;
$i < count($childs);
$i++) {
310 $pchilds = $childs[
$i]->child_nodes();
311 if ($pchilds[0]->node_name() ==
"Paragraph" &&
312 $pchilds[0]->get_attribute(
"Characteristic") !=
"Code") {
313 $cur_seq[] = $childs[
$i];
316 if ($childs[
$i]->get_attribute(
"PCID") == $pc_id &&
317 $childs[
$i]->get_attribute(
"HierId") ==
$hier_id) {
335 foreach ($seq as $p_node) {
336 $ids .= $id_sep . $p_node->get_attribute(
"HierId") .
":" . $p_node->get_attribute(
"PCID");
337 $po = $a_pg_obj->getContentObject(
338 $p_node->get_attribute(
"HierId"),
339 $p_node->get_attribute(
"PCID")
341 $s_text = $po->getText();
342 $s_text = $po->xml2output($s_text,
true,
false);
343 $char = $po->getCharacteristic();
353 return $ids . $content;
363 if (!empty($a_char)) {
364 $this->par_node->set_attribute(
"Characteristic", $a_char);
366 if ($this->par_node->has_attribute(
"Characteristic")) {
367 $this->par_node->remove_attribute(
"Characteristic");
379 if (is_object($this->par_node)) {
380 return $this->par_node->get_attribute(
"Characteristic");
390 if (!empty($a_char)) {
391 $this->par_node->set_attribute(
"SubCharacteristic", $a_char);
393 if ($this->par_node->has_attribute(
"SubCharacteristic")) {
394 $this->par_node->remove_attribute(
"SubCharacteristic");
406 return $this->par_node->get_attribute(
"AutoIndent");
411 if (!empty($a_char)) {
412 $this->par_node->set_attribute(
"AutoIndent", $a_char);
414 if ($this->par_node->has_attribute(
"AutoIndent")) {
415 $this->par_node->remove_attribute(
"AutoIndent");
425 return $this->par_node->get_attribute(
"SubCharacteristic");
434 if (!empty($a_char)) {
435 $this->par_node->set_attribute(
"DownloadTitle", $a_char);
437 if ($this->par_node->has_attribute(
"DownloadTitle")) {
438 $this->par_node->remove_attribute(
"DownloadTitle");
448 return $this->par_node->get_attribute(
"DownloadTitle");
457 $a_char = empty($a_char)?
"n":$a_char;
459 $this->par_node->set_attribute(
"ShowLineNumbers", $a_char);
468 return $this->par_node->get_attribute(
"ShowLineNumbers");
476 $this->par_node->set_attribute(
"Language", $a_lang);
484 return $this->par_node->get_attribute(
"Language");
487 public function input2xml($a_text, $a_wysiwyg = 0, $a_handle_lists =
true)
502 $a_text = preg_replace(
'/\[' . $a_bb .
'\]/i',
"<" . $a_tag .
">", $a_text);
503 $a_text = preg_replace(
'/\[\/' . $a_bb .
'\]/i',
"</" . $a_tag .
">", $a_text);
511 public static function _input2xml($a_text, $a_lang, $a_wysiwyg = 0, $a_handle_lists =
true)
518 $a_text = str_replace(
"<br />", chr(10), $a_text);
523 $a_text = trim($a_text);
529 $a_text = str_replace(
"&",
"&", $a_text);
531 $a_text = str_replace(
"<",
"<", $a_text);
532 $a_text = str_replace(
">",
">", $a_text);
535 $a_text = preg_replace(
'/<([\s\/]*?PageTurn.*?)>/i',
"<$1>", $a_text);
536 $a_text = preg_replace(
'/<([\s\/]*?BibItemIdentifier.*?)>/i',
"<$1>", $a_text);
547 $a_text = str_replace(chr(13) . chr(10),
"<br />", $a_text);
548 $a_text = str_replace(chr(13),
"<br />", $a_text);
549 $a_text = str_replace(chr(10),
"<br />", $a_text);
551 if ($a_handle_lists) {
555 foreach (self::getBBMap() as $bb =>
$tag) {
557 $a_text = str_replace(
"[" . $bb .
"][/" . $bb .
"]",
"", $a_text);
560 $a_text = self::replaceBBCode($a_text, $bb,
$tag);
563 $a_text = self::intLinks2xml($a_text);
566 $ws =
"[ \t\r\f\v\n]*";
568 while (preg_match(
"~\[(xln$ws(url$ws=$ws\"([^\"])*\")$ws(target$ws=$ws(\"(Glossary|FAQ|Media)\"))?$ws)\]\[\/xln\]~i", $a_text, $found)) {
569 $a_text = str_replace($found[0],
"", $a_text);
571 while (preg_match(
'~\[(xln$ws(url$ws=$ws(([^]])*)))$ws\]\[\/xln\]~i', $a_text, $found)) {
572 $a_text = str_replace($found[0],
"", $a_text);
575 while (preg_match(
"~\[(xln$ws(url$ws=$ws\"([^\"])*\")$ws(target$ws=$ws(\"(Glossary|FAQ|Media)\"))?$ws)\]~i", $a_text, $found)) {
577 if (isset($attribs[
"url"])) {
580 if (in_array($a2[
"target"], array(
"FAQ",
"Glossary",
"Media"))) {
581 $tstr =
' TargetFrame="' . $a2[
"target"] .
'"';
583 $a_text = str_replace(
"[" . $found[1] .
"]",
"<ExtLink Href=\"" . $attribs[
"url"] .
"\"$tstr>", $a_text);
585 $a_text = str_replace(
"[" . $found[1] .
"]",
"[error: xln" . $found[1] .
"]", $a_text);
590 while (preg_match(
'~\[(xln$ws(url$ws=$ws(([^]])*)))$ws\]~i', $a_text, $found)) {
591 if ($found[3] !=
"") {
592 $a_text = str_replace(
"[" . $found[1] .
"]",
"<ExtLink Href=\"" . $found[3] .
"\">", $a_text);
594 $a_text = str_replace(
"[" . $found[1] .
"]",
"[error: xln" . $found[1] .
"]", $a_text);
597 $a_text = preg_replace(
'~\[\/xln\]~i',
"</ExtLink>", $a_text);
600 $ws =
"[ \t\r\f\v\n]*";
601 while (preg_match(
"~\[(anc$ws(name$ws=$ws\"([^\"])*\")$ws)\]~i", $a_text, $found)) {
603 $a_text = str_replace(
"[" . $found[1] .
"]",
"<Anchor Name=\"" . $attribs[
"name"] .
"\">", $a_text);
605 $a_text = preg_replace(
"~\[\/anc\]~i",
"</Anchor>", $a_text);
608 while (preg_match(
"~\[(marked$ws(class$ws=$ws\"([^\"])*\")$ws)\]~i", $a_text, $found)) {
610 if (isset($attribs[
"class"])) {
611 $a_text = str_replace(
"[" . $found[1] .
"]",
"<Marked Class=\"" . $attribs[
"class"] .
"\">", $a_text);
613 $a_text = str_replace(
"[" . $found[1] .
"]",
"[error:marked" . $found[1] .
"]", $a_text);
616 $a_text = preg_replace(
'~\[\/marked\]~i',
"</Marked>", $a_text);
633 $objDefinition = $DIC[
"objDefinition"];
635 $rtypes = $objDefinition->getAllRepositoryTypes();
639 $ws =
"[ \t\r\f\v\n]*";
640 $ltypes =
"page|chap|term|media|obj|dfile|sess|wpage|ppage|" . implode($rtypes,
"|");
642 while (preg_match(
'~\[(iln' . $ws .
'((inst' . $ws .
'=' . $ws .
'([\"0-9])*)?' . $ws .
643 "((" . $ltypes .
")$ws=$ws([\"0-9])*)$ws" .
644 "(target$ws=$ws(\"(New|FAQ|Media)\"))?$ws(anchor$ws=$ws(\"([^\"])*\"))?$ws))\]\[\/iln\]~i", $a_text, $found)) {
645 $a_text = str_replace($found[0],
"", $a_text);
647 while (preg_match(
'~\[(iln' . $ws .
'((inst' . $ws .
'=' . $ws .
'([\"0-9])*)?' . $ws .
648 "((" . $ltypes .
")$ws=$ws([\"0-9])*)$ws" .
649 "(target$ws=$ws(\"(New|FAQ|Media)\"))?$ws(anchor$ws=$ws(\"([^\"])*\"))?$ws))\]~i", $a_text, $found)) {
651 $inst_str = $attribs[
"inst"];
653 if (isset($attribs[
"page"])) {
655 if (!empty($found[10])) {
656 $tframestr =
" TargetFrame=\"" . $found[10] .
"\" ";
659 if ($attribs[
"anchor"] !=
"") {
660 $ancstr =
' Anchor="' . $attribs[
"anchor"] .
'" ';
663 $a_text = preg_replace(
664 '/\[' . addcslashes($found[1],
'/') .
'\]/i',
665 "<IntLink Target=\"il_" . $inst_str .
"_pg_" . $attribs[
'page'] .
"\" Type=\"PageObject\"" . $tframestr . $ancstr .
">",
670 elseif (isset($attribs[
"chap"])) {
671 if (!empty($found[10])) {
672 $tframestr =
" TargetFrame=\"" . $found[10] .
"\" ";
676 $a_text = preg_replace(
677 '/\[' . $found[1] .
'\]/i',
678 "<IntLink Target=\"il_" . $inst_str .
"_st_" . $attribs[
'chap'] .
"\" Type=\"StructureObject\"" . $tframestr .
">",
683 elseif (isset($attribs[
"term"])) {
684 switch ($found[10]) {
686 $tframestr =
" TargetFrame=\"New\" ";
690 $tframestr =
" TargetFrame=\"Glossary\" ";
693 $a_text = preg_replace(
694 '/\[' . $found[1] .
'\]/i',
695 "<IntLink Target=\"il_" . $inst_str .
"_git_" . $attribs[
'term'] .
"\" Type=\"GlossaryItem\" $tframestr>",
700 elseif (isset($attribs[
"wpage"])) {
702 $a_text = preg_replace(
703 '/\[' . $found[1] .
'\]/i',
704 "<IntLink Target=\"il_" . $inst_str .
"_wpage_" . $attribs[
'wpage'] .
"\" Type=\"WikiPage\" $tframestr>",
709 elseif (isset($attribs[
"ppage"])) {
711 $a_text = preg_replace(
712 '/\[' . $found[1] .
'\]/i',
713 "<IntLink Target=\"il_" . $inst_str .
"_ppage_" . $attribs[
'ppage'] .
"\" Type=\"PortfolioPage\" $tframestr>",
718 elseif (isset($attribs[
"media"])) {
719 if (!empty($found[10])) {
720 $tframestr =
" TargetFrame=\"" . $found[10] .
"\" ";
721 $a_text = preg_replace(
722 '/\[' . $found[1] .
'\]/i',
723 "<IntLink Target=\"il_" . $inst_str .
"_mob_" . $attribs[
'media'] .
"\" Type=\"MediaObject\"" . $tframestr .
">",
727 $a_text = preg_replace(
728 '/\[' . $found[1] .
'\]/i',
729 "<IntLink Target=\"il_" . $inst_str .
"_mob_" . $attribs[
'media'] .
"\" Type=\"MediaObject\"/>",
735 elseif (isset($attribs[
"dfile"])) {
736 $a_text = preg_replace(
737 '/\[' . $found[1] .
'\]/i',
738 "<IntLink Target=\"il_" . $inst_str .
"_dfile_" . $attribs[
'dfile'] .
"\" Type=\"File\">",
745 foreach ($objDefinition->getAllRepositoryTypes() as
$t) {
746 if (isset($attribs[
$t])) {
747 $obj_id = $attribs[
$t];
750 if (isset($attribs[
"obj"])) {
751 $obj_id = $attribs[
"obj"];
755 if ($inst_str ==
"") {
756 $a_text = preg_replace(
757 '/\[' . $found[1] .
'\]/i',
758 "<IntLink Target=\"il_" . $inst_str .
"_obj_" . $obj_id .
"\" Type=\"RepositoryItem\">",
762 $a_text = preg_replace(
763 '/\[' . $found[1] .
'\]/i',
764 "<IntLink Target=\"il_" . $inst_str .
"_" . $found[6] .
"_" . $obj_id .
"\" Type=\"RepositoryItem\">",
769 $a_text = preg_replace(
'/\[' . $found[1] .
'\]/i',
"[error: iln" . $found[1] .
"]", $a_text);
774 while (preg_match(
"~\[(iln$ws((inst$ws=$ws([\"0-9])*)?" . $ws .
"media$ws=$ws([\"0-9])*)$ws)/\]~i", $a_text, $found)) {
776 $inst_str = $attribs[
"inst"];
777 $a_text = preg_replace(
778 '~\[' . $found[1] .
'/\]~i',
779 "<IntLink Target=\"il_" . $inst_str .
"_mob_" . $attribs[
'media'] .
"\" Type=\"MediaObject\"/>",
785 while (preg_match(
"~\[(iln$ws((inst$ws=$ws([\"0-9])*)?" . $ws .
"user$ws=$ws(\"([^\"])*)\")$ws)/\]~i", $a_text, $found)) {
787 $inst_str = $attribs[
"inst"];
788 include_once(
"./Services/User/classes/class.ilObjUser.php");
790 $a_text = preg_replace(
791 '~\[' . $found[1] .
'/\]~i',
792 "<IntLink Target=\"il_" . $inst_str .
"_user_" . $user_id .
"\" Type=\"User\"/>",
797 $a_text = preg_replace(
'~\[\/iln\]~i',
"</IntLink>", $a_text);
811 $rows = explode(
"<br />", $a_text .
"<br />");
820 if (str_replace(
"#",
"*", substr($row, 0, 3)) ==
"***") {
822 } elseif (str_replace(
"#",
"*", substr($row, 0, 2)) ==
"**") {
824 } elseif (str_replace(
"#",
"*", substr($row, 0, 1)) ==
"*") {
829 if ($level < $old_level) {
830 for (
$i = $old_level;
$i > $level;
$i--) {
831 $text .=
"</SimpleListItem></" . $clist[
$i] .
">";
834 $text .=
"</SimpleListItem>";
836 } elseif ($old_level > 0 && $level > 0 && ($level == $old_level)) {
837 $text .=
"</SimpleListItem>";
838 } elseif (($level == $old_level) &&
$text !=
"") {
843 if ($level > $old_level) {
844 for (
$i = $old_level + 1;
$i <= $level;
$i++) {
845 if (substr($row,
$i - 1, 1) ==
"*") {
846 $clist[
$i] =
"SimpleBulletList";
848 $clist[
$i] =
"SimpleNumberedList";
850 $text .=
"<" . $clist[
$i] .
"><SimpleListItem>";
852 } elseif ($old_level > 0 && $level > 0) {
853 $text .=
"<SimpleListItem>";
855 $text .= substr($row, $level);
861 if (substr(
$text, strlen(
$text) - 6) ==
"<br />") {
878 "</SimpleListItem>",
"<SimpleListItem>",
"<SimpleListItem/>",
"<SimpleNumberedList>",
"</SimpleNumberedList>"));
880 $current_list = array();
882 for (
$i = 0;
$i <= count($segments);
$i++) {
883 if ($segments[
$i] ==
"<SimpleBulletList>") {
884 if (count($current_list) == 0) {
887 array_push($current_list,
"*");
889 } elseif ($segments[
$i] ==
"<SimpleNumberedList>") {
890 if (count($current_list) == 0) {
893 array_push($current_list,
"#");
895 } elseif ($segments[
$i] ==
"</SimpleBulletList>") {
896 array_pop($current_list);
898 } elseif ($segments[
$i] ==
"</SimpleNumberedList>") {
899 array_pop($current_list);
901 } elseif ($segments[
$i] ==
"<SimpleListItem>") {
903 } elseif ($segments[
$i] ==
"</SimpleListItem>") {
905 } elseif ($segments[
$i] ==
"<SimpleListItem/>") {
910 foreach ($current_list as
$list) {
921 foreach ($current_list as
$list) {
934 if ($segments[count($segments) - 1] ==
"</SimpleBulletList>" ||
935 $segments[count($segments) - 1] ==
"</SimpleNumberedList>" &&
936 substr(
$text, strlen(
$text) - 6) ==
"<br />") {
950 $nothing_found =
false;
951 while (!$nothing_found) {
952 $nothing_found =
true;
954 foreach ($a_needles as $needle) {
955 $pos = stripos($a_haystack, $needle);
956 if (is_int($pos) && ($pos < $found || $found == -1)) {
958 $found_needle = $needle;
959 $nothing_found =
false;
963 $segments[] = substr($a_haystack, 0, $found);
964 $a_haystack = substr($a_haystack, $found);
967 $segments[] = substr($a_haystack, 0, strlen($found_needle));
968 $a_haystack = substr($a_haystack, strlen($found_needle));
971 if ($a_haystack !=
"") {
972 $segments[] = $a_haystack;
985 public static function xml2output($a_text, $a_wysiwyg =
false, $a_replace_lists =
true, $unmask =
true)
993 foreach (self::getBBMap() as $bb =>
$tag) {
994 $a_text = preg_replace(
'~<' .
$tag .
'[^>]*>~i',
"[" . $bb .
"]", $a_text);
995 $a_text = preg_replace(
'~</' .
$tag .
'>~i',
"[/" . $bb .
"]", $a_text);
996 $a_text = preg_replace(
'~<' .
$tag .
'/>~i',
"[" . $bb .
"][/" . $bb .
"]", $a_text);
1000 if ($a_replace_lists) {
1007 while (preg_match(
'~<IntLink(' . $any .
')>~i', $a_text, $found)) {
1010 $target = explode(
"_", $attribs[
"Target"]);
1012 $inst_str = (!is_int(strpos($attribs[
"Target"],
"__")))
1013 ? $inst_str =
"inst=\"" .
$target[1] .
"\" " 1015 switch ($attribs[
"Type"]) {
1017 $tframestr = (!empty($attribs[
"TargetFrame"]))
1018 ?
" target=\"" . $attribs[
"TargetFrame"] .
"\"" 1020 $ancstr = (!empty($attribs[
"Anchor"]))
1021 ?
' anchor="' . $attribs[
"Anchor"] .
'"' 1023 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"page=\"" .
$target_id .
"\"$tframestr$ancstr]", $a_text);
1026 case "StructureObject":
1027 $tframestr = (!empty($attribs[
"TargetFrame"]))
1028 ?
" target=\"" . $attribs[
"TargetFrame"] .
"\"" 1030 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"chap=\"" . $target_id .
"\"$tframestr]", $a_text);
1033 case "GlossaryItem":
1034 $tframestr = (empty($attribs[
"TargetFrame"]) || $attribs[
"TargetFrame"] ==
"Glossary")
1036 :
" target=\"" . $attribs[
"TargetFrame"] .
"\"";
1037 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"term=\"" . $target_id .
"\"" . $tframestr .
"]", $a_text);
1042 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"wpage=\"" . $target_id .
"\"" . $tframestr .
"]", $a_text);
1045 case "PortfolioPage":
1047 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"ppage=\"" . $target_id .
"\"" . $tframestr .
"]", $a_text);
1051 if (empty($attribs[
"TargetFrame"])) {
1052 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"media=\"" . $target_id .
"\"/]", $a_text);
1054 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln media=\"" . $target_id .
"\"" .
1055 " target=\"" . $attribs[
"TargetFrame"] .
"\"]", $a_text);
1060 case "RepositoryItem":
1061 if ($inst_str ==
"") {
1067 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"$target_type=\"" . $target_id .
"\"" . $tframestr .
"]", $a_text);
1072 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"dfile=\"" . $target_id .
"\"" . $tframestr .
"]", $a_text);
1077 include_once(
"./Services/User/classes/class.ilObjUser.php");
1078 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln " . $inst_str .
"user=\"" .
ilObjUser::_lookupLogin($target_id) .
"\"/]", $a_text);
1082 $a_text = preg_replace(
'~<IntLink' . $found[1] .
'>~i',
"[iln]", $a_text);
1086 $a_text = str_replace(
"</IntLink>",
"[/iln]", $a_text);
1089 while (preg_match(
'~<ExtLink(' . $any .
')>~i', $a_text, $found)) {
1094 if (in_array($attribs[
"TargetFrame"], array(
"FAQ",
"Glossary",
"Media"))) {
1095 $tstr =
' target="' . $attribs[
"TargetFrame"] .
'"';
1097 $a_text = str_replace(
"<ExtLink" . $found[1] .
">",
"[xln url=\"" . $attribs[
"Href"] .
"\"$tstr]", $a_text);
1099 $a_text = str_replace(
"</ExtLink>",
"[/xln]", $a_text);
1102 while (preg_match(
'~<Anchor(' . $any .
'/)>~i', $a_text, $found)) {
1105 $a_text = str_replace(
"<Anchor" . $found[1] .
">",
"[anc name=\"" . $attribs[
"Name"] .
"\"][/anc]", $a_text);
1107 while (preg_match(
'~<Anchor(' . $any .
')>~i', $a_text, $found)) {
1110 $a_text = str_replace(
"<Anchor" . $found[1] .
">",
"[anc name=\"" . $attribs[
"Name"] .
"\"]", $a_text);
1112 $a_text = str_replace(
"</Anchor>",
"[/anc]", $a_text);
1115 while (preg_match(
'~<Marked(' . $any .
')>~i', $a_text, $found)) {
1118 $a_text = str_replace(
"<Marked" . $found[1] .
">",
"[marked class=\"" . $attribs[
"Class"] .
"\"]", $a_text);
1120 $a_text = str_replace(
"</Marked>",
"[/marked]", $a_text);
1124 $a_text = str_replace(
"<br />",
"\n", $a_text);
1125 $a_text = str_replace(
"<br/>",
"\n", $a_text);
1130 $a_text = str_replace(
"{",
"{", $a_text);
1131 $a_text = str_replace(
"}",
"}", $a_text);
1135 $a_text = str_replace(
"<",
"<", $a_text);
1136 $a_text = str_replace(
">",
">", $a_text);
1140 $a_text = str_replace(
""",
"\"", $a_text);
1144 $a_text = str_replace(
"&",
"&", $a_text);
1148 $a_text = str_replace(
"<",
"&lt;", $a_text);
1149 $a_text = str_replace(
">",
"&gt;", $a_text);
1164 $a_text = str_replace(
"=<SimpleBulletList>",
"=<br /><SimpleBulletList>", $a_text);
1165 $a_text = str_replace(
"=<SimpleNumberedList>",
"=<br /><SimpleNumberedList>", $a_text);
1166 $a_text = str_replace(
"</SimpleBulletList>=",
"</SimpleBulletList><br />=", $a_text);
1167 $a_text = str_replace(
"</SimpleNumberedList>=",
"</SimpleNumberedList><br />=", $a_text);
1168 $a_text =
"<br />" . $a_text .
"<br />";
1173 while ($c_text !=
"") {
1176 $s1 = strpos($c_text,
"<br />=");
1179 $s2 = strpos($c_text,
"<br />==");
1180 if (is_int($s2) && $s2 <= $s1) {
1182 $s3 = strpos($c_text,
"<br />===");
1183 if (is_int($s3) && $s3 <= $s2) {
1185 $n = strpos($c_text,
"<br />", $s3 + 1);
1186 if (
$n > ($s3 + 9) && substr($c_text,
$n - 3, 9) ==
"===<br />") {
1189 if ($s3 > 0 || $head !=
"") {
1191 $chunks[] = array(
"level" => 0,
1195 $chunks[] = array(
"level" => 3,
1196 "text" => trim(substr($c_text, $s3 + 9,
$n - $s3 - 12)));
1200 $head .= substr($c_text, 0,
$n);
1201 $c_text = substr($c_text,
$n);
1205 $n = strpos($c_text,
"<br />", $s2 + 1);
1206 if (
$n > ($s2 + 8) && substr($c_text,
$n - 2, 8) ==
"==<br />") {
1209 if ($s2 > 0 || $head !=
"") {
1211 $chunks[] = array(
"level" => 0,
1215 $chunks[] = array(
"level" => 2,
"text" => trim(substr($c_text, $s2 + 8,
$n - $s2 - 10)));
1219 $head .= substr($c_text, 0,
$n);
1220 $c_text = substr($c_text,
$n);
1225 $n = strpos($c_text,
"<br />", $s1 + 1);
1226 if (
$n > ($s1 + 7) && substr($c_text,
$n - 1, 7) ==
"=<br />") {
1229 if ($s1 > 0 || $head !=
"") {
1231 $chunks[] = array(
"level" => 0,
1235 $chunks[] = array(
"level" => 1,
"text" => trim(substr($c_text, $s1 + 7,
$n - $s1 - 8)));
1239 $head .= substr($c_text, 0,
$n);
1240 $c_text = substr($c_text,
$n);
1246 $chunks[] = array(
"level" => 0,
"text" => $head . $c_text);
1251 if (count($chunks) == 0) {
1252 $chunks[] = array(
"level" => 0,
"text" =>
"");
1257 if (substr($chunks[0][
"text"], 0, 6) ==
"<br />") {
1258 $chunks[0][
"text"] = substr($chunks[0][
"text"], 6);
1263 $chunks[count($chunks) - 1][
"text"],
1264 strlen($chunks[count($chunks) - 1][
"text"]) - 6,
1267 $chunks[count($chunks) - 1][
"text"] =
1268 substr($chunks[count($chunks) - 1][
"text"], 0, strlen($chunks[count($chunks) - 1][
"text"]) - 6);
1269 if ($chunks[count($chunks) - 1][
"text"] ==
"") {
1270 unset($chunks[count($chunks) - 1]);
1283 if (substr($a_str, 0, 6) ==
"<br />" && substr($a_str, 6, 1) !=
"=") {
1284 $a_str = substr($a_str, 6);
1288 if (substr($a_str, 0, 1) ==
"=") {
1289 $a_str =
"<br />" . $a_str;
1300 if (substr($a_str, strlen($a_str) - 6) ==
"<br />") {
1301 $a_str = substr($a_str, 0, strlen($a_str) - 6);
1328 $this->log->debug(
"step 1: " . substr(
$a_content, 0, 1000));
1330 $this->log->debug(
"step 2: " . substr(
$t[
"text"], 0, 1000));
1335 $pc_id = explode(
":", $a_pc_id);
1336 $insert_at = explode(
":", $a_insert_at);
1337 $t_id = explode(
":",
$t[
"id"]);
1340 if ($a_insert_at !=
"") {
1342 $par->create($a_pg_obj, $insert_at[0], $insert_at[1]);
1344 $par = $a_pg_obj->getContentObject($pc_id[0], $pc_id[1]);
1347 if ($a_insert_at !=
"") {
1348 $pc_id = $a_pg_obj->generatePCId();
1349 $par->writePCId($pc_id);
1350 $this->inserted_pc_id = $pc_id;
1352 $this->inserted_pc_id = $pc_id[1];
1355 $par->setLanguage(
$ilUser->getLanguage());
1356 $par->setCharacteristic(
$t[
"class"]);
1358 $t2 = $par->input2xml(
$t[
"text"],
true,
false);
1359 $this->log->debug(
"step 3: " . substr($t2, 0, 1000));
1362 $this->log->debug(
"step 4: " . substr($t2, 0, 1000));
1364 $updated = $par->setText($t2,
true);
1366 if ($updated !==
true) {
1371 $updated = $par->updatePage($a_pg_obj);
1384 if ($a_as_ajax_str) {
1385 $a_pg_obj->stripHierIDs();
1386 $a_pg_obj->addHierIds();
1389 $combined = $a_pg_obj->getHierIdsForPCIds(
1390 array($this->inserted_pc_id)
1392 foreach ($combined as $pc_id =>
$hier_id) {
1394 $ids .= $sep .
$hier_id .
":" . $pc_id;
1401 return $this->inserted_pc_id;
1419 $res = $doc->loadXML($content);
1426 $xpath =
new DOMXpath($doc);
1428 $tags = self::getXMLTagMap();
1430 $elements = $xpath->query(
"//span");
1431 include_once(
"./Services/Utilities/classes/class.ilDOM2Util.php");
1432 while (!is_null($elements) && !is_null($element = $elements->item(0))) {
1434 $class = $element->getAttribute(
"class");
1435 if (substr($class, 0, 16) ==
"ilc_text_inline_") {
1436 $class_arr = explode(
" ", $class);
1437 $tag = substr($class_arr[0], 16);
1442 $cnode->setAttribute(
"Class", substr($class_arr[0], 16));
1444 for (
$i = 1;
$i < count($class_arr);
$i++) {
1445 $tag = substr($class_arr[
$i], 16);
1446 if (isset(
$tags[$tag])) {
1450 $cnode->setAttribute(
"Class", substr($class_arr[$i], 16));
1457 $elements = $xpath->query(
"//span");
1461 $xpath =
new DOMXpath($doc);
1462 $elements = $xpath->query(
"/dummy/div");
1465 if (!is_null($elements)) {
1466 foreach ($elements as $element) {
1467 $id = $element->getAttribute(
"id");
1468 $class = $element->getAttribute(
"class");
1469 $class = substr($class, 15);
1470 if (trim($class) ==
"") {
1471 $class =
"Standard";
1474 $text = $doc->saveXML($element);
1478 $pos = strpos(
$text,
">");
1480 $pos = strrpos(
$text,
"<");
1487 if (!in_array($bb, array(
"code",
"tex",
"fn",
"xln"))) {
1488 $text = str_replace(
1493 $text = str_replace(
1498 $text = str_replace(
"<il" . $cl .
"/>",
"",
$text);
1501 $text = str_replace(
1502 array(
"<code>",
"</code>"),
1503 array(
"[code]",
"[/code]"),
1506 $text = str_replace(
1507 array(
'<sup class="ilc_sup_Sup">',
"</sup>"),
1508 array(
"[sup]",
"[/sup]"),
1511 $text = str_replace(
1512 array(
'<sub class="ilc_sub_Sub">',
"</sub>"),
1513 array(
"[sub]",
"[/sub]"),
1518 $text = str_replace(
'<ul class="ilc_list_u_BulletedList"/>',
"",
$text);
1519 $text = str_replace(
'<ul class="ilc_list_o_NumberedList"/>',
"",
$text);
1524 while (preg_match(
'~<ilMarked(' . $any .
')>~i',
$text, $found)) {
1527 $text = str_replace(
"<ilMarked" . $found[1] .
">",
"[marked class=\"" . $attribs[
"Class"] .
"\"]",
$text);
1529 $text = str_replace(
"</ilMarked>",
"[/marked]",
$text);
1532 $ret[] = array(
"text" =>
$text,
"id" =>
$id,
"class" => $class);
1545 $text = str_replace(
1546 array(
"<ul>",
"</ul>"),
1547 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
1550 $text = str_replace(
1551 array(
"<ul class='ilc_list_u_BulletedList'>",
"</ul>"),
1552 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
1555 $text = str_replace(
1556 array(
"<ul class=\"ilc_list_u_BulletedList\">",
"</ul>"),
1557 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
1560 $text = str_replace(
1561 array(
"<ol>",
"</ol>"),
1562 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
1565 $text = str_replace(
1566 array(
"<ol class='ilc_list_o_NumberedList'>",
"</ol>"),
1567 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
1570 $text = str_replace(
1571 array(
"<ol class=\"ilc_list_o_NumberedList\">",
"</ol>"),
1572 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
1575 $text = str_replace(
1576 array(
"<li>",
"</li>"),
1577 array(
"<SimpleListItem>",
"</SimpleListItem>"),
1580 $text = str_replace(
1581 array(
"<li class='ilc_list_item_StandardListItem'>",
"</li>"),
1582 array(
"<SimpleListItem>",
"</SimpleListItem>"),
1585 $text = str_replace(
1586 array(
"<li class=\"ilc_list_item_StandardListItem\">",
"</li>"),
1587 array(
"<SimpleListItem>",
"</SimpleListItem>"),
1591 $text = str_replace(
1592 array(
"<li class=\"ilc_list_item_StandardListItem\"/>"),
1593 array(
"<SimpleListItem></SimpleListItem>"),
1597 $text = str_replace(
"<SimpleBulletList><br />",
"<SimpleBulletList>",
$text);
1598 $text = str_replace(
"<SimpleNumberedList><br />",
"<SimpleNumberedList>",
$text);
1599 $text = str_replace(
"<br /><SimpleBulletList>",
"<SimpleBulletList>",
$text);
1600 $text = str_replace(
"<br /><SimpleNumberedList>",
"<SimpleNumberedList>",
$text);
1601 $text = str_replace(
"</SimpleBulletList><br />",
"</SimpleBulletList>",
$text);
1602 $text = str_replace(
"</SimpleNumberedList><br />",
"</SimpleNumberedList>",
$text);
1603 $text = str_replace(
"</SimpleListItem><br />",
"</SimpleListItem>",
$text);
1617 $a_page->beforePageContentUpdate($this);
1619 $ret = $a_page->update();
1631 if (is_array($a_glos) && count($a_glos) > 0) {
1632 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1639 $found_terms = array();
1640 foreach ($a_glos as $glo) {
1643 $glo_ref_id = current($ref_ids);
1644 if ($glo_ref_id > 0) {
1646 foreach ($terms as
$t) {
1647 if (is_int(stripos(
$text, $t[
"term"]))) {
1648 $found_terms[$t[
"id"]] =
$t;
1656 if (count($found_terms) > 0) {
1657 self::linkTermsInDom($this->dom, $found_terms, $this->par_node);
1672 foreach ($a_terms as $k =>
$t) {
1673 $a_terms[$k][
"termlength"] = strlen(
$t[
"term"]);
1679 $a_dom = $a_dom->myDOMDocument;
1682 $a_par_node = $a_par_node->myDOMNode;
1687 if ($a_par_node == null) {
1688 $parnodes = $xpath->query(
"//Paragraph[@Characteristic != 'Code']");
1690 $parnodes = $xpath->query(
".//Paragraph[@Characteristic != 'Code']", $a_par_node->parentNode);
1693 include_once(
"./Services/Utilities/classes/class.ilStr.php");
1695 foreach ($parnodes as $parnode) {
1696 $textnodes = $xpath->query(
'.//text()', $parnode);
1697 foreach ($textnodes as
$node) {
1698 $p = $node->getNodePath();
1701 if (!is_int(strpos($p,
"/IntLink")) &&
1702 !is_int(strpos($p,
"/ExtLink"))) {
1703 $node_val = $node->nodeValue;
1706 foreach ($a_terms as
$t) {
1710 while (is_int($pos)) {
1714 if ($tex_bpos > 0 && $tex_epos > 0 && $tex_bpos < $pos && $tex_epos > $pos) {
1720 $valid_limiters = array(
"",
" ",
" ",
".",
",",
":",
";",
"!",
"?",
"\"",
"'",
"(",
")");
1725 if ((in_array($b, $valid_limiters) || htmlentities($b, null,
'utf-8') ==
" ") && in_array($a, $valid_limiters)) {
1726 $mid =
'[iln term="' . $t[
"id"] .
'"]' .
1745 $node->nodeValue = $node_val;
1754 $text = $a_dom->saveXML($parnode);
1763 '<?xml version="1.0" encoding="UTF-8"?><Paragraph>' .
$text .
'</Paragraph>',
1767 $temp_dom = $temp_dom->myDOMDocument;
1769 if (empty($error)) {
1771 $children = $parnode->childNodes;
1772 while ($parnode->hasChildNodes()) {
1773 $parnode->removeChild($parnode->firstChild);
1777 $xpath_temp =
new DOMXPath($temp_dom);
1778 $temp_pars = $xpath_temp->query(
"//Paragraph");
1780 foreach ($temp_pars as $new_par_node) {
1781 $new_childs = $new_par_node->childNodes;
1783 foreach ($new_childs as $new_child) {
1785 $cloned_child = $a_dom->importNode($new_child,
true);
1786 $parnode->appendChild($cloned_child);
1803 $a_page->buildDom();
1804 $a_dom = $a_page->getDom();
1805 self::linkTermsInDom($a_dom, $a_terms);
1821 self::saveMetaKeywords($a_page, $a_domdoc);
1822 self::saveAnchors($a_page, $a_domdoc);
1833 self::_deleteAnchors($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage());
1855 self::_deleteAnchors($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage());
1859 $nodes = $xpath->query(
'//Anchor');
1862 $name = $node->getAttribute(
"Name");
1863 if (trim(
$name) !=
"" && !in_array(
$name, $saved)) {
1864 self::_saveAnchor($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage(),
$name);
1877 $ilDB = $DIC->database();
1880 "DELETE FROM page_anchor WHERE " .
1881 " page_parent_type = " .
$ilDB->quote($a_parent_type,
"text") .
1882 " AND page_id = " .
$ilDB->quote($a_page_id,
"integer") .
1883 " AND page_lang = " .
$ilDB->quote($a_page_lang,
"text")
1890 public static function _saveAnchor($a_parent_type, $a_page_id, $a_page_lang, $a_anchor_name)
1894 $ilDB = $DIC->database();
1896 $ilDB->manipulate(
"INSERT INTO page_anchor " .
1897 "(page_parent_type, page_id, page_lang, anchor_name) VALUES (" .
1898 $ilDB->quote($a_parent_type,
"text") .
"," .
1899 $ilDB->quote($a_page_id,
"integer") .
"," .
1900 $ilDB->quote($a_page_lang,
"text") .
"," .
1901 $ilDB->quote($a_anchor_name,
"text") .
1908 public static function _readAnchors($a_parent_type, $a_page_id, $a_page_lang =
"-")
1912 $ilDB = $DIC->database();
1914 $and_lang = ($a_page_lang !=
"")
1915 ?
" AND page_lang = " .
$ilDB->quote($a_page_lang,
"text")
1918 $set =
$ilDB->query(
1919 "SELECT * FROM page_anchor " .
1920 " WHERE page_parent_type = " .
$ilDB->quote($a_parent_type,
"text") .
1921 " AND page_id = " .
$ilDB->quote($a_page_id,
"integer") .
1925 while ($rec =
$ilDB->fetchAssoc($set)) {
1926 $anchors[] = $rec[
"anchor_name"];
1940 if ($a_page->getParentType() ==
"gdf" ||
1941 $a_page->getParentType() ==
"lm") {
1943 $keywords = array();
1947 $nodes = $xpath->query(
'//Keyw');
1949 $k = trim(strip_tags($node->nodeValue));
1950 if (!in_array($k, $keywords)) {
1955 $meta_type = ($a_page->getParentType() ==
"gdf")
1958 $meta_rep_id = $a_page->getParentId();
1959 $meta_id = $a_page->getId();
1961 include_once(
"./Services/MetaData/classes/class.ilMD.php");
1962 $md_obj =
new ilMD($meta_rep_id, $meta_id, $meta_type);
1963 $mkeywords = array();
1965 if (is_object($md_section = $md_obj->getGeneral())) {
1966 foreach ($ids = $md_section->getKeywordIds() as
$id) {
1967 $md_key = $md_section->getKeyword(
$id);
1968 $mkeywords[] = strtolower($md_key->getKeyword());
1970 $lang = $md_key->getKeywordLanguageCode();
1974 foreach ($ids = $md_section->getLanguageIds() as
$id) {
1975 $md_lang = $md_section->getLanguage(
$id);
1977 $lang = $md_lang->getLanguageCode();
1981 foreach ($keywords as $k) {
1982 if (!in_array(strtolower($k), $mkeywords)) {
1983 if (trim($k) !=
"" &&
$lang !=
"") {
1984 $md_key = $md_section->addKeyword();
1989 $mkeywords[] = strtolower($k);
2003 if ($a_mode !=
"edit" && $adve_settings->get(
"auto_url_linking")) {
2004 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
2021 if ($a_mode !=
"edit" && $adve_settings->get(
"auto_url_linking")) {
2022 return array(
"il.ExtLink.autolink('.ilc_Paragraph, .ilc_page_fn_Footnote','ilc_link_ExtLink');");
static _lookupLogin($a_user_id)
lookup login
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getLastSavedPCId($a_pg_obj, $a_as_ajax_str=false)
Get last inserted pc ids.
if(isset($_REQUEST['delete'])) $list
createAfter($node)
Create paragraph node (incl.
static attribsToArray($a_str)
converts a string of format var1 = "val1" var2 = "val2" ...
static xml2outputJS($s_text, $char, $a_pc_id)
Prepare content for js output.
static getBBMap()
Get bb to xml tag map.
static strPos($a_haystack, $a_needle, $a_offset=null)
static xml2outputReplaceLists($a_text)
Replaces with *.
getSubCharacteristic()
get attribute subcharacteristic
xpath_new_context($dom_document)
static beforePageDelete($a_page)
Before page is being deleted.
getDownloadTitle()
get attribute download title
setShowLineNumbers($a_char)
set attribute showlinenumbers
removeTrailingBr($a_str)
Remove trailing
static segmentString($a_haystack, $a_needles)
Segments a string into an array at each position of a substring.
static handleAjaxContentPost($text)
Post input2xml handling of ajax content.
domxml_open_mem($str, $mode=0, &$error=null)
static getLocalJsPaths()
Get paths of necessary js files.
input2xml($a_text, $a_wysiwyg=0, $a_handle_lists=true)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
if(!array_key_exists('StateId', $_REQUEST)) $id
setDownloadTitle($a_char)
set attribute download title
setText($a_text, $a_auto_split=false)
Set (xml) content of text paragraph.
static _lookupId($a_user_str)
Lookup id by login.
static replaceByChilds($node)
Replace a node by its child.
setNode($a_node)
Set Page Content Node.
setType($a_type)
Set Type.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create paragraph node (incl.
saveJS($a_pg_obj, $a_content, $a_char, $a_pc_id, $a_insert_at="")
Save input coming from ajax.
static subStr($a_str, $a_start, $a_length=null)
static getXMLTagMap()
Get tag to bb map.
getLanguage()
get language
getParagraphSequenceContent($a_pg_obj)
Get paragraph sequenc of current paragraph.
static xml2output($a_text, $a_wysiwyg=false, $a_replace_lists=true, $unmask=true)
Converts xml from DB to output in edit textarea.
static _getAllReferences($a_id)
get all reference ids of object
setLanguage($a_lang)
set language
getAutoIndent()
Get AutoIndent (Code Paragraphs)
init()
Init page content component.
static strIPos($a_haystack, $a_needle, $a_offset=null)
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getType()
Need to override getType from ilPageContent to distinguish between Pararagraph and Source...
setSubCharacteristic($a_char)
set attribute subcharacteristic
createBeforeNode(&$node)
Create new page content (incl.
static afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
After page history entry has been created.
static input2xmlReplaceLists($a_text)
Converts xml from DB to output in edit textarea.
foreach($_POST as $key=> $value) $res
static handleAjaxContent($a_content)
Handle ajax content.
static linkTermsInDom($a_dom, $a_terms, $a_par_node=null)
Link terms in a dom page object in bb style.
updatePage($a_page)
Update page object (it would be better to have this centralized and to change the constructors and pa...
createAtNode(&$node)
Create new page content (incl.
setCharacteristic($a_char)
Set Characteristic of paragraph.
static strrPos($a_haystack, $a_needle, $a_offset=null)
getText($a_short_mode=false)
Get (xml) content of paragraph.
autoLinkGlossaries($a_glos)
Auto link glossaries.
static changeName($node, $name, $keep_attributes=true)
Change name of a node.
getCharacteristic()
Get characteristic of paragraph.
static getTermList( $a_glo_ref_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
static replaceBBCode($a_text, $a_bb, $a_tag)
Replace bb code.
static saveAnchors($a_page, $a_domdoc)
Save anchors.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _lookupType($a_id, $a_reference=false)
lookup object type
static _readAnchors($a_parent_type, $a_page_id, $a_page_lang="-")
Read anchors of a page.
autoSplit($a_text)
This function splits a paragraph text that has been already processed with input2xml at each header p...
static _saveAnchor($a_parent_type, $a_page_id, $a_page_lang, $a_anchor_name)
Save an anchor.
static _deleteAnchors($a_parent_type, $a_page_id, $a_page_lang)
Delete anchors of a page.
static addParent($node, $name)
Add parent.
static _input2xml($a_text, $a_lang, $a_wysiwyg=0, $a_handle_lists=true)
converts user input to xml
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
static _getCommonBBButtons()
Get common bb buttons.
const DOMXML_LOAD_PARSING
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
getOnloadCode($a_mode)
Get onload code.
handleNextBr($a_str)
Remove preceding
static saveMetaKeywords($a_page, $a_domdoc)
save all keywords
getJavascriptFiles($a_mode)
Get Javascript files.
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
static intLinks2xml($a_text)
internal links to xml
getShowLineNumbers()
get attribute showlinenumbers