4require_once 
"./Services/Object/classes/class.ilObject.php";
 
    5require_once 
"Services/MetaData/classes/class.ilMDLanguageItem.php";
 
   48                parent::__construct($a_id,$a_call_by_reference);
 
   52                $this->mob_ids = array();
 
   53                $this->file_ids = array();
 
   54                $this->q_ids = array();
 
   60        function create($a_no_meta_data = 
false)
 
   87#               echo "Content<br>\n";
 
   90                $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
   91                $this->lm_tree->setTreeTablePK(
"lm_id");
 
   96                $set = 
$ilDB->query(
"SELECT * FROM lm_glossaries ".
 
   97                        " WHERE lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  100                while ($rec = 
$ilDB->fetchAssoc($set))
 
  102                        $glos[] = $rec[
"glo_id"];
 
  116                return parent::getTitle();
 
  124                parent::setTitle($a_title);
 
  135                return parent::getDescription();
 
  143                parent::setDescription($a_description);
 
  155                $this->import_id = $a_id;
 
  165                $this->layout_per_page = $a_val;
 
  175                return $this->layout_per_page;
 
  185                $this->disable_def_feedback = $a_val;
 
  195                return $this->disable_def_feedback;
 
  205                $this->progr_icons = $a_val;
 
  215                return $this->progr_icons;
 
  225                $this->store_tries = $a_val;
 
  235                return $this->store_tries;
 
  245                $this->restrict_forw_nav = $a_val;
 
  255                return $this->restrict_forw_nav;
 
  286                $ilDB->manipulate(
"DELETE FROM lm_glossaries WHERE ".
 
  287                        " lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  291                        $ilDB->manipulate(
"INSERT INTO lm_glossaries ".
 
  292                                "(lm_id, glo_id) VALUES (".
 
  293                                $ilDB->quote($this->getId(), 
"integer").
",".
 
  294                                $ilDB->quote($glo_id, 
"integer").
 
  319                parent::putInTree($a_parent);
 
  334                $this->lm_tree->setTreeTablePK(
"lm_id");
 
  335                $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
  336                $this->lm_tree->addTree($this->
getId(), 1);
 
  346                $this->auto_glossaries = array();
 
  347                if (is_array($a_val))
 
  349                        foreach ($a_val as $v)
 
  353                                        !in_array($v, $this->auto_glossaries))
 
  355                                        $this->auto_glossaries[] = $v;
 
  398                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
  399                include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
 
  400                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
  402                $root_id = $this->lm_tree->getRootId();
 
  406                $chap->setType(
"st");
 
  407                $chap->setTitle(
$lng->txt(
"cont_new_chap"));
 
  408                $chap->setLMId($this->
getId());
 
  414                $page->setType(
"pg");
 
  415                $page->setTitle(
$lng->txt(
"cont_new_page"));
 
  416                $page->setLMId($this->
getId());
 
  428                $this->for_translation = $a_val;
 
  458                if(!is_writable($lm_data_dir))
 
  460                        $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
 
  461                                .
") not writeable.",$this->
ilias->error_obj->FATAL);
 
  465                $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
 
  467                if(!@is_dir($lm_dir))
 
  469                        $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
 
  477                        $this->
ilias->raiseError(
"Creation of Import Directory failed.",$this->
ilias->error_obj->FATAL);
 
  487                        "/lm_".$this->getId();
 
  495                if(strlen($this->import_dir))
 
  501                        "/lm_".$this->getId().
"/import";
 
  520                $this->import_dir = $a_import_dir;
 
  532                if(!is_writable($lm_data_dir))
 
  534                        $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
 
  535                                .
") not writeable.",$this->
ilias->error_obj->FATAL);
 
  538                $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
 
  540                if(!@is_dir($lm_dir))
 
  542                        $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
 
  549                                $export_dir = $lm_dir.
"/export_scorm";
 
  553                                if (substr(
$a_type, 0, 4) == 
"html")
 
  555                                        $export_dir = $lm_dir.
"/export_".
$a_type;
 
  559                                        $export_dir = $lm_dir.
"/export";
 
  565                if(!@is_dir($export_dir))
 
  567                        $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
 
  583                                if (substr(
$a_type, 0, 4) == 
"html")
 
  614                if (!parent::delete())
 
  620                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
  628                $this->lm_tree->removeTree($this->lm_tree->getTreeId());
 
  634                $q = 
"DELETE FROM content_object WHERE id = ".
 
  636                $ilDB->manipulate($q);
 
  639                $q = 
