4require_once 
"./Services/Object/classes/class.ilObject.php";
 
    5require_once 
"Services/MetaData/classes/class.ilMDLanguageItem.php";
 
    6require_once(
"./Services/Xml/classes/class.ilNestedSetXML.php");
 
   49                $this->
ilObject($a_id,$a_call_by_reference);
 
   53                $this->mob_ids = array();
 
   54                $this->file_ids = array();
 
   55                $this->q_ids = array();
 
   61        function create($a_no_meta_data = 
false)
 
   88#               echo "Content<br>\n";
 
   91                $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
   92                $this->lm_tree->setTreeTablePK(
"lm_id");
 
   97                $set = 
$ilDB->query(
"SELECT * FROM lm_glossaries ".
 
   98                        " WHERE lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  101                while ($rec = 
$ilDB->fetchAssoc($set))
 
  103                        $glos[] = $rec[
"glo_id"];
 
  117                return parent::getTitle();
 
  125                parent::setTitle($a_title);
 
  136                return parent::getDescription();
 
  144                parent::setDescription($a_description);
 
  156                $this->import_id = $a_id;
 
  166                $this->layout_per_page = $a_val;
 
  176                return $this->layout_per_page;
 
  186                $this->disable_def_feedback = $a_val;
 
  196                return $this->disable_def_feedback;
 
  206                $this->progr_icons = $a_val;
 
  216                return $this->progr_icons;
 
  226                $this->store_tries = $a_val;
 
  236                return $this->store_tries;
 
  246                $this->restrict_forw_nav = $a_val;
 
  256                return $this->restrict_forw_nav;
 
  287                $ilDB->manipulate(
"DELETE FROM lm_glossaries WHERE ".
 
  288                        " lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  292                        $ilDB->manipulate(
"INSERT INTO lm_glossaries ".
 
  293                                "(lm_id, glo_id) VALUES (".
 
  294                                $ilDB->quote($this->getId(), 
"integer").
",".
 
  295                                $ilDB->quote($glo_id, 
"integer").
 
  320                parent::putInTree($a_parent);
 
  335                $this->lm_tree->setTreeTablePK(
"lm_id");
 
  336                $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
  337                $this->lm_tree->addTree($this->
getId(), 1);
 
  347                $this->auto_glossaries = array();
 
  348                if (is_array($a_val))
 
  350                        foreach ($a_val as $v)
 
  354                                        !in_array($v, $this->auto_glossaries))
 
  356                                        $this->auto_glossaries[] = $v;
 
  399                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
  400                include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
 
  401                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
  403                $root_id = $this->lm_tree->getRootId();
 
  407                $chap->setType(
"st");
 
  408                $chap->setTitle(
$lng->txt(
"cont_new_chap"));
 
  409                $chap->setLMId($this->
getId());
 
  415                $page->setType(
"pg");
 
  416                $page->setTitle(
$lng->txt(
"cont_new_page"));
 
  417                $page->setLMId($this->
getId());
 
  429                $this->for_translation = $a_val;
 
  459                if(!is_writable($lm_data_dir))
 
  461                        $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
 
  462                                .
") not writeable.",$this->
ilias->error_obj->FATAL);
 
  466                $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
 
  468                if(!@is_dir($lm_dir))
 
  470                        $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
 
  478                        $this->
ilias->raiseError(
"Creation of Import Directory failed.",$this->
ilias->error_obj->FATAL);
 
  488                        "/lm_".$this->getId();
 
  496                if(strlen($this->import_dir))
 
  502                        "/lm_".$this->getId().
"/import";
 
  521                $this->import_dir = $a_import_dir;
 
  533                if(!is_writable($lm_data_dir))
 
  535                        $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
 
  536                                .
") not writeable.",$this->
ilias->error_obj->FATAL);
 
  539                $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
 
  541                if(!@is_dir($lm_dir))
 
  543                        $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
 
  550                                $export_dir = $lm_dir.
"/export_scorm";
 
  554                                if (substr($a_type, 0, 4) == 
"html")
 
  556                                        $export_dir = $lm_dir.
"/export_".$a_type;
 
  560                                        $export_dir = $lm_dir.
"/export";
 
  566                if(!@is_dir($export_dir))
 
  568                        $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
 
  584                                if (substr($a_type, 0, 4) == 
"html")
 
  586                                        $export_dir = 
ilUtil::getDataDir().
"/lm_data".
"/lm_".$this->getId().
"/export_".$a_type;
 
  615                if (!parent::delete())
 
  621                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
  629                $nested->init($this->
getId(), 
"bib");
 
  630                $nested->deleteAllDBData();
 
  634                $this->lm_tree->removeTree($this->lm_tree->getTreeId());
 
  640                $q = 
"DELETE FROM content_object WHERE id = ".
 
  642                $ilDB->manipulate($q);
 
  645                $q = 
