19 declare(strict_types=1);
41 $this->dom_util = $DIC->copage()->internal()->domain()->
domUtil();
42 if (isset($DIC[
'ilLoggerFactory'])) {
43 $this->log = $domain->
log();
52 $this->log->debug(
"Handle mob upload");
54 $this->log->debug($title);
57 $this->log->debug(
"New...");
58 $mob = new \ilObjMediaObject();
59 $mob->setTitle($title);
60 $mob->setDescription(
"");
63 $mob->createDirectory();
64 $media_item = new \ilMediaItem();
65 $mob->addMediaItem($media_item);
66 $media_item->setPurpose(
"Standard");
68 $this->log->debug(
"Update...");
69 $media_item = $mob->getMediaItem(
"Standard");
74 $file = $mob_dir .
"/" . $file_name;
76 $this->log->debug(
"Move file to: " . $mob_dir .
", " . $file_name);
90 $media_item->setFormat($format);
92 $media_item->setLocationType(
"LocalFile");
98 (
string) $mob->getId(),
114 "overlays/" . $result->
getName(),
120 (
string) $mob->
getId(),
127 return \ilObjMediaObject::_getURL($mob->
getId()) .
"/overlays/" . $file;
132 return \ilObjMediaObject::getThumbnailPath(
140 $piname = pathinfo($file);
141 return basename($file,
"." . $piname[
'extension']) .
".png";
147 function ($file) use ($mob) {
167 $path =
"//InteractiveImage/MediaAlias";
169 $nodes = $this->dom_util->path($dom,
$path);
170 foreach ($nodes as $node) {
171 $old_id = $node->getAttribute(
"OriginId");
172 if (($a_mapping[$old_id] ?? 0) > 0) {
173 $node->setAttribute(
"OriginId",
"il__mob_" . $a_mapping[$old_id]);
resolveIIMMediaAliases(\DOMDocument $dom, array $a_mapping)
Resolve iim media aliases (in ilContObjParse)
handleUploadResult(FileUpload $upload, UploadResult $result, \ilObjMediaObject $mob=null)
getOverlayThumbnailPath(\ilObjMediaObject $mob, string $file)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(InternalDomainService $domain)
InternalDomainService $domain
getOverlays(\ilObjMediaObject $mob)
getOverlayThumbnailName(string $file)
moveOneFileTo(UploadResult $uploadResult, string $destination, int $location=Location::STORAGE, string $file_name='', bool $override_existing=false)
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResul...
handleOverlayUpload(\ilObjMediaObject $mob, FileUpload $upload, UploadResult $result)
Class BasicHandlerResult.
getOverlayWebPath(\ilObjMediaObject $mob, string $file)
ILIAS COPage Dom DomUtil $dom_util
const WEB
The filesystem within the ilias web root.