"DELETE FROM lm_menu WHERE lm_id = ".
 
  641                $ilDB->manipulate($q);
 
  644                $ilDB->manipulate(
"DELETE FROM lm_glossaries WHERE ".
 
  645                        " lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  670                $this->layout = $a_layout;
 
  686                $this->style_id = $a_style_id;
 
  696                $q = 
"UPDATE content_object SET ".
 
  697                        " stylesheet = ".$ilDB->quote((
int) $a_style_id, 
"integer").
 
  698                        " WHERE id = ".$ilDB->quote($this->
getId(), 
"integer");
 
  699                $ilDB->manipulate($q);
 
  701                $this->style_id = $a_style_id;
 
  714                $ilDB->manipulate(
"UPDATE content_object SET ".
 
  715                        " header_page = ".
$ilDB->quote($a_page_id, 
"integer").
 
  716                        " WHERE id = ".$ilDB->quote($a_lm_id, 
"integer")
 
  730                $ilDB->manipulate(
"UPDATE content_object SET ".
 
  731                        " footer_page = ".
$ilDB->quote($a_page_id, 
"integer").
 
  732                        " WHERE id = ".$ilDB->quote($a_lm_id, 
"integer")
 
  744                if ($a_from_style < 0)  
 
  746                        $q = 
"SELECT stylesheet FROM content_object, style_data ".
 
  747                                " WHERE content_object.stylesheet = style_data.id ".
 
  748                                " AND style_data.standard = ".$ilDB->quote(0, 
"integer").
 
  749                                " AND content_object.stylesheet > ".$ilDB->quote(0, 
"integer");
 
  750                        $style_set = 
$ilDB->query($q);
 
  751                        while($style_rec = 
$ilDB->fetchAssoc($style_set))
 
  754                                $q = 
"UPDATE content_object SET ".
 
  755                                        " stylesheet = ".$ilDB->quote((
int) $a_to_style, 
"integer").
 
  756                                        " WHERE stylesheet = ".$ilDB->quote($style_rec[
"stylesheet"], 
"integer");
 
  757                                $ilDB->manipulate($q);
 
  760                                $style_obj = 
$ilias->obj_factory->getInstanceByObjId($style_rec[
"stylesheet"]);
 
  761                                $style_obj->delete();
 
  766                        $q = 
"UPDATE content_object SET ".
 
  767                                " stylesheet = ".$ilDB->quote((
int) $a_to_style, 
"integer").
 
  768                                " WHERE stylesheet = ".$ilDB->quote($a_from_style, 
"integer");
 
  769                        $ilDB->manipulate($q);
 
  780        static protected function _lookup($a_obj_id, $a_field)
 
  784                $q = 
"SELECT ".$a_field.
" FROM content_object ".
 
  785                        " WHERE id = ".$ilDB->quote($a_obj_id, 
"integer");
 
  790                return $rec[$a_field];
 
  811                $q = 
"SELECT stylesheet FROM content_object ".
 
  812                        " WHERE id = ".$ilDB->quote($a_cont_obj_id, 
"integer");
 
  816                return $sheet[
"stylesheet"];
 
  826                $q = 
"SELECT id FROM content_object ".
 
  827                        " WHERE stylesheet = ".$ilDB->quote($a_style_id, 
"integer");
 
  832                        $obj_ids[] = $cont[
"id"];
 
  844                $q = 
"SELECT disable_def_feedback FROM content_object ".
 
  845                        " WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
  849                return $rec[
"disable_def_feedback"];
 
  859                $q = 
"SELECT store_tries FROM content_object ".
 
  860                        " WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
  864                return $rec[
"store_tries"];
 
  877                $q = 
"SELECT count(*) as cnt FROM content_object ".
 
  878                        " WHERE stylesheet = ".$ilDB->quote($a_style_id, 
"integer");
 
  879                $cset = 
$ilDB->query($q);
 
  880                $crow = 
$ilDB->fetchAssoc($cset);
 
  882                return (
int) $crow[
"cnt"];
 
  894                $q = 
"SELECT count(*) as cnt FROM content_object, style_data ".
 
  895                        " WHERE stylesheet = style_data.id ".
 
  896                        " AND standard = ".$ilDB->quote(0, 
"integer");
 
  897                $cset = 
$ilDB->query($q);
 
  898                $crow = 
$ilDB->fetchAssoc($cset);
 
  900                return (
int) $crow[
"cnt"];
 
  910                $q = 
"SELECT count(*) as cnt FROM content_object ".
 
  911                        " WHERE stylesheet = ".$ilDB->quote(0, 
"integer");
 
  912                $cset = 
$ilDB->query($q);
 
  913                $crow = 
$ilDB->fetchAssoc($cset);
 
  915                return (
int) $crow[
"cnt"];
 
  927                $q = 
"UPDATE content_object SET ".
 
  928                        " stylesheet = ".$ilDB->quote(0, 
"integer").
 
  929                        " WHERE stylesheet = ".$ilDB->quote((
int) $a_style_id, 
"integer");
 
  931                $ilDB->manipulate($q);
 
  949                $this->pg_header = $a_pg_header;
 
  957                return $this->toc_mode;
 
  965                return $this->public_access_mode;
 
  975                $this->toc_mode = $a_toc_mode;
 
  980                $this->online = $a_online;
 
  990                $this->lm_menu_active = $a_act_lm_menu;
 
  995                return $this->lm_menu_active;
 
 1000                $this->toc_active = $a_toc;
 
 1005                return $this->toc_active;
 
 1010                $this->numbering = $a_num;
 
 1015                return $this->numbering;
 
 1020                $this->print_view_active = $a_print;
 
 1025                return $this->print_view_active;
 
 1030                $this->prevent_glossary_appendix_active = $a_print;
 
 1035                return $this->prevent_glossary_appendix_active;
 
 1045                $this->hide_header_footer_print = $a_val;
 
 1055                return $this->hide_header_footer_print;
 
 1060                $this->downloads_active = $a_down;
 
 1065                return $this->downloads_active;
 
 1070                $this->downloads_public_active = $a_down;
 
 1075                return $this->downloads_public_active;
 
 1080                $this->pub_notes = $a_pub_notes;
 
 1085                return $this->pub_notes;
 
 1090                $this->clean_frames = $a_clean;
 
 1095                return $this->clean_frames;
 
 1100                $this->user_comments = $a_comm;
 
 1105                $this->public_access_mode = $a_mode;
 
 1110                return $this->user_comments;
 
 1115                $this->header_page = $a_pg;
 
 1120                return $this->header_page;
 
 1125                $this->footer_page = $a_pg;
 
 1130                return $this->footer_page;
 
 1140                $q = 
"SELECT * FROM content_object WHERE id = ".
 
 1144                $this->
setLayout($lm_rec[
"default_layout"]);
 
 1174                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1193                $q = 
"UPDATE content_object SET ".
 
 1194                        " default_layout = ".$ilDB->quote($this->
getLayout(), 
"text").
", ".
 
 1195                        " stylesheet = ".$ilDB->quote($this->
getStyleSheetId(), 
"integer").
",".
 
 1196                        " page_header = ".$ilDB->quote($this->
getPageHeader(), 
"text").
",".
 
 1197                        " toc_mode = ".$ilDB->quote($this->
getTOCMode(), 
"text").
",".
 
 1212                        " header_page = ".$ilDB->quote($this->
getHeaderPage(), 
"integer").
",".
 
 1213                        " footer_page = ".$ilDB->quote($this->
getFooterPage(), 
"integer").
",".
 
 1215                        " layout_per_page = ".$ilDB->quote($this->
getLayoutPerPage(), 
"integer").
", ".
 
 1216                        " rating = ".$ilDB->quote($this->
hasRating(), 
"integer").
", ".
 
 1217                        " rating_pages = ".$ilDB->quote($this->
hasRatingPages(), 
"integer").
", ".
 
 1220                        " store_tries = ".$ilDB->quote($this->
getStoreTries(), 
"integer").
", ".
 
 1222                        " for_translation = ".$ilDB->quote((
int) $this->
getForTranslation(), 
"integer").
" ".
 
 1223                        " WHERE id = ".$ilDB->quote($this->
getId(), 
"integer");
 
 1224                $ilDB->manipulate($q);
 
 1226                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1237                $q = 
"INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->
getId(), 
"integer").
")";
 
 1238                $ilDB->manipulate($q);
 
 1241                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1256                $q = 
"SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
 1268                $dir = opendir(
"./Modules/LearningModule/layouts/lm");
 
 1272                while(
$file = readdir($dir))
 
 1277                                if (@is_dir(
"./Modules/LearningModule/layouts/lm/".
$file))
 
 1287                        'toc2win' => 
'toc2win',
 
 1288                        'toc2windyn' => 
'toc2windyn',
 
 1289                        '1window' => 
'1window',
 
 1290                        '2window' => 
'2window',
 
 1291                        '3window' => 
'3window',
 
 1292                        'presentation' => 
'presentation',
 
 1293                        'fullscreen' => 
'fullscreen' 
 1296                foreach ($layouts as 
$l)
 
 1315                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1321                        foreach (
$path as $node)
 
 1323                                if ($node[
"type"] == 
"st")
 
 1342                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1350                        foreach (
$path as $node)
 
 1352                                if ($node[
"type"] == 
"st")
 
 1356                                        foreach ($tconds as $tcond)
 
 1377                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1385                        foreach (
$path as $node)
 
 1387                                if ($node[
"type"] == 
"st")
 
 1391                                        foreach ($tconds as $tcond)
 
 1396                                                        return $node[
"child"];
 
 1411                $tree = 
new ilTree($a_cont_obj_id);
 
 1412                $tree->setTableNames(
'lm_tree',
'lm_data');
 
 1413                $tree->setTreeTablePK(
"lm_id");
 
 1414                if ($tree->isInTree($a_page_id))
 
 1416                        $succ = $tree->fetchSuccessorNode($a_page_id, 
"pg");
 
 1429                $tree->setTableNames(
'lm_tree',
'lm_data');
 
 1430                $tree->setTreeTablePK(
"lm_id");
 
 1432                $tree->checkTreeChilds();
 
 1448                $set = 
$ilDB->query(
"SELECT DISTINCT l1.lm_id".
 
 1450                        " JOIN lm_tree l2 ON ( l1.child = l2.parent".
 
 1451                        " AND l1.lm_id = l2.lm_id )".
 
 1452                        " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
 
 1453                        " WHERE (l2.lft < l1.lft".
 
 1454                        " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
 
 1455                        " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer").
 
 1456                        " ORDER BY lm_data.create_date DESC" 
 1458                if ($rec = 
$ilDB->fetchAssoc($set))
 
 1464                $set = 
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = ".
$ilDB->quote($this->getId(), 
"integer"));
 
 1465                while ($node = 
$ilDB->fetchAssoc($set))
 
 1467                        $q = 
"SELECT * FROM lm_data WHERE obj_id = ".
 
 1468                                $ilDB->quote($node[
"child"], 
"integer");
 
 1469                        $obj_set = 
$ilDB->query($q);
 
 1470                        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
 1473                                $node_data = $tree->getNodeData($node[
"child"]);
 
 1474                                $node_data[
"child"] = $node[
"child"];
 
 1475                                $tree->deleteTree($node_data);
 
 1480                $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
 
 1481                foreach ($nodes as $node)
 
 1483                        $q = 
"SELECT * FROM lm_data WHERE obj_id = ".
 
 1484                                $ilDB->quote($node[
"parent"], 
"integer");
 
 1485                        $obj_set = 
$ilDB->query($q);
 
 1486                        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
 1487                        if ($obj_rec[
"type"] == 
"pg")
 
 1489                                $node_data = $tree->getNodeData($node[
"child"]);
 
 1490                                if ($tree->isInTree($node[
"child"]))
 
 1492                                        $tree->deleteTree($node_data);
 
 1499                $set = 
$ilDB->query(
"SELECT DISTINCT l1.lm_id".
 
 1501                                " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
 
 1502                                " JOIN lm_data ON (l1.child = lm_data.obj_id)".
 
 1503                                " WHERE l1.child <> 1".
 
 1504                                " AND l1.lm_id <> lm_data.lm_id".
 
 1505                                " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer"));
 
 1506                if ($rec = 
$ilDB->fetchAssoc($set))
 
 1508                        $set = 