"DELETE FROM lm_menu WHERE lm_id = ".
 
  647                $ilDB->manipulate($q);
 
  650                $ilDB->manipulate(
"DELETE FROM lm_glossaries WHERE ".
 
  651                        " lm_id = ".
$ilDB->quote($this->getId(), 
"integer")
 
  676                $this->layout = $a_layout;
 
  692                $this->style_id = $a_style_id;
 
  702                $q = 
"UPDATE content_object SET ".
 
  703                        " stylesheet = ".$ilDB->quote((
int) $a_style_id, 
"integer").
 
  704                        " WHERE id = ".$ilDB->quote($this->
getId(), 
"integer");
 
  705                $ilDB->manipulate($q);
 
  707                $this->style_id = $a_style_id;
 
  720                $ilDB->manipulate(
"UPDATE content_object SET ".
 
  721                        " header_page = ".
$ilDB->quote($a_page_id, 
"integer").
 
  722                        " WHERE id = ".$ilDB->quote($a_lm_id, 
"integer")
 
  736                $ilDB->manipulate(
"UPDATE content_object SET ".
 
  737                        " footer_page = ".
$ilDB->quote($a_page_id, 
"integer").
 
  738                        " WHERE id = ".$ilDB->quote($a_lm_id, 
"integer")
 
  750                if ($a_from_style < 0)  
 
  752                        $q = 
"SELECT stylesheet FROM content_object, style_data ".
 
  753                                " WHERE content_object.stylesheet = style_data.id ".
 
  754                                " AND style_data.standard = ".$ilDB->quote(0, 
"integer").
 
  755                                " AND content_object.stylesheet > ".$ilDB->quote(0, 
"integer");
 
  756                        $style_set = 
$ilDB->query($q);
 
  757                        while($style_rec = 
$ilDB->fetchAssoc($style_set))
 
  760                                $q = 
"UPDATE content_object SET ".
 
  761                                        " stylesheet = ".$ilDB->quote((
int) $a_to_style, 
"integer").
 
  762                                        " WHERE stylesheet = ".$ilDB->quote($style_rec[
"stylesheet"], 
"integer");
 
  763                                $ilDB->manipulate($q);
 
  766                                $style_obj =& 
$ilias->obj_factory->getInstanceByObjId($style_rec[
"stylesheet"]);
 
  767                                $style_obj->delete();
 
  772                        $q = 
"UPDATE content_object SET ".
 
  773                                " stylesheet = ".$ilDB->quote((
int) $a_to_style, 
"integer").
 
  774                                " WHERE stylesheet = ".$ilDB->quote($a_from_style, 
"integer");
 
  775                        $ilDB->manipulate($q);
 
  786        static protected function _lookup($a_obj_id, $a_field)
 
  790                $q = 
"SELECT ".$a_field.
" FROM content_object ".
 
  791                        " WHERE id = ".$ilDB->quote($a_obj_id, 
"integer");
 
  796                return $rec[$a_field];
 
  817                $q = 
"SELECT stylesheet FROM content_object ".
 
  818                        " WHERE id = ".$ilDB->quote($a_cont_obj_id, 
"integer");
 
  822                return $sheet[
"stylesheet"];
 
  832                $q = 
"SELECT id FROM content_object ".
 
  833                        " WHERE stylesheet = ".$ilDB->quote($a_style_id, 
"integer");
 
  838                        $obj_ids[] = $cont[
"id"];
 
  850                $q = 
"SELECT disable_def_feedback FROM content_object ".
 
  851                        " WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
  855                return $rec[
"disable_def_feedback"];
 
  865                $q = 
"SELECT store_tries FROM content_object ".
 
  866                        " WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
  870                return $rec[
"store_tries"];
 
  883                $q = 
"SELECT count(*) as cnt FROM content_object ".
 
  884                        " WHERE stylesheet = ".$ilDB->quote($a_style_id, 
"integer");
 
  885                $cset = 
$ilDB->query($q);
 
  886                $crow = 
$ilDB->fetchAssoc($cset);
 
  888                return (
int) $crow[
"cnt"];
 
  900                $q = 
"SELECT count(*) as cnt FROM content_object, style_data ".
 
  901                        " WHERE stylesheet = style_data.id ".
 
  902                        " AND standard = ".$ilDB->quote(0, 
"integer");
 
  903                $cset = 
$ilDB->query($q);
 
  904                $crow = 
$ilDB->fetchAssoc($cset);
 
  906                return (
int) $crow[
"cnt"];
 
  916                $q = 
"SELECT count(*) as cnt FROM content_object ".
 
  917                        " WHERE stylesheet = ".$ilDB->quote(0, 
"integer");
 
  918                $cset = 
$ilDB->query($q);
 
  919                $crow = 
$ilDB->fetchAssoc($cset);
 
  921                return (
int) $crow[
"cnt"];
 
  933                $q = 
"UPDATE content_object SET ".
 
  934                        " stylesheet = ".$ilDB->quote(0, 
"integer").
 
  935                        " WHERE stylesheet = ".$ilDB->quote((
int) $this->
getId($a_style_id), 
"integer");
 
  937                $ilDB->manipulate($q);
 
  955                $this->pg_header = $a_pg_header;
 
  963                return $this->toc_mode;
 
  971                return $this->public_access_mode;
 
  981                $this->toc_mode = $a_toc_mode;
 
  986                $this->online = $a_online;
 
  996                $this->lm_menu_active = $a_act_lm_menu;
 
 1001                return $this->lm_menu_active;
 
 1006                $this->toc_active = $a_toc;
 
 1011                return $this->toc_active;
 
 1016                $this->numbering = $a_num;
 
 1021                return $this->numbering;
 
 1026                $this->print_view_active = $a_print;
 
 1031                return $this->print_view_active;
 
 1036                $this->prevent_glossary_appendix_active = $a_print;
 
 1041                return $this->prevent_glossary_appendix_active;
 
 1051                $this->hide_header_footer_print = $a_val;
 
 1061                return $this->hide_header_footer_print;
 
 1066                $this->downloads_active = $a_down;
 
 1071                return $this->downloads_active;
 
 1076                $this->downloads_public_active = $a_down;
 
 1081                return $this->downloads_public_active;
 
 1086                $this->pub_notes = $a_pub_notes;
 
 1091                return $this->pub_notes;
 
 1096                $this->clean_frames = $a_clean;
 
 1101                return $this->clean_frames;
 
 1106                $this->user_comments = $a_comm;
 
 1111                $this->public_access_mode = $a_mode;
 
 1116                return $this->user_comments;
 
 1121                $this->header_page = $a_pg;
 
 1126                return $this->header_page;
 
 1131                $this->footer_page = $a_pg;
 
 1136                return $this->footer_page;
 
 1146                $q = 
"SELECT * FROM content_object WHERE id = ".
 
 1150                $this->
setLayout($lm_rec[
"default_layout"]);
 
 1180                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1199                $q = 
"UPDATE content_object SET ".
 
 1200                        " default_layout = ".$ilDB->quote($this->
getLayout(), 
"text").
", ".
 
 1201                        " stylesheet = ".$ilDB->quote($this->
getStyleSheetId(), 
"integer").
",".
 
 1202                        " page_header = ".$ilDB->quote($this->
getPageHeader(), 
"text").
",".
 
 1203                        " toc_mode = ".$ilDB->quote($this->
getTOCMode(), 
"text").
",".
 
 1218                        " header_page = ".$ilDB->quote($this->
getHeaderPage(), 
"integer").
",".
 
 1219                        " footer_page = ".$ilDB->quote($this->
getFooterPage(), 
"integer").
",".
 
 1221                        " layout_per_page = ".$ilDB->quote($this->
getLayoutPerPage(), 
"integer").
", ".
 
 1222                        " rating = ".$ilDB->quote($this->
hasRating(), 
"integer").
", ".
 
 1223                        " rating_pages = ".$ilDB->quote($this->
hasRatingPages(), 
"integer").
", ".
 
 1226                        " store_tries = ".$ilDB->quote($this->
getStoreTries(), 
"integer").
", ".
 
 1228                        " for_translation = ".$ilDB->quote((
int) $this->
getForTranslation(), 
"integer").
" ".
 
 1229                        " WHERE id = ".$ilDB->quote($this->
getId(), 
"integer");
 
 1230                $ilDB->manipulate($q);
 
 1233                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1244                $q = 
"INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->
getId(), 
"integer").
")";
 
 1245                $ilDB->manipulate($q);
 
 1248                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
 1263                $q = 
"SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, 
"integer");
 
 1277                $dir = opendir(
"./Modules/LearningModule/layouts/lm");
 
 1281                while(
$file = readdir($dir))
 
 1286                                if (@is_dir(
"./Modules/LearningModule/layouts/lm/".
$file))
 
 1296                        'toc2win' => 
'toc2win',
 
 1297                        'toc2windyn' => 
'toc2windyn',
 
 1298                        '1window' => 
'1window',
 
 1299                        '2window' => 
'2window',
 
 1300                        '3window' => 
'3window',
 
 1301                        'presentation' => 
'presentation',
 
 1302                        'fullscreen' => 
'fullscreen' 
 1305                foreach ($layouts as 
$l)
 
 1324                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1330                        foreach (
$path as $node)
 
 1332                                if ($node[
"type"] == 
"st")
 
 1351                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1359                        foreach (
$path as $node)
 
 1361                                if ($node[
"type"] == 
"st")
 
 1365                                        foreach ($tconds as $tcond)
 
 1386                $lm_tree->setTableNames(
'lm_tree',
'lm_data');
 
 1394                        foreach (
$path as $node)
 
 1396                                if ($node[
"type"] == 
"st")
 
 1400                                        foreach ($tconds as $tcond)
 
 1405                                                        return $node[
"child"];
 
 1425        function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
 
 1465                if ($a_node_id==
$_GET[
"ref_id"])
 
 1467                        $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
 
 1468                        $parent_type = $parent_obj->getType();
 
 1469                        if($parent_type == $this->
getType())
 
 1471                                $a_node_id = (int) $tree->getParentId($a_node_id);
 
 1475                parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
 
 1484                $tree = 
new ilTree($a_cont_obj_id);
 
 1485                $tree->setTableNames(
'lm_tree',
'lm_data');
 
 1486                $tree->setTreeTablePK(
"lm_id");
 
 1487                if ($tree->isInTree($a_page_id))
 
 1489                        $succ = $tree->fetchSuccessorNode($a_page_id, 
"pg");
 
 1502                $tree->setTableNames(
'lm_tree',
'lm_data');
 
 1503                $tree->setTreeTablePK(
"lm_id");
 
 1505                $tree->checkTreeChilds();
 
 1521                $set = 
$ilDB->query(
"SELECT DISTINCT l1.lm_id".
 
 1523                        " JOIN lm_tree l2 ON ( l1.child = l2.parent".
 
 1524                        " AND l1.lm_id = l2.lm_id )".
 
 1525                        " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
 
 1526                        " WHERE (l2.lft < l1.lft".
 
 1527                        " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
 
 1528                        " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer").
 
 1529                        " ORDER BY lm_data.create_date DESC" 
 1531                if ($rec = 
$ilDB->fetchAssoc($set))
 
 1537                $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
 
 1538                foreach ($nodes as $node)
 
 1540                        $q = 
"SELECT * FROM lm_data WHERE obj_id = ".
 
 1541                                $ilDB->quote($node[
"child"], 
"integer");
 
 1542                        $obj_set = 
$ilDB->query($q);
 
 1543                        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
 1546                                $node_data = $tree->getNodeData($node[
"child"]);
 
 1547                                $tree->deleteTree($node_data);
 
 1552                $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
 
 1553                foreach ($nodes as $node)
 
 1555                        $q = 
"SELECT * FROM lm_data WHERE obj_id = ".
 
 1556                                $ilDB->quote($node[
"parent"], 
"integer");
 
 1557                        $obj_set = 
$ilDB->query($q);
 
 1558                        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
 1559                        if ($obj_rec[
"type"] == 
"pg")
 
 1561                                $node_data = $tree->getNodeData($node[
"child"]);
 
 1562                                if ($tree->isInTree($node[
"child"]))
 
 1564                                        $tree->deleteTree($node_data);
 
 1571                $set = 
$ilDB->query(
"SELECT DISTINCT l1.lm_id".
 
 1573                                " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
 
 1574                                " JOIN lm_data ON (l1.child = lm_data.obj_id)".
 
 1575                                " WHERE l1.child <> 1".
 
 1576                                " AND l1.lm_id <> lm_data.lm_id".
 
 1577                                " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer"));
 
 1578                if ($rec = 
$ilDB->fetchAssoc($set))
 
 1580                        $set = 
