50 $this->use_previous_import_ids = $a_val;
63 return array(
"5.1.0",
"4.3.0",
"4.1.0");
66 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
68 return "https://www.ilias.de/xml/Services/MediaObject/" . $a_entity;
71 protected function getTypes(
string $a_entity,
string $a_version): array
74 if ($a_entity ==
"mob") {
81 "Description" =>
"text",
89 "Description" =>
"text",
97 if ($a_entity ==
"mob_media_item") {
104 "MobId" =>
"integer",
105 "Width" =>
"integer",
106 "Height" =>
"integer",
111 "Location" =>
"text",
112 "LocationType" =>
"text",
114 "TextRepresentation" =>
"text" 120 if ($a_entity ==
"mob_mi_map_area") {
121 switch ($a_version) {
130 "LinkType" =>
"text",
135 "TargetFrame" =>
"text",
136 "HighlightMode" =>
"text",
137 "HighlightText" =>
"text" 143 if ($a_entity ==
"mob_mi_parameter") {
144 switch ($a_version) {
165 if (!is_array($a_ids)) {
166 $a_ids = array($a_ids);
170 if ($a_entity ==
"mob") {
171 $this->data = array();
173 switch ($a_version) {
176 foreach ($a_ids as $mob_id) {
178 $this->data[] = array(
"Id" => $mob_id,
187 foreach ($a_ids as $mob_id) {
189 $this->data[] = array(
"Id" => $mob_id,
201 if ($a_entity ==
"mob_media_item") {
202 switch ($a_version) {
207 "caption, nr, purpose, location, location_type, format, text_representation" .
208 " FROM media_item WHERE " .
209 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
216 if ($a_entity ==
"mob_mi_map_area") {
217 switch ($a_version) {
222 " ,shape, coords, link_type, title, href, target, type, target_frame, " .
223 " highlight_mode, highlight_class" .
226 $ilDB->in(
"item_id", $a_ids,
false,
"integer") .
227 " ORDER BY nr",
true,
false) as
$r) {
231 if ($r[
"Type"] ==
"RepositoryItem") {
232 $id_arr = explode(
"_", $r[
"Target"]);
239 $r[
"Target"] =
"il_" . $id_arr[1] .
"_" .
$id;
250 if ($a_entity ==
"mob_mi_parameter") {
251 switch ($a_version) {
256 " FROM mob_parameter " .
258 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
270 ?array $a_rec = null,
276 "mob_media_item" => array(
"ids" => $a_rec[
"Id"] ?? null)
279 case "mob_media_item":
281 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"] ?? null),
282 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"] ?? null)
293 if ($a_entity ==
"mob") {
298 $a_set[
"Dir"] = $dir;
309 string $a_schema_version
316 $newObj->setType(
"mob");
317 $newObj->setTitle($a_rec[
"Title"]);
318 $newObj->setDescription($a_rec[
"Description"]);
321 $newObj->setImportId($a_rec[
"ImportId"]);
326 $newObj->createDirectory();
328 $this->current_mob = $newObj;
330 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
334 $this->mob_log->debug(
"s:-$source_dir-,t:-$target_dir-");
340 $a_mapping->
addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
344 "0:" . $a_rec[
"Id"] .
":mob",
345 "0:" . $newObj->getId() .
":mob" 349 case "mob_media_item":
352 $mob_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
353 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id) {
360 $newObj->setMobId($mob_id);
361 $newObj->setWidth($a_rec[
"Width"]);
362 $newObj->setHeight($a_rec[
"Height"]);
363 $newObj->setCaption($a_rec[
"Caption"]);
364 $newObj->setNr($a_rec[
"Nr"]);
365 $newObj->setPurpose($a_rec[
"Purpose"]);
366 $newObj->setLocation($a_rec[
"Location"]);
367 $newObj->setLocationType($a_rec[
"LocationType"]);
368 $newObj->setFormat($a_rec[
"Format"]);
369 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
371 $this->current_media_item = $newObj;
373 $a_mapping->
addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
377 case "mob_mi_parameter":
380 $med_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
381 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
386 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
390 case "mob_mi_map_area":
392 $med_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
393 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
400 $map_area->setItemId($med_id);
401 $map_area->setNr($a_rec[
"Nr"]);
402 $map_area->setShape($a_rec[
"Shape"]);
403 $map_area->setCoords($a_rec[
"Coords"]);
404 $map_area->setLinkType($a_rec[
"LinkType"]);
405 $map_area->setTitle($a_rec[
"Title"]);
406 $map_area->setHref($a_rec[
"Href"]);
407 $map_area->setTarget($a_rec[
"Target"]);
408 $map_area->setType($a_rec[
"Type"]);
409 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
410 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
411 $map_area->setHighlightClass($a_rec[
"HighlightClass"]);
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static _lookupObjId(int $ref_id)
static _lookupImportId(int $obj_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static _lookupTitle(int $obj_id)
getCurrentInstallationId()
static _lookupDescription(int $obj_id)
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
stripTags(array $rec, array $omit_keys=[])
static _lookupType(int $id, bool $reference=false)
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id