$ilDB->query(
"SELECT DISTINCT l1.child ".
 
 1510                                " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
 
 1511                                " JOIN lm_data ON (l1.child = lm_data.obj_id)".
 
 1512                                " WHERE l1.child <> 1".
 
 1513                                " AND l1.lm_id <> lm_data.lm_id".
 
 1514                                " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer"));
 
 1515                        include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
 
 1516                        while ($rec = 
$ilDB->fetchAssoc($set))
 
 1520                                if (is_object($cobj))
 
 1522                                        if ($cobj->getType() == 
"pg")
 
 1525                                                $pg_copy = $cobj->copy($this);
 
 1528                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1529                                                        " child = ".
$ilDB->quote($pg_copy->getId(), 
"integer").
 
 1530                                                        " WHERE child = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1531                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1534                                        else if ($cobj->getType() == 
"st")
 
 1537                                                $st_copy = $cobj->copy($this);
 
 1540                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1541                                                        " child = ".
$ilDB->quote($st_copy->getId(), 
"integer").
 
 1542                                                        " WHERE child = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1543                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1547                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1548                                                        " parent = ".
$ilDB->quote($st_copy->getId(), 
"integer").
 
 1549                                                        " WHERE parent = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1550                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1565        function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 
 1573                                $attrs[
"Type"] = 
"LearningModule";
 
 1576                $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
 
 1583                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Structure Objects");
 
 1584                $ilBench->start(
"ContentObjectExport", 
"exportStructureObjects");
 
 1586                $ilBench->stop(
"ContentObjectExport", 
"exportStructureObjects");
 
 1587                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Structure Objects");
 
 1590                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
 
 1591                $ilBench->start(
"ContentObjectExport", 
"exportPageObjects");
 
 1593                $ilBench->stop(
"ContentObjectExport", 
"exportPageObjects");
 
 1594                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
 
 1597                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
 
 1598                $ilBench->start(
"ContentObjectExport", 
"exportMediaObjects");
 
 1600                $ilBench->stop(
"ContentObjectExport", 
"exportMediaObjects");
 
 1601                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
 
 1604                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export File Items");
 
 1605                $ilBench->start(
"ContentObjectExport", 
"exportFileItems");
 
 1607                $ilBench->stop(
"ContentObjectExport", 
"exportFileItems");
 
 1608                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
 
 1611                if (count($this->q_ids) > 0)
 
 1613                        $qti_file = fopen($a_target_dir.
"/qti.xml", 
"w");
 
 1614                        include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
 
 1616                        fwrite($qti_file, $pool->questionsToXML($this->q_ids));
 
 1622                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Properties");
 
 1624                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export Properties");
 
 1626                $a_xml_writer->xmlEndTag(
"ContentObject");
 
 1637                include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
 
 1639                $md2xml->setExportMode(
true);
 
 1640                $md2xml->startExport();
 
 1641                $a_xml_writer->appendXML($md2xml->getXML());
 
 1652                include_once 
'./Modules/LearningModule/classes/class.ilStructureObject.php';
 
 1654                $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
 
 1655                foreach ($childs as $child)
 
 1657                        if($child[
"type"] != 
"st")
 
 1663                        $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
 
 1664                        unset($structure_obj);
 
 1679                include_once 
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
 
 1680                include_once 
"./Modules/LearningModule/classes/class.ilLMPage.php";
 
 1683                foreach ($pages as $page)
 
 1687                                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Page Object ".$page[
