當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilObjStyleSheet::export方法代碼示例

本文整理匯總了PHP中ilObjStyleSheet::export方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObjStyleSheet::export方法的具體用法?PHP ilObjStyleSheet::export怎麽用?PHP ilObjStyleSheet::export使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilObjStyleSheet的用法示例。


在下文中一共展示了ilObjStyleSheet::export方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildExportFileXML

 /**
  * 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";
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:63,代碼來源:class.ilContObjectExport.php


注:本文中的ilObjStyleSheet::export方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。