4define(
"IL_INSERT_BEFORE", 0);
5define(
"IL_INSERT_AFTER", 1);
6define(
"IL_INSERT_CHILD", 2);
8define (
"IL_CHAPTER_TITLE",
"st_title");
9define (
"IL_PAGE_TITLE",
"pg_title");
10define (
"IL_NO_HEADER",
"none");
79 final public function ilPageObject($a_id = 0, $a_old_nr = 0, $a_lang =
"-")
86 require_once(
"./Services/COPage/syntax_highlight/php/Beautifier/Init.php");
87 require_once(
"./Services/COPage/syntax_highlight/php/Output/Output_css.php");
94 $this->contains_int_link =
false;
95 $this->needs_parsing =
false;
96 $this->update_listeners = array();
97 $this->update_listener_cnt = 0;
98 $this->dom_builded =
false;
99 $this->page_not_found =
false;
100 $this->old_nr = $a_old_nr;
101 $this->encoding =
"UTF-8";
103 array(
"PageContent",
"TableRow",
"TableData",
"ListItem",
"FileItem",
104 "Section",
"Tab",
"ContentPopup");
106 $this->show_page_act_info =
false;
144 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
156 $this->language = $a_val;
176 $this->page_config = $a_val;
186 return $this->page_config;
196 $this->rendermd5 = $a_rendermd5;
206 return $this->rendermd5;
216 $this->renderedcontent = $a_renderedcontent;
226 return $this->renderedcontent;
236 $this->renderedtime = $a_renderedtime;
246 return $this->renderedtime;
256 $this->lastchange = $a_lastchange;
266 return $this->lastchange;
276 $this->last_change_user = $a_val;
286 return $this->last_change_user;
296 $this->show_page_act_info = $a_val;
306 return $this->show_page_act_info;
317 if ($this->old_nr == 0)
319 $query =
"SELECT * FROM page_object".
320 " WHERE page_id = ".$ilDB->quote($this->
id,
"integer").
321 " AND parent_type=".$ilDB->quote($this->
getParentType(),
"text").
322 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text");
324 $this->page_record =
$ilDB->fetchAssoc($pg_set);
325 $this->
setActive($this->page_record[
"active"]);
332 $query =
"SELECT * FROM page_history".
333 " WHERE page_id = ".$ilDB->quote($this->
id,
"integer").
334 " AND parent_type=".$ilDB->quote($this->
getParentType(),
"text").
335 " AND nr = ".$ilDB->quote((
int) $this->old_nr,
"integer").
336 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text");
338 $this->page_record =
$ilDB->fetchAssoc($pg_set);
340 if (!$this->page_record)
342 include_once(
"./Services/COPage/exceptions/class.ilCOPageNotFoundException.php");
347 $this->xml = $this->page_record[
"content"];
348 $this->
setParentId($this->page_record[
"parent_id"]);
349 $this->last_change_user = $this->page_record[
"last_change_user"];
350 $this->create_user = $this->page_record[
"create_user"];
365 static function _exists($a_parent_type, $a_id, $a_lang =
"", $a_no_cache =
false)
368 if (!$a_no_cache && isset(self::$exists[$a_parent_type.
":".$a_id.
":".$a_lang]))
370 return self::$exists[$a_parent_type.
":".$a_id.
":".$a_lang];
376 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
379 $query =
"SELECT page_id FROM page_object WHERE page_id = ".$ilDB->quote($a_id,
"integer").
" ".
380 "AND parent_type = ".$ilDB->quote($a_parent_type,
"text").$and_lang;
384 self::$exists[$a_parent_type.
":".$a_id.
":".$a_lang] =
true;
389 self::$exists[$a_parent_type.
":".$a_id.
":".$a_lang] =
false;
405 include_once(
"./Services/COPage/classes/class.ilPageUtil.php");
412 if ($this->dom_builded && !$a_force)
422 $path =
"//PageObject";
424 if (count(
$res->nodeset) == 1)
426 $this->node =&
$res->nodeset[0];
431 $this->dom_builded =
true;
464 return $this->dom->myDOMDocument;
486 $this->parent_id = $a_id;
497 $this->update_listeners[$cnt][
"object"] =& $a_object;
498 $this->update_listeners[$cnt][
"method"] = $a_method;
499 $this->update_listeners[$cnt][
"parameters"] = $a_parameters;
500 $this->update_listener_cnt++;
507 $object =& $this->update_listeners[$i][
"object"];
508 $method = $this->update_listeners[$i][
"method"];
509 $parameters = $this->update_listeners[$i][
"parameters"];
510 $object->$method($parameters);
521 $this->active = $a_active;
529 function getActive($a_check_scheduled_activation =
false)
531 if ($a_check_scheduled_activation && !$this->active)
533 include_once(
"./Services/Calendar/classes/class.ilDateTime.php");
542 return $this->active;
554 $set =
$ilDB->query(
"SELECT page_id, parent_type, lang, active, activation_start, activation_end, show_activation_info FROM page_object ".
555 " WHERE parent_id = ".
$ilDB->quote($a_parent_id,
"integer")
557 while ($rec =
$ilDB->fetchAssoc($set))
559 self::$activation_data[$rec[
"page_id"].
":".$rec[
"parent_type"].
":".$rec[
"lang"]] = $rec;
567 static function _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation =
false, $a_lang =
"-")
577 if (isset(self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang]))
579 $rec = self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang];
583 $set =
$ilDB->queryF(
"SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s".
584 " AND parent_type = %s AND lang = %s",
585 array(
"integer",
"text",
"text"),
586 array($a_id, $a_parent_type, $a_lang));
587 $rec =
$ilDB->fetchAssoc($set);
593 if (!$rec[
"active"] && $a_check_scheduled_activation)
595 if ($rec[
"n"] >= $rec[
"activation_start"] &&
596 $rec[
"n"] <= $rec[
"activation_end"])
602 return $rec[
"active"];
620 if (isset(self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang]))
622 $rec = self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang];
626 $set =
$ilDB->queryF(
"SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s".
627 " AND parent_type = %s AND lang = %s", array(
"integer",
"text",
"text"),
628 array($a_id, $a_parent_type, $a_lang));
629 $rec =
$ilDB->fetchAssoc($set);
632 if (!$rec[
"active"] && $rec[
"activation_start"] !=
"")
643 function _writeActive($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation =
true, $a_lang =
"-")
653 if ($a_reset_scheduled_activation)
655 $st =
$ilDB->manipulateF(
"UPDATE page_object SET active = %s, activation_start = %s, ".
656 " activation_end = %s WHERE page_id = %s".
657 " AND parent_type = %s AND lang = %s", array(
"boolean",
"timestamp",
"timestamp",
"integer",
"text",
"text"),
658 array($a_active,
null,
null, $a_id, $a_parent_type, $a_lang));
662 $st =
$ilDB->prepareManip(
"UPDATE page_object SET active = %s WHERE page_id = %s".
663 " AND parent_type = %s AND lang = %s", array(
"boolean",
"integer",
"text",
"text"),
664 array($a_active, $a_id, $a_parent_type, $a_lang));
681 if (isset(self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang]))
683 $rec = self::$activation_data[$a_id.
":".$a_parent_type.
":".$a_lang];
687 $set =
$ilDB->queryF(
"SELECT active, activation_start, activation_end, show_activation_info FROM page_object WHERE page_id = %s".
688 " AND parent_type = %s AND lang = %s",
689 array(
"integer",
"text",
"text"),
690 array($a_id, $a_parent_type, $a_lang));
691 $rec =
$ilDB->fetchAssoc($set);
705 $res =
$ilDB->query(
"SELECT parent_id FROM page_object WHERE page_id = ".
$ilDB->quote($a_id,
"integer").
" ".
706 "AND parent_type=".$ilDB->quote($a_type,
"text"));
708 return $rec[
"parent_id"];
718 $st =
$ilDB->manipulateF(
"UPDATE page_object SET parent_id = %s WHERE page_id = %s".
719 " AND parent_type = %s", array(
"integer",
"integer",
"text"),
720 array($a_par_id, $a_pg_id, $a_parent_type));
730 if ($a_activationstart ==
"")
732 $a_activationstart =
null;
734 $this->activationstart = $a_activationstart;
744 return $this->activationstart;
754 if ($a_activationend ==
"")
756 $a_activationend =
null;
758 $this->activationend = $a_activationend;
768 return $this->activationend;
782 if (!is_object($cont_node))
786 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
787 $node_name = $cont_node->node_name();
788 if ($node_name ==
"PageObject")
792 if ($node_name ==
"PageContent")
794 $child_node = $cont_node->first_child();
795 $node_name = $child_node->node_name();
799 if ($node_name ==
"Table")
801 if ($child_node->get_attribute(
"DataTable") ==
"y")
803 require_once(
"./Services/COPage/classes/class.ilPCDataTable.php");
805 $tab->setNode($cont_node);
806 $tab->setHierId($a_hier_id);
810 require_once(
"./Services/COPage/classes/class.ilPCTable.php");
812 $tab->setNode($cont_node);
813 $tab->setHierId($a_hier_id);
815 $tab->setPcId($a_pc_id);
820 if ($node_name ==
"MediaObject")
822 if (
$_GET[
"pgEdMediaMode"] !=
"") {echo
"ilPageObject::error media";
exit;}
825 require_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
827 $mal_node =& $child_node->first_child();
829 $id_arr = explode(
"_", $mal_node->get_attribute(
"OriginId"));
830 $mob_id = $id_arr[count($id_arr) - 1];
840 $mob->readMediaObject($mob_id);
843 $mob->setNode($cont_node);
844 $mob->setHierId($a_hier_id);
845 $mob->setPcId($a_pc_id);
856 if (!is_array($pc_def))
858 include_once(
"./Services/COPage/exceptions/class.ilCOPageUnknownPCTypeException.php");
861 $pc_class =
"ilPC".$pc_def[
"name"];
862 $pc_path =
"./".$pc_def[
"component"].
"/".$pc_def[
"directory"].
"/class.".$pc_class.
".php";
863 require_once($pc_path);
864 $pc =
new $pc_class($this);
865 $pc->setNode($cont_node);
866 $pc->setHierId($a_hier_id);
867 $pc->setPcId($a_pc_id);
880 if($a_hier_id ==
"pg")
889 $path =
"//*[@PCID = '$a_pc_id']";
891 if (count(
$res->nodeset) == 1)
893 $cont_node =&
$res->nodeset[0];
899 $path =
"//*[@HierId = '$a_hier_id']";
901 if (count(
$res->nodeset) == 1)
903 $cont_node =&
$res->nodeset[0];
921 $path =
"//*[@PCID = '$a_pc_id']//".$a_content_tag;
923 if (count(
$res->nodeset) > 0)
930 $path =
"//*[@HierId = '$a_hier_id']//".$a_content_tag;
932 if (count(
$res->nodeset) > 0)
943 $path =
"//*[@HierId = '$a_hier_id']";
945 if (count(
$res->nodeset) == 1)
968 $this->encoding = $a_encoding;
994 $enc_str = (!empty($this->encoding))
995 ?
"encoding=\"".$this->encoding.
"\""
997 return "<?xml version=\"1.0\" $enc_str ?>".
998 "<!DOCTYPE PageObject SYSTEM \"".ILIAS_ABSOLUTE_PATH.
"/xml/".$this->cur_dtd.
"\">".
1013 $xml = $this->getXmlContent();
1020 $xml = $temp_dom->dump_mem(0, $this->encoding);
1021 $xml = eregi_replace(
"<\?xml[^>]*>",
"",
$xml);
1022 $xml = eregi_replace(
"<!DOCTYPE[^>]*>",
"",
$xml);
1040 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
1065 $a_dom = $a_dom->myDOMDocument;
1067 foreach ($defs as $def)
1070 $cl = $def[
"pc_class"];
1071 $cl::handleCopiedContent($a_dom, $a_self_ass, $a_clone_mobs);
1083 $path =
"//InteractiveImage/MediaAlias";
1088 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
1089 for ($i = 0; $i < count (
$res->nodeset); $i++)
1091 $or_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
1096 if (!($inst_id > 0))
1100 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1105 $new_mob = $media_object->duplicate();
1107 $res->nodeset[$i]->set_attribute(
"OriginId",
"il__mob_".$new_mob->getId());
1119 $path =
"//MediaObject/MediaAlias";
1124 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
1125 for ($i = 0; $i < count (
$res->nodeset); $i++)
1127 $or_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
1132 if (!($inst_id > 0))
1136 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1141 $new_mob = $media_object->duplicate();
1143 $res->nodeset[$i]->set_attribute(
"OriginId",
"il__mob_".$new_mob->getId());
1156 $path =
"//Question";
1161 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
1162 for ($i = 0; $i < count (
$res->nodeset); $i++)
1164 $qref =
$res->nodeset[$i]->get_attribute(
"QRef");
1169 if (!($inst_id > 0))
1173 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1176 if (is_object($question) && $question->isComplete())
1182 $question->createPageObject();
1187 $duplicate_id = $question->duplicate(
false);
1188 $res->nodeset[$i]->set_attribute(
"QRef",
"il__qst_".$duplicate_id);
1204 $path =
"//Question";
1207 for ($i = 0; $i < count (
$res->nodeset); $i++)
1209 $parent_node =
$res->nodeset[$i]->parent_node();
1210 $parent_node->unlink_node($parent_node);
1226 $path =
"//PageContent";
1229 return count (
$res->nodeset);
1236 function getXMLFromDom($a_incl_head =
false, $a_append_mobs =
false, $a_append_bib =
false,
1237 $a_append_str =
"", $a_omit_pageobject_tag =
false)
1242 return $this->dom->dump_mem(0, $this->encoding);
1247 if ($a_append_mobs || $a_append_bib || $a_append_link_info)
1261 return "<dummy>".$this->dom->dump_node($this->node).$mobs.$bibs.$trans.$a_append_str.
"</dummy>";
1265 if (is_object($this->dom))
1267 if ($a_omit_pageobject_tag)
1270 $childs =& $this->node->child_nodes();
1271 for($i = 0; $i < count($childs); $i++)
1273 $xml.= $this->dom->dump_node($childs[$i]);
1279 $xml = $this->dom->dump_mem(0, $this->encoding);
1280 $xml = eregi_replace(
"<\?xml[^>]*>",
"",
$xml);
1281 $xml = eregi_replace(
"<!DOCTYPE[^>]*>",
"",
$xml);
1306 "ed_paste_clip",
"ed_edit",
"ed_edit_prop",
"ed_delete",
"ed_moveafter",
1307 "ed_movebefore",
"ed_go",
"ed_class",
"ed_width",
"ed_align_left",
1308 "ed_align_right",
"ed_align_center",
"ed_align_left_float",
1309 "ed_align_right_float",
"ed_delete_item",
"ed_new_item_before",
1310 "ed_new_item_after",
"ed_copy_clip",
"please_select",
"ed_split_page",
1311 "ed_item_up",
"ed_item_down",
"ed_split_page_next",
"ed_enable",
1312 "de_activate",
"ed_paste",
"ed_edit_multiple",
"ed_cut",
"ed_copy",
"ed_insert_templ",
1313 "ed_click_to_add_pg",
"download");
1316 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
1318 foreach ($defs as $def)
1320 $lang_vars[] =
"pc_".$def[
"pc_type"];
1321 $lang_vars[] =
"ed_insert_".$def[
"pc_type"];
1324 $cl = $def[
"pc_class"];
1325 $lvs = call_user_func($def[
"pc_class"].
'::getLangVars');
1326 foreach ($lvs as $lv)
1332 foreach ($lang_vars as $lang_var)
1346 $xml.=
"<LV name=\"$var\" value=\"".$lng->txt(
"cont_".$var).
"\"/>";
1355 require_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
1357 $path =
"//Paragraph[1]";
1359 if (count(
$res->nodeset) > 0)
1361 $cont_node =&
$res->nodeset[0]->parent_node();
1363 $par->setNode($cont_node);
1364 return $par->getText();
1379 if (is_object(
$node))
1381 $node->set_content($a_content);
1399 $this->contains_int_link = $a_contains_link;
1419 $this->import_mode = $a_val;
1435 if ($a_parse ===
true)
1437 $this->needs_parsing =
true;
1439 if ($a_parse ===
false)
1441 $this->needs_parsing =
false;
1454 $this->contains_question = $a_val;
1464 return $this->contains_question;
1478 $path =
"//MediaObject/MediaAlias";
1481 for($i = 0; $i < count(
$res->nodeset); $i++)
1483 $id_arr = explode(
"_",
$res->nodeset[$i]->get_attribute(
"OriginId"));
1484 $mob_id = $id_arr[count($id_arr) - 1];
1485 $mob_ids[$mob_id] = $mob_id;
1490 $path =
"//InteractiveImage/MediaAlias";
1492 for($i = 0; $i < count(
$res->nodeset); $i++)
1494 $id_arr = explode(
"_",
$res->nodeset[$i]->get_attribute(
"OriginId"));
1495 $mob_id = $id_arr[count($id_arr) - 1];
1496 $mob_ids[$mob_id] = $mob_id;
1501 $path =
"//IntLink[@Type = 'MediaObject']";
1504 for($i = 0; $i < count(
$res->nodeset); $i++)
1506 if ((
$res->nodeset[$i]->get_attribute(
"TargetFrame") ==
"") ||
1509 $target =
$res->nodeset[$i]->get_attribute(
"Target");
1510 $id_arr = explode(
"_", $target);
1511 if (($id_arr[1] == IL_INST_ID) ||
1512 (substr($target, 0, 4) ==
"il__"))
1514 $mob_id = $id_arr[count($id_arr) - 1];
1517 $mob_ids[$mob_id] = $mob_id;
1535 $path =
"//IntLink";
1540 for($i = 0; $i < count(
$res->nodeset); $i++)
1543 if ($a_cnt_multiple)
1545 $add =
":".$cnt_multiple;
1547 $target =
$res->nodeset[$i]->get_attribute(
"Target");
1548 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1549 $targetframe =
$res->nodeset[$i]->get_attribute(
"TargetFrame");
1550 $anchor =
$res->nodeset[$i]->get_attribute(
"Anchor");
1551 $links[$target.
":".$type.
":".$targetframe.
":".$anchor.$add] =
1552 array(
"Target" => $target,
"Type" => $type,
1553 "TargetFrame" => $targetframe,
"Anchor" => $anchor);
1556 if ($type ==
"MediaObject" && $targetframe ==
"")
1558 if (substr($target, 0, 4) ==
"il__")
1560 $id_arr = explode(
"_", $target);
1561 $id = $id_arr[count($id_arr) - 1];
1564 foreach($med_links as $key => $med_link)
1566 $links[$key] = $med_link;
1578 $path =
"//MediaAlias";
1581 require_once(
"Services/MediaObjects/classes/class.ilMediaItem.php");
1582 for($i = 0; $i < count(
$res->nodeset); $i++)
1584 $oid =
$res->nodeset[$i]->get_attribute(
"OriginId");
1585 if (substr($oid, 0, 4) ==
"il__")
1587 $id_arr = explode(
"_", $oid);
1588 $id = $id_arr[count($id_arr) - 1];
1591 foreach($med_links as $key => $med_link)
1593 $links[$key] = $med_link;
1613 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1614 foreach($mob_ids as $mob_id => $dummy)
1633 $path =
"//MediaObject/MediaAlias[@OriginId='il__mob_$a_mob_id']";
1635 $mal_node =&
$res->nodeset[$a_nr - 1];
1636 $mob_node =& $mal_node->parent_node();
1638 return $this->dom->dump_node($mob_node);
1651 libxml_disable_entity_loader(
false);
1653 @$this->dom->validate($error);
1676 $this->hier_ids = array();
1677 $this->first_row_ids = array();
1678 $this->first_col_ids = array();
1679 $this->list_item_ids = array();
1680 $this->file_item_ids = array();
1687 foreach ($this->id_elements as $el)
1689 $path.= $sep.
"//".$el;
1694 for($i = 0; $i < count(
$res->nodeset); $i++)
1696 $cnode =
$res->nodeset[$i];
1697 $ctag = $cnode->node_name();
1701 while($cnode =& $cnode->previous_sibling())
1703 if (($cnode->node_type() == XML_ELEMENT_NODE)
1704 && $cnode->has_attribute(
"HierId"))
1706 $sib_hier_id = $cnode->get_attribute(
"HierId");
1712 if ($sib_hier_id !=
"")
1714 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
1716 $res->nodeset[$i]->set_attribute(
"HierId", $node_hier_id);
1717 $this->hier_ids[] = $node_hier_id;
1718 if ($ctag ==
"TableData")
1720 if (substr($par_hier_id,strlen($par_hier_id)-2) ==
"_1")
1722 $this->first_row_ids[] = $node_hier_id;
1725 if ($ctag ==
"ListItem")
1727 $this->list_item_ids[] = $node_hier_id;
1729 if ($ctag ==
"FileItem")
1731 $this->file_item_ids[] = $node_hier_id;
1737 $cnode =
$res->nodeset[$i];
1739 while($cnode =& $cnode->parent_node())
1741 if (($cnode->node_type() == XML_ELEMENT_NODE)
1742 && $cnode->has_attribute(
"HierId"))
1744 $par_hier_id = $cnode->get_attribute(
"HierId");
1750 if (($par_hier_id !=
"") && ($par_hier_id !=
"pg"))
1752 $node_hier_id = $par_hier_id.
"_1";
1753 $res->nodeset[$i]->set_attribute(
"HierId", $node_hier_id);
1754 $this->hier_ids[] = $node_hier_id;
1755 if ($ctag ==
"TableData")
1757 $this->first_col_ids[] = $node_hier_id;
1758 if (substr($par_hier_id,strlen($par_hier_id)-2) ==
"_1")
1760 $this->first_row_ids[] = $node_hier_id;
1763 if ($ctag ==
"ListItem")
1765 $this->list_item_ids[] = $node_hier_id;
1767 if ($ctag ==
"FileItem")
1769 $this->file_item_ids[] = $node_hier_id;
1775 $node_hier_id =
"1";
1776 $res->nodeset[$i]->set_attribute(
"HierId", $node_hier_id);
1777 $this->hier_ids[] = $node_hier_id;
1784 $path =
"//PageObject";
1786 for($i = 0; $i < count(
$res->nodeset); $i++)
1788 $res->nodeset[$i]->set_attribute(
"HierId",
"pg");
1789 $this->hier_ids[] =
"pg";
1799 return $this->hier_ids;
1808 return $this->first_row_ids;
1817 return $this->first_col_ids;
1826 return $this->list_item_ids;
1835 return $this->file_item_ids;
1843 if(is_object($this->dom))
1846 $path =
"//*[@HierId]";
1848 for($i = 0; $i < count(
$res->nodeset); $i++)
1850 if (
$res->nodeset[$i]->has_attribute(
"HierId"))
1852 $res->nodeset[$i]->remove_attribute(
"HierId");
1864 if (!is_array($a_pc_ids) || count($a_pc_ids) == 0)
1870 if(is_object($this->dom))
1873 $path =
"//*[@PCID]";
1875 for($i = 0; $i < count(
$res->nodeset); $i++)
1877 $pc_id =
$res->nodeset[$i]->get_attribute(
"PCID");
1878 if (in_array($pc_id, $a_pc_ids))
1880 $ret[$pc_id] =
$res->nodeset[$i]->get_attribute(
"HierId");
1896 $path =
"//FileItem";
1898 for($i = 0; $i < count(
$res->nodeset); $i++)
1900 $cnode =&
$res->nodeset[$i];
1901 $size_node =& $this->dom->create_element(
"Size");
1902 $size_node =& $cnode->append_child($size_node);
1904 $childs =& $cnode->child_nodes();
1906 for($j = 0; $j < count($childs); $j++)
1908 if ($childs[$j]->node_name() ==
"Identifier")
1910 if ($childs[$j]->has_attribute(
"Entry"))
1912 $entry = $childs[$j]->get_attribute(
"Entry");
1913 $entry_arr = explode(
"_", $entry);
1914 $id = $entry_arr[count($entry_arr) - 1];
1915 require_once(
"./Modules/File/classes/class.ilObjFile.php");
1920 $size_node->set_content(
$size);
1935 $this->log->debug(
"start");
1939 $path =
"//IntLink";
1941 for($i = 0; $i < count(
$res->nodeset); $i++)
1943 $target =
$res->nodeset[$i]->get_attribute(
"Target");
1944 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1946 if ($a_link_map ==
null)
1949 $this->log->debug(
"no map, type: ".$type.
", target: ".$target.
", new target: ".$new_target);
1954 $nt = explode(
"_", $a_link_map[$target]);
1955 $new_target =
false;
1956 if ($nt[1] == IL_INST_ID)
1958 $new_target =
"il__".$nt[2].
"_".$nt[3];
1960 $this->log->debug(
"map, type: ".$type.
", target: ".$target.
", new target: ".$new_target);
1962 if ($new_target !==
false)
1964 $res->nodeset[$i]->set_attribute(
"Target", $new_target);
1970 IL_INST_ID > 0 && $type !=
"RepositoryItem")
1975 $res->nodeset[$i]->set_attribute(
"Target", $new_target);
1986 $path =
"//MediaAlias";
1990 for($i = 0; $i < count(
$res->nodeset); $i++)
1992 $orig_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
1993 $id_arr = explode(
"_", $orig_id);
1994 $mob_id = $id_arr[count($id_arr) - 1];
2011 $path =
"//MediaAlias";
2014 for($i = 0; $i < count(
$res->nodeset); $i++)
2017 $old_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
2018 $old_id = explode(
"_", $old_id);
2019 $old_id = $old_id[count($old_id) - 1];
2021 if ($a_mapping[$old_id] > 0)
2023 $new_id = $a_mapping[$old_id];
2024 if ($a_reuse_existing_by_import)
2028 $imp = explode(
"_", $import_id);
2036 if ($import_id ==
"")
2040 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2042 if (in_array($old_id, $med_of_def_lang))
2049 $res->nodeset[$i]->set_attribute(
"OriginId",
"il__mob_".$new_id);
2069 $path =
"//InteractiveImage/MediaAlias";
2072 for($i = 0; $i < count(
$res->nodeset); $i++)
2074 $old_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
2075 if ($a_mapping[$old_id] > 0)
2077 $res->nodeset[$i]->set_attribute(
"OriginId",
"il__mob_".$a_mapping[$old_id]);
2097 $path =
"//FileItem/Identifier";
2100 for($i = 0; $i < count(
$res->nodeset); $i++)
2102 $old_id =
$res->nodeset[$i]->get_attribute(
"Entry");
2103 $old_id = explode(
"_", $old_id);
2104 $old_id = $old_id[count($old_id) - 1];
2105 if ($a_mapping[$old_id] > 0)
2107 $res->nodeset[$i]->set_attribute(
"Entry",
"il__file_".$a_mapping[$old_id]);
2125 $path =
"//Question";
2128 for($i = 0; $i < count(
$res->nodeset); $i++)
2130 $qref =
$res->nodeset[$i]->get_attribute(
"QRef");
2132 if (isset($a_mapping[$qref]))
2134 $res->nodeset[$i]->set_attribute(
"QRef",
"il__qst_".$a_mapping[$qref][
"pool"]);
2159 $path =
"//IntLink";
2161 for($i = 0; $i < count(
$res->nodeset); $i++)
2163 $target =
$res->nodeset[$i]->get_attribute(
"Target");
2164 $type =
$res->nodeset[$i]->get_attribute(
"Type");
2166 if ($a_from_to[$obj_id] > 0 && is_int(strpos($target,
"__")))
2170 $res->nodeset[$i]->set_attribute(
"Target",
"il__pg_".$a_from_to[$obj_id]);
2175 $res->nodeset[$i]->set_attribute(
"Target",
"il__st_".$a_from_to[$obj_id]);
2185 $path =
"//MediaAlias";
2188 require_once(
"Services/MediaObjects/classes/class.ilMediaItem.php");
2189 require_once(
"Services/COPage/classes/class.ilMediaAliasItem.php");
2191 for($i = 0; $i < count(
$res->nodeset); $i++)
2193 $media_object_node =
$res->nodeset[$i]->parent_node();
2194 $page_content_node = $media_object_node->parent_node();
2195 $c_hier_id = $page_content_node->get_attribute(
"HierId");
2199 $c_hier_id,
"Standard");
2200 $areas = $std_alias_item->getMapAreas();
2201 $correction_needed =
false;
2202 if (count($areas) > 0)
2205 foreach($areas as $area)
2207 if ($area[
"Type"] ==
"PageObject" ||
2208 $area[
"Type"] ==
"StructureObject")
2210 $t = $area[
"Target"];
2211 $tid = _extractObjIdOfTarget(
$t);
2212 if ($a_from_to[$tid] > 0)
2214 $correction_needed =
true;
2225 $oid =
$res->nodeset[$i]->get_attribute(
"OriginId");
2226 if (substr($oid, 0, 4) ==
"il__")
2228 $id_arr = explode(
"_", $oid);
2229 $id = $id_arr[count($id_arr) - 1];
2232 $med_item = $mob->getMediaItem(
"Standard");
2233 $med_areas = $med_item->getMapAreas();
2235 foreach($med_areas as $area)
2237 $link_type = ($area->getLinkType() ==
"int")
2242 "Nr" => $area->getNr(),
2243 "Shape" => $area->getShape(),
2244 "Coords" => $area->getCoords(),
2246 "LinkType" => $link_type,
2247 "Href" => $area->getHref(),
2248 "Title" => $area->getTitle(),
2249 "Target" => $area->getTarget(),
2250 "Type" => $area->getType(),
2251 "TargetFrame" => $area->getTargetFrame()
2255 if ($area->getType() ==
"PageObject" ||
2256 $area->getType() ==
"StructureObject")
2258 $t = $area->getTarget();
2260 if ($a_from_to[$tid] > 0)
2262 $correction_needed =
true;
2271 if ($correction_needed)
2274 $std_alias_item->deleteAllMapAreas();
2275 foreach($areas as $area)
2277 if ($area[
"Link"][
"LinkType"] ==
"IntLink")
2279 $target = $area[
"Link"][
"Target"];
2280 $type = $area[
"Link"][
"Type"];
2282 if ($a_from_to[$obj_id] > 0)
2286 $area[
"Link"][
"Target"] =
"il__pg_".$a_from_to[$obj_id];
2290 $area[
"Link"][
"Target"] =
"il__st_".$a_from_to[$obj_id];
2295 $std_alias_item->addMapArea($area[
"Shape"], $area[
"Coords"],
2296 $area[
"Link"][
"Title"],
2297 array(
"Type" => $area[
"Link"][
"Type"],
2298 "TargetFrame" => $area[
"Link"][
"TargetFrame"],
2299 "Target" => $area[
"Link"][
"Target"],
2300 "Href" => $area[
"Link"][
"Href"],
2301 "LinkType" => $area[
"Link"][
"LinkType"],
2319 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
2326 foreach($sources as $source)
2329 if ($source[
"type"] ==
"lm:pg")
2332 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
2333 if (self::_exists(
"lm", $source[
"id"], $source[
"lang"]))
2335 $page_obj =
new ilLMPage($source[
"id"], 0, $source[
"lang"]);
2336 if (!$page_obj->page_not_found)
2339 $page_obj->handleImportRepositoryLink($a_rep_import_id,
2340 $a_rep_type, $a_rep_ref_id);
2342 $page_obj->update();
2355 $path =
"//IntLink";
2358 for($i = 0; $i < count(
$res->nodeset); $i++)
2361 $target =
$res->nodeset[$i]->get_attribute(
"Target");
2362 $type =
$res->nodeset[$i]->get_attribute(
"Type");
2363 if ($target == $a_rep_import_id && $type ==
"RepositoryItem")
2366 $res->nodeset[$i]->set_attribute(
"Target",
2367 "il__".$a_rep_type.
"_".$a_rep_ref_id);
2397 $ilDB->insert(
"page_object", array(
2398 "page_id" => array(
"integer", $this->
getId()),
2399 "parent_id" => array(
"integer", $this->
getParentId()),
2401 "content" => array(
"clob", $content),
2403 "create_user" => array(
"integer",
$ilUser->getId()),
2404 "last_change_user" => array(
"integer",
$ilUser->getId()),
2405 "active" => array(
"integer", (
int) $this->
getActive()),
2409 "inactive_elements" => array(
"integer", $iel),
2410 "int_links" => array(
"integer", $inl),
2412 "last_change" => array(
"timestamp",
ilUtil::now())
2433 $this->log->debug(
"ilPageObject, updateFromXML(): start, id: ".$this->
getId());
2441 $this->log->debug(
"ilPageObject, updateFromXML(): content: ".substr($content, 0, 100));
2449 $ilDB->update(
"page_object", array(
2450 "content" => array(
"clob", $content),
2451 "parent_id" => array(
"integer", $this->
getParentId()),
2452 "last_change_user" => array(
"integer",
$ilUser->getId()),
2453 "last_change" => array(
"timestamp",
ilUtil::now()),
2454 "active" => array(
"integer", $this->
getActive()),
2457 "inactive_elements" => array(
"integer", $iel),
2458 "int_links" => array(
"integer", $inl),
2460 "page_id" => array(
"integer", $this->
getId()),
2468 $this->log->debug(
"ilPageObject, updateFromXML(): end");
2479 protected final function __afterUpdate($a_domdoc, $a_xml, $a_creation =
false, $a_empty =
false)
2482 if (!$a_creation || !$a_empty)
2493 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
2495 foreach ($defs as $def)
2498 $cl = $def[
"pc_class"];
2499 call_user_func($def[
"pc_class"].
'::afterPageUpdate', $this, $a_domdoc, $a_xml, $a_creation);
2525 function update($a_validate =
true, $a_no_history =
false)
2529 $this->log->debug(
"ilPageObject, update(): start, id: ".$this->
getId());
2554 include_once(
"./Services/User/classes/class.ilUserUtil.php");
2557 1 =>
"nocontent#".
$lng->txt(
"cont_not_saved_edit_lock_expired").
"<br />".
2558 $lng->txt(
"obj_usr").
": ".
2560 $lng->txt(
"content_until").
": ".
2567 $this->log->debug(
"ilPageObject, update(): errors: ".print_r(
$errors,
true));
2584 $old_set =
$ilDB->query(
"SELECT * FROM page_object WHERE ".
2585 "page_id = ".
$ilDB->quote($this->getId(),
"integer").
" AND ".
2586 "parent_type = ".$ilDB->quote($this->getParentType(),
"text").
" AND ".
2587 "lang = ".$ilDB->quote($this->getLanguage(),
"text"));
2588 $last_nr_set =
$ilDB->query(
"SELECT max(nr) as mnr FROM page_history WHERE ".
2589 "page_id = ".
$ilDB->quote($this->getId(),
"integer").
" AND ".
2590 "parent_type = ".$ilDB->quote($this->getParentType(),
"text").
" AND ".
2591 "lang = ".$ilDB->quote($this->getLanguage(),
"text"));
2592 $last_nr =
$ilDB->fetchAssoc($last_nr_set);
2593 if ($old_rec =
$ilDB->fetchAssoc($old_set))
2597 if (($content != $old_rec[
"content"] ||
$ilUser->getId() != $old_rec[
"last_change_user"]) &&
2598 !$a_no_history && !$this->history_saved &&
$lm_set->get(
"page_history", 1))
2600 if ($old_rec[
"content"] !=
"<PageObject></PageObject>")
2602 $ilDB->manipulateF(
"DELETE FROM page_history WHERE ".
2603 "page_id = %s AND parent_type = %s AND hdate = %s AND lang = %s",
2604 array(
"integer",
"text",
"timestamp",
"text"),
2605 array($old_rec[
"page_id"], $old_rec[
"parent_type"], $old_rec[
"last_change"], $old_rec[
"lang"]));
2609 $last_c = $old_rec[
"last_change"];
2615 $ilDB->insert(
"page_history", array(
2616 "page_id" => array(
"integer", $old_rec[
"page_id"]),
2617 "parent_type" => array(
"text", $old_rec[
"parent_type"]),
2618 "lang" => array(
"text", $old_rec[
"lang"]),
2619 "hdate" => array(
"timestamp", $last_c),
2620 "parent_id" => array(
"integer", $old_rec[
"parent_id"]),
2621 "content" => array(
"clob", $old_rec[
"content"]),
2622 "user_id" => array(
"integer", $old_rec[
"last_change_user"]),
2624 "nr" => array(
"integer", (
int) $last_nr[
"mnr"] + 1)
2627 $old_content = $old_rec[
"content"];
2628 $old_domdoc =
new DOMDocument();
2629 $old_nr = $last_nr[
"mnr"] + 1;
2630 $old_domdoc->loadXML(
'<?xml version="1.0" encoding="UTF-8"?>'.$old_content);
2635 $this->history_saved =
true;
2639 $this->history_saved =
true;
2644 $em = (trim($content) ==
"<PageObject/>")
2652 $ilDB->update(
"page_object", array(
2653 "content" => array(
"clob", $content),
2654 "parent_id" => array(
"integer", $this->
getParentId()),
2655 "last_change_user" => array(
"integer",
$ilUser->getId()),
2656 "last_change" => array(
"timestamp",
ilUtil::now()),
2657 "is_empty" => array(
"integer", $em),
2658 "active" => array(
"integer", $this->
getActive()),
2662 "inactive_elements" => array(
"integer", $iel),
2663 "int_links" => array(
"integer", $inl),
2665 "page_id" => array(
"integer", $this->
getId()),
2673 $this->log->debug(
"ilPageObject, update(): updated and returning true, content: ".substr($this->
getXMLContent(), 0, 100));
2694 $copg_logger->debug(
"ilPageObject: Delete called for ID '".$this->
getId().
"',".
2696 " hist nr: '".$this->old_nr.
"', ".
2697 " lang: '".$this->getLanguage().
"', "
2703 if (!$this->page_not_found)
2708 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2710 foreach ($mobs2 as $m)
2712 if (!in_array($m,
$mobs))
2718 $copg_logger->debug(
"ilPageObject: ... found ".count(
$mobs).
" media objects.");
2732 include_once(
"./Services/News/classes/class.ilNewsItem.php");
2737 $ilDB->manipulate(
"DELETE FROM page_object ".
2738 "WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
2739 " AND parent_type= ".$ilDB->quote($this->getParentType(),
"text"));
2743 foreach (
$mobs as $mob_id)
2745 $copg_logger->debug(
"ilPageObject: ... processing mob ".$mob_id.
".");
2749 $copg_logger->debug(
"ilPageObject: ... type mismatch. Ignoring mob ".$mob_id.
".");
2755 $copg_logger->debug(
"ilPageObject: ... delete mob ".$mob_id.
".");
2762 $copg_logger->debug(
"ilPageObject: ... missing mob ".$mob_id.
".");
2789 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
2791 foreach ($defs as $def)
2794 $cl = $def[
"pc_class"];
2795 call_user_func($def[
"pc_class"].
'::beforePageDelete', $this);
2810 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
2812 foreach ($defs as $def)
2815 $cl = $def[
"pc_class"];
2816 call_user_func($def[
"pc_class"].
'::afterPageHistoryEntry', $this, $a_old_domdoc, $a_old_content, $a_old_nr);
2830 $xpath =
new DOMXPath($a_domdoc);
2831 $path =
"//Paragraph | //Section | //MediaAlias | //FileItem".
2832 " | //Table | //TableData | //Tabs | //List";
2833 $nodes = $xpath->query(
$path);
2835 foreach($nodes as
$node)
2837 switch (
$node->localName)
2840 $sname =
$node->getAttribute(
"Characteristic");
2841 $stype =
"text_block";
2846 $sname =
$node->getAttribute(
"Characteristic");
2852 $sname =
$node->getAttribute(
"Class");
2853 $stype =
"media_cont";
2858 $sname =
$node->getAttribute(
"Class");
2859 $stype =
"flist_li";
2864 $sname =
$node->getAttribute(
"Template");
2867 $sname =
$node->getAttribute(
"Class");
2879 $sname =
$node->getAttribute(
"Class");
2880 $stype =
"table_cell";
2885 $sname =
$node->getAttribute(
"Template");
2888 if (
$node->getAttribute(
"Type") ==
"HorizontalAccordion")
2890 $stype =
"haccordion";
2892 if (
$node->getAttribute(
"Type") ==
"VerticalAccordion")
2894 $stype =
"vaccordion";
2901 $sname =
$node->getAttribute(
"Class");
2902 if (
$node->getAttribute(
"Type") ==
"Ordered")
2913 if ($sname !=
"" && $stype !=
"")
2915 $usages[$sname.
":".$stype.
":".$template] = array(
"sname" => $sname,
2916 "stype" => $stype,
"template" => $template);
2923 foreach ($usages as $u)
2925 $ilDB->manipulate(
"INSERT INTO page_style_usage ".
2926 "(page_id, page_type, page_lang, page_nr, template, stype, sname) VALUES (".
2927 $ilDB->quote($this->getId(),
"integer").
",".
2928 $ilDB->quote($this->getParentType(),
"text").
",".
2929 $ilDB->quote($this->getLanguage(),
"text").
",".
2930 $ilDB->quote($a_old_nr,
"integer").
",".
2931 $ilDB->quote($u[
"template"],
"integer").
",".
2932 $ilDB->quote($u[
"stype"],
"text").
",".
2933 $ilDB->quote($u[
"sname"],
"text").
2948 if ($a_old_nr !==
false)
2950 $and_old_nr =
" AND page_nr = ".$ilDB->quote($a_old_nr,
"integer");
2953 $ilDB->manipulate(
"DELETE FROM page_style_usage WHERE ".
2954 " page_id = ".
$ilDB->quote($this->getId(),
"integer").
2955 " AND page_type = ".$ilDB->quote($this->getParentType(),
"text").
2956 " AND page_lang = ".$ilDB->quote($this->getLanguage(),
"text").
2969 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2970 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2975 $objs = array_merge(
$mobs, $files);
2987 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
3006 $xpath =
new DOMXPath($a_domdoc);
3007 $nodes = $xpath->query(
'//IntLink');
3008 foreach($nodes as
$node)
3010 $link_type =
$node->getAttribute(
"Type");
3014 case "StructureObject":
3022 case "GlossaryItem":
3030 case "RepositoryItem":
3047 $target =
$node->getAttribute(
"Target");
3052 if (is_int(strpos($target,
"__")))
3087 $curr_node->unlink_node($curr_node);
3104 if (!is_array($a_hids))
3108 foreach($a_hids as $a_hid)
3110 $a_hid = explode(
":", $a_hid);
3115 if (!$this->
checkForTag(
"Question", $a_hid[0], $a_hid[1]) || $a_self_ass)
3118 if (is_object($curr_node))
3120 $parent_node = $curr_node->parent_node();
3121 if ($parent_node->node_name() !=
"TableRow")
3123 $curr_node->unlink_node($curr_node);
3154 if (!is_array($a_hids))
3159 $time = date(
"Y-m-d H:i:s", time());
3161 $hier_ids = array();
3163 foreach($a_hids as $a_hid)
3169 $a_hid = explode(
":", $a_hid);
3173 foreach($hier_ids as
$h)
3175 if(
$h.
"_" == substr($a_hid[0], 0, strlen(
$h) + 1))
3177 $skip[] = $a_hid[0];
3179 if($a_hid[0].
"_" == substr(
$h, 0, strlen($a_hid[0]) + 1))
3184 $pc_id[$a_hid[0]] = $a_hid[1];
3185 if ($a_hid[0] !=
"")
3187 $hier_ids[$a_hid[0]] = $a_hid[0];
3190 foreach ($skip as $s)
3192 unset($hier_ids[$s]);
3194 include_once(
"./Services/COPage/classes/class.ilPageContent.php");
3197 foreach($hier_ids as $hid)
3200 if (is_object($curr_node))
3202 if ($curr_node->node_name() ==
"PageContent")
3204 $content = $this->dom->dump_node($curr_node);
3206 $content = eregi_replace(
"PCID=\"[a-z0-9]*\"",
"",$content);
3207 $content = eregi_replace(
"HierId=\"[a-z0-9_]*\"",
"",$content);
3209 $ilUser->addToPCClipboard($content, $time, $nr);
3214 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
3225 $a_hid = explode(
":", $a_hier_id);
3226 $content =
$ilUser->getPCClipboardContent();
3230 for ($i = count($content) - 1; $i >= 0; $i--)
3234 $temp_dom =
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?>'.$c,
3240 $path =
"//PageContent";
3242 if (count(
$res->nodeset) > 0)
3244 $new_pc_node =
$res->nodeset[0];
3245 $cloned_pc_node = $new_pc_node->clone_node (
true);
3246 $cloned_pc_node->unlink_node ($cloned_pc_node);
3265 if (!is_array($a_hids))
3269 $obj = & $this->content_obj;
3271 foreach($a_hids as $a_hid)
3273 $a_hid = explode(
":", $a_hid);
3275 if (is_object($curr_node))
3277 if ($curr_node->node_name() ==
"PageContent")
3280 if ($cont_obj->isEnabled ())
3283 if (!$this->
checkForTag(
"Question", $a_hid[0], $a_hid[1]) || $a_self_ass)
3285 $cont_obj->disable();
3290 $cont_obj->enable();
3315 foreach ($hier_ids as $hier_id)
3318 if (!is_int(strpos($hier_id,
"_")))
3320 if ($hier_id !=
"pg" && $hier_id >= $a_hid)
3323 $curr_node->unlink_node($curr_node);
3345 foreach ($hier_ids as $hier_id)
3348 if (!is_int(strpos($hier_id,
"_")))
3350 if ($hier_id !=
"pg" && $hier_id < $a_hid)
3353 $curr_node->unlink_node($curr_node);
3373 $hier_ids = $a_source_page->getHierIds();
3375 $copy_ids = array();
3378 foreach ($hier_ids as $hier_id)
3381 if (!is_int(strpos($hier_id,
"_")))
3383 if ($hier_id !=
"pg" && $hier_id >= $a_hid)
3385 $copy_ids[] = $hier_id;
3391 $parent_node =& $a_target_page->getContentNode(
"pg");
3392 $target_dom =& $a_target_page->getDom();
3393 $parent_childs =& $parent_node->child_nodes();
3394 $cnt_parent_childs = count($parent_childs);
3396 $first_child =& $parent_childs[0];
3397 foreach($copy_ids as $copy_id)
3399 $source_node =& $a_source_page->getContentNode($copy_id);
3401 $new_node =& $source_node->clone_node(
true);
3402 $new_node->unlink_node($new_node);
3404 $source_node->unlink_node($source_node);
3406 if($cnt_parent_childs == 0)
3408 $new_node =& $parent_node->append_child($new_node);
3413 $new_node =& $first_child->insert_before($new_node, $first_child);
3415 $parent_childs =& $parent_node->child_nodes();
3420 $a_target_page->update();
3421 $a_source_page->update();
3433 $curr_name = $curr_node->node_name();
3436 if (($curr_name ==
"TableData") || ($curr_name ==
"PageObject") ||
3437 ($curr_name ==
"ListItem") || ($curr_name ==
"Section")
3438 || ($curr_name ==
"Tab") || ($curr_name ==
"ContentPopup"))
3443 $hid = $curr_node->get_attribute(
"HierId");
3452 $pos = explode(
"_", $a_pos);
3453 $target_pos = array_pop($pos);
3454 $parent_pos = implode($pos,
"_");
3458 $parent_pos = $a_pos;
3462 if($parent_pos !=
"")
3468 $parent_node =& $this->
getNode();
3472 $parent_childs =& $parent_node->child_nodes();
3473 $cnt_parent_childs = count($parent_childs);
3479 $new_node =& $a_cont_obj->getNode();
3483 if($succ_node =& $curr_node->next_sibling())
3485 $new_node =& $succ_node->insert_before($new_node, $succ_node);
3490 $new_node =& $parent_node->append_child($new_node);
3492 $a_cont_obj->setNode($new_node);
3497 $new_node =& $a_cont_obj->getNode();
3499 $new_node =& $succ_node->insert_before($new_node, $succ_node);
3500 $a_cont_obj->setNode($new_node);
3506 $new_node =& $a_cont_obj->getNode();
3507 if($cnt_parent_childs == 0)
3509 $new_node =& $parent_node->append_child($new_node);
3513 $new_node =& $parent_childs[0]->insert_before($new_node, $parent_childs[0]);
3515 $a_cont_obj->setNode($new_node);
3521 if (!$this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
3522 $sub_nodes = $curr_node->child_nodes() ;
3523 foreach ( $sub_nodes as $sub_node ) {
3524 if ($sub_node->node_name() ==
"PlaceHolder") {
3525 $curr_node->unlink_node();
3538 $curr_name = $curr_node->node_name();
3541 if (($curr_name ==
"TableData") || ($curr_name ==
"PageObject") ||
3542 ($curr_name ==
"ListItem") || ($curr_name ==
"Section")
3543 || ($curr_name ==
"Tab") || ($curr_name ==
"ContentPopup"))
3548 $hid = $curr_node->get_attribute(
"HierId");
3556 $pos = explode(
"_", $a_pos);
3557 $target_pos = array_pop($pos);
3558 $parent_pos = implode($pos,
"_");
3562 $parent_pos = $a_pos;
3566 if($parent_pos !=
"")
3572 $parent_node =& $this->
getNode();
3576 $parent_childs =& $parent_node->child_nodes();
3577 $cnt_parent_childs = count($parent_childs);
3584 if($succ_node = $curr_node->next_sibling())
3586 $a_cont_node = $succ_node->insert_before($a_cont_node, $succ_node);
3590 $a_cont_node = $parent_node->append_child($a_cont_node);
3598 $a_cont_node = $succ_node->insert_before($a_cont_node, $succ_node);
3605 if($cnt_parent_childs == 0)
3607 $a_cont_node = $parent_node->append_child($a_cont_node);
3611 $a_cont_node = $parent_childs[0]->insert_before($a_cont_node, $parent_childs[0]);
3624 if($a_source == $a_target)
3631 $source_node =& $content->getNode();
3632 $clone_node =& $source_node->clone_node(
true);
3638 $content->setNode($clone_node);
3650 if($a_source == $a_target)
3657 $source_node =& $content->getNode();
3658 $clone_node =& $source_node->clone_node(
true);
3664 $content->setNode($clone_node);
3675 $a_content = eregi_replace(
"\[com\]",
"<Comment>",$a_content);
3676 $a_content = eregi_replace(
"\[\/com\]",
"</Comment>",$a_content);
3677 $a_content = eregi_replace(
"\[emp]",
"<Emph>",$a_content);
3678 $a_content = eregi_replace(
"\[\/emp\]",
"</Emph>",$a_content);
3679 $a_content = eregi_replace(
"\[str]",
"<Strong>",$a_content);
3680 $a_content = eregi_replace(
"\[\/str\]",
"</Strong>",$a_content);
3691 $path =
"//IntLink";
3693 for($i = 0; $i < count(
$res->nodeset); $i++)
3695 $target =
$res->nodeset[$i]->get_attribute(
"Target");
3696 $type =
$res->nodeset[$i]->get_attribute(
"Type");
3698 if (substr($target, 0, 4) ==
"il__")
3700 $id = substr($target, 4, strlen($target) - 4);
3704 if ($a_res_ref_to_obj_id && $type ==
"RepositoryItem")
3706 $id_arr = explode(
"_",
$id);
3725 $new_target =
"il_".$a_inst.
"_".
$id;
3726 $res->nodeset[$i]->set_attribute(
"Target", $new_target);
3735 $path =
"//MediaAlias";
3737 for($i = 0; $i < count(
$res->nodeset); $i++)
3739 $origin_id =
$res->nodeset[$i]->get_attribute(
"OriginId");
3740 if (substr($origin_id, 0, 4) ==
"il__")
3742 $new_id =
"il_".$a_inst.
"_".substr($origin_id, 4, strlen($origin_id) - 4);
3743 $res->nodeset[$i]->set_attribute(
"OriginId", $new_id);
3750 $path =
"//FileItem/Identifier";
3752 for($i = 0; $i < count(
$res->nodeset); $i++)
3754 $origin_id =
$res->nodeset[$i]->get_attribute(
"Entry");
3755 if (substr($origin_id, 0, 4) ==
"il__")
3757 $new_id =
"il_".$a_inst.
"_".substr($origin_id, 4, strlen($origin_id) - 4);
3758 $res->nodeset[$i]->set_attribute(
"Entry", $new_id);
3765 $path =
"//Question";
3767 for($i = 0; $i < count(
$res->nodeset); $i++)
3769 $qref =
$res->nodeset[$i]->get_attribute(
"QRef");
3771 if (substr($qref, 0, 4) ==
"il__")
3773 $new_id =
"il_".$a_inst.
"_".substr($qref, 4, strlen($qref) - 4);
3775 $res->nodeset[$i]->set_attribute(
"QRef", $new_id);
3782 $path =
"//ContentInclude";
3784 for($i = 0; $i < count(
$res->nodeset); $i++)
3786 $ci =
$res->nodeset[$i]->get_attribute(
"InstId");
3789 $res->nodeset[$i]->set_attribute(
"InstId", $a_inst);
3805 foreach ($this->id_elements as $el)
3807 $path.= $sep.
"//".$el.
"[not(@PCID)]";
3809 $path.= $sep.
"//".$el.
"[@PCID='']";
3815 if (count (
$res->nodeset) > 0)
3836 foreach ($this->id_elements as $el)
3838 $path.= $sep.
"//".$el.
"[@PCID]";
3846 for ($i = 0; $i < count (
$res->nodeset); $i++)
3849 $pcids[] =
$node->get_attribute(
"PCID");
3868 foreach ($this->id_elements as $el)
3870 $path.= $sep.
"//".$el.
"[@PCID='".$a_pc_id.
"']";
3877 return (count(
$res->nodeset) > 0);
3888 if ($a_pc_ids ===
false)
3892 $id = ilUtil::randomHash(10, $a_pc_ids);
3909 foreach ($this->id_elements as $el)
3911 $path.= $sep.
"//".$el.
"[not(@PCID)]";
3913 $path.= $sep.
"//".$el.
"[@PCID='']";
3919 for ($i = 0; $i < count (
$res->nodeset); $i++)
3922 $id = ilUtil::randomHash(10, $pcids);
3925 $res->nodeset[$i]->set_attribute(
"PCID",
$id);
3935 $this->addHierIds();
3939 $path =
"//PageContent";
3944 require_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
3945 for ($i = 0; $i < count (
$res->nodeset); $i++)
3947 $hier_id =
$res->nodeset[$i]->get_attribute(
"HierId");
3948 $pc_id =
$res->nodeset[$i]->get_attribute(
"PCID");
3949 $dump = $mydom->dump_node(
$res->nodeset[$i]);
3950 if (($hpos = strpos($dump,
' HierId="'.$hier_id.
'"')) > 0)
3952 $dump = substr($dump, 0, $hpos).
3953 substr($dump, $hpos + strlen(
' HierId="'.$hier_id.
'"'));
3956 $childs =
$res->nodeset[$i]->child_nodes();
3958 if ($childs[0] && $childs[0]->node_name() ==
"Paragraph")
3960 $content = $mydom->dump_node($childs[0]);
3961 $content = substr($content, strpos($content,
">") + 1,
3962 strrpos($content,
"<") - (strpos($content,
">") + 1));
3970 array(
"hier_id" => $hier_id,
"hash" => md5($dump),
"content" => $content);
3986 $path =
"//Question";
3991 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
3992 for ($i = 0; $i < count (
$res->nodeset); $i++)
3994 $qref =
$res->nodeset[$i]->get_attribute(
"QRef");
3999 if (!($inst_id > 0))
4021 $path =
"/descendant::Paragraph[position() = $par_id]";
4025 if (count (
$res->nodeset) != 1)
4026 die (
"Should not happen");
4028 $context_node =
$res->nodeset[0];
4032 $childs = $context_node->child_nodes();
4034 for($j=0; $j<count($childs); $j++)
4036 $content .= $mydom->dump_node($childs[$j]);
4039 $content = str_replace(
"<br />",
"\n", $content);
4040 $content = str_replace(
"<br/>",
"\n", $content);
4042 $plain_content = html_entity_decode($content);
4060 $xsl = file_get_contents(
"./Services/COPage/xsl/page_fo.xsl");
4061 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
4067 $fo = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args,
$params);
4070 $fo = str_replace(
"\n",
"", $fo);
4071 $fo = str_replace(
"<br/>",
"<br>", $fo);
4072 $fo = str_replace(
"<br>",
"\n", $fo);
4077 $fo = substr($fo, strpos($fo,
">") + 1);
4083 $this->offline_handler = $handler;
4110 $query =
"SELECT * FROM page_object WHERE page_id = ".
4111 $ilDB->quote($a_id,
"integer").
" AND ".
4112 " parent_type = ".$ilDB->quote($a_parent_type,
"text").
" AND ".
4113 " lang = ".$ilDB->quote($a_lang,
"text").
" AND ".
4114 " inactive_elements = ".$ilDB->quote(1,
"integer");
4133 if (strpos($a_content,
" Enabled=\"False\""))
4147 $h_query =
"SELECT * FROM page_history ".
4148 " WHERE page_id = ".$ilDB->quote($this->
getId(),
"integer").
4149 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4150 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4151 " ORDER BY hdate DESC";
4153 $hset =
$ilDB->query($h_query);
4154 $hentries = array();
4156 while ($hrec =
$ilDB->fetchAssoc($hset))
4158 $hrec[
"sortkey"] = (int) $hrec[
"nr"];
4159 $hrec[
"user"] = (int) $hrec[
"user_id"];
4160 $hentries[] = $hrec;
4173 $res =
$ilDB->queryF(
"SELECT * FROM page_history ".
4174 " WHERE page_id = %s ".
4175 " AND parent_type = %s ".
4178 array(
"integer",
"text",
"integer",
"text"),
4200 $and_nr = ($a_nr > 0)
4201 ?
" AND nr < ".
$ilDB->quote((
int) $a_nr,
"integer")
4203 $res =
$ilDB->query(
"SELECT MAX(nr) mnr FROM page_history ".
4204 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4205 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4206 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4209 if (
$row[
"mnr"] > 0)
4211 $res =
$ilDB->query(
"SELECT * FROM page_history ".
4212 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4213 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4214 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4215 " AND nr = ".$ilDB->quote((
int)
$row[
"mnr"],
"integer"));
4221 $res =
$ilDB->query(
"SELECT MIN(nr) mnr FROM page_history ".
4222 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4223 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4224 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4225 " AND nr > ".$ilDB->quote((
int) $a_nr,
"integer"));
4227 if (
$row[
"mnr"] > 0)
4229 $res =
$ilDB->query(
"SELECT * FROM page_history ".
4230 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4231 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4232 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4233 " AND nr = ".$ilDB->quote((
int)
$row[
"mnr"],
"integer"));
4241 $res =
$ilDB->query(
"SELECT * FROM page_history ".
4242 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4243 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4244 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text").
4245 " AND nr = ".$ilDB->quote((
int) $a_nr,
"integer"));
4250 $res =
$ilDB->query(
"SELECT page_id, last_change hdate, parent_type, parent_id, last_change_user user_id, content, lang FROM page_object ".
4251 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4252 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text").
4253 " AND lang = ".$ilDB->quote($this->
getLanguage(),
"text"));
4266 $rnode =
$res->nodeset[0];
4269 foreach($a_hashes as $pc_id =>
$h)
4272 if (
$h[
"change"] !=
"")
4274 $dc_node = $this->dom->create_element(
"DivClass");
4275 $dc_node->set_attribute(
"HierId",
$h[
"hier_id"]);
4276 $dc_node->set_attribute(
"Class",
"ilEdit".
$h[
"change"]);
4277 $dc_node = $rnode->append_child($dc_node);
4292 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
4296 $l_hashes = $l_page->getPageContentsHashes();
4297 $r_hashes = $r_page->getPageContentsHashes();
4299 foreach ($l_hashes as $pc_id =>
$h)
4301 if (!isset($r_hashes[$pc_id]))
4303 $l_hashes[$pc_id][
"change"] =
"Deleted";
4307 if ($l_hashes[$pc_id][
"hash"] != $r_hashes[$pc_id][
"hash"])
4309 $l_hashes[$pc_id][
"change"] =
"Modified";
4310 $r_hashes[$pc_id][
"change"] =
"Modified";
4312 include_once(
"./Services/COPage/mediawikidiff/class.WordLevelDiff.php");
4314 if ($l_hashes[$pc_id][
"content"] !=
"" &&
4315 $r_hashes[$pc_id][
"content"] !=
"")
4317 $new_left = str_replace(
"\n",
"<br />", $l_hashes[$pc_id][
"content"]);
4318 $new_right = str_replace(
"\n",
"<br />", $r_hashes[$pc_id][
"content"]);
4321 $new_left = $wldiff->orig();
4322 $new_right = $wldiff->closing();
4323 $l_page->setParagraphContent($l_hashes[$pc_id][
"hier_id"], $new_left[0]);
4324 $r_page->setParagraphContent($l_hashes[$pc_id][
"hier_id"], $new_right[0]);
4331 foreach ($r_hashes as $pc_id =>
$h)
4333 if (!isset($l_hashes[$pc_id]))
4335 $r_hashes[$pc_id][
"change"] =
"New";
4338 $l_page->addChangeDivClasses($l_hashes);
4339 $r_page->addChangeDivClasses($r_hashes);
4341 return array(
"l_page" => $l_page,
"r_page" => $r_page,
4342 "l_changes" => $l_hashes,
"r_changes" => $r_hashes);
4352 $ilDB->manipulate(
"UPDATE page_object ".
4353 " SET view_cnt = view_cnt + 1 ".
4354 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4355 " AND parent_type = ".$ilDB->quote($this->getParentType(),
"text").
4356 " AND lang = ".$ilDB->quote($this->getLanguage(),
"text"));
4373 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4376 $page_changes = array();
4377 $limit_ts = date(
'Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
4378 $q =
"SELECT * FROM page_object ".
4379 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
4380 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").
4381 " AND last_change >= ".$ilDB->quote($limit_ts,
"timestamp").$and_lang;
4383 $set =
$ilDB->query($q);
4384 while($page =
$ilDB->fetchAssoc($set))
4386 $page_changes[] = array(
4387 "date" => $page[
"last_change"],
4388 "id" => $page[
"page_id"],
4389 "lang" => $page[
"lang"],
4391 "user" => $page[
"last_change_user"]);
4397 $limit_ts = date(
'Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
4398 $and_str =
" AND hdate >= ".$ilDB->quote($limit_ts,
"timestamp").
" ";
4401 $q =
"SELECT * FROM page_history ".
4402 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
4403 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").
4405 $set =
$ilDB->query($q);
4406 while ($page =
$ilDB->fetchAssoc($set))
4408 $page_changes[] = array(
4409 "date" => $page[
"hdate"],
4410 "id" => $page[
"page_id"],
4411 "lang" => $page[
"lang"],
4413 "nr" => $page[
"nr"],
4414 "user" => $page[
"user_id"]);
4419 return $page_changes;
4429 static function getAllPages($a_parent_type, $a_parent_id, $a_lang =
"-")
4436 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4439 $page_changes = array();
4441 $q =
"SELECT * FROM page_object ".
4442 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
4443 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").$and_lang;
4444 $set =
$ilDB->query($q);
4446 while ($page =
$ilDB->fetchAssoc($set))
4448 $key_add = ($a_lang ==
"")
4451 $pages[$page[
"page_id"].$key_add] = array(
4452 "date" => $page[
"last_change"],
4453 "id" => $page[
"page_id"],
4454 "lang" => $page[
"lang"],
4455 "user" => $page[
"last_change_user"]);
4467 static function getNewPages($a_parent_type, $a_parent_id, $a_lang =
"-")
4474 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4479 $q =
"SELECT * FROM page_object ".
4480 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
4481 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").$and_lang.
4482 " ORDER BY created DESC";
4483 $set =
$ilDB->query($q);
4484 while($page =
$ilDB->fetchAssoc($set))
4486 if ($page[
"created"] !=
"")
4489 "created" => $page[
"created"],
4490 "id" => $page[
"page_id"],
4491 "lang" => $page[
"lang"],
4492 "user" => $page[
"create_user"],
4513 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4516 $contributors = array();
4517 $set =
$ilDB->queryF(
"SELECT last_change_user, lang, page_id FROM page_object ".
4518 " WHERE parent_id = %s AND parent_type = %s ".
4519 " AND last_change_user != %s".$and_lang,
4520 array(
"integer",
"text",
"integer"),
4521 array($a_parent_id, $a_parent_type, 0));
4523 while ($page =
$ilDB->fetchAssoc($set))
4527 $contributors[$page[
"last_change_user"]][$page[
"page_id"]][$page[
"lang"]] = 1;
4531 $contributors[$page[
"last_change_user"]][$page[
"page_id"]] = 1;
4535 $set =
$ilDB->queryF(
"SELECT count(DISTINCT page_id, parent_type, hdate, lang) as cnt, lang, page_id, user_id FROM page_history ".
4536 " WHERE parent_id = %s AND parent_type = %s AND user_id != %s ".$and_lang.
4537 " GROUP BY page_id, user_id, lang ",
4538 array(
"integer",
"text",
"integer"),
4539 array($a_parent_id, $a_parent_type, 0));
4540 while ($hpage =
$ilDB->fetchAssoc($set))
4544 $contributors[$hpage[
"user_id"]][$hpage[
"page_id"]][$hpage[
"lang"]] =
4545 $contributors[$hpage[
"user_id"]][$hpage[
"page_id"]][$hpage[
"lang"]] + $hpage[
"cnt"];
4549 $contributors[$hpage[
"user_id"]][$hpage[
"page_id"]] =
4550 $contributors[$hpage[
"user_id"]][$hpage[
"page_id"]] + $hpage[
"cnt"];
4555 foreach ($contributors as $k => $co)
4560 $c[] = array(
"user_id" => $k,
"pages" => $co,
4561 "lastname" => $name[
"lastname"],
"firstname" => $name[
"firstname"]);
4581 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4584 $contributors = array();
4585 $set =
$ilDB->queryF(
"SELECT last_change_user, lang FROM page_object ".
4586 " WHERE page_id = %s AND parent_type = %s ".
4587 " AND last_change_user != %s".$and_lang,
4588 array(
"integer",
"text",
"integer"),
4589 array($a_page_id, $a_parent_type, 0));
4591 while ($page =
$ilDB->fetchAssoc($set))
4595 $contributors[$page[
"last_change_user"]][$page[
"lang"]] = 1;
4599 $contributors[$page[
"last_change_user"]] = 1;
4603 $set =
$ilDB->queryF(
"SELECT count(DISTINCT page_id, parent_type, hdate, lang) as cnt, lang, page_id, user_id FROM page_history ".
4604 " WHERE page_id = %s AND parent_type = %s AND user_id != %s ".$and_lang.
4605 " GROUP BY user_id, page_id, lang ",
4606 array(
"integer",
"text",
"integer"),
4607 array($a_page_id, $a_parent_type, 0));
4608 while ($hpage =
$ilDB->fetchAssoc($set))
4612 $contributors[$hpage[
"user_id"]][$page[
"lang"]] =
4613 $contributors[$hpage[
"user_id"]][$page[
"lang"]] + $hpage[
"cnt"];
4617 $contributors[$hpage[
"user_id"]] =
4618 $contributors[$hpage[
"user_id"]] + $hpage[
"cnt"];
4623 foreach ($contributors as $k => $co)
4625 include_once
"Services/User/classes/class.ilObjUser.php";
4627 $c[] = array(
"user_id" => $k,
"pages" => $co,
4628 "lastname" => $name[
"lastname"],
"firstname" => $name[
"firstname"]);
4641 $ilDB->update(
"page_object", array(
4642 "rendered_content" => array(
"clob", $a_content),
4643 "render_md5" => array(
"text", $a_md5),
4644 "rendered_time" => array(
"timestamp",
ilUtil::now())
4646 "page_id" => array(
"integer", $this->
getId()),
4663 $page_changes = array();
4668 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
4671 $q =
"SELECT * FROM page_object ".
4672 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
4673 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").
4674 " AND int_links = ".$ilDB->quote(1,
"integer").$and_lang;
4675 $set =
$ilDB->query($q);
4677 while ($page =
$ilDB->fetchAssoc($set))
4679 $key_add = ($a_lang ==
"")
4682 $pages[$page[
"page_id"].$key_add] = array(
4683 "date" => $page[
"last_change"],
4684 "id" => $page[
"page_id"],
4685 "lang" => $page[
"lang"],
4686 "user" => $page[
"last_change_user"]);
4700 if (strpos($a_content,
"IntLink"))
4727 $link_type =
"MediaObject";
4728 $a_id =
"il__mob_".$a_id;
4732 $link_type =
"PageObject";
4733 $a_id =
"il__pg_".$a_id;
4737 $link_type =
"GlossaryItem";
4738 $a_id =
"il__git_".$a_id;
4739 $a_target =
"Glossary";
4744 if ($link_type ==
"" || $a_id ==
"")
4747 $path =
"//PageObject/InitOpenedContent";
4749 if (count(
$res->nodeset) > 0)
4751 $res->nodeset[0]->unlink_node(
$res->nodeset[0]);
4757 $path =
"//PageObject/InitOpenedContent";
4759 if (count(
$res->nodeset) > 0)
4761 $init_node =
$res->nodeset[0];
4762 $childs = $init_node->child_nodes();
4763 for($i = 0; $i < count($childs); $i++)
4765 if ($childs[$i]->node_name() ==
"IntLink")
4767 $il_node = $childs[$i];
4773 $path =
"//PageObject";
4775 $page_node =
$res->nodeset[0];
4776 $init_node = $this->dom->create_element(
"InitOpenedContent");
4777 $init_node = $page_node->append_child($init_node);
4778 $il_node = $this->dom->create_element(
"IntLink");
4779 $il_node = $init_node->append_child($il_node);
4781 $il_node->set_attribute(
"Target", $a_id);
4782 $il_node->set_attribute(
"Type", $link_type);
4783 $il_node->set_attribute(
"TargetFrame", $a_target);
4800 $path =
"//PageObject/InitOpenedContent";
4803 if (count(
$res->nodeset) > 0)
4805 $init_node =
$res->nodeset[0];
4806 $childs = $init_node->child_nodes();
4807 for($i = 0; $i < count($childs); $i++)
4809 if ($childs[$i]->node_name() ==
"IntLink")
4811 $il_node = $childs[$i];
4815 if (!is_null($il_node))
4817 $id = $il_node->get_attribute(
"Target");
4818 $link_type = $il_node->get_attribute(
"Type");
4819 $target = $il_node->get_attribute(
"TargetFrame");
4831 case "GlossaryItem":
4835 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
4837 return array(
"id" =>
$id,
"type" => $type,
"target" => $target);
4866 function copy($a_id, $a_parent_type =
"", $a_parent_id = 0, $a_clone_mobs =
false)
4868 if ($a_parent_type ==
"")
4871 if ($a_parent_id == 0)
4877 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
4890 $new_page_object->setParentId($a_parent_id);
4891 $new_page_object->setId($a_id);
4893 $new_page_object->setXMLContent($orig_page->copyXMLContent($a_clone_mobs));
4894 $new_page_object->setActive($orig_page->getActive());
4895 $new_page_object->setActivationStart($orig_page->getActivationStart());
4896 $new_page_object->setActivationEnd($orig_page->getActivationEnd());
4899 $new_page_object->buildDom();
4900 $new_page_object->update();
4904 $new_page_object->create();
4921 $set =
$ilDB->query(
"SELECT lang FROM page_object ".
4922 " WHERE page_id = ".
$ilDB->quote($a_id,
"integer").
4923 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text")
4926 while ($rec =
$ilDB->fetchAssoc($set))
4928 $langs[] = $rec[
"lang"];
4942 0, 0, $a_target_lang);
4943 $transl_page->setId($this->
getId());
4945 $transl_page->setXMLContent($this->copyXMLContent());
4946 $transl_page->setActive($this->
getActive());
4949 $transl_page->create();
4965 $min = (int) $aset->get(
"block_mode_minutes") ;
4970 $ilDB->manipulate(
"UPDATE page_object SET ".
4971 " edit_lock_user = ".
$ilDB->quote(
$ilUser->getId(),
"integer").
",".
4972 " edit_lock_ts = ".$ilDB->quote($ts,
"integer").
4973 " WHERE (edit_lock_user = ".$ilDB->quote(
$ilUser->getId(),
"integer").
" OR ".
4974 " edit_lock_ts < ".$ilDB->quote(time() - ($min * 60),
"integer").
") ".
4975 " AND page_id = ".
$ilDB->quote($this->getId(),
"integer").
4976 " AND parent_type = ".$ilDB->quote($this->getParentType(),
"text")
4979 $set =
$ilDB->query(
"SELECT edit_lock_user FROM page_object ".
4980 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
4981 " AND parent_type = ".$ilDB->quote($this->getParentType(),
"text")
4983 $rec =
$ilDB->fetchAssoc($set);
4984 if ($rec[
"edit_lock_user"] !=
$ilUser->getId())
5002 $min = (int) $aset->get(
"block_mode_minutes") ;
5007 $ilDB->manipulate(
"UPDATE page_object SET ".
5008 " edit_lock_user = ".
$ilDB->quote(
$ilUser->getId(),
"integer").
",".
5009 " edit_lock_ts = 0".
5010 " WHERE edit_lock_user = ".$ilDB->quote(
$ilUser->getId(),
"integer").
5011 " AND page_id = ".$ilDB->quote($this->getId(),
"integer").
5012 " AND parent_type = ".$ilDB->quote($this->getParentType(),
"text")
5015 $set =
$ilDB->query(
"SELECT edit_lock_user FROM page_object ".
5016 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
5017 " AND parent_type = ".$ilDB->quote($this->getParentType(),
"text")
5019 $rec =
$ilDB->fetchAssoc($set);
5020 if ($rec[
"edit_lock_user"] !=
$ilUser->getId())
5039 $min = (int) $aset->get(
"block_mode_minutes");
5041 $set =
$ilDB->query(
"SELECT edit_lock_user, edit_lock_ts FROM page_object ".
5042 " WHERE page_id = ".
$ilDB->quote($this->getId(),
"integer").
5043 " AND parent_type = ".$ilDB->quote($this->
getParentType(),
"text")
5045 $rec =
$ilDB->fetchAssoc($set);
5046 $rec[
"edit_lock_until"] = $rec[
"edit_lock_ts"] + $min * 60;
5063 public static function truncateHTML($a_text, $a_length = 100, $a_ending =
'...', $a_exact =
false, $a_consider_html =
true)
5065 include_once
"Services/Utilities/classes/class.ilStr.php";
5067 if ($a_consider_html)
5070 if(strlen(preg_replace(
'/<.*?>/',
'', $a_text)) <= $a_length)
5076 $total_length = strlen($a_ending);
5077 $open_tags = array();
5079 preg_match_all(
'/(<.+?>)?([^<>]*)/s', $a_text, $lines, PREG_SET_ORDER);
5080 foreach($lines as $line_matchings)
5083 if(!empty($line_matchings[1]))
5086 if(preg_match(
'/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1]))
5091 else if(preg_match(
'/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings))
5094 $pos = array_search($tag_matchings[1], $open_tags);
5097 unset($open_tags[$pos]);
5101 else if (preg_match(
'/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings))
5104 array_unshift($open_tags, strtolower($tag_matchings[1]));
5107 $truncate .= $line_matchings[1];
5111 $content_length = strlen(preg_replace(
'/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i',
' ', $line_matchings[2]));
5112 if($total_length+$content_length > $a_length)
5115 $left = $a_length - $total_length;
5116 $entities_length = 0;
5118 if(preg_match_all(
'/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE))
5121 foreach($entities[0] as $entity)
5123 if($entity[1]+1-$entities_length <= $left)
5126 $entities_length += strlen($entity[0]);
5144 $truncate .= $line_matchings[2];
5145 $total_length += $content_length;
5149 if($total_length >= $a_length)
5157 if(strlen($a_text) <= $a_length)
5169 if(!
sizeof($open_tags))
5175 $spacepos = strrpos($truncate,
' ');
5176 if($spacepos !==
false)
5186 $truncate .= $a_ending;
5188 if($a_consider_html)
5191 foreach($open_tags as $tag)
5193 $truncate .=
'</'.$tag.
'>';
5224 $and_lang =
" AND lang = ".$ilDB->quote($a_lang,
"text");
5228 $q =
"SELECT last_change FROM page_object ".
5229 " WHERE parent_id = ".$ilDB->quote($a_parent_id,
"integer").
5230 " AND parent_type = ".$ilDB->quote($a_parent_type,
"text").$and_lang.
5231 " ORDER BY last_change DESC";
5233 $set =
$ilDB->query($q);
5234 $rec =
$ilDB->fetchAssoc($set);
5236 return $rec[
"last_change"];
5246 $file_obj_ids = array();
5250 $path =
"//FileItem/Identifier";
5252 for($i = 0; $i < count(
$res->nodeset); $i++)
5254 $file_obj_ids[] =
$res->nodeset[$i]->get_attribute(
"Entry");
5257 return $file_obj_ids;
static _instantiateQuestion($question_id)
Page not found exception.
getPCDefinitions()
Get PC definitions.
getPCDefinitionByName($a_pc_name)
Get PC definition by name.
static requirePCClassByName($a_name)
Get instance.
Unknown page content type exception.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
_exists($a_type, $a_target)
Check if internal link refers to a valid target.
_saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst=0, $a_source_lang="-")
save internal link information
_extractObjIdOfTarget($a_target)
Extract object id out of target.
_deleteAllLinksOfSource($a_source_type, $a_source_id, $a_lang="-")
Delete all links of a given source.
_extractInstOfTarget($a_target)
Extract installation id out of target.
_removeInstFromTarget($a_target)
Removes installation id from target string.
_getIdForImportId($a_type, $a_target)
Get current id for an import id.
_getSourcesOfTarget($a_target_type, $a_target_id, $a_target_inst)
get all sources of a link target
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
Extension of ilPageObject for learning modules.
static getLogger($a_component_id)
Get component logger.
static deleteNewsOfContext($a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id=0, $a_context_sub_obj_type="")
Delete all news of a context.
static _lookupFileSize($a_id)
Lookups the file size of the file in bytes.
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static _lookupName($a_user_id)
lookup user name
static _lookupObjId($a_id)
static _lookupImportId($a_obj_id)
_getLastUpdateOfObjects($a_objs)
Get last update for a set of media objects.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static xml2output($a_text, $a_wysiwyg=false, $a_replace_lists=true)
Converts xml from DB to output in edit textarea.
static incEdId($ed_id)
Increases an hierarchical editing id at lowest level (last number)
static sortHierIds($a_array)
Sort an array of Hier IDS in ascending order.
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static getConfigInstance($a_parent_type)
Get page config instance.
releasePageLock()
Release page lock.
stripHierIDs()
strip all hierarchical id attributes out of the dom tree
switchEnableMultiple($a_hids, $a_update=true, $a_self_ass=false)
(De-)activate elements
moveContentBefore($a_source, $a_target, $a_spcid="", $a_tpcid="")
move content object from position $a_source before position $a_target (both hierarchical content ids)
getEditLockInfo()
Get edit lock info.
getRenderedContent()
Get Rendered Content.
removeQuestions(&$temp_dom)
Remove questions from document.
setRenderedContent($a_renderedcontent)
Set Rendered Content.
getOfflineHandler()
Get offline handler.
__beforeDelete()
Before deletion handler (internal).
static truncateHTML($a_text, $a_length=100, $a_ending='...', $a_exact=false, $a_consider_html=true)
Truncate (html) string.
getRenderMd5()
Get Render MD5.
deleteStyleUsages($a_old_nr=0)
Delete style usages.
initPageConfig()
Init page config.
getLastChangeUser()
Get last change user.
_moveContentAfterHierId(&$a_source_page, &$a_target_page, $a_hid)
move content of hierarchical id >= $a_hid to other page
containsIntLinks($a_content)
Check whether content contains internal links.
static getPageContributors($a_parent_type, $a_page_id, $a_lang="-")
Get all contributors for parent object.
registerOfflineHandler($handler)
static getNewPages($a_parent_type, $a_parent_id, $a_lang="-")
Get new pages.
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
Checks whether page exists and is not empty (may return true on some empty pages)
getFirstColumnIds()
get ids of all first table columns
setActivationEnd($a_activationend)
Set Activation End.
getHistoryInfo($a_nr)
Get information about a history entry, its predecessor and its successor.
saveInitialOpenedContent($a_type, $a_id, $a_target)
Save initial opened content.
addFileSizes()
add file sizes
deleteInternalLinks()
Delete internal links.
deleteContent($a_hid, $a_update=true, $a_pcid="")
delete content object with hierarchical id $a_hid
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
getLanguage()
Get language.
getPageConfig()
Get page config object.
setContainsIntLink($a_contains_link)
lm parser set this flag to true, if the page contains intern links (this method should only be called...
pasteContents($a_hier_id, $a_self_ass=false)
Paste contents from pc clipboard.
__afterHistoryEntry($a_old_domdoc, $a_old_content, $a_old_nr)
Before deletion handler (internal).
getEditLock()
Get page lock.
setImportMode($a_val)
Set import mode.
addUpdateListener(&$a_object, $a_method, $a_parameters="")
insertInstIntoIDs($a_inst, $a_res_ref_to_obj_id=true)
inserts installation id into ids (e.g.
afterUpdate()
After update.
setLanguage($a_val)
Set language.
newMobCopies($temp_dom)
Replaces media objects with copies.
getInitialOpenedContent()
Get initial opened content.
create()
create new page (with current xml data)
countPageContents()
Remove questions from document.
saveStyleUsage($a_domdoc, $a_old_nr=0)
Save all style class/template usages.
setActivationStart($a_activationstart)
Set Activation Start.
insertContentNode(&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
insert a content node before/after a sibling or as first child of a parent
deleteContentBeforeHierId($a_hid, $a_update=true)
delete content object with hierarchical id < $a_hid
increaseViewCnt()
Increase view cnt.
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
updateFromXML()
Updates page object with current xml content.
insertContent(&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
insert a content node before/after a sibling or as first child of a parent
setRenderedTime($a_renderedtime)
Set Rendered Time.
getContainsQuestion()
Get contains question.
existsPCId($a_pc_id)
existsPCId
getActivationEnd()
Get Activation End.
deleteContentFromHierId($a_hid, $a_update=true)
delete content object with hierarchical id >= $a_hid
getXMLContent($a_incl_head=false)
get xml content of page
getLastUpdateOfIncludedElements()
Get last update of included elements (media objects and files).
afterConstructor()
After constructor.
static _lookupContainsDeactivatedElements($a_id, $a_parent_type, $a_lang="-")
lookup whether page contains deactivated elements
validateDom()
Validate the page content agains page DTD.
cutContents($a_hids)
Copy contents to clipboard and cut them from the page.
resolveFileItems($a_mapping)
Resolve file items (after import)
setLastChange($a_lastchange)
Set Last Change.
resolveMediaAliases($a_mapping, $a_reuse_existing_by_import=false)
Resolve media aliases (after import)
handleImportRepositoryLink($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
static lookupParentId($a_id, $a_type)
Lookup parent id.
getHierIds()
get all hierarchical ids
resolveIntLinks($a_link_map=null)
Resolves all internal link targets of the page, if targets are available (after import)
appendLangVarXML(&$xml, $var)
containsIntLink()
returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method s...
setShowActivationInfo($a_val)
Set show page activation info.
generatePcId($a_pc_ids=false)
Generate new pc id.
setRenderMd5($a_rendermd5)
Set Render MD5.
newQuestionCopies(&$temp_dom)
Replaces existing question content elements with new copies.
getActivationStart()
Get Activation Start.
getMultimediaXML()
get a xml string that contains all media object elements, that are referenced by any media alias in t...
getParentType()
Get parent type.
static lookupTranslations($a_parent_type, $a_id)
Lookup translations.
getContentObject($a_hier_id, $a_pc_id="")
Get a content object of the page.
saveInternalLinks($a_domdoc)
save internal links of page
static getPagesWithLinks($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object that contain internal links.
_writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
getPageContentsHashes()
Get page contents hashes.
getHistoryEntry($a_old_nr)
Get History Entry.
getContentTemplates()
Get content templates.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
_writeActive($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
write activation status
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
setXMLContent($a_xml, $a_encoding="UTF-8")
set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD,...
setPageConfig($a_val)
Set page config object.
collectMediaObjects($a_inline_only=true)
get all media objects, that are referenced and used within the page
getAllFileObjIds()
Get all file object ids.
moveIntLinks($a_from_to)
Move internal links from one destination to another.
getFirstRowIds()
get ids of all first table rows
getMediaAliasElement($a_mob_id, $a_nr=1)
get complete media object (alias) element
getQuestionIds()
Get question ids.
checkPCIds()
Check, whether (all) page content hashes are set.
getDom()
Deprecated php4DomDocument.
getDomDoc()
Get dom doc (php5 dom document)
copy($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
Copy page.
copyXmlContent($a_clone_mobs=false)
Copy content of page; replace page components with copies where necessary (e.g.
getXMLFromDom($a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
get xml content of page from dom (use this, if any changes are made to the document)
getFO()
get fo page content
ilPageObject($a_id=0, $a_old_nr=0, $a_lang="-")
Constructor @access public.
copyPageToTranslation($a_target_lang)
Copy page to translation.
setActive($a_active)
set activation
addHierIDs()
Add hierarchical ID (e.g.
checkForTag($a_content_tag, $a_hier_id, $a_pc_id="")
Get content node from dom.
insertPCIds()
Insert Page Content IDs.
containsDeactivatedElements($a_content)
Check whether content contains deactivated elements.
compareVersion($a_left, $a_right)
Compares to revisions of the page.
getAllPCIds()
Get all pc ids.
performAutomaticModifications()
Perform automatic modifications (may be overwritten by sub classes)
getFileItemIds()
get ids of all file items
getHistoryEntries()
Get History Entries.
static getParentObjectContributors($a_parent_type, $a_parent_id, $a_lang="-")
Get all contributors for parent object.
getLastChange()
Get Last Change.
getShowActivationInfo()
Get show page activation info.
resolveQuestionReferences($a_mapping)
Resolve all quesion references (after import)
bbCode2XML(&$a_content)
transforms bbCode to corresponding xml
& getContentNode($a_hier_id, $a_pc_id="")
Get content node from dom.
static getRecentChanges($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
Get recent pages changes for parent object.
handleCopiedContent($a_dom, $a_self_ass=true, $a_clone_mobs=false)
Handle copied content.
writeRenderedContent($a_content, $a_md5)
Write rendered content.
getLanguageVariablesXML()
Get language variables as XML.
needsImportParsing($a_parse="")
static preloadActivationDataByParentId($a_parent_id)
Preload activation data by Parent Id.
addChangeDivClasses($a_hashes)
getListItemIds()
get ids of all list items
static getLastChangeByParent($a_parent_type, $a_parent_id, $a_lang="")
Get all pages for parent object.
createFromXML()
Create new page object with current xml content.
newIIMCopies($temp_dom)
Replaces media objects in interactive images with copies of the interactive images.
__afterUpdate($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
After update event handler (internal).
getHierIdsForPCIds($a_pc_ids)
Get hier ids for a set of pc ids.
static _isScheduledActivation($a_id, $a_parent_type, $a_lang="-")
Check whether page is activated by time schedule.
copyContents($a_hids)
Copy contents to clipboard.
beforePageContentUpdate($a_page_content)
Before page content update.
update($a_validate=true, $a_no_history=false)
update complete page content in db (dom xml content is used)
getImportMode()
Get import mode.
appendXMLContent($a_xml)
append xml content to page setXMLContent must be called before and the same encoding must be used
deleteContents($a_hids, $a_update=true, $a_self_ass=false)
Delete multiple content objects.
_lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
getInternalLinks($a_cnt_multiple=false)
get all internal links that are used within the page
setContainsQuestion($a_val)
Set contains question.
moveContentAfter($a_source, $a_target, $a_spcid="", $a_tpcid="")
move content object from position $a_source before position $a_target (both hierarchical content ids)
getRenderedTime()
Get Rendered Time.
send_paragraph($par_id, $filename)
setLastChangeUser($a_val)
Set last change user.
resolveIIMMediaAliases($a_mapping)
Resolve iim media aliases (in ilContObjParse)
getActive($a_check_scheduled_activation=false)
get activation
setParagraphContent($a_hier_id, $a_content)
Set content of paragraph.
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
static shortenText($a_string, $a_start_pos, $a_num_bytes, $a_encoding='UTF-8')
Shorten text to the given number of bytes.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static now()
Return current timestamp in Y-m-d H:i:s format.
const DOMXML_LOAD_VALIDATING
const DOMXML_LOAD_PARSING
const ILIAS_VERSION_NUMERIC
domxml_open_mem($str, $mode=DOMXML_LOAD_PARSING, &$error=NULL)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
redirection script todo: (a better solution should control the processing via a xml file)