19 declare(strict_types=1);
42 $this->dom_util = $DIC->copage()->internal()->domain()->
domUtil();
43 if (isset($DIC[
'ilLoggerFactory'])) {
44 $this->log = $domain->
log();
46 $this->media_manager = $DIC->mediaObjects()->internal()->domain()->mediaObject();
54 $this->log->debug(
"Handle mob upload");
56 $this->log->debug($title);
59 $this->log->debug(
"New...");
60 $mob = new \ilObjMediaObject();
61 $mob->setTitle($title);
62 $mob->setDescription(
"");
65 $media_item = $mob->addMediaItemFromUpload(
70 $this->log->debug(
"Update...");
71 $media_item = $mob->replaceMediaItemFromUpload(
81 (
string) $mob->getId(),
96 "overlays/" . $result->
getName(),
102 (
string) $mob->
getId(),
109 return $this->media_manager->getLocalSrc($mob->
getId(),
"/overlays/" . $file);
114 return $this->media_manager->getLocalSrc($mob->
getId(),
"/thumb/" . $file);
119 $piname = pathinfo($file);
120 return basename($file,
"." . $piname[
'extension']) .
".png";
127 $file = $file[
"basename"];
146 $path =
"//InteractiveImage/MediaAlias";
148 $nodes = $this->dom_util->path($dom,
$path);
149 foreach ($nodes as $node) {
150 $old_id = $node->getAttribute(
"OriginId");
151 if (($a_mapping[$old_id] ?? 0) > 0) {
152 $node->setAttribute(
"OriginId",
"il__mob_" . $a_mapping[$old_id]);
resolveIIMMediaAliases(\DOMDocument $dom, array $a_mapping)
Resolve iim media aliases (in ilContObjParse)
getOverlayThumbnailPath(\ilObjMediaObject $mob, string $file)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(InternalDomainService $domain)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
InternalDomainService $domain
getOverlays(\ilObjMediaObject $mob)
handleUploadResult(FileUpload $upload, UploadResult $result, ?\ilObjMediaObject $mob=null)
getOverlayThumbnailName(string $file)
handleOverlayUpload(\ilObjMediaObject $mob, FileUpload $upload, UploadResult $result)
Class BasicHandlerResult.
getOverlayWebPath(\ilObjMediaObject $mob, string $file)
ILIAS COPage Dom DomUtil $dom_util
ILIAS MediaObjects MediaObjectManager $media_manager