"obj_id"]);
 
 1691                                $page_obj->exportXML($a_xml_writer, 
"normal", $a_inst);
 
 1694                                $mob_ids = $page_obj->getMediaObjectIDs();
 
 1695                                foreach($mob_ids as $mob_id)
 
 1697                                        $this->mob_ids[$mob_id] = $mob_id;
 
 1701                                $file_ids = $page_obj->getFileItemIds();
 
 1702                                foreach($file_ids as $file_id)
 
 1704                                        $this->file_ids[$file_id] = $file_id;
 
 1708                                $q_ids = $page_obj->getQuestionIds();
 
 1709                                foreach($q_ids as $q_id)
 
 1711                                        $this->q_ids[$q_id] = $q_id;
 
 1727                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1729                $linked_mobs = array();
 
 1732                foreach ($this->mob_ids as $mob_id)
 
 1736                                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
 
 1738                                $media_obj->exportXML($a_xml_writer, $a_inst);
 
 1739                                $media_obj->exportFiles($a_target_dir);
 
 1741                                $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
 
 1742                                $linked_mobs = array_merge($linked_mobs, $lmobs);
 
 1749                foreach ($linked_mobs as $mob_id)
 
 1753                                $expLog->write(
date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
 
 1755                                $media_obj->exportXML($a_xml_writer, $a_inst);
 
 1756                                $media_obj->exportFiles($a_target_dir);
 
 1769                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 1771                foreach ($this->file_ids as $file_id)
 
 1773                        $expLog->write(
date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
 
 1774                        $file_obj = 
new ilObjFile($file_id, 
false);
 
 1775                        $file_obj->export($a_target_dir);
 
 1787                $a_xml_writer->xmlStartTag(
"Properties", $attrs);
 
 1790                $attrs = array(
"Name" => 
"Layout", 
"Value" => $this->
getLayout());
 
 1791                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1794                $attrs = array(
"Name" => 
"PageHeader", 
"Value" => $this->
getPageHeader());
 
 1795                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1798                $attrs = array(
"Name" => 
"TOCMode", 
"Value" => $this->
getTOCMode());
 
 1799                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1802                $attrs = array(
"Name" => 
"ActiveLMMenu", 
"Value" =>
 
 1804                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1807                $attrs = array(
"Name" => 
"ActiveNumbering", 
"Value" =>
 
 1809                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1812                $attrs = array(
"Name" => 
"ActiveTOC", 
"Value" =>
 
 1814                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1817                $attrs = array(
"Name" => 
"ActivePrintView", 
"Value" =>
 
 1819                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1825                $attrs = array(
"Name" => 
"CleanFrames", 
"Value" =>
 
 1827                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1830                $attrs = array(
"Name" => 
"PublicNotes", 
"Value" =>
 
 1832                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1835                $attrs = array(
"Name" => 
"HistoryUserComments", 
"Value" =>
 
 1837                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1840                $attrs = array(
"Name" => 
"Rating", 
"Value" =>
 
 1842                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1843                $attrs = array(
"Name" => 
"RatingPages", 
"Value" =>
 
 1845                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1850                        $attrs = array(
"Name" => 
"HeaderPage", 
"Value" =>
 
 1851                                "il_".IL_INST_ID.
"_pg_".$this->getHeaderPage());
 
 1852                        $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1858                        $attrs = array(
"Name" => 
"FooterPage", 
"Value" =>
 
 1859                                "il_".IL_INST_ID.
"_pg_".$this->getFooterPage());
 
 1860                        $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1864                $attrs = array(
"Name" => 
"LayoutPerPage", 
"Value" =>
 
 1866                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1869                $attrs = array(
"Name" => 
"ProgressIcons", 
"Value" =>
 
 1871                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1874                $attrs = array(
"Name" => 
"StoreTries", 
"Value" =>
 
 1876                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1879                $attrs = array(
"Name" => 
"RestrictForwardNavigation", 
"Value" =>
 
 1881                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1884                $attrs = array(
"Name" => 
"DisableDefaultFeedback", 
"Value" =>
 
 1886                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1888                $a_xml_writer->xmlEndTag(
"Properties");
 
 1898                $types = array(
"xml", 
"html", 
"scorm");
 
 1900                foreach ($types as 
$type)
 
 1904                        if (!@is_dir($dir) or
 
 1905                                !is_writeable($dir))
 
 1916                        while ($entry = $cdir->read())
 
 1918                                if ($entry != 
"." and
 
 1920                                        substr($entry, -4) == 
".zip" and
 
 1921                                        preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry))
 
 1923                                        $file[$entry.$type] = array(
"type" => 
$type, 
"file" => $entry,
 
 1924                                                "size" => filesize($dir.
"/".$entry));
 
 1946                $this->public_export_file[
$a_type] = $a_file;
 
 1958                return $this->public_export_file[
$a_type];
 
 1967                if (!@is_dir($dir) or
 
 1968                        !is_writeable($dir))
 
 1980                while ($entry = $dir->read())
 
 1982                        if ($entry != 
"." and
 
 1984                                substr($entry, -4) == 
".pdf" and
 
 1985                                preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry))
 
 2014                include(
"./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
 
 2016                $man_builder->buildManifest();
 
 2017                $man_builder->dump($a_target_dir);
 
 2020                copy(
"Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir.
"/adlcp_rootv1p2.xsd");
 
 2021                copy(
"Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir.
"/imscp_rootv1p1p2.xsd");
 
 2022                copy(
"Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir.
"/imsmd_rootv1p2p1.xsd");
 
 2023                copy(
"Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir.
"/ims_xml.xsd");
 
 2027                $zip_file = $a_target_dir.
"/".$date.
"__".IL_INST_ID.
"__".
 
 2031                        $a_target_dir.
"/imsmanifest.xml",
 
 2032                        $a_target_dir.
"/adlcp_rootv1p2.xsd",
 
 2033                        $a_target_dir.
"/imscp_rootv1p1p2.xsd",
 
 2034                        $a_target_dir.
"/ims_xml.xsd",
 
 2035                        $a_target_dir.
"/imsmd_rootv1p2p1.xsd")
 
 2041                rename($zip_file, $dest_file);
 
 2050        function exportHTML($a_target_dir, 
$log, $a_zip_file = 
true, $a_export_format = 
"html", $a_lang = 
"")
 
 2054                $user_lang = 
$ilUser->getLanguage();
 
 2059                $mob_dir = $a_target_dir.
"/mobs";
 
 2061                $file_dir = $a_target_dir.
"/files";
 
 2063                $teximg_dir = $a_target_dir.
"/teximg";
 
 2065                $style_dir = $a_target_dir.
"/style";
 
 2067                $style_img_dir = $a_target_dir.
"/style/images";
 
 2069                $content_style_dir = $a_target_dir.
"/content_style";
 
 2071                $content_style_img_dir = $a_target_dir.
"/content_style/images";
 
 2076                include_once 
'./Services/MathJax/classes/class.ilMathJax.php';
 
 2081                $style_name = 
$ilUser->prefs[
"style"].
".css";
 
 2082                copy($location_stylesheet, $style_dir.
"/".$style_name);
 
 2083                $fh = fopen($location_stylesheet, 
"r");
 
 2084                $css = fread(
$fh, filesize($location_stylesheet));
 
 2085                preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
 
 2086                foreach (array_unique(
$files[1]) as $fileref)
 
 2088                        $css_fileref = str_replace(array(
"'", 
'"'), 
"", $fileref);
 
 2089                        $fileref = dirname($location_stylesheet).
"/".$css_fileref;
 
 2090                        if (is_file($fileref))
 
 2095                                copy($fileref, $style_dir.
"/".$css_fileref);
 
 2102                $ilBench->start(
"ExportHTML", 
"exportContentStyle");
 
 2105                        $cont_stylesheet = 
"./Services/COPage/css/content.css";
 
 2107                        $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
 
 2108                        preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
 
 2109                        foreach (array_unique(
$files[1]) as $fileref)
 
 2111                                if (is_file(str_replace(
"..", 
".", $fileref)))
 
 2113                                        copy(str_replace(
"..", 
".", $fileref), $content_style_img_dir.
"/".basename($fileref));
 
 2115                                $css = str_replace($fileref, 
"images/".basename($fileref),$css);
 
 2117                        fwrite(fopen($content_style_dir.
"/content.css",
'w'),$css);
 
 2122                        $style->writeCSSFile($content_style_dir.
"/content.css", 
"images");
 
 2123                        $style->copyImagesToDir($content_style_img_dir);
 
 2125                $ilBench->stop(
"ExportHTML", 
"exportContentStyle");
 
 2129                copy($syn_stylesheet, $a_target_dir.
"/syntaxhighlight.css");
 
 2132                include_once(
"./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
 
 2133                $_GET[
"cmd"] = 
"nop";
 
 2134                $get_transl = 
$_GET[
"transl"];
 
 2135                $_GET[
"transl"] = 
"";
 
 2137                $lm_gui->setOfflineMode(
true, ($a_lang == 
"all"));
 
 2138                $lm_gui->setOfflineDirectory($a_target_dir);
 
 2139                $lm_gui->setExportFormat($a_export_format);
 
 2143                if ($a_lang != 
"all")
 
 2145                        $langs = array($a_lang);
 
 2149                        $ot_langs = $ot->getLanguages();
 
 2150                        foreach ($ot_langs as $otl)
 
 2152                                $langs[] = $otl[
"lang_code"];
 
 2157                $this->offline_mobs = array();
 
 2158                $this->offline_int_links = array();
 
 2159                $this->offline_files = array();
 
 2162                foreach ($langs as 
$lang)
 
 2172                                $ilUser->setLanguage($user_lang);
 
 2173                                $ilUser->setCurrentLanguage($user_lang);
 
 2178                                if (
$lang == $ot->getMasterLanguage())
 
 2184                                        $lm_gui->lang = 
$lang;
 
 2189                        $ilBench->start(
"ExportHTML", 
"exportHTMLPages");
 
 2191                        $this->
exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang == 
"all"));
 
 2192                        $ilBench->stop(
"ExportHTML", 
"exportHTMLPages");
 
 2195                        $ilLocator->clearItems();
 
 2198                                $tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
 2202                                $lm_gui->tpl = 
$tpl;
 
 2203                                $content = $lm_gui->showTableOfContents();
 
 2205                                if ($a_lang == 
"all")
 
 2207                                        $file = $a_target_dir . 
"/table_of_contents_".$lang.
".html";
 
 2211                                        $file = $a_target_dir . 
"/table_of_contents.html";
 
 2215                                if (!($fp = @fopen(
$file,
"w+")))
 
 2217                                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2218                                                " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2221                                fwrite($fp, $content);
 
 2227                $ilBench->start(
"ExportHTML", 
"exportHTMLGlossaryTerms");
 
 2229                $ilBench->stop(
"ExportHTML", 
"exportHTMLGlossaryTerms");
 
 2232                $ilBench->start(
"ExportHTML", 
"exportHTMLMediaObjects");
 
 2233                $linked_mobs = array();
 
 2234                foreach ($this->offline_mobs as $mob)
 
 2238                                $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob, 
"_blank", $linked_mobs);
 
 2241                $linked_mobs2 = array();                                
 
 2242                foreach ($linked_mobs as $mob)
 
 2246                                $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob, 
"_blank", $linked_mobs2);
 
 2249                $_GET[
"obj_type"]  = 
"MediaObject";
 
 2250                $_GET[
"obj_id"]  = $a_mob_id;
 
 2252                $ilBench->stop(
"ExportHTML", 
"exportHTMLMediaObjects");
 
 2255                $ilBench->start(
"ExportHTML", 
"exportHTMLFileObjects");
 
 2256                foreach ($this->offline_files as 
$file)
 
 2260                $ilBench->stop(
"ExportHTML", 
"exportHTMLFileObjects");
 
 2263                if (count($this->q_ids) > 0)
 
 2265                        foreach ($this->q_ids as $q_id)
 
 2269                                        $a_target_dir.
"/assessment/0/".$q_id.
"/images");
 
 2274                $ilBench->start(
"ExportHTML", 
"exportHTMLImages");
 
 2275                $image_dir = $a_target_dir.
"/images";
 
 2279                        $image_dir.
"/enlarge.svg");
 
 2281                        $image_dir.
"/browser/plus.png");
 
 2283                        $image_dir.
"/browser/minus.png");
 
 2285                        $image_dir.
"/browser/blank.png");
 
 2287                        $image_dir.
"/spacer.png");
 
 2289                        $image_dir.
"/icon_st.svg");
 
 2291                        $image_dir.
"/icon_pg.svg");
 
 2293                        $image_dir.
"/icon_lm.svg");
 
 2295                        $image_dir.
"/nav_arr_L.png");
 
 2297                        $image_dir.
"/nav_arr_R.png");
 
 2299                $ilBench->stop(
"ExportHTML", 
"exportHTMLImages");
 
 2302                $services_dir = $a_target_dir.
