本文整理汇总了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";
}