4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
37 parent::setNode($a_node);
39 $childs = $a_node->child_nodes();
40 for ($i=0; $i<count($childs); $i++)
42 if ($childs[$i]->node_name() ==
"Paragraph")
44 $this->par_node = $childs[$i];
58 $this->par_node =& $this->dom->create_element(
"Paragraph");
59 $this->par_node =& $this->node->append_child($this->par_node);
60 $this->par_node->set_attribute(
"Language",
"");
61 $node->append_child ($this->node);
72 $this->par_node =& $this->dom->create_element(
"Paragraph");
73 $this->par_node =& $this->node->append_child($this->par_node);
74 $this->par_node->set_attribute(
"Language",
"");
87 if($succ_node =
$node->next_sibling())
89 $this->node = $succ_node->insert_before($this->node, $succ_node);
93 $parent_node =
$node->parent_node();
94 $this->node = $parent_node->append_child($this->node);
96 $this->par_node = $this->dom->create_element(
"Paragraph");
97 $this->par_node = $this->node->append_child($this->par_node);
98 $this->par_node->set_attribute(
"Language",
"");
108 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
112 $this->node =& $this->dom->create_element(
"PageContent");
115 $a_pg_obj->insertContent($this, $a_hier_id,
IL_INSERT_AFTER, $a_pc_id);
117 $this->par_node =& $this->dom->create_element(
"Paragraph");
118 $this->par_node =& $this->node->append_child($this->par_node);
119 $this->par_node->set_attribute(
"Language",
"");
128 function setText($a_text, $a_auto_split =
false)
132 if (!is_array($a_text))
134 $text = array(array(
"level" => 0,
"text" => $a_text));
150 $check.=
"<Paragraph>".$t[
"text"].
"</Paragraph>";
154 $temp_dom =
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.$check.
'</Paragraph>',
161 $temp_dom =
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.
$text[0][
"text"].
'</Paragraph>',
165 $children = $this->par_node->child_nodes();
166 for($i=0; $i<count($children); $i++)
168 $this->par_node->remove_child($children[$i]);
173 $path =
"//Paragraph";
175 if (count(
$res->nodeset) == 1)
177 $new_par_node =&
$res->nodeset[0];
178 $new_childs = $new_par_node->child_nodes();
180 for($i=0; $i<count($new_childs); $i++)
182 $cloned_child =& $new_childs[$i]->clone_node(
true);
183 $this->par_node->append_child($cloned_child);
189 if ((count(
$text) > 1) && (substr($orig_characteristic, 0, 8) ==
"Headline"))
191 $orig_characteristic =
"";
193 if (
$text[0][
"level"] > 0)
195 $this->par_node->set_attribute(
"Characteristic",
'Headline'.
$text[0][
"level"]);
203 for ($i=1; $i<count(
$text); $i++)
208 $next_par->createAfter($c_node);
210 if (
$text[$i][
"level"] > 0)
212 $next_par->setCharacteristic(
"Headline".
$text[$i][
"level"]);
216 $next_par->setCharacteristic($orig_characteristic);
218 $ok = $next_par->setText(
$text[$i][
"text"],
false);
219 $c_node = $next_par->node;
228 $text = str_replace(
"<br>",
"\n", $check);
231 $text = str_replace(
"</SimpleListItem>",
"</SimpleListItem>\n",
$text);
232 $text = str_replace(
"<SimpleBulletList>",
"\n<SimpleBulletList>",
$text);
233 $text = str_replace(
"<SimpleNumberedList>",
"\n<SimpleNumberedList>",
$text);
234 $text = str_replace(
"<Paragraph>\n",
"<Paragraph>",
$text);
235 $text = str_replace(
"</Paragraph>",
"</Paragraph>\n",
$text);
236 include_once(
"./Services/Dom/classes/class.ilDomDocument.php");
237 $doc =
new ilDOMDocument();
238 $text =
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.$text.
'</Paragraph>';
240 $this->success = $doc->loadXML(
$text);
241 $error = $doc->errors;
243 foreach ($error as $e)
245 $e = str_replace(
" in Entity",
"", $e);
259 if (is_object($this->par_node))
262 $childs = $this->par_node->child_nodes();
263 for($i=0; $i<count($childs); $i++)
265 $content .= $this->dom->dump_node($childs[$i]);
280 $childs = $this->par_node->parent_node()->parent_node()->child_nodes();
286 for($i=0; $i<count($childs); $i++)
288 $pchilds = $childs[$i]->child_nodes();
289 if ($pchilds[0]->node_name() ==
"Paragraph" &&
290 $pchilds[0]->get_attribute(
"Characteristic") !=
"Code")
292 $cur_seq[] = $childs[$i];
295 if ($childs[$i]->get_attribute(
"PCID") == $pc_id &&
296 $childs[$i]->get_attribute(
"HierId") ==
$hier_id)
318 foreach ($seq as $p_node)
320 $ids.= $id_sep.$p_node->get_attribute(
"HierId").
":".$p_node->get_attribute(
"PCID");
321 $po = $a_pg_obj->getContentObject($p_node->get_attribute(
"HierId"),
322 $p_node->get_attribute(
"PCID"));
323 $s_text = $po->getText();
324 $s_text = $po->xml2output($s_text,
true,
false);
325 $char = $po->getCharacteristic();
336 return $ids.$content;
348 $this->par_node->set_attribute(
"Characteristic", $a_char);
352 if ($this->par_node->has_attribute(
"Characteristic"))
354 $this->par_node->remove_attribute(
"Characteristic");
366 if (is_object($this->par_node))
368 return $this->par_node->get_attribute(
"Characteristic");
380 $this->par_node->set_attribute(
"SubCharacteristic", $a_char);
384 if ($this->par_node->has_attribute(
"SubCharacteristic"))
386 $this->par_node->remove_attribute(
"SubCharacteristic");
398 return $this->par_node->get_attribute(
"AutoIndent");
405 $this->par_node->set_attribute(
"AutoIndent", $a_char);
409 if ($this->par_node->has_attribute(
"AutoIndent"))
411 $this->par_node->remove_attribute(
"AutoIndent");
421 return $this->par_node->get_attribute(
"SubCharacteristic");
432 $this->par_node->set_attribute(
"DownloadTitle", $a_char);
436 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 function input2xml($a_text, $a_wysiwyg = 0, $a_handle_lists =
true)
495 static function _input2xml($a_text, $a_lang, $a_wysiwyg = 0, $a_handle_lists =
true)
504 $a_text = str_replace(
"<br />", chr(10), $a_text);
509 $a_text = trim($a_text);
516 $a_text = str_replace(
"&",
"&",$a_text);
518 $a_text = str_replace(
"<",
"<",$a_text);
519 $a_text = str_replace(
">",
">",$a_text);
522 $a_text = preg_replace(
'/<([\s\/]*?PageTurn.*?)>/i',
"<$1>",$a_text);
523 $a_text = preg_replace(
'/<([\s\/]*?BibItemIdentifier.*?)>/i',
"<$1>",$a_text);
534 $a_text = str_replace(chr(13).chr(10),
"<br />",$a_text);
535 $a_text = str_replace(chr(13),
"<br />", $a_text);
536 $a_text = str_replace(chr(10),
"<br />", $a_text);
544 $atags = array(
"com",
"emp",
"str",
"fn",
"quot",
"code",
"acc",
"imp",
"kw",
"sub",
"sup");
545 foreach ($atags as $at)
547 $a_text = str_replace(
"[".$at.
"][/".$at.
"]",
"", $a_text);
551 $a_text = eregi_replace(
"\[com\]",
"<Comment Language=\"".$a_lang.
"\">",$a_text);
552 $a_text = eregi_replace(
"\[\/com\]",
"</Comment>",$a_text);
553 $a_text = eregi_replace(
"\[emp\]",
"<Emph>",$a_text);
554 $a_text = eregi_replace(
"\[\/emp\]",
"</Emph>",$a_text);
555 $a_text = eregi_replace(
"\[str\]",
"<Strong>",$a_text);
556 $a_text = eregi_replace(
"\[\/str\]",
"</Strong>",$a_text);
557 $a_text = eregi_replace(
"\[fn\]",
"<Footnote>",$a_text);
558 $a_text = eregi_replace(
"\[\/fn\]",
"</Footnote>",$a_text);
559 $a_text = eregi_replace(
"\[quot\]",
"<Quotation Language=\"".$a_lang.
"\">",$a_text);
560 $a_text = eregi_replace(
"\[\/quot\]",
"</Quotation>",$a_text);
561 $a_text = eregi_replace(
"\[code\]",
"<Code>",$a_text);
562 $a_text = eregi_replace(
"\[\/code\]",
"</Code>",$a_text);
563 $a_text = eregi_replace(
"\[acc\]",
"<Accent>",$a_text);
564 $a_text = eregi_replace(
"\[\/acc\]",
"</Accent>",$a_text);
565 $a_text = eregi_replace(
"\[imp\]",
"<Important>",$a_text);
566 $a_text = eregi_replace(
"\[\/imp\]",
"</Important>",$a_text);
567 $a_text = eregi_replace(
"\[kw\]",
"<Keyw>",$a_text);
568 $a_text = eregi_replace(
"\[\/kw\]",
"</Keyw>",$a_text);
569 $a_text = eregi_replace(
"\[sub\]",
"<Sub>",$a_text);
570 $a_text = eregi_replace(
"\[\/sub\]",
"</Sub>",$a_text);
571 $a_text = eregi_replace(
"\[sup\]",
"<Sup>",$a_text);
572 $a_text = eregi_replace(
"\[\/sup\]",
"</Sup>",$a_text);
574 $a_text = self::intLinks2xml($a_text);
577 $ws=
"[ \t\r\f\v\n]*";
579 while (eregi(
"\[(xln$ws(url$ws=$ws\"([^\"])*\")$ws(target$ws=$ws(\"(Glossary|FAQ|Media)\"))?$ws)\]\[\/xln\]", $a_text, $found))
581 $a_text = str_replace($found[0],
"",$a_text);
583 while (eregi(
"\[(xln$ws(url$ws=$ws(([^]])*)))$ws\]\[\/xln\]", $a_text, $found))
585 $a_text = str_replace($found[0],
"",$a_text);
588 while (eregi(
"\[(xln$ws(url$ws=$ws\"([^\"])*\")$ws(target$ws=$ws(\"(Glossary|FAQ|Media)\"))?$ws)\]", $a_text, $found))
591 if (isset($attribs[
"url"]))
595 if (in_array($a2[
"target"], array(
"FAQ",
"Glossary",
"Media")))
597 $tstr =
' TargetFrame="'.$a2[
"target"].
'"';
599 $a_text = str_replace(
"[".$found[1].
"]",
"<ExtLink Href=\"".$attribs[
"url"].
"\"$tstr>", $a_text);
603 $a_text = str_replace(
"[".$found[1].
"]",
"[error: xln".$found[1].
"]",$a_text);
608 while (eregi(
"\[(xln$ws(url$ws=$ws(([^]])*)))$ws\]", $a_text, $found))
612 $a_text = str_replace(
"[".$found[1].
"]",
"<ExtLink Href=\"".$found[3].
"\">", $a_text);
616 $a_text = str_replace(
"[".$found[1].
"]",
"[error: xln".$found[1].
"]",$a_text);
619 $a_text = eregi_replace(
"\[\/xln\]",
"</ExtLink>",$a_text);
622 $ws=
"[ \t\r\f\v\n]*";
623 while (eregi(
"\[(anc$ws(name$ws=$ws\"([^\"])*\")$ws)\]", $a_text, $found))
626 $a_text = str_replace(
"[".$found[1].
"]",
"<Anchor Name=\"".$attribs[
"name"].
"\">", $a_text);
628 $a_text = eregi_replace(
"\[\/anc\]",
"</Anchor>",$a_text);
641 global $objDefinition;
643 $rtypes = $objDefinition->getAllRepositoryTypes();
647 $ws=
"[ \t\r\f\v\n]*";
648 $ltypes =
"page|chap|term|media|obj|dfile|sess|wpage|".implode($rtypes,
"|");
650 while (eregi(
"\[(iln$ws((inst$ws=$ws([\"0-9])*)?$ws".
651 "((".$ltypes.
")$ws=$ws([\"0-9])*)$ws".
652 "(target$ws=$ws(\"(New|FAQ|Media)\"))?$ws(anchor$ws=$ws(\"([^\"])*\"))?$ws))\]\[\/iln\]", $a_text, $found))
654 $a_text = str_replace($found[0],
"",$a_text);
657 while (eregi(
"\[(iln$ws((inst$ws=$ws([\"0-9])*)?$ws".
658 "((".$ltypes.
")$ws=$ws([\"0-9])*)$ws".
659 "(target$ws=$ws(\"(New|FAQ|Media)\"))?$ws(anchor$ws=$ws(\"([^\"])*\"))?$ws))\]", $a_text, $found))
662 $inst_str = $attribs[
"inst"];
664 if (isset($attribs[
"page"]))
667 if (!empty($found[10]))
669 $tframestr =
" TargetFrame=\"".$found[10].
"\" ";
672 if ($attribs[
"anchor"] !=
"")
674 $ancstr =
' Anchor="'.$attribs[
"anchor"].
'" ';
676 $a_text = eregi_replace(
"\[".$found[1].
"\]",
677 "<IntLink Target=\"il_".$inst_str.
"_pg_".$attribs[page].
"\" Type=\"PageObject\"".$tframestr.$ancstr.
">", $a_text);
680 else if (isset($attribs[
"chap"]))
682 if (!empty($found[10]))
684 $tframestr =
" TargetFrame=\"".$found[10].
"\" ";
690 $a_text = eregi_replace(
"\[".$found[1].
"\]",
691 "<IntLink Target=\"il_".$inst_str.
"_st_".$attribs[chap].
"\" Type=\"StructureObject\"".$tframestr.
">", $a_text);
694 else if (isset($attribs[
"term"]))
699 $tframestr =
" TargetFrame=\"New\" ";
703 $tframestr =
" TargetFrame=\"Glossary\" ";
706 $a_text = eregi_replace(
"\[".$found[1].
"\]",
707 "<IntLink Target=\"il_".$inst_str.
"_git_".$attribs[term].
"\" Type=\"GlossaryItem\" $tframestr>", $a_text);
710 else if (isset($attribs[
"wpage"]))
723 $a_text = eregi_replace(
"\[".$found[1].
"\]",
724 "<IntLink Target=\"il_".$inst_str.
"_wpage_".$attribs[wpage].
"\" Type=\"WikiPage\" $tframestr>", $a_text);
727 else if (isset($attribs[
"media"]))
729 if (!empty($found[10]))
731 $tframestr =
" TargetFrame=\"".$found[10].
"\" ";
732 $a_text = eregi_replace(
"\[".$found[1].
"\]",
733 "<IntLink Target=\"il_".$inst_str.
"_mob_".$attribs[media].
"\" Type=\"MediaObject\"".$tframestr.
">", $a_text);
737 $a_text = eregi_replace(
"\[".$found[1].
"\]",
738 "<IntLink Target=\"il_".$inst_str.
"_mob_".$attribs[media].
"\" Type=\"MediaObject\"/>", $a_text);
742 else if (isset($attribs[
"dfile"]))
744 $a_text = eregi_replace(
"\[".$found[1].
"\]",
745 "<IntLink Target=\"il_".$inst_str.
"_dfile_".$attribs[dfile].
"\" Type=\"File\">", $a_text);
751 foreach ($objDefinition->getAllRepositoryTypes() as
$t)
753 if (isset($attribs[
$t]))
755 $obj_id = $attribs[
$t];
758 if (isset($attribs[
"obj"]))
760 $obj_id = $attribs[
"obj"];
767 $a_text = eregi_replace(
"\[".$found[1].
"\]",
768 "<IntLink Target=\"il_".$inst_str.
"_obj_".$obj_id.
"\" Type=\"RepositoryItem\">", $a_text);
772 $a_text = eregi_replace(
"\[".$found[1].
"\]",
773 "<IntLink Target=\"il_".$inst_str.
"_".$found[6].
"_".$obj_id.
"\" Type=\"RepositoryItem\">", $a_text);
778 $a_text = eregi_replace(
"\[".$found[1].
"\]",
"[error: iln".$found[1].
"]",$a_text);
782 while (eregi(
"\[(iln$ws((inst$ws=$ws([\"0-9])*)?".$ws.
"media$ws=$ws([\"0-9])*)$ws)/\]", $a_text, $found))
785 $inst_str = $attribs[
"inst"];
786 $a_text = eregi_replace(
"\[".$found[1].
"/\]",
787 "<IntLink Target=\"il_".$inst_str.
"_mob_".$attribs[media].
"\" Type=\"MediaObject\"/>", $a_text);
791 while (eregi(
"\[(iln$ws((inst$ws=$ws([\"0-9])*)?".$ws.
"user$ws=$ws(\"([^\"])*)\")$ws)/\]", $a_text, $found))
794 $inst_str = $attribs[
"inst"];
795 include_once(
"./Services/User/classes/class.ilObjUser.php");
797 $a_text = eregi_replace(
"\[".$found[1].
"/\]",
798 "<IntLink Target=\"il_".$inst_str.
"_user_".$user_id.
"\" Type=\"User\"/>", $a_text);
801 $a_text = eregi_replace(
"\[\/iln\]",
"</IntLink>",$a_text);
815 $rows = explode(
"<br />", $a_text.
"<br />");
822 foreach ($rows as
$row)
825 if (str_replace(
"#",
"*", substr($row, 0, 3)) ==
"***")
829 else if (str_replace(
"#",
"*", substr($row, 0, 2)) ==
"**")
833 else if (str_replace(
"#",
"*", substr($row, 0, 1)) ==
"*")
839 if ($level < $old_level)
841 for ($i = $old_level; $i > $level; $i--)
843 $text.=
"</SimpleListItem></".$clist[$i].
">";
847 $text.=
"</SimpleListItem>";
850 else if ($old_level > 0 && $level > 0 && ($level == $old_level))
852 $text.=
"</SimpleListItem>";
854 else if (($level == $old_level) &&
$text !=
"")
860 if ($level > $old_level)
862 for($i = $old_level + 1; $i <= $level; $i++)
864 if (substr($row, $i - 1, 1) ==
"*")
866 $clist[$i] =
"SimpleBulletList";
870 $clist[$i] =
"SimpleNumberedList";
872 $text.=
"<".$clist[$i].
"><SimpleListItem>";
875 else if ($old_level > 0 && $level > 0)
877 $text.=
"<SimpleListItem>";
879 $text.= substr($row, $level);
885 if (substr(
$text, strlen(
$text) - 6) ==
"<br />")
903 "</SimpleListItem>",
"<SimpleListItem>",
"<SimpleListItem/>",
"<SimpleNumberedList>",
"</SimpleNumberedList>"));
905 $current_list = array();
907 for ($i=0; $i<= count($segments); $i++)
909 if ($segments[$i] ==
"<SimpleBulletList>")
911 if (count($current_list) == 0)
915 array_push($current_list,
"*");
918 else if ($segments[$i] ==
"<SimpleNumberedList>")
920 if (count($current_list) == 0)
924 array_push($current_list,
"#");
927 else if ($segments[$i] ==
"</SimpleBulletList>")
929 array_pop($current_list);
932 else if ($segments[$i] ==
"</SimpleNumberedList>")
934 array_pop($current_list);
937 else if ($segments[$i] ==
"<SimpleListItem>")
941 else if ($segments[$i] ==
"</SimpleListItem>")
945 else if ($segments[$i] ==
"<SimpleListItem/>")
952 foreach($current_list as $list)
968 foreach($current_list as $list)
973 $text.= $segments[$i];
983 if ($segments[count($segments) - 1] ==
"</SimpleBulletList>" ||
984 $segments[count($segments) - 1] ==
"</SimpleNumberedList>" &&
1000 $nothing_found =
false;
1001 while (!$nothing_found)
1003 $nothing_found =
true;
1005 foreach($a_needles as $needle)
1007 $pos = stripos($a_haystack, $needle);
1008 if (is_int($pos) && ($pos < $found || $found == -1))
1011 $found_needle = $needle;
1012 $nothing_found =
false;
1017 $segments[] = substr($a_haystack, 0, $found);
1018 $a_haystack = substr($a_haystack, $found);
1022 $segments[] = substr($a_haystack, 0, strlen($found_needle));
1023 $a_haystack = substr($a_haystack, strlen($found_needle));
1026 if ($a_haystack !=
"")
1028 $segments[] = $a_haystack;
1041 static function xml2output($a_text, $a_wysiwyg =
false, $a_replace_lists =
true)
1048 $a_text = eregi_replace(
"<Comment[^>]*>",
"[com]",$a_text);
1049 $a_text = eregi_replace(
"</Comment>",
"[/com]",$a_text);
1050 $a_text = eregi_replace(
"<Comment/>",
"[com][/com]",$a_text);
1051 $a_text = eregi_replace(
"<Emph>",
"[emp]",$a_text);
1052 $a_text = eregi_replace(
"</Emph>",
"[/emp]",$a_text);
1053 $a_text = eregi_replace(
"<Emph/>",
"[emp][/emp]",$a_text);
1054 $a_text = eregi_replace(
"<Strong>",
"[str]",$a_text);
1055 $a_text = eregi_replace(
"</Strong>",
"[/str]",$a_text);
1056 $a_text = eregi_replace(
"<Strong/>",
"[str][/str]",$a_text);
1057 $a_text = eregi_replace(
"<Footnote[^>]*>",
"[fn]",$a_text);
1058 $a_text = eregi_replace(
"</Footnote>",
"[/fn]",$a_text);
1059 $a_text = eregi_replace(
"<Footnote/>",
"[fn][/fn]",$a_text);
1060 $a_text = eregi_replace(
"<Quotation[^>]*>",
"[quot]",$a_text);
1061 $a_text = eregi_replace(
"</Quotation>",
"[/quot]",$a_text);
1062 $a_text = eregi_replace(
"<Quotation/>",
"[quot][/quot]",$a_text);
1063 $a_text = eregi_replace(
"<Code[^>]*>",
"[code]",$a_text);
1064 $a_text = eregi_replace(
"</Code>",
"[/code]",$a_text);
1065 $a_text = eregi_replace(
"<Code/>",
"[code][/code]",$a_text);
1066 $a_text = eregi_replace(
"<Accent>",
"[acc]",$a_text);
1067 $a_text = eregi_replace(
"</Accent>",
"[/acc]",$a_text);
1068 $a_text = eregi_replace(
"<Important>",
"[imp]",$a_text);
1069 $a_text = eregi_replace(
"</Important>",
"[/imp]",$a_text);
1070 $a_text = eregi_replace(
"<Keyw>",
"[kw]",$a_text);
1071 $a_text = eregi_replace(
"</Keyw>",
"[/kw]",$a_text);
1072 $a_text = eregi_replace(
"<Sup>",
"[sup]",$a_text);
1073 $a_text = eregi_replace(
"</Sup>",
"[/sup]",$a_text);
1074 $a_text = eregi_replace(
"<Sub>",
"[sub]",$a_text);
1075 $a_text = eregi_replace(
"</Sub>",
"[/sub]",$a_text);
1078 if ($a_replace_lists)
1086 while (eregi(
"<IntLink($any)>", $a_text, $found))
1090 $target = explode(
"_", $attribs[
"Target"]);
1092 $inst_str = (!is_int(strpos($attribs[
"Target"],
"__")))
1093 ? $inst_str =
"inst=\"".$target[1].
"\" " 1095 switch($attribs[
"Type"])
1098 $tframestr = (!empty($attribs[
"TargetFrame"]))
1099 ?
" target=\"".$attribs[
"TargetFrame"].
"\"" 1101 $ancstr = (!empty($attribs[
"Anchor"]))
1102 ?
' anchor="'.$attribs[
"Anchor"].
'"' 1104 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"page=\"".
$target_id.
"\"$tframestr$ancstr]",$a_text);
1107 case "StructureObject":
1108 $tframestr = (!empty($attribs[
"TargetFrame"]))
1109 ?
" target=\"".$attribs[
"TargetFrame"].
"\"" 1111 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"chap=\"".
$target_id.
"\"$tframestr]",$a_text);
1114 case "GlossaryItem":
1115 $tframestr = (empty($attribs[
"TargetFrame"]) || $attribs[
"TargetFrame"] ==
"Glossary")
1117 :
" target=\"".$attribs[
"TargetFrame"].
"\"";
1118 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"term=\"".
$target_id.
"\"".$tframestr.
"]",$a_text);
1126 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"wpage=\"".
$target_id.
"\"".$tframestr.
"]",$a_text);
1130 if (empty($attribs[
"TargetFrame"]))
1132 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"media=\"".
$target_id.
"\"/]",$a_text);
1136 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln media=\"".
$target_id.
"\"".
1137 " target=\"".$attribs[
"TargetFrame"].
"\"]",$a_text);
1142 case "RepositoryItem":
1143 if ($inst_str ==
"")
1149 $rtype = $target[count($target) - 2];
1152 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"$target_type=\"".
$target_id.
"\"".$tframestr.
"]",$a_text);
1157 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln ".$inst_str.
"dfile=\"".
$target_id.
"\"".$tframestr.
"]",$a_text);
1162 include_once(
"./Services/User/classes/class.ilObjUser.php");
1167 $a_text = eregi_replace(
"<IntLink".$found[1].
">",
"[iln]",$a_text);
1171 $a_text = eregi_replace(
"</IntLink>",
"[/iln]",$a_text);
1174 while (eregi(
"<ExtLink($any)>", $a_text, $found))
1180 if (in_array($attribs[
"TargetFrame"], array(
"FAQ",
"Glossary",
"Media")))
1182 $tstr =
' target="'.$attribs[
"TargetFrame"].
'"';
1184 $a_text = str_replace(
"<ExtLink".$found[1].
">",
"[xln url=\"".$attribs[
"Href"].
"\"$tstr]",$a_text);
1186 $a_text = eregi_replace(
"</ExtLink>",
"[/xln]",$a_text);
1189 while (eregi(
"<Anchor($any/)>", $a_text, $found))
1193 $a_text = str_replace(
"<Anchor".$found[1].
">",
"[anc name=\"".$attribs[
"Name"].
"\"][/anc]",$a_text);
1195 while (eregi(
"<Anchor($any)>", $a_text, $found))
1199 $a_text = str_replace(
"<Anchor".$found[1].
">",
"[anc name=\"".$attribs[
"Name"].
"\"]",$a_text);
1201 $a_text = eregi_replace(
"</Anchor>",
"[/anc]",$a_text);
1207 $a_text = str_replace(
"<br />",
"\n", $a_text);
1208 $a_text = str_replace(
"<br/>",
"\n", $a_text);
1214 $a_text = str_replace(
"{",
"{", $a_text);
1215 $a_text = str_replace(
"}",
"}", $a_text);
1218 $a_text = str_replace(
"<",
"<", $a_text);
1219 $a_text = str_replace(
">",
">",$a_text);
1222 $a_text = str_replace(
""",
"\"", $a_text);
1226 $a_text = str_replace(
"&",
"&", $a_text);
1229 $a_text = str_replace(
"<",
"&lt;", $a_text);
1230 $a_text = str_replace(
">",
"&gt;", $a_text);
1244 $a_text = str_replace (
"=<SimpleBulletList>",
"=<br /><SimpleBulletList>", $a_text);
1245 $a_text = str_replace (
"=<SimpleNumberedList>",
"=<br /><SimpleNumberedList>", $a_text);
1246 $a_text = str_replace (
"</SimpleBulletList>=",
"</SimpleBulletList><br />=", $a_text);
1247 $a_text = str_replace (
"</SimpleNumberedList>=",
"</SimpleNumberedList><br />=", $a_text);
1248 $a_text =
"<br />".$a_text.
"<br />";
1253 while ($c_text !=
"")
1257 $s1 = strpos($c_text,
"<br />=");
1261 $s2 = strpos($c_text,
"<br />==");
1262 if (is_int($s2) && $s2 <= $s1)
1265 $s3 = strpos($c_text,
"<br />===");
1266 if (is_int($s3) && $s3 <= $s2)
1269 $n = strpos($c_text,
"<br />", $s3 + 1);
1270 if (
$n > ($s3+9) && substr($c_text,
$n-3, 9) ==
"===<br />")
1274 if ($s3 > 0 || $head !=
"")
1277 $chunks[] = array(
"level" => 0,
1281 $chunks[] = array(
"level" => 3,
1282 "text" => trim(substr($c_text, $s3+9,
$n-$s3-12)));
1288 $head.= substr($c_text, 0,
$n);
1289 $c_text = substr($c_text,
$n);
1295 $n = strpos($c_text,
"<br />", $s2 + 1);
1296 if (
$n > ($s2+8) && substr($c_text,
$n-2, 8) ==
"==<br />")
1300 if ($s2 > 0 || $head !=
"")
1303 $chunks[] = array(
"level" => 0,
1307 $chunks[] = array(
"level" => 2,
"text" => trim(substr($c_text, $s2+8,
$n-$s2-10)));
1313 $head.= substr($c_text, 0,
$n);
1314 $c_text = substr($c_text,
$n);
1321 $n = strpos($c_text,
"<br />", $s1 + 1);
1322 if (
$n > ($s1+7) && substr($c_text,
$n-1, 7) ==
"=<br />")
1326 if ($s1 > 0 || $head !=
"")
1329 $chunks[] = array(
"level" => 0,
1333 $chunks[] = array(
"level" => 1,
"text" => trim(substr($c_text, $s1+7,
$n-$s1-8)));
1339 $head.= substr($c_text, 0,
$n);
1340 $c_text = substr($c_text,
$n);
1348 $chunks[] = array(
"level" => 0,
"text" => $head.$c_text);
1353 if (count($chunks) == 0)
1355 $chunks[] = array(
"level" => 0,
"text" =>
"");
1360 if (substr($chunks[0][
"text"], 0, 6) ==
"<br />")
1362 $chunks[0][
"text"] = substr($chunks[0][
"text"], 6);
1366 if (substr($chunks[count($chunks) - 1][
"text"],
1367 strlen($chunks[count($chunks) - 1][
"text"]) - 6, 6) ==
"<br />")
1369 $chunks[count($chunks) - 1][
"text"] =
1370 substr($chunks[count($chunks) - 1][
"text"], 0, strlen($chunks[count($chunks) - 1][
"text"]) - 6);
1371 if ($chunks[count($chunks) - 1][
"text"] ==
"")
1373 unset($chunks[count($chunks) - 1]);
1386 if (substr($a_str, 0, 6) ==
"<br />" && substr($a_str, 6, 1) !=
"=")
1388 $a_str = substr($a_str, 6);
1394 if (substr($a_str, 0, 1) ==
"=")
1396 $a_str =
"<br />".$a_str;
1407 if (substr($a_str, strlen($a_str) - 6) ==
"<br />")
1409 $a_str = substr($a_str, 0, strlen($a_str) - 6);
1432 function saveJS($a_pg_obj, $a_content, $a_char, $a_pc_id, $a_insert_at =
"")
1436 $t = self::handleAjaxContent($a_content);
1437 if (
$text ===
false)
1442 $pc_id = explode(
":", $a_pc_id);
1443 $insert_at = explode(
":", $a_insert_at);
1444 $t_id = explode(
":",
$t[
"id"]);
1447 if ($a_insert_at !=
"")
1450 $par->create($a_pg_obj, $insert_at[0], $insert_at[1]);
1454 $par = $a_pg_obj->getContentObject($pc_id[0], $pc_id[1]);
1457 if ($a_insert_at !=
"")
1459 $pc_id = $a_pg_obj->generatePCId();
1460 $par->writePCId($pc_id);
1461 $this->inserted_pc_id = $pc_id;
1465 $this->inserted_pc_id = $pc_id[1];
1468 $par->setLanguage($ilUser->getLanguage());
1469 $par->setCharacteristic(
$t[
"class"]);
1471 $t2 = $par->input2xml(
$t[
"text"],
true,
false);
1473 $updated = $par->setText($t2,
true);
1475 if ($updated !==
true)
1477 echo $updated;
exit;
1480 $updated = $par->updatePage($a_pg_obj);
1495 $a_pg_obj->stripHierIDs();
1496 $a_pg_obj->addHierIds();
1499 $combined = $a_pg_obj->getHierIdsForPCIds(
1500 array($this->inserted_pc_id));
1501 foreach ($combined as $pc_id =>
$hier_id)
1504 $ids.= $sep.$hier_id.
":".$pc_id;
1511 return $this->inserted_pc_id;
1520 $a_content =
"<dummy>".$a_content.
"</dummy>";
1529 $res = $doc->loadXML($content);
1537 $xpath =
new DOMXpath($doc);
1539 $elements = $xpath->query(
"//span");
1540 include_once(
"./Services/Utilities/classes/class.ilDOM2Util.php");
1541 while (!is_null($elements) && !is_null($element = $elements->item(0)))
1544 $class = $element->getAttribute(
"class");
1545 if (substr($class, 0, 16) ==
"ilc_text_inline_")
1547 $class_arr = explode(
" ", $class);
1549 for ($i = 1; $i < count($class_arr); $i++)
1559 $elements = $xpath->query(
"//span");
1563 $xpath =
new DOMXpath($doc);
1564 $elements = $xpath->query(
"/dummy/div");
1567 if (!is_null($elements))
1569 foreach ($elements as $element)
1571 $id = $element->getAttribute(
"id");
1572 $class = $element->getAttribute(
"class");
1573 $class = substr($class, 15);
1574 if (trim($class) ==
"")
1576 $class =
"Standard";
1579 $text = $doc->saveXML($element);
1583 $pos = strpos(
$text,
">");
1585 $pos = strrpos(
$text,
"<");
1593 if (!in_array($bb, array(
"code",
"tex",
"fn",
"xln")))
1595 $text = str_replace(
"<il".$cl.
">",
1596 "[".$bb.
"]",
$text);
1597 $text = str_replace(
"</il".$cl.
">",
1598 "[/".$bb.
"]",
$text);
1599 $text = str_replace(
"<il".$cl.
"/>",
"",
$text);
1602 $text = str_replace(array(
"<code>",
"</code>"),
1603 array(
"[code]",
"[/code]"),
$text);
1604 $text = str_replace(array(
'<sup class="ilc_sup_Sup">',
"</sup>"),
1605 array(
"[sup]",
"[/sup]"),
$text);
1606 $text = str_replace(array(
'<sub class="ilc_sub_Sub">',
"</sub>"),
1607 array(
"[sub]",
"[/sub]"),
$text);
1610 $text = str_replace(
'<ul class="ilc_list_u_BulletedList"/>',
"",
$text);
1611 $text = str_replace(
'<ul class="ilc_list_o_NumberedList"/>',
"",
$text);
1613 $ret[] = array(
"text" =>
$text,
"id" => $id,
"class" => $class);
1626 $text = str_replace(array(
"<ul>",
"</ul>"),
1627 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
$text);
1628 $text = str_replace(array(
"<ul class='ilc_list_u_BulletedList'>",
"</ul>"),
1629 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
$text);
1630 $text = str_replace(array(
"<ul class=\"ilc_list_u_BulletedList\">",
"</ul>"),
1631 array(
"<SimpleBulletList>",
"</SimpleBulletList>"),
$text);
1632 $text = str_replace(array(
"<ol>",
"</ol>"),
1633 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
$text);
1634 $text = str_replace(array(
"<ol class='ilc_list_o_NumberedList'>",
"</ol>"),
1635 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
$text);
1636 $text = str_replace(array(
"<ol class=\"ilc_list_o_NumberedList\">",
"</ol>"),
1637 array(
"<SimpleNumberedList>",
"</SimpleNumberedList>"),
$text);
1638 $text = str_replace(array(
"<li>",
"</li>"),
1639 array(
"<SimpleListItem>",
"</SimpleListItem>"),
$text);
1640 $text = str_replace(array(
"<li class='ilc_list_item_StandardListItem'>",
"</li>"),
1641 array(
"<SimpleListItem>",
"</SimpleListItem>"),
$text);
1642 $text = str_replace(array(
"<li class=\"ilc_list_item_StandardListItem\">",
"</li>"),
1643 array(
"<SimpleListItem>",
"</SimpleListItem>"),
$text);
1645 $text = str_replace(array(
"<li class=\"ilc_list_item_StandardListItem\"/>"),
1646 array(
"<SimpleListItem></SimpleListItem>"),
$text);
1648 $text = str_replace(
"<SimpleBulletList><br />",
"<SimpleBulletList>",
$text);
1649 $text = str_replace(
"<SimpleNumberedList><br />",
"<SimpleNumberedList>",
$text);
1650 $text = str_replace(
"<br /><SimpleBulletList>",
"<SimpleBulletList>",
$text);
1651 $text = str_replace(
"<br /><SimpleNumberedList>",
"<SimpleNumberedList>",
$text);
1652 $text = str_replace(
"</SimpleBulletList><br />",
"</SimpleBulletList>",
$text);
1653 $text = str_replace(
"</SimpleNumberedList><br />",
"</SimpleNumberedList>",
$text);
1654 $text = str_replace(
"</SimpleListItem><br />",
"</SimpleListItem>",
$text);
1668 $a_page->beforePageContentUpdate($this);
1670 $ret = $a_page->update();
1682 if (is_array($a_glos) && count($a_glos) > 0)
1684 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1691 $found_terms = array();
1692 foreach ($a_glos as $glo)
1697 foreach ($terms as
$t)
1699 if (is_int(stripos(
$text, $t[
"term"])))
1701 $found_terms[$t[
"id"]] =
$t;
1708 if (count($found_terms) > 0)
1710 self::linkTermsInDom($this->dom, $found_terms, $this->par_node);
1725 foreach ($a_terms as $k =>
$t)
1727 $a_terms[$k][
"termlength"] = strlen(
$t[
"term"]);
1734 $a_dom = $a_dom->myDOMDocument;
1738 $a_par_node = $a_par_node->myDOMNode;
1741 $xpath =
new DOMXPath($a_dom);
1743 if ($a_par_node == null)
1745 $parnodes = $xpath->query(
"//Paragraph[@Characteristic != 'Code']");
1749 $parnodes = $xpath->query(
".//Paragraph[@Characteristic != 'Code']", $a_par_node->parentNode);
1752 include_once(
"./Services/Utilities/classes/class.ilStr.php");
1754 foreach ($parnodes as $parnode)
1756 $textnodes = $xpath->query(
'.//text()', $parnode);
1757 foreach ($textnodes as
$node)
1759 $p = $node->getNodePath();
1762 if (!is_int(strpos($p,
"/IntLink")) &&
1763 !is_int(strpos($p,
"/ExtLink")))
1765 $node_val = $node->nodeValue;
1768 foreach ($a_terms as
$t)
1773 while (is_int($pos))
1777 $valid_limiters = array(
"",
" ",
" ",
".",
",",
":",
";",
"!",
"?",
"\"",
"'",
"(",
")");
1782 if ((in_array($b, $valid_limiters) || htmlentities($b, null,
'utf-8') ==
" ")&& in_array($a, $valid_limiters))
1784 $mid =
'[iln term="'.$t[
"id"].
'"]'.
1805 $node->nodeValue = $node_val;
1814 $text = $a_dom->saveXML($parnode);
1822 $temp_dom =
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.
$text.
'</Paragraph>',
1824 $temp_dom = $temp_dom->myDOMDocument;
1829 $children = $parnode->childNodes;
1830 while ($parnode->hasChildNodes())
1832 $parnode->removeChild($parnode->firstChild);
1836 $xpath_temp =
new DOMXPath($temp_dom);
1837 $temp_pars = $xpath_temp->query(
"//Paragraph");
1839 foreach ($temp_pars as $new_par_node)
1841 $new_childs = $new_par_node->childNodes;
1843 foreach($new_childs as $new_child)
1846 $cloned_child = $a_dom->importNode($new_child,
true);
1847 $parnode->appendChild($cloned_child);
1864 $a_page->buildDom();
1865 $a_dom = $a_page->getDom();
1867 self::linkTermsInDom($a_dom, $a_terms);
1883 self::saveMetaKeywords($a_page, $a_domdoc);
1884 self::saveAnchors($a_page, $a_domdoc);
1895 self::_deleteAnchors($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage());
1917 self::_deleteAnchors($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage());
1920 $xpath =
new DOMXPath($a_domdoc);
1921 $nodes = $xpath->query(
'//Anchor');
1923 foreach ($nodes as
$node)
1925 $name = $node->getAttribute(
"Name");
1926 if (trim($name) !=
"" && !in_array($name, $saved))
1928 self::_saveAnchor($a_page->getParentType(), $a_page->getId(), $a_page->getLanguage(), $name);
1942 $ilDB->manipulate(
"DELETE FROM page_anchor WHERE ".
1943 " page_parent_type = ".$ilDB->quote($a_parent_type,
"text").
1944 " AND page_id = ".$ilDB->quote($a_page_id,
"integer").
1945 " AND page_lang = ".$ilDB->quote($a_page_lang,
"text")
1952 static function _saveAnchor($a_parent_type, $a_page_id, $a_page_lang, $a_anchor_name)
1956 $ilDB->manipulate(
"INSERT INTO page_anchor ".
1957 "(page_parent_type, page_id, page_lang, anchor_name) VALUES (".
1958 $ilDB->quote($a_parent_type,
"text").
",".
1959 $ilDB->quote($a_page_id,
"integer").
",".
1960 $ilDB->quote($a_page_lang,
"text").
",".
1961 $ilDB->quote($a_anchor_name,
"text").
1968 static function _readAnchors($a_parent_type, $a_page_id, $a_page_lang =
"-")
1972 $and_lang = ($a_page_lang !=
"")
1973 ?
" AND page_lang = ".$ilDB->quote($a_page_lang,
"text")
1976 $set = $ilDB->query(
"SELECT * FROM page_anchor ".
1977 " WHERE page_parent_type = ".$ilDB->quote($a_parent_type,
"text").
1978 " AND page_id = ".$ilDB->quote($a_page_id,
"integer").
1982 while ($rec = $ilDB->fetchAssoc($set))
1984 $anchors[] = $rec[
"anchor_name"];
1998 if ($a_page->getParentType() ==
"gdf" ||
1999 $a_page->getParentType() ==
"lm")
2002 $keywords = array();
2005 $xpath =
new DOMXPath($a_domdoc);
2006 $nodes = $xpath->query(
'//Keyw');
2007 foreach($nodes as
$node)
2009 $k = trim(strip_tags($node->nodeValue));
2010 if (!in_array($k, $keywords))
2016 $meta_type = ($a_page->getParentType() ==
"gdf")
2019 $meta_rep_id = $a_page->getParentId();
2020 $meta_id = $a_page->getId();
2022 include_once(
"./Services/MetaData/classes/class.ilMD.php");
2023 $md_obj =
new ilMD($meta_rep_id, $meta_id, $meta_type);
2024 $mkeywords = array();
2026 if(is_object($md_section = $md_obj->getGeneral()))
2028 foreach($ids = $md_section->getKeywordIds() as $id)
2030 $md_key = $md_section->getKeyword($id);
2031 $mkeywords[] = strtolower($md_key->getKeyword());
2034 $lang = $md_key->getKeywordLanguageCode();
2039 foreach($ids = $md_section->getLanguageIds() as $id)
2041 $md_lang = $md_section->getLanguage($id);
2044 $lang = $md_lang->getLanguageCode();
2048 foreach ($keywords as $k)
2050 if (!in_array(strtolower($k), $mkeywords))
2052 if (trim($k) !=
"" &&
$lang !=
"")
2054 $md_key = $md_section->addKeyword();
2059 $mkeywords[] = strtolower($k);
2073 if ($a_mode !=
"edit" && $adve_settings->get(
"auto_url_linking"))
2075 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
2092 if ($a_mode !=
"edit" && $adve_settings->get(
"auto_url_linking"))
2094 return array(
"il.ExtLink.autolink('.ilc_Paragraph','ilc_link_ExtLink');");
const DOMXML_LOAD_PARSING
static _lookupLogin($a_user_id)
lookup login
getLastSavedPCId($a_pg_obj, $a_as_ajax_str=false)
Get last inserted pc ids.
createAfter($node)
Create paragraph node (incl.
domxml_open_mem($str, $mode=DOMXML_LOAD_PARSING, &$error=NULL)
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 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.
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)
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.
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.
getLanguage()
get language
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getParagraphSequenceContent($a_pg_obj)
Get paragraph sequenc of current paragraph.
setLanguage($a_lang)
set language
getAutoIndent()
Get AutoIndent (Code Paragraphs)
init()
Init page content component.
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 xml2output($a_text, $a_wysiwyg=false, $a_replace_lists=true)
Converts xml from DB to output in edit textarea.
static input2xmlReplaceLists($a_text)
Converts xml from DB to output in edit textarea.
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.
getText($a_short_mode=false)
Get (xml) content of paragraph.
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null)
Get all terms for given set of glossary ids.
autoLinkGlossaries($a_glos)
Auto link glossaries.
saveMetaKeywords($a_page, $a_domdoc)
save all keywords
static changeName($node, $name, $keep_attributes=true)
Change name of a node.
getCharacteristic()
Get characteristic of paragraph.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
saveAnchors($a_page, $a_domdoc)
Save anchors.
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 strIPos($a_haystack, $a_needle, $a_offset=NULL)
static _getCommonBBButtons()
Get common bb buttons.
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
setNode(&$a_node)
Set Page Content Node.
getOnloadCode($a_mode)
Get onload code.
handleNextBr($a_str)
Remove preceding
static subStr($a_str, $a_start, $a_length=NULL)
getJavascriptFiles($a_mode)
Get Javascript files.
static intLinks2xml($a_text)
internal links to xml
getShowLineNumbers()
get attribute showlinenumbers