"/Services";
 
 2304                $media_service_dir = $services_dir.
"/MediaObjects";
 
 2306                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
 2309                $mp3_dir = $media_service_dir.
"/flash_mp3_player";
 
 2314                include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 2322                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 2323                foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
 
 2325                        if ($f[
"source"] != 
"")
 
 2327                                copy($f[
"source"], $f[
"target"]);
 
 2333                $tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
 
 2334                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2338                        $ilUser->setLanguage($user_lang);
 
 2339                        $ilUser->setCurrentLanguage($user_lang);
 
 2357                        $zip_file = $zip_target_dir.
"/".$date.
"__".IL_INST_ID.
"__".
 
 2373                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 2374                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
 2375                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
 2376                include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 2379                                "target" => $a_target_dir.
'/js/yahoo/yahoo-min.js',
 
 2382                                "target" => $a_target_dir.
'/js/yahoo/yahoo-dom-event.js',
 
 2385                                "target" => $a_target_dir.
'/js/yahoo/animation-min.js',
 
 2387                        array(
"source" => 
'./Services/JavaScript/js/Basic.js',
 
 2388                                "target" => $a_target_dir.
'/js/Basic.js',
 
 2390                        array(
"source" => 
'./Services/Accordion/js/accordion.js',
 
 2391                                "target" => $a_target_dir.
'/js/accordion.js',
 
 2393                        array(
"source" => 
'./Services/Accordion/css/accordion.css',
 
 2394                                "target" => $a_target_dir.
'/css/accordion.css',
 
 2397                                "target" => $a_target_dir.
'/js/jquery.js',
 
 2400                                "target" => $a_target_dir.
'/js/maphilight.js',
 
 2403                                "target" => $a_target_dir.
'/js/jquery-ui-min.js',
 
 2405                        array(
"source" => 
'./Services/COPage/js/ilCOPagePres.js',
 
 2406                                "target" => $a_target_dir.
'/js/ilCOPagePres.js',
 
 2408                        array(
"source" => 
'./Modules/Scorm2004/scripts/questions/pure.js',
 
 2409                                "target" => $a_target_dir.
'/js/pure.js',
 
 2411                        array(
"source" => 
'./Modules/Scorm2004/scripts/questions/question_handling.js',
 
 2412                                "target" => $a_target_dir.
'/js/question_handling.js',
 
 2414                        array(
"source" => 
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
 
 2415                                "target" => $a_target_dir.
'/js/ilMatchingQuestion.js',
 
 2417                        array(
"source" => 
'./Modules/Scorm2004/templates/default/question_handling.css',
 
 2418                                "target" => $a_target_dir.
'/css/question_handling.css',
 
 2420                        array(
"source" => 
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
 
 2421                                "target" => $a_target_dir.
'/css/test_javascript.css',
 
 2435                        array(
"source" => 
'./Modules/LearningModule/js/LearningModule.js',
 
 2436                                "target" => $a_target_dir.
'/js/LearningModule.js',
 
 2444                        $scripts[] = array(
"source" => 
"",
 
 2450                include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
 
 2453                        if (is_int(strpos($p, 
"ExtLink")))
 
 2455                                $scripts[] = array(
"source" => $p,
 
 2456                                        "target" => $a_target_dir.
'/js/ilExtLink.js',
 
 2459                        if (is_int(strpos($p, 
"linkify")))
 
 2461                                $scripts[] = array(
"source" => $p,
 
 2462                                        "target" => $a_target_dir.
'/js/linkify.js',
 
 2476                $file_dir = $a_target_dir.
"/files/file_".$a_file_id;
 
 2478                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 2479                $file_obj = 
new ilObjFile($a_file_id, 
false);
 
 2480                $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
 
 2481                if (!is_file($source_file))
 
 2483                        $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
 
 2485                if (is_file($source_file))
 
 2487                        copy($source_file, $file_dir.
"/".$file_obj->getFileName());
 
 2494        function exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
 
 2498                $mob_dir = $a_target_dir.
"/mobs";
 
 2501                if (@is_dir($source_dir))
 
 2508                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2509                $_GET[
"obj_type"]  = 
"MediaObject";
 
 2510                $_GET[
"mob_id"]  = $a_mob_id;
 
 2511                $_GET[
"frame"] = $a_frame;
 
 2513                $content = $a_lm_gui->media();
 
 2514                $file = $a_target_dir.
"/media_".$a_mob_id.
".html";
 
 2517                if (!($fp = @fopen(
$file,
"w+")))
 
 2519                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2520                                " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2523                fwrite($fp, $content);
 
 2527                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 2529                if ($mob_obj->hasFullscreenItem())
 
 2532                        $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2533                        $_GET[
"obj_type"]  = 
"";
 
 2534                        $_GET[
"frame"]  = 
"";
 
 2535                        $_GET[
"mob_id"]  = $a_mob_id;
 
 2536                        $_GET[
"cmd"] = 
"fullscreen";
 
 2537                        $content = $a_lm_gui->fullscreen();
 
 2538                        $file = $a_target_dir.
"/fullscreen_".$a_mob_id.
".html";
 
 2541                        if (!($fp = @fopen(
$file,
"w+")))
 
 2543                                die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2544                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2547                        fwrite($fp, $content);
 
 2550                $linked_mobs = $mob_obj->getLinkedMediaObjects();
 
 2551                foreach ($linked_mobs as 
$id)
 
 2556                $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
 
 2566                foreach($this->offline_int_links as $int_link)
 
 2568                        $ilLocator->clearItems();
 
 2569                        if ($int_link[
"type"] == 
"git")
 
 2572                                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2574                                $_GET[
"obj_id"] = $int_link[
"id"];
 
 2575                                $_GET[
"frame"] = 
"_blank";
 
 2576                                $content = $a_lm_gui->glossary();
 
 2577                                $file = $a_target_dir.
"/term_".$int_link[
"id"].
".html";
 
 2580                                if (!($fp = @fopen(
$file,
"w+")))
 
 2582                                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2583                                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2586                                fwrite($fp, $content);
 
 2590                                include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
 2592                                foreach($defs as $def)
 
 2595                                        foreach($def_mobs as $def_mob)
 
 2597                                                $this->offline_mobs[$def_mob] = $def_mob;
 
 2598                                                include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 2605                                        $this->offline_files = array_merge($this->offline_files, $def_files);
 
 2616        function exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang = 
"", $a_all_languages = 
false)
 
 2624                $this->first_page_id = $first_page[
"child"];
 
 2628                $int_links = array();
 
 2629                $this->offline_files = array();
 
 2631                include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
 2632                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 2636                $exp_id_map = array();
 
 2638                if (
$lm_set->get(
"html_export_ids"))
 
 2640                        foreach ($pages as $page)
 
 2643                                if (trim($exp_id) != 
"")
 
 2645                                        $exp_id_map[$page[
"obj_id"]] = trim($exp_id);
 
 2656                foreach ($pages as $page)
 
 2660                                $ilLocator->clearItems();
 
 2661                                $ilBench->start(
"ExportHTML", 
"exportHTMLPage");
 
 2662                                $ilBench->start(
"ExportHTML", 
"exportPageHTML");
 
 2664                                        "", $exp_id_map, $a_lang, $a_all_languages);
 
 2665                                $ilBench->stop(
"ExportHTML", 
"exportPageHTML");
 
 2669                                foreach ($pcs as $pc)
 
 2671                                        if ($pc[
"type"] == 
"incl")
 
 2674                                                foreach($incl_mobs as $incl_mob)
 
 2676                                                        $mobs[$incl_mob] = $incl_mob;
 
 2677                                                        include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 2686                                foreach($pg_mobs as $pg_mob)
 
 2688                                        $mobs[$pg_mob] = $pg_mob;
 
 2689                                        include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 2696                                $int_links = array_merge($int_links, $pg_links);
 
 2699                                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 2701                                $this->offline_files = array_merge($this->offline_files, $pg_files);
 
 2704                                include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
 
 2706                                foreach($q_ids as $q_id)
 
 2708                                        $this->q_ids[$q_id] = $q_id;
 
 2711                                $ilBench->stop(
"ExportHTML", 
"exportHTMLPage");
 
 2714                foreach (
$mobs as $m)
 
 2716                        $this->offline_mobs[$m] = $m;
 
 2718                foreach ($int_links as $k => $v)
 
 2720                        $this->offline_int_links[$k] = $v;
 
 2730                $a_exp_id_map = array(), $a_lang = 
"-", $a_all_languages = 
false)
 
 2735                if ($a_lang != 
"-" && $a_lang != 
"" && $a_all_languages)
 
 2737                        $lang_suffix = 
"_".$a_lang;
 
 2743                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2745                include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
 
 2748                $_GET[
"obj_id"] = $a_lm_page_id;
 
 2749                $_GET[
"frame"] = $a_frame;
 
 2754                        if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
 
 2756                                $file = $a_target_dir.
"/lm_pg_".$a_exp_id_map[$a_lm_page_id].$lang_suffix.
".html";
 
 2760                                $file = $a_target_dir.
"/lm_pg_".$a_lm_page_id.$lang_suffix.
".html";
 
 2765                        if ($a_frame != 
"toc")
 
 2767                                $file = $a_target_dir.
"/frame_".$a_lm_page_id.
"_".$a_frame.$lang_suffix.
".html";
 
 2771                                $file = $a_target_dir.
"/frame_".$a_frame.$lang_suffix.
".html";
 
 2776                if (@is_file(
$file))
 
 2781                $content = $a_lm_gui->layout(
"main.xml", 
false);
 
 2784                if (!($fp = @fopen(
$file,
"w+")))
 
 2786                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2787                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2794                fwrite($fp, $content);
 
 2799                if ($this->first_page_id == $a_lm_page_id && $a_frame == 
"")
 
 2801                        copy(
$file, $a_target_dir.
"/index".$lang_suffix.
".html");
 
 2805                $frameset = $a_lm_gui->getCurrentFrameSet();
 
 2807                foreach ($frameset as $frame)
 
 2809                        $this->
exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
 
 2826                $attrs[
"xmlns:fo"] = 
"http://www.w3.org/1999/XSL/Format";
 
 2827                $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
 
 2831                $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
 
 2835                $attrs[
"master-name"] = 
"DinA4";
 
 2836                $attrs[
"page-height"] = 
"29.7cm";
 
 2837                $attrs[
"page-width"] = 
"21cm";
 
 2838                $attrs[
"margin-top"] = 
"4cm";
 
 2839                $attrs[
"margin-bottom"] = 
"1cm";
 
 2840                $attrs[
"margin-left"] = 
"2.8cm";
 
 2841                $attrs[
"margin-right"] = 
"7.3cm";
 
 2842                $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
 
 2846                $attrs[
"margin-top"] = 
"0cm";
 
 2847                $attrs[
"margin-bottom"] = 
"1.25cm";
 
 2848                $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
 
 2852                $attrs[
"extent"] = 
"1cm";
 
 2853                $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
 
 2857                $attrs[
"extent"] = 
"1cm";
 
 2858                $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
 
 2861                $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
 
 2864                $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
 
 2868                $attrs[
"master-reference"] = 
"DinA4";
 
 2869                $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
 
 2873                $attrs[
"flow-name"] = 
"xsl-region-body";
 
 2874                $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
 
 2879                $ilBench->start(
"ContentObjectExport", 
"exportFOStructureObjects");
 
 2881                $ilBench->stop(
"ContentObjectExport", 
"exportFOStructureObjects");
 
 2885                $a_xml_writer->xmlEndTag(
"fo:flow");
 
 2888                $a_xml_writer->xmlEndTag(
"fo:page-sequence");
 
 2891                $a_xml_writer->xmlEndTag(
"fo:root");
 
 2902                $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
 
 2903                foreach ($childs as $child)
 
 2905                        if($child[
"type"] != 
"st")
 
 2911                        $structure_obj->exportFO($a_xml_writer, $expLog);
 
 2912                        unset($structure_obj);
 
 2918                include_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2922                $export_file = $cont_exp->buildExportFile();
 
 2923                return $export_file;
 
 2937                $lmtree->setTableNames(
'lm_tree',
'lm_data');
 
 2938                $lmtree->setTreeTablePK(
"lm_id");
 
 2941                $source_obj->setLMId($this->
getId());
 
 2946                        $target_obj->setLMId($this->
getId());
 
 2947                        $target_parent = $lmtree->getParentId(
$target_id);
 
 2951                if ($source_obj->getType() == 
"pg")
 
 2954                        if ($lmtree->isInTree($source_obj->getId()))
 
 2956                                $node_data = $lmtree->getNodeData($source_obj->getId());
 
 2959                                if ($movecopy == 
"move")
 
 2961                                        $parent_id = $lmtree->getParentId($source_obj->getId());
 
 2962                                        $lmtree->deleteTree($node_data);
 
 2965                                        require_once(
"./Services/History/classes/class.ilHistory.php");
 
 2971                                                $this->getType().
":st");
 
 2976                                        $new_page = $source_obj->copy();
 
 2977                                        $source_id = $new_page->getId();
 
 2978                                        $source_obj = $new_page;
 
 2982                                if(!$lmtree->isInTree($source_obj->getId()))
 
 2989                                        else if ($as_subitem)           
 
 2993                                                $pg_childs = $lmtree->getChildsByType($parent, 
"pg");
 
 2994                                                if (count($pg_childs) != 0)
 
 2996                                                        $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
 
 3002                                                $parent = $target_parent;
 
 3006                                        $lmtree->insertNode($source_obj->getId(),
 
 3007                                                $parent, $target_pos);
 
 3010                                        if ($movecopy == 
"move")
 
 3013                                                include_once(
"./Services/History/classes/class.ilHistory.php");
 
 3019                                                        $this->getType().
":st");
 
 3027                if ($source_obj->getType() == 
"st")
 
 3030                        $source_node = $lmtree->getNodeData($source_id);
 
 3031                        $subnodes = $lmtree->getSubtree($source_node);
 
 3034                        foreach ($subnodes as $subnode)
 
 3049                                $pg_childs = $lmtree->getChildsByType($target_parent, 
"pg");
 
 3050                                if (count($pg_childs) != 0)
 
 3052                                        $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
 
 3055                        else if ($as_subitem)           
 
 3059                                $childs = $lmtree->getChilds($target_parent);
 
 3060                                if (count($childs) != 0)
 
 3062                                        $target_pos = $childs[count($childs) - 1][
"obj_id"];
 
 3087                        if ($movecopy == 
"move")
 
 3089                                $lmtree->deleteTree($source_node);
 
 3094                                $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
 
 3097                        if (!$lmtree->isInTree($source_id))
 
 3099                                $lmtree->insertNode($source_id, $target_parent, $target_pos);
 
 3102                                if ($movecopy == 
"move")
 
 3104                                        foreach ($subnodes as $node)
 
 3106                                                if($node[
"obj_id"] != $source_id)
 
 3108                                                        $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
 
 3126                include_once 
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
 
 3127                include_once 
"./Modules/LearningModule/classes/class.ilLMPage.php";
 
 3132                foreach ($pages as $page)
 
 3136                                $cpage = 
new ilLMPage($page[
"obj_id"]);
 
 3138                                $error = @$cpage->validateDom();
 
 3142                                        $this->lng->loadLanguageModule(
"content");
 
 3146                                        $mess.= $this->lng->txt(
"obj_pg").
": ".
$title;
 
 3147                                        $mess.= 
'<div class="small">';
 
 3150                                                $err_mess = implode($e, 
" - ");
 
 3151                                                if (!is_int(strpos($err_mess, 
":0:")))
 
 3153                                                        $mess.= htmlentities($err_mess).
"<br />";
 
 3172                $a_import_into_help_module = 0)
 
 3180                $file = pathinfo($a_filename);
 
 3184                        $a_filename, $full_path);
 
 3189                $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
 
 3214                $this->log->debug(
"import from directory ".$a_directory);
 
 3217                $subdir = basename($a_directory);
 
 3218                $xml_file = $a_directory.
"/".$subdir.
".xml";
 
 3221                if (!is_dir($a_directory))
 
 3223                        $this->log->error(
sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir));
 
 3224                        return sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir);
 
 3228                if (!is_file($xml_file))
 
 3230                        $this->log->error(
sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"));
 
 3231                        return sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml");
 
 3235                $this->log->debug(
"import qti");
 
 3236                $qti_file = $a_directory.
"/qti.xml";
 
 3238                if (is_file($qti_file))
 
 3240                        include_once 
"./Services/QTI/classes/class.ilQTIParser.php";
 
 3241                        include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 3244                        $result = $qtiParser->startParsing ();
 
 3245                        $founditems = & $qtiParser->getFoundItems ();
 
 3247                        if (count($founditems) > 0)
 
 3250                                $qtiParser->setTestObject($testObj);
 
 3251                                $result = $qtiParser->startParsing();
 
 3252                                $qtis = array_merge($qtis, $qtiParser->getImportMapping());
 
 3256                $this->log->debug(
"get ilContObjParser");
 
 3257                include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
 
 3259                $contParser = 
new ilContObjParser($this, $xml_file, $subdir, $a_directory);
 
 3261                $contParser->setImportMapping($a_mapping);
 
 3262                $contParser->setQuestionMapping($qtis);
 
 3263                $contParser->startParsing();
 
 3268                $style_file = $a_directory.
"/style.xml";
 
 3269                $style_zip_file = $a_directory.
"/style.zip";
 
 3270                if (is_file($style_zip_file))   
 
 3272                        require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 3274                        $style->import($style_zip_file);
 
 3277                else if (is_file($style_file))  
 
 3279                        require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 3281                        $style->import($style_file);
 
 3294                        include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
 3310        public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree = 
false)
 
 3314                $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
 
 3321                if(!$cp_options->isRootNode($this->getRefId()))
 
 3323                        $new_obj->setOnline($this->
getOnline());
 
 3329                $new_obj->setLayout($this->
getLayout());
 
 3343                $new_obj->setRating($this->
hasRating());
 
 3353                $new_obj->createLMTree();
 
 3356                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 3358                if ($style_id > 0 &&
 
 3362                        $new_id = $style_obj->ilClone();
 
 3363                        $new_obj->setStyleSheetId($new_id);
 
 3377                        $new_obj->setHeaderPage($new_page_header);
 
 3381                        $new_obj->setFooterPage($new_page_footer);
 
 3386                include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
 
 3388                $obj_settings->cloneSettings($new_obj->getId());
 
 3389                unset($obj_settings);
 
 3392                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
 3394                $ot->copy($new_obj->getId());
 
 3397                include_once 
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
 
 3399                $menu->setObjId($this->
getId());
 
 3401                $new_menu->setObjId($new_obj->getId());
 
 3402                foreach ($menu->getMenuEntries() as $entry)
 
 3411                        $new_menu->setTarget($entry[
"link"]);
 
 3412                        $new_menu->setTitle($entry[
"title"]);
 
 3413                        $new_menu->setLinkType($entry[
"type"]);
 
 3414                        $new_menu->setLinkRefId($entry[
"ref_id"]);
 
 3415                        $new_menu->create();
 
 3430                $parent_id = $a_target_obj->lm_tree->readRootId();
 
 3432                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 3433                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
 3436                $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), 
"st");
 
 3437                $copied_nodes = array();
 
 3439                foreach ($chapters as $chap)
 
 3448                foreach ($pages as $p)
 
 3450                        if (!$this->lm_tree->isInTree($p[
"obj_id"]))
 
 3453                                $target_item = $item->copy($a_target_obj);
 
 3454                                $copied_nodes[$item->getId()] = $target_item->getId();
 
 3459                include_once 
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
 
 3461                foreach($copied_nodes as $old_id => $new_id)
 
 3465                                $a_target_obj->getRefId().
'_'.$new_id
 
 3471                $a_target_obj->checkTree();
 
 3473                return $copied_nodes;
 
 3488                $set = 
$ilDB->query(
"SELECT * FROM lm_glossaries ".
 
 3489                        " WHERE lm_id = ".
$ilDB->quote($a_lm_id, 
"integer")
 
 3492                while ($rec = 
$ilDB->fetchAssoc($set))
 
 3494                        $glos[] = $rec[
"glo_id"];
 
 3508                include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 3512                include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
 3516                $found_pages = array();
 
 3517                foreach ($pages as $p)
 
 3520                        $c = $pg->getXMLContent();
 
 3521                        foreach ($terms as 
$t)
 
 3523                                if (is_int(stripos($c, 
$t[
"term"])))
 
 3525                                        $found_pages[$p[
"id"]][
"terms"][] = 
$t;
 
 3526                                        if (!is_object($found_pages[$p[
"id"]][
"page"]))
 
 3528                                                $found_pages[$p[
"id"]][
"page"] = $pg;
 
 3536                include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
 3537                foreach ($found_pages as 
$id => $fp)
 
 3557                if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
 
 3570                $this->rating = (bool)$a_value;
 
 3580                $this->rating_pages = (bool)$a_value;
 
 3591                parent::MDUpdateListener($a_element);
 
 3593                include_once 
'Services/MetaData/classes/class.ilMD.php';
 
 3598                                include_once(
"./Services/Object/classes/class.ilObjectLP.php");                         
 
 3600                                if(in_array($obj_lp->getCurrentMode(), 
 
 3603                                        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");                                
 
 3612                                if(!is_object($md_gen = $md->getGeneral()))
 
 3617                                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
 3619                                if ($ot->getContentActivated())
 
 3621                                        $ot->setDefaultTitle($md_gen->getTitle());
 
 3623                                        foreach($md_gen->getDescriptionIds() as 
$id)
 
 3625                                                $md_des = $md_gen->getDescription(
$id);
 
 3626                                                $ot->setDefaultDescription($md_des->getDescription());
 
 3644                $dirs = array(
"xml", 
"scorm");
 
 3645                $export_files = array();
 
 3647                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
 3649                if ($ot->getContentActivated())
 
 3651                        $langs = $ot->getLanguages();
 
 3652                        foreach ($langs as 
$l => $ldata)
 
 3654                                $dirs[] = 
"html_".$l;
 
 3656                        $dirs[] = 
"html_all";
 
 3663                foreach($dirs as $dir)
 
 3665                        $type = explode(
"_", $dir);
 
 3674                                        $export_files[] = array(
"type" => 
$type,
 
 3682                return $export_files;
 
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(strpos( $jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
An exception for terminatinating execution or to throw for unit testing.
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Export class for content objects.
Content Object (ILIAS native learning module / digilib book) Manifest export class.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static getLocalExplorerJsPath()
Get local path of explorer js.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
static getDefinitionList($a_term_id)
static
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, $a_include_references=false)
Get all terms for given set of glossary ids.
static _lookGlossaryTerm($term_id)
get glossary term
static _createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
static _getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static pasteTree($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static _lookupTitle($a_obj_id)
Lookup title.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
static getPageList($lm_id)
static
Extension of ilPageObject for learning modules.
Class ilLMPresentationGUI.
const LP_MODE_COLLECTION_TLT
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static getLocalJsPaths()
Get paths of necessary js files.
static getLogger($a_component_id)
Get component logger.
static getInstance()
Singleton: get instance.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
Class ilObjContentObject.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
exportFO(&$a_xml_writer, $a_target_dir)
export object to fo
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
static lookupAutoGlossaries($a_lm_id)
Lookup auto glossaries.
putInTree($a_parent)
put content object in main tree
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
updateProperties()
Update content object properties.
setAutoGlossaries($a_val)
Set auto glossaries.
setTitle($a_title)
set title of content object
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
export all pages of learning module to html file
setActiveLMMenu($a_act_lm_menu)
getLayoutPerPage()
Get layout per page.
createProperties()
create new properties record
& getLMTree()
get content object tree
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
setForTranslation($a_val)
Set for translation.
static getAvailableLayouts()
get all available lm layouts
exportSCORM($a_target_dir, $log)
export scorm package
isActiveHistoryUserComments()
getRestrictForwardNavigation()
Get restrict forward navigation.
getDataDirectory()
get data directory
importFromZipFile($a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
Import lm from zip file.
getHideHeaderFooterPrint()
Get hide header footer in print mode.
exportHTMLFile($a_target_dir, $a_file_id)
export file object
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
setActiveDownloadsPublic($a_down)
update()
update complete object (meta data and properties)
getTOCMode()
get toc mode ("chapters" | "pages")
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
getExportDirectory($a_type="xml")
get export directory of lm
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
static _lookupRestrictForwardNavigation($a_obj_id)
Lookup forward restriction navigation.
static writeHeaderPage($a_lm_id, $a_page_id)
Write header page.
setActiveNumbering($a_num)
setImportDirectory($a_import_dir)
Set import directory for further use in ilContObjParser.
getForTranslation()
Get for translation.
importFromDirectory($a_directory, $a_validate=true, $a_mapping=null)
Import lm from directory.
getTitle()
get title of content object
static _lookupStoreTries($a_id)
Lookup disable default feedback.
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
create($a_no_meta_data=false)
create content object
getAutoGlossaries()
Get auto glossaries.
static getSupplyingExportFiles($a_target_dir=".")
Get supplying export files.
static _lookupStyleSheetId($a_cont_obj_id)
lookup style sheet ID
isActivePreventGlossaryAppendix()
static _getNrLMsNoStyle()
get number of learning modules assigned no style
static writeFooterPage($a_lm_id, $a_page_id)
Write footer page.
static _getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id)
get top chapter of page for that any precondition is missing
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
setHistoryUserComments($a_comm)
removeAutoGlossary($a_glo_id)
Remove auto glossary.
setProgressIcons($a_val)
Set progress icons.
setLayoutPerPage($a_val)
Set layout per page.
createLMTree()
create content object tree (that stores structure object hierarchie)
getExportFiles()
get export files
getLayout()
get default page layout of content object (see directory layouts/)
getDescription()
get description of content object
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
static _lookup($a_obj_id, $a_field)
Lookup property.
getPublicAccessMode()
get public access mode ("complete" | "selected")
setRestrictForwardNavigation($a_val)
Set restrict forward navigation.
getImportDirectory()
get import directory of lm
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
addFirstChapterAndPage()
Add first chapter and page.
setImportId($a_id)
set import id
readProperties()
read content object properties
getStyleSheetId()
get ID of assigned style sheet object
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
MDUpdateListener($a_element)
Meta data update listener.
static hasSuccessorPage($a_cont_obj_id, $a_page_id)
checks if page has a successor page
static _lookupOnline($a_id)
check wether content object is online
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
setDescription($a_description)
set description of content object
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
export page html
executeDragDrop($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
Execute Drag Drop Action.
setPublicExportFile($a_type, $a_file)
specify public export file for type
validatePages()
Validate all pages.
static _lookupContObjIdByStyleId($a_style_id)
lookup style sheet ID
isActiveDownloadsPublic()
getStoreTries()
Get store tries.
read()
read data of content object
setActivePrintView($a_print)
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
updateAutoGlossaries()
Update auto glossaries.
createExportDirectory($a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
setStoreTries($a_val)
Set store tries.
setTOCMode($a_toc_mode="chapters")
set toc mode
getProgressIcons()
Get progress icons.
setPublicNotes($a_pub_notes)
static _getMissingPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
gets all missing preconditions of page
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static isOnlineHelpModule($a_id, $a_as_obj_id=false)
Is module an online module.
static _getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
setActiveDownloads($a_down)
static _deleteStyleAssignments($a_style_id)
delete all style references to style
exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export object to xml (see ilias_co.dtd)
getPublicExportFiles()
Get public export files.
setActivePreventGlossaryAppendix($a_print)
setLayout($a_layout)
set default page layout
setPublicAccessMode($a_mode)
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone learning module.
getImportId()
get import id
static _moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
getOfflineFiles($dir)
get offline files
getDisableDefaultFeedback()
Get disable default feedback for questions.
getPublicExportFile($a_type)
get public export file
autoLinkGlossaryTerms($a_glo_id)
Auto link glossary terms.
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static _lookupStandard($a_id)
Lookup standard flag.
static getSyntaxStylePath()
get syntax style path
static getInstance($a_obj_id)
static getInstance($a_obj_id)
Get instance.
Class ilObject Basic functions for all objects.
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
getType()
get object type @access public
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
createMetaData()
create meta data entry
getRefId()
get reference id @access public
cloneMetaData($target_obj)
Copy meta data.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
getId()
get object id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
static resetInitialState()
Reset initial state (for exports)
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
static getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static getLocalMediaElementJsPath()
Get local path of jQuery file.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getDataDir()
get data directory (outside webspace)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static tf2yn($a_tf)
convert true/false to "y"/"n"
static getWebspaceDir($mode="filesystem")
get webspace directory
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static zip($a_dir, $a_file, $compress_content=false)
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static yn2tf($a_yn)
convert "y"/"n" to true/false
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getLocalPath($a_name="")
Get local path of a YUI js file.
static getLocaljQueryUIPath()
Get local path of jQuery UI file.
static getLocaljQueryPath()
Get local path of jQuery file.
static getLocalMaphilightPath()
Get local path of maphilight file.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
redirection script todo: (a better solution should control the processing via a xml file)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
if(!is_array($argv)) $options