$ilDB->query(
"SELECT DISTINCT l1.child ".
 
 1582                                " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
 
 1583                                " JOIN lm_data ON (l1.child = lm_data.obj_id)".
 
 1584                                " WHERE l1.child <> 1".
 
 1585                                " AND l1.lm_id <> lm_data.lm_id".
 
 1586                                " AND l1.lm_id = ".
$ilDB->quote($this->getId(), 
"integer"));
 
 1587                        include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
 
 1588                        while ($rec = 
$ilDB->fetchAssoc($set))
 
 1592                                if (is_object($cobj))
 
 1594                                        if ($cobj->getType() == 
"pg")
 
 1597                                                $pg_copy = $cobj->copy($this);
 
 1600                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1601                                                        " child = ".
$ilDB->quote($pg_copy->getId(), 
"integer").
 
 1602                                                        " WHERE child = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1603                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1606                                        else if ($cobj->getType() == 
"st")
 
 1609                                                $st_copy = $cobj->copy($this);
 
 1612                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1613                                                        " child = ".
$ilDB->quote($st_copy->getId(), 
"integer").
 
 1614                                                        " WHERE child = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1615                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1619                                                $ilDB->manipulate(
"UPDATE lm_tree SET ".
 
 1620                                                        " parent = ".
$ilDB->quote($st_copy->getId(), 
"integer").
 
 1621                                                        " WHERE parent = ".$ilDB->quote($cobj->getId(), 
"integer").
 
 1622                                                        " AND lm_id = ".$ilDB->quote($this->getId(), 
"integer")
 
 1637        function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 
 1645                                $attrs[
"Type"] = 
"LearningModule";
 
 1649                                $attrs[
"Type"] = 
"LibObject";
 
 1652                $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
 
 1659                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Structure Objects");
 
 1660                $ilBench->start(
"ContentObjectExport", 
"exportStructureObjects");
 
 1662                $ilBench->stop(
"ContentObjectExport", 
"exportStructureObjects");
 
 1663                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Structure Objects");
 
 1666                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
 
 1667                $ilBench->start(
"ContentObjectExport", 
"exportPageObjects");
 
 1669                $ilBench->stop(
"ContentObjectExport", 
"exportPageObjects");
 
 1670                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
 
 1673                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
 
 1674                $ilBench->start(
"ContentObjectExport", 
"exportMediaObjects");
 
 1676                $ilBench->stop(
"ContentObjectExport", 
"exportMediaObjects");
 
 1677                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
 
 1680                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export File Items");
 
 1681                $ilBench->start(
"ContentObjectExport", 
"exportFileItems");
 
 1683                $ilBench->stop(
"ContentObjectExport", 
"exportFileItems");
 
 1684                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
 
 1687                if (count($this->q_ids) > 0)
 
 1689                        $qti_file = fopen($a_target_dir.
"/qti.xml", 
"w");
 
 1690                        include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
 
 1692                        fwrite($qti_file, $pool->toXML($this->q_ids));
 
 1698                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Properties");
 
 1700                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Properties");
 
 1702                $a_xml_writer->xmlEndTag(
"ContentObject");
 
 1713                include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
 
 1715                $md2xml->setExportMode(
true);
 
 1716                $md2xml->startExport();
 
 1717                $a_xml_writer->appendXML($md2xml->getXML());
 
 1728                include_once 
'./Modules/LearningModule/classes/class.ilStructureObject.php';
 
 1730                $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
 
 1731                foreach ($childs as $child)
 
 1733                        if($child[
"type"] != 
"st")
 
 1739                        $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
 
 1740                        unset($structure_obj);
 
 1755                include_once 
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
 
 1756                include_once 
