/**
  * Object specific configuration 
  *
  * @param int $a_obj_id object id
  */
 function configureByObjectId($a_obj_id)
 {
     if ($a_obj_id > 0) {
         include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
         $this->setDisableDefaultQuestionFeedback(ilObjLearningModule::_lookupDisableDefaultFeedback($a_obj_id));
         if (ilObjContentObject::isOnlineHelpModule($a_obj_id, true)) {
             $this->setEnableSelfAssessment(false, false);
         }
     }
 }
 /**
  * Show export IDs overview
  *
  * @param
  * @return
  */
 function showExportIDsOverview($a_validation = false)
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl;
     $this->setTabs();
     $this->setContentSubTabs("export_ids");
     if (ilObjContentObject::isOnlineHelpModule($this->object->getRefId())) {
         // toolbar
         $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
         include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
         $lm_tree = $this->object->getTree();
         $childs = $lm_tree->getChilds($lm_tree->readRootId());
         $options = array("" => $lng->txt("all"));
         foreach ($childs as $c) {
             $options[$c["child"]] = $c["title"];
         }
         $si = new ilSelectInputGUI($this->lng->txt("help_component"), "help_chap");
         $si->setOptions($options);
         $si->setValue(ilSession::get("help_chap"));
         $ilToolbar->addInputItem($si, true);
         $ilToolbar->addFormButton($lng->txt("help_filter"), "filterHelpChapters");
         include_once "./Modules/LearningModule/classes/class.ilHelpMappingTableGUI.php";
         $tbl = new ilHelpMappingTableGUI($this, "showExportIDsOverview", $a_validation, false);
     } else {
         include_once "./Modules/LearningModule/classes/class.ilExportIDTableGUI.php";
         $tbl = new ilExportIDTableGUI($this, "showExportIDsOverview", $a_validation, false);
     }
     $tpl->setContent($tbl->getHTML());
 }
 /**
  * build xml export file
  */
 function buildExportFileXML()
 {
     global $ilBench;
     $ilBench->start("ContentObjectExport", "buildExportFile");
     require_once "./Services/Xml/classes/class.ilXmlWriter.php";
     $this->xml = new ilXmlWriter();
     // set dtd definition
     $this->xml->xmlSetDtdDef("<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
     // set generated comment
     $this->xml->xmlSetGenCmt("Export of ILIAS Content Module " . $this->cont_obj->getId() . " of installation " . $this->inst . ".");
     // set xml header
     $this->xml->xmlHeader();
     // create directories
     $this->cont_obj->createExportDirectory();
     ilUtil::makeDir($this->export_dir . "/" . $this->subdir);
     ilUtil::makeDir($this->export_dir . "/" . $this->subdir . "/objects");
     // get Log File
     $expDir = $this->cont_obj->getExportDirectory();
     $expLog = new ilLog($expDir, "export.log");
     $expLog->delete();
     $expLog->setLogFormat("");
     $expLog->write(date("[y-m-d H:i:s] ") . "Start Export");
     // get xml content
     //echo "ContObjExport:".$this->inst_id.":<br>";
     $ilBench->start("ContentObjectExport", "buildExportFile_getXML");
     $this->cont_obj->exportXML($this->xml, $this->inst_id, $this->export_dir . "/" . $this->subdir, $expLog);
     $ilBench->stop("ContentObjectExport", "buildExportFile_getXML");
     // export style
     if ($this->cont_obj->getStyleSheetId() > 0) {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $style_obj = new ilObjStyleSheet($this->cont_obj->getStyleSheetId(), false);
         //$style_obj->exportXML($this->export_dir."/".$this->subdir);
         $style_obj->setExportSubDir("style");
         $style_file = $style_obj->export();
         if (is_file($style_file)) {
             copy($style_file, $this->export_dir . "/" . $this->subdir . "/style.zip");
         }
     }
     // dump xml document to screen (only for debugging reasons)
     /*
     echo "<PRE>";
     echo htmlentities($this->xml->xmlDumpMem($format));
     echo "</PRE>";
     */
     // dump xml document to file
     $this->xml->xmlDumpFile($this->export_dir . "/" . $this->subdir . "/" . $this->filename, false);
     // help export (workaround to use ref id here)
     if (ilObjContentObject::isOnlineHelpModule((int) $_GET["ref_id"])) {
         include_once "./Services/Export/classes/class.ilExport.php";
         $exp = new ilExport();
         $exp->exportEntity("help", $this->cont_obj->getId(), "4.3.0", "Services/Help", "OnlineHelp", $this->export_dir . "/" . $this->subdir);
     }
     // zip the file
     ilUtil::zip($this->export_dir . "/" . $this->subdir, $this->export_dir . "/" . $this->subdir . ".zip");
     // destroy writer object
     $this->xml->_XmlWriter;
     $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export");
     $ilBench->stop("ContentObjectExport", "buildExportFile");
     return $this->export_dir . "/" . $this->subdir . ".zip";
 }