本文整理汇总了PHP中ilObjFile::export方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjFile::export方法的具体用法?PHP ilObjFile::export怎么用?PHP ilObjFile::export使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjFile
的用法示例。
在下文中一共展示了ilObjFile::export方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportFileItems
/**
* export files of file itmes
*
*/
function exportFileItems($a_target_dir, &$expLog)
{
include_once "./Modules/File/classes/class.ilObjFile.php";
foreach ($this->file_ids as $file_id) {
$expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
$file_obj = new ilObjFile($file_id, false);
$file_obj->export($a_target_dir);
unset($file_obj);
}
}
示例2: exportFileItems
/**
* export files of file itmes
*
*/
function exportFileItems($a_target_dir, &$expLog)
{
include_once "./Modules/File/classes/class.ilObjFile.php";
if (is_array($this->file_ids)) {
foreach ($this->file_ids as $file_id) {
$expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
if (ilObject::_lookupType($file_id) == "file") {
$file_obj = new ilObjFile($file_id, false);
$file_obj->export($a_target_dir);
unset($file_obj);
} else {
$expLog->write(date("[y-m-d H:i:s] ") . "File Item not found, ID: " . $file_id);
}
}
}
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
$linked_mobs = array();
if (is_array($this->mob_ids)) {
// mobs directly embedded into pages
foreach ($this->mob_ids as $mob_id) {
if ($mob_id > 0 && ilObject::_exists($mob_id)) {
$expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportFiles($a_target_dir, $expLog);
$lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
$linked_mobs = array_merge($linked_mobs, $lmobs);
unset($media_obj);
}
}
// linked mobs (in map areas)
foreach ($linked_mobs as $mob_id) {
if ($mob_id > 0 && ilObject::_exists($mob_id)) {
$expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportFiles($a_target_dir);
unset($media_obj);
}
}
}
//media files in questions
foreach ($this->q_media as $media) {
if ($media != "") {
error_log($media);
copy($media, $a_target_dir . "/objects/" . basename($media));
}
}
}