"./Modules/LearningModule/classes/class.ilLMPage.php";
 
 1759                foreach ($pages as $page)
 
 1763                                $expLog->write(date(
"[y-m-d H:i:s] ").
"Page Object ".$page[
"obj_id"]);
 
 1767                                $page_obj->exportXML($a_xml_writer, 
"normal", $a_inst);
 
 1770                                $mob_ids = $page_obj->getMediaObjectIDs();
 
 1771                                foreach($mob_ids as $mob_id)
 
 1773                                        $this->mob_ids[$mob_id] = $mob_id;
 
 1777                                $file_ids = $page_obj->getFileItemIds();
 
 1778                                foreach($file_ids as $file_id)
 
 1780                                        $this->file_ids[$file_id] = $file_id;
 
 1784                                $q_ids = $page_obj->getQuestionIds();
 
 1785                                foreach($q_ids as $q_id)
 
 1787                                        $this->q_ids[$q_id] = $q_id;
 
 1803                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1805                $linked_mobs = array();
 
 1808                foreach ($this->mob_ids as $mob_id)
 
 1812                                $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
 
 1814                                $media_obj->exportXML($a_xml_writer, $a_inst);
 
 1815                                $media_obj->exportFiles($a_target_dir);
 
 1817                                $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
 
 1818                                $linked_mobs = array_merge($linked_mobs, $lmobs);
 
 1825                foreach ($linked_mobs as $mob_id)
 
 1829                                $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
 
 1831                                $media_obj->exportXML($a_xml_writer, $a_inst);
 
 1832                                $media_obj->exportFiles($a_target_dir);
 
 1845                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 1847                foreach ($this->file_ids as $file_id)
 
 1849                        $expLog->write(date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
 
 1850                        $file_obj = 
new ilObjFile($file_id, 
false);
 
 1851                        $file_obj->export($a_target_dir);
 
 1863                $a_xml_writer->xmlStartTag(
"Properties", $attrs);
 
 1866                $attrs = array(
"Name" => 
"Layout", 
"Value" => $this->
getLayout());
 
 1867                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1870                $attrs = array(
"Name" => 
"PageHeader", 
"Value" => $this->
getPageHeader());
 
 1871                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1874                $attrs = array(
"Name" => 
"TOCMode", 
"Value" => $this->
getTOCMode());
 
 1875                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1878                $attrs = array(
"Name" => 
"ActiveLMMenu", 
"Value" =>
 
 1880                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1883                $attrs = array(
"Name" => 
"ActiveNumbering", 
"Value" =>
 
 1885                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1888                $attrs = array(
"Name" => 
"ActiveTOC", 
"Value" =>
 
 1890                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1893                $attrs = array(
"Name" => 
"ActivePrintView", 
"Value" =>
 
 1895                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1901                $attrs = array(
"Name" => 
"CleanFrames", 
"Value" =>
 
 1903                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1906                $attrs = array(
"Name" => 
"PublicNotes", 
"Value" =>
 
 1908                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1911                $attrs = array(
"Name" => 
"HistoryUserComments", 
"Value" =>
 
 1913                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1916                $attrs = array(
"Name" => 
"Rating", 
"Value" =>
 
 1918                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1919                $attrs = array(
"Name" => 
"RatingPages", 
"Value" =>
 
 1921                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1926                        $attrs = array(
"Name" => 
"HeaderPage", 
"Value" =>
 
 1927                                "il_".IL_INST_ID.
"_pg_".$this->getHeaderPage());
 
 1928                        $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1934                        $attrs = array(
"Name" => 
"FooterPage", 
"Value" =>
 
 1935                                "il_".IL_INST_ID.
"_pg_".$this->getFooterPage());
 
 1936                        $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1940                $attrs = array(
"Name" => 
"LayoutPerPage", 
"Value" =>
 
 1942                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1945                $attrs = array(
"Name" => 
"ProgressIcons", 
"Value" =>
 
 1947                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1950                $attrs = array(
"Name" => 
"StoreTries", 
"Value" =>
 
 1952                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1955                $attrs = array(
"Name" => 
"RestrictForwardNavigation", 
"Value" =>
 
 1957                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1960                $attrs = array(
"Name" => 
"DisableDefaultFeedback", 
"Value" =>
 
 1962                $a_xml_writer->xmlElement(
"Property", $attrs);
 
 1964                $a_xml_writer->xmlEndTag(
"Properties");
 
 1974                $types = array(
"xml", 
"html", 
"scorm");
 
 1976                foreach ($types as 
$type)
 
 1980                        if (!@is_dir($dir) or
 
 1981                                !is_writeable($dir))
 
 1992                        while ($entry = $cdir->read())
 
 1994                                if ($entry != 
"." and
 
 1996                                        substr($entry, -4) == 
".zip" and
 
 1997                                        ereg(
"^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
 
 1999                                        $file[$entry.$type] = array(
"type" => 
$type, 
"file" => $entry,
 
 2000                                                "size" => filesize($dir.
"/".$entry));
 
 2022                $this->public_export_file[$a_type] = $a_file;
 
 2034                return $this->public_export_file[$a_type];
 
 2043                if (!@is_dir($dir) or
 
 2044                        !is_writeable($dir))
 
 2056                while ($entry = $dir->read())
 
 2058                        if ($entry != 
"." and
 
 2060                                substr($entry, -4) == 
".pdf" and
 
 2061                                ereg(
"^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
 
 2090                include(
"./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
 
 2092                $man_builder->buildManifest();
 
 2093                $man_builder->dump($a_target_dir);
 
 2096                copy(
"Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir.
"/adlcp_rootv1p2.xsd");
 
 2097                copy(
"Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir.
"/imscp_rootv1p1p2.xsd");
 
 2098                copy(
"Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir.
"/imsmd_rootv1p2p1.xsd");
 
 2099                copy(
"Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir.
"/ims_xml.xsd");
 
 2103                $zip_file = $a_target_dir.
"/".$date.
"__".IL_INST_ID.
"__".
 
 2107                        $a_target_dir.
"/imsmanifest.xml",
 
 2108                        $a_target_dir.
"/adlcp_rootv1p2.xsd",
 
 2109                        $a_target_dir.
"/imscp_rootv1p1p2.xsd",
 
 2110                        $a_target_dir.
"/ims_xml.xsd",
 
 2111                        $a_target_dir.
"/imsmd_rootv1p2p1.xsd")
 
 2117                rename($zip_file, $dest_file);
 
 2126        function exportHTML($a_target_dir, 
$log, $a_zip_file = 
true, $a_export_format = 
"html", $a_lang = 
"")
 
 2130                $user_lang = 
$ilUser->getLanguage();
 
 2135                $mob_dir = $a_target_dir.
"/mobs";
 
 2137                $file_dir = $a_target_dir.
"/files";
 
 2139                $teximg_dir = $a_target_dir.
"/teximg";
 
 2141                $style_dir = $a_target_dir.
"/style";
 
 2143                $style_img_dir = $a_target_dir.
"/style/images";
 
 2145                $content_style_dir = $a_target_dir.
"/content_style";
 
 2147                $content_style_img_dir = $a_target_dir.
"/content_style/images";
 
 2153                $style_name = 
$ilUser->prefs[
"style"].
".css";
 
 2154                copy($location_stylesheet, $style_dir.
"/".$style_name);
 
 2155                $fh = fopen($location_stylesheet, 
"r");
 
 2156                $css = fread($fh, filesize($location_stylesheet));
 
 2157                preg_match_all(
"/url\(([^\)]*)\)/",$css,$files);
 
 2158                foreach (array_unique($files[1]) as $fileref)
 
 2160                        $css_fileref = str_replace(array(
"'", 
'"'), 
"", $fileref);
 
 2161                        $fileref = dirname($location_stylesheet).
"/".$css_fileref;
 
 2162                        if (is_file($fileref))
 
 2167                                copy($fileref, $style_dir.
"/".$css_fileref);
 
 2174                $ilBench->start(
"ExportHTML", 
"exportContentStyle");
 
 2177                        $cont_stylesheet = 
"./Services/COPage/css/content.css";
 
 2179                        $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
 
 2180                        preg_match_all(
"/url\(([^\)]*)\)/",$css,$files);
 
 2181                        foreach (array_unique($files[1]) as $fileref)
 
 2183                                if (is_file(str_replace(
"..", 
".", $fileref)))
 
 2185                                        copy(str_replace(
"..", 
".", $fileref), $content_style_img_dir.
"/".basename($fileref));
 
 2187                                $css = str_replace($fileref, 
"images/".basename($fileref),$css);
 
 2189                        fwrite(fopen($content_style_dir.
"/content.css",
'w'),$css);
 
 2194                        $style->writeCSSFile($content_style_dir.
"/content.css", 
"images");
 
 2195                        $style->copyImagesToDir($content_style_img_dir);
 
 2197                $ilBench->stop(
"ExportHTML", 
"exportContentStyle");
 
 2201                copy($syn_stylesheet, $a_target_dir.
"/syntaxhighlight.css");
 
 2204                include_once(
"./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
 
 2205                $_GET[
"cmd"] = 
"nop";
 
 2206                $get_transl = 
$_GET[
"transl"];
 
 2207                $_GET[
"transl"] = 
"";
 
 2209                $lm_gui->setOfflineMode(
true, ($a_lang == 
"all"));
 
 2210                $lm_gui->setOfflineDirectory($a_target_dir);
 
 2211                $lm_gui->setExportFormat($a_export_format);
 
 2215                if ($a_lang != 
"all")
 
 2217                        $langs = array($a_lang);
 
 2221                        $ot_langs = $ot->getLanguages();
 
 2222                        foreach ($ot_langs as $otl)
 
 2224                                $langs[] = $otl[
"lang_code"];
 
 2229                $this->offline_mobs = array();
 
 2230                $this->offline_int_links = array();
 
 2231                $this->offline_files = array();
 
 2234                foreach ($langs as 
$lang)
 
 2244                                $ilUser->setLanguage($user_lang);
 
 2245                                $ilUser->setCurrentLanguage($user_lang);
 
 2250                                if (
$lang == $ot->getMasterLanguage())
 
 2256                                        $lm_gui->lang = 
$lang;
 
 2261                        $ilBench->start(
"ExportHTML", 
"exportHTMLPages");
 
 2263                        $this->
exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang == 
"all"));
 
 2264                        $ilBench->stop(
"ExportHTML", 
"exportHTMLPages");
 
 2268                $ilBench->start(
"ExportHTML", 
"exportHTMLGlossaryTerms");
 
 2270                $ilBench->stop(
"ExportHTML", 
"exportHTMLGlossaryTerms");
 
 2273                $ilBench->start(
"ExportHTML", 
"exportHTMLMediaObjects");
 
 2274                $linked_mobs = array();
 
 2275                foreach ($this->offline_mobs as $mob)
 
 2279                                $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob, 
"_blank", $linked_mobs);
 
 2282                $linked_mobs2 = array();                                
 
 2283                foreach ($linked_mobs as $mob)
 
 2287                                $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob, 
"_blank", $linked_mobs2);
 
 2290                $_GET[
"obj_type"]  = 
"MediaObject";
 
 2291                $_GET[
"obj_id"]  = $a_mob_id;
 
 2293                $ilBench->stop(
"ExportHTML", 
"exportHTMLMediaObjects");
 
 2296                $ilBench->start(
"ExportHTML", 
"exportHTMLFileObjects");
 
 2297                foreach ($this->offline_files as 
$file)
 
 2301                $ilBench->stop(
"ExportHTML", 
"exportHTMLFileObjects");
 
 2304                if (count($this->q_ids) > 0)
 
 2306                        foreach ($this->q_ids as $q_id)
 
 2310                                        $a_target_dir.
"/assessment/0/".$q_id.
"/images");
 
 2315                $ilBench->start(
"ExportHTML", 
"exportHTMLTOC");
 
 2316                $ilLocator->clearItems();
 
 2319                        $tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
 2321                        $content =& $lm_gui->showTableOfContents();
 
 2322                        $file = $a_target_dir.
"/table_of_contents.html";
 
 2325                        if (!($fp = @fopen(
$file,
"w+")))
 
 2327                                die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2328                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2331                        fwrite($fp, $content);
 
 2334                $ilBench->stop(
"ExportHTML", 
"exportHTMLTOC");
 
 2337                $ilBench->start(
"ExportHTML", 
"exportHTMLImages");
 
 2338                $image_dir = $a_target_dir.
"/images";
 
 2342                        $image_dir.
"/enlarge.svg");
 
 2344                        $image_dir.
"/browser/plus.png");
 
 2346                        $image_dir.
"/browser/minus.png");
 
 2348                        $image_dir.
"/browser/blank.png");
 
 2350                        $image_dir.
"/spacer.png");
 
 2352                        $image_dir.
"/icon_st.svg");
 
 2354                        $image_dir.
"/icon_pg.svg");
 
 2356                        $image_dir.
"/icon_lm.svg");
 
 2358                        $image_dir.
"/nav_arr_L.png");
 
 2360                        $image_dir.
"/nav_arr_R.png");
 
 2362                $ilBench->stop(
"ExportHTML", 
"exportHTMLImages");
 
 2365                $services_dir = $a_target_dir.
"/Services";
 
 2367                $media_service_dir = $services_dir.
"/MediaObjects";
 
 2369                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
 2372                $mp3_dir = $media_service_dir.
"/flash_mp3_player";
 
 2377                include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 2385                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 2386                foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
 
 2388                        if ($f[
"source"] != 
"")
 
 2390                                copy($f[
"source"], $f[
"target"]);
 
 2396                $tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
 
 2397                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2401                        $ilUser->setLanguage($user_lang);
 
 2402                        $ilUser->setCurrentLanguage($user_lang);
 
 2420                        $zip_file = $zip_target_dir.
"/".$date.
"__".IL_INST_ID.
"__".
 
 2436                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 2437                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
 2438                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
 2439                include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 2442                                "target" => $a_target_dir.
'/js/yahoo/yahoo-min.js',
 
 2445                                "target" => $a_target_dir.
'/js/yahoo/yahoo-dom-event.js',
 
 2448                                "target" => $a_target_dir.
'/js/yahoo/animation-min.js',
 
 2450                        array(
"source" => 
'./Services/JavaScript/js/Basic.js',
 
 2451                                "target" => $a_target_dir.
'/js/Basic.js',
 
 2453                        array(
"source" => 
'./Services/Accordion/js/accordion.js',
 
 2454                                "target" => $a_target_dir.
'/js/accordion.js',
 
 2456                        array(
"source" => 
'./Services/Accordion/css/accordion.css',
 
 2457                                "target" => $a_target_dir.
'/css/accordion.css',
 
 2460                                "target" => $a_target_dir.
'/js/jquery.js',
 
 2463                                "target" => $a_target_dir.
'/js/maphilight.js',
 
 2466                                "target" => $a_target_dir.
'/js/jquery-ui-min.js',
 
 2468                        array(
"source" => 
'./Services/COPage/js/ilCOPagePres.js',
 
 2469                                "target" => $a_target_dir.
'/js/ilCOPagePres.js',
 
 2471                        array(
"source" => 
'./Modules/Scorm2004/scripts/questions/pure.js',
 
 2472                                "target" => $a_target_dir.
'/js/pure.js',
 
 2474                        array(
"source" => 
'./Modules/Scorm2004/scripts/questions/question_handling.js',
 
 2475                                "target" => $a_target_dir.
'/js/question_handling.js',
 
 2477                        array(
"source" => 
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
 
 2478                                "target" => $a_target_dir.
'/js/ilMatchingQuestion.js',
 
 2480                        array(
"source" => 
'./Modules/Scorm2004/templates/default/question_handling.css',
 
 2481                                "target" => $a_target_dir.
'/css/question_handling.css',
 
 2483                        array(
"source" => 
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
 
 2484                                "target" => $a_target_dir.
'/css/test_javascript.css',
 
 2498                        array(
"source" => 
'./Modules/LearningModule/js/LearningModule.js',
 
 2499                                "target" => $a_target_dir.
'/js/LearningModule.js',
 
 2507                        $scripts[] = array(
"source" => 
"",
 
 2513                include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
 
 2516                        if (is_int(strpos($p, 
"ExtLink")))
 
 2518                                $scripts[] = array(
"source" => $p,
 
 2519                                        "target" => $a_target_dir.
'/js/ilExtLink.js',
 
 2522                        if (is_int(strpos($p, 
"linkify")))
 
 2524                                $scripts[] = array(
"source" => $p,
 
 2525                                        "target" => $a_target_dir.
'/js/linkify.js',
 
 2539                $file_dir = $a_target_dir.
"/files/file_".$a_file_id;
 
 2541                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 2542                $file_obj = 
new ilObjFile($a_file_id, 
false);
 
 2543                $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
 
 2544                if (!is_file($source_file))
 
 2546                        $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
 
 2548                if (is_file($source_file))
 
 2550                        copy($source_file, $file_dir.
"/".$file_obj->getFileName());
 
 2557        function exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
 
 2561                $mob_dir = $a_target_dir.
"/mobs";
 
 2564                if (@is_dir($source_dir))
 
 2571                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2572                $_GET[
"obj_type"]  = 
"MediaObject";
 
 2573                $_GET[
"mob_id"]  = $a_mob_id;
 
 2574                $_GET[
"frame"] = $a_frame;
 
 2576                $content =& $a_lm_gui->media();
 
 2577                $file = $a_target_dir.
"/media_".$a_mob_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(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 2592                if ($mob_obj->hasFullscreenItem())
 
 2595                        $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2596                        $_GET[
"obj_type"]  = 
"";
 
 2597                        $_GET[
"frame"]  = 
"";
 
 2598                        $_GET[
"mob_id"]  = $a_mob_id;
 
 2599                        $_GET[
"cmd"] = 
"fullscreen";
 
 2600                        $content =& $a_lm_gui->fullscreen();
 
 2601                        $file = $a_target_dir.
"/fullscreen_".$a_mob_id.
".html";
 
 2604                        if (!($fp = @fopen(
$file,
"w+")))
 
 2606                                die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2607                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2610                        fwrite($fp, $content);
 
 2613                $linked_mobs = $mob_obj->getLinkedMediaObjects();
 
 2614                foreach ($linked_mobs as 
$id)
 
 2619                $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
 
 2629                foreach($this->offline_int_links as $int_link)
 
 2631                        $ilLocator->clearItems();
 
 2632                        if ($int_link[
"type"] == 
"git")
 
 2635                                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2637                                $_GET[
"obj_id"] = $int_link[
"id"];
 
 2638                                $_GET[
"frame"] = 
"_blank";
 
 2639                                $content =& $a_lm_gui->glossary();
 
 2640                                $file = $a_target_dir.
"/term_".$int_link[
"id"].
".html";
 
 2643                                if (!($fp = @fopen(
$file,
"w+")))
 
 2645                                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2646                                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2649                                fwrite($fp, $content);
 
 2653                                include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
 2655                                foreach($defs as $def)
 
 2658                                        foreach($def_mobs as $def_mob)
 
 2660                                                $this->offline_mobs[$def_mob] = $def_mob;
 
 2661                                                include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 2668                                        $this->offline_files = array_merge($this->offline_files, $def_files);
 
 2679        function exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang = 
"", $a_all_languages = 
false)
 
 2687                $this->first_page_id = $first_page[
"child"];
 
 2691                $int_links = array();
 
 2692                $this->offline_files = array();
 
 2694                include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
 2695                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 2699                $exp_id_map = array();
 
 2701                if (
$lm_set->get(
"html_export_ids"))
 
 2703                        foreach ($pages as $page)
 
 2706                                if (trim($exp_id) != 
"")
 
 2708                                        $exp_id_map[$page[
"obj_id"]] = trim($exp_id);
 
 2719                foreach ($pages as $page)
 
 2723                                $ilLocator->clearItems();
 
 2724                                $ilBench->start(
"ExportHTML", 
"exportHTMLPage");
 
 2725                                $ilBench->start(
"ExportHTML", 
"exportPageHTML");
 
 2727                                        "", $exp_id_map, $a_lang, $a_all_languages);
 
 2728                                $ilBench->stop(
"ExportHTML", 
"exportPageHTML");
 
 2732                                foreach ($pcs as $pc)
 
 2734                                        if ($pc[
"type"] == 
"incl")
 
 2737                                                foreach($incl_mobs as $incl_mob)
 
 2739                                                        $mobs[$incl_mob] = $incl_mob;
 
 2740                                                        include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 2749                                foreach($pg_mobs as $pg_mob)
 
 2751                                        $mobs[$pg_mob] = $pg_mob;
 
 2752                                        include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 2759                                $int_links = array_merge($int_links, $pg_links);
 
 2762                                include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 2764                                $this->offline_files = array_merge($this->offline_files, $pg_files);
 
 2767                                include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
 
 2769                                foreach($q_ids as $q_id)
 
 2771                                        $this->q_ids[$q_id] = $q_id;
 
 2774                                $ilBench->stop(
"ExportHTML", 
"exportHTMLPage");
 
 2777                foreach (
$mobs as $m)
 
 2779                        $this->offline_mobs[$m] = $m;
 
 2781                foreach ($int_links as $k => $v)
 
 2783                        $this->offline_int_links[$k] = $v;
 
 2793                $a_exp_id_map = array(), $a_lang = 
"-", $a_all_languages = 
false)
 
 2798                if ($a_lang != 
"-" && $a_lang != 
"" && $a_all_languages)
 
 2800                        $lang_suffix = 
"_".$a_lang;
 
 2806                $tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 2808                include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
 
 2811                $_GET[
"obj_id"] = $a_lm_page_id;
 
 2812                $_GET[
"frame"] = $a_frame;
 
 2817                        if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
 
 2819                                $file = $a_target_dir.
"/lm_pg_".$a_exp_id_map[$a_lm_page_id].$lang_suffix.
".html";
 
 2823                                $file = $a_target_dir.
"/lm_pg_".$a_lm_page_id.$lang_suffix.
".html";
 
 2828                        if ($a_frame != 
"toc")
 
 2830                                $file = $a_target_dir.
"/frame_".$a_lm_page_id.
"_".$a_frame.$lang_suffix.
".html";
 
 2834                                $file = $a_target_dir.
"/frame_".$a_frame.$lang_suffix.
".html";
 
 2839                if (@is_file(
$file))
 
 2844                $content =& $a_lm_gui->layout(
"main.xml", 
false);
 
 2847                if (!($fp = @fopen(
$file,
"w+")))
 
 2849                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 2850                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 2857                fwrite($fp, $content);
 
 2862                if ($this->first_page_id == $a_lm_page_id && $a_frame == 
"")
 
 2864                        copy(
$file, $a_target_dir.
"/index".$lang_suffix.
".html");
 
 2868                $frameset = $a_lm_gui->getCurrentFrameSet();
 
 2870                foreach ($frameset as $frame)
 
 2872                        $this->
exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
 
 2889                $attrs[
"xmlns:fo"] = 
"http://www.w3.org/1999/XSL/Format";
 
 2890                $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
 
 2894                $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
 
 2898                $attrs[
"master-name"] = 
"DinA4";
 
 2899                $attrs[
"page-height"] = 
"29.7cm";
 
 2900                $attrs[
"page-width"] = 
"21cm";
 
 2901                $attrs[
"margin-top"] = 
"4cm";
 
 2902                $attrs[
"margin-bottom"] = 
"1cm";
 
 2903                $attrs[
"margin-left"] = 
"2.8cm";
 
 2904                $attrs[
"margin-right"] = 
"7.3cm";
 
 2905                $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
 
 2909                $attrs[
"margin-top"] = 
"0cm";
 
 2910                $attrs[
"margin-bottom"] = 
"1.25cm";
 
 2911                $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
 
 2915                $attrs[
"extent"] = 
"1cm";
 
 2916                $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
 
 2920                $attrs[
"extent"] = 
"1cm";
 
 2921                $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
 
 2924                $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
 
 2927                $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
 
 2931                $attrs[
"master-reference"] = 
"DinA4";
 
 2932                $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
 
 2936                $attrs[
"flow-name"] = 
"xsl-region-body";
 
 2937                $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
 
 2942                $ilBench->start(
"ContentObjectExport", 
"exportFOStructureObjects");
 
 2944                $ilBench->stop(
"ContentObjectExport", 
"exportFOStructureObjects");
 
 2948                $a_xml_writer->xmlEndTag(
"fo:flow");
 
 2951                $a_xml_writer->xmlEndTag(
"fo:page-sequence");
 
 2954                $a_xml_writer->xmlEndTag(
"fo:root");
 
 2965                $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
 
 2966                foreach ($childs as $child)
 
 2968                        if($child[
"type"] != 
"st")
 
 2974                        $structure_obj->exportFO($a_xml_writer, $expLog);
 
 2975                        unset($structure_obj);
 
 2981                include_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2985                $export_file = $cont_exp->buildExportFile();
 
 2986                return $export_file;
 
 3000                $lmtree->setTableNames(
'lm_tree',
'lm_data');
 
 3001                $lmtree->setTreeTablePK(
"lm_id");
 
 3004                $source_obj->setLMId($this->
getId());
 
 3009                        $target_obj->setLMId($this->
getId());
 
 3010                        $target_parent = $lmtree->getParentId(
$target_id);
 
 3014                if ($source_obj->getType() == 
"pg")
 
 3017                        if ($lmtree->isInTree($source_obj->getId()))
 
 3019                                $node_data = $lmtree->getNodeData($source_obj->getId());
 
 3022                                if ($movecopy == 
"move")
 
 3024                                        $parent_id = $lmtree->getParentId($source_obj->getId());
 
 3025                                        $lmtree->deleteTree($node_data);
 
 3028                                        require_once(
"./Services/History/classes/class.ilHistory.php");
 
 3034                                                $this->getType().
":st");
 
 3039                                        $new_page =& $source_obj->copy();
 
 3040                                        $source_id = $new_page->getId();
 
 3041                                        $source_obj =& $new_page;
 
 3045                                if(!$lmtree->isInTree($source_obj->getId()))
 
 3052                                        else if ($as_subitem)           
 
 3056                                                $pg_childs =& $lmtree->getChildsByType($parent, 
"pg");
 
 3057                                                if (count($pg_childs) != 0)
 
 3059                                                        $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
 
 3065                                                $parent = $target_parent;
 
 3069                                        $lmtree->insertNode($source_obj->getId(),
 
 3070                                                $parent, $target_pos);
 
 3073                                        if ($movecopy == 
"move")
 
 3076                                                include_once(
"./Services/History/classes/class.ilHistory.php");
 
 3082                                                        $this->getType().
":st");
 
 3090                if ($source_obj->getType() == 
"st")
 
 3093                        $source_node = $lmtree->getNodeData($source_id);
 
 3094                        $subnodes = $lmtree->getSubtree($source_node);
 
 3097                        foreach ($subnodes as $subnode)
 
 3112                                $pg_childs =& $lmtree->getChildsByType($target_parent, 
"pg");
 
 3113                                if (count($pg_childs) != 0)
 
 3115                                        $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
 
 3118                        else if ($as_subitem)           
 
 3122                                $childs =& $lmtree->getChilds($target_parent);
 
 3123                                if (count($childs) != 0)
 
 3125                                        $target_pos = $childs[count($childs) - 1][
"obj_id"];
 
 3150                        if ($movecopy == 
"move")
 
 3152                                $lmtree->deleteTree($source_node);
 
 3157                                $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
 
 3160                        if (!$lmtree->isInTree($source_id))
 
 3162                                $lmtree->insertNode($source_id, $target_parent, $target_pos);
 
 3165                                if ($movecopy == 
"move")
 
 3167                                        foreach ($subnodes as $node)
 
 3169                                                if($node[
"obj_id"] != $source_id)
 
 3171                                                        $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
 
 3189                include_once 
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
 
 3190                include_once 
"./Modules/LearningModule/classes/class.ilLMPage.php";
 
 3195                foreach ($pages as $page)
 
 3199                                $cpage = 
new ilLMPage($page[
"obj_id"]);
 
 3201                                $error = @$cpage->validateDom();
 
 3205                                        $this->lng->loadLanguageModule(
"content");
 
 3209                                        $mess.= $this->lng->txt(
"obj_pg").
": ".
$title;
 
 3210                                        $mess.= 
'<div class="small">';
 
 3211                                        foreach ($error as $e)
 
 3213                                                $err_mess = implode($e, 
" - ");
 
 3214                                                if (!is_int(strpos($err_mess, 
":0:")))
 
 3216                                                        $mess.= htmlentities($err_mess).
"<br />";
 
 3235                $a_import_into_help_module = 0)
 
 3243                $file = pathinfo($a_filename);
 
 3247                        $a_filename, $full_path);
 
 3252                $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
 
 3277                $this->log->debug(
"import from directory ".$a_directory);
 
 3280                $subdir = basename($a_directory);
 
 3281                $xml_file = $a_directory.
"/".$subdir.
".xml";
 
 3284                if (!is_dir($a_directory))
 
 3286                        $this->log->error(sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir));
 
 3287                        return sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir);
 
 3291                if (!is_file($xml_file))
 
 3293                        $this->log->error(sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"));
 
 3294                        return sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml");
 
 3298                $this->log->debug(
"import qti");
 
 3299                $qti_file = $a_directory.
"/qti.xml";
 
 3301                if (is_file($qti_file))
 
 3303                        include_once 
"./Services/QTI/classes/class.ilQTIParser.php";
 
 3304                        include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 3307                        $result = $qtiParser->startParsing ();
 
 3308                        $founditems = & $qtiParser->getFoundItems ();
 
 3310                        if (count($founditems) > 0)
 
 3313                                $qtiParser->setTestObject($testObj);
 
 3314                                $result = $qtiParser->startParsing();
 
 3315                                $qtis = array_merge($qtis, $qtiParser->getImportMapping());
 
 3319                $this->log->debug(
"get ilContObjParser");
 
 3320                include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
 
 3322                $contParser = 
new ilContObjParser($this, $xml_file, $subdir, $a_directory);
 
 3324                $contParser->setImportMapping($a_mapping);
 
 3325                $contParser->setQuestionMapping($qtis);
 
 3326                $contParser->startParsing();
 
 3331                $style_file = $a_directory.
"/style.xml";
 
 3332                $style_zip_file = $a_directory.
"/style.zip";
 
 3333                if (is_file($style_zip_file))   
 
 3335                        require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
 3337                        $style->import($style_zip_file);
 
 3340                else if (is_file($style_file))  
 
 3342                        require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
 3344                        $style->import($style_file);
 
 3357                        include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
 3377                $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
 
 3384                if(!$cp_options->isRootNode($this->getRefId()))
 
 3386                        $new_obj->setOnline($this->
getOnline());
 
 3392                $new_obj->setLayout($this->
getLayout());
 
 3406                $new_obj->setRating($this->
hasRating());
 
 3416                $new_obj->createLMTree();
 
 3419                include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
 3421                if ($style_id > 0 &&
 
 3425                        $new_id = $style_obj->ilClone();
 
 3426                        $new_obj->setStyleSheetId($new_id);
 
 3436                        $new_obj->setHeaderPage($new_page_header);
 
 3440                        $new_obj->setFooterPage($new_page_footer);
 
 3445                include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
 
 3447                $obj_settings->cloneSettings($new_obj->getId());
 
 3448                unset($obj_settings);
 
 3451                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
 3453                $ot->copy($new_obj->getId());
 
 3465                $parent_id = $a_target_obj->lm_tree->readRootId();
 
 3467                include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 3468                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
 3471                $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), 
"st");
 
 3472                $copied_nodes = array();
 
 3474                foreach ($chapters as $chap)
 
 3483                foreach ($pages as $p)
 
 3485                        if (!$this->lm_tree->isInTree($p[
"obj_id"]))
 
 3488                                $target_item = $item->copy($a_target_obj);
 
 3489                                $copied_nodes[$item->getId()] = $target_item->getId();
 
 3494                include_once 
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
 
 3496                foreach($copied_nodes as $old_id => $new_id)
 
 3500                                $a_target_obj->getRefId().
'_'.$new_id
 
 3506                $a_target_obj->checkTree();
 
 3508                return $copied_nodes;
 
 3523                $set = 
$ilDB->query(
"SELECT * FROM lm_glossaries ".
 
 3524                        " WHERE lm_id = ".
$ilDB->quote($a_lm_id, 
"integer")
 
 3527                while ($rec = 
$ilDB->fetchAssoc($set))
 
 3529                        $glos[] = $rec[
"glo_id"];
 
 3543                include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 3547                include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
 3551                $found_pages = array();
 
 3552                foreach ($pages as $p)
 
 3555                        $c = $pg->getXMLContent();
 
 3556                        foreach ($terms as 
$t)
 
 3558                                if (is_int(stripos($c, 
$t[
"term"])))
 
 3560                                        $found_pages[$p[
"id"]][
"terms"][] = 
$t;
 
 3561                                        if (!is_object($found_pages[$p[
"id"]][
"page"]))
 
 3563                                                $found_pages[$p[
"id"]][
"page"] = $pg;
 
 3571                include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
 3572                foreach ($found_pages as 
$id => $fp)
 
 3592                if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
 
 3605                $this->rating = (bool)$a_value;
 
 3615                $this->rating_pages = (bool)$a_value;
 
 3626                parent::MDUpdateListener($a_element);
 
 3628                include_once 
'Services/MetaData/classes/class.ilMD.php';
 
 3633                                include_once(
"./Services/Object/classes/class.ilObjectLP.php");                         
 
 3635                                if(in_array($obj_lp->getCurrentMode(), 
 
 3638                                        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");                                
 
 3647                                if(!is_object($md_gen = $md->getGeneral()))
 
 3652                                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
 3654                                if ($ot->getContentActivated())
 
 3656                                        $ot->setDefaultTitle($md_gen->getTitle());
 
 3658                                        foreach($md_gen->getDescriptionIds() as 
$id)
 
 3660                                                $md_des = $md_gen->getDescription(
$id);
 
 3661                                                $ot->setDefaultDescription($md_des->getDescription());
 
_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 _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
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.
getDefinitionList($a_term_id)
static
static _lookGlossaryTerm($term_id)
get glossary term
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null)
Get all terms for given set of glossary ids.
_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.
_getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
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.
_deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
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
getPageList($lm_id)
static
Extension of ilPageObject for learning modules.
Class ilLMPresentationGUI.
const LP_MODE_COLLECTION_TLT
_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.
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
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.
_deleteStyleAssignments($a_style_id)
delete all style references to style
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
putInTree($a_parent)
put content object in main tree
updateProperties()
Update content object properties.
setAutoGlossaries($a_val)
Set auto glossaries.
getAvailableLayouts()
get all available lm layouts
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
setForTranslation($a_val)
Set for translation.
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
_getMissingPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
gets all missing preconditions of page
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.
_lookupStyleSheetId($a_cont_obj_id)
lookup style sheet ID
_lookupOnline($a_id)
check wether content object is online
_moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
getForTranslation()
Get for translation.
_getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
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.
isActivePreventGlossaryAppendix()
_lookupContObjIdByStyleId($a_style_id)
lookup style sheet ID
static writeFooterPage($a_lm_id, $a_page_id)
Write footer page.
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)
_checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
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)
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
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.
hasSuccessorPage($a_cont_obj_id, $a_page_id)
checks if page has a successor page
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.
ilObjContentObject($a_id=0, $a_call_by_reference=true)
Constructor @access public.
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)
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 _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
_getNrLMsNoStyle()
get number of learning modules assigned no style
_getNrLMsIndividualStyles()
get number of learning modules with individual styles
setActiveDownloads($a_down)
exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export object to xml (see ilias_co.dtd)
lookupAutoGlossaries($a_lm_id)
Lookup auto glossaries.
setActivePreventGlossaryAppendix($a_print)
setLayout($a_layout)
set default page layout
setPublicAccessMode($a_mode)
getImportId()
get import id
getOfflineFiles($dir)
get offline files
getDisableDefaultFeedback()
Get disable default feedback for questions.
getPublicExportFile($a_type)
get public export file
_getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id)
get top chapter of page for that any precondition is missing
cloneObject($a_target_id, $a_copy_id=0)
Clone learning module.
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
getSyntaxStylePath()
get syntax style path
_lookupStandard($a_id)
Lookup standard flag.
static getInstance($a_obj_id)
static getInstance($a_obj_id)
Get instance.
Class ilObject Basic functions for all objects.
getType()
get object type @access public
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
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
_writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
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.
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.
getLocalMediaElementCssPath()
Get local path of jQuery file.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
getLocalMediaElementJsPath()
Get local path of jQuery file.
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.
getLocalMaphilightPath()
Get local path of maphilight file.
getLocaljQueryPath()
Get local path of jQuery file.
getLocaljQueryUIPath()
Get local path of jQuery UI file.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
redirection script todo: (a better solution should control the processing via a xml file)
if(!is_array($argv)) $options
if(strpos( $jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting