4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
30 $this->use_previous_import_ids = $a_val;
51 return array(
"5.1.0",
"4.3.0",
"4.1.0");
62 return "http://www.ilias.de/xml/Services/MediaObject/".$a_entity;
71 protected function getTypes($a_entity, $a_version)
74 if ($a_entity ==
"mob")
83 "Description" =>
"text",
91 "Description" =>
"text",
99 if ($a_entity ==
"mob_media_item")
106 "MobId" =>
"integer",
107 "Width" =>
"integer",
108 "Height" =>
"integer",
113 "Location" =>
"text",
114 "LocationType" =>
"text",
116 "TextRepresentation" =>
"text" 123 "MobId" =>
"integer",
124 "Width" =>
"integer",
125 "Height" =>
"integer",
130 "Location" =>
"text",
131 "LocationType" =>
"text",
133 "TextRepresentation" =>
"text" 139 if ($a_entity ==
"mob_mi_map_area")
151 "LinkType" =>
"text",
156 "TargetFrame" =>
"text",
157 "HighlightMode" =>
"text",
158 "HighlightText" =>
"text" 164 if ($a_entity ==
"mob_mi_parameter")
186 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
190 if (!is_array($a_ids))
192 $a_ids =
array($a_ids);
196 if ($a_entity ==
"mob")
204 foreach ($a_ids as $mob_id)
217 foreach ($a_ids as $mob_id)
233 if ($a_entity ==
"mob_media_item")
239 "caption, nr, purpose, location, location_type, format, text_representation".
240 " FROM media_item WHERE ".
241 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
247 "caption, nr, purpose, location, location_type, format, text_representation".
248 " FROM media_item WHERE ".
249 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
256 if ($a_entity ==
"mob_mi_map_area")
264 " ,shape, coords, link_type, title, href, target, type, target_frame, ".
265 " highlight_mode, highlight_class".
268 $ilDB->in(
"item_id", $a_ids,
false,
"integer").
269 " ORDER BY nr",
true,
false) as
$r)
274 if ($r[
"Type"] ==
"RepositoryItem")
276 $id_arr = explode(
"_", $r[
"Target"]);
283 $id = $otype.
"_".$obj_id.
"_".
$ref_id;
284 $r[
"Target"] =
"il_".$id_arr[1].
"_".$id;
295 if ($a_entity ==
"mob_mi_parameter")
303 " FROM mob_parameter ".
305 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
321 "mob_media_item" =>
array(
"ids" => $a_rec[
"Id"])
324 case "mob_media_item":
326 "mob_mi_map_area" =>
array(
"ids" => $a_rec[
"Id"]),
327 "mob_mi_parameter" =>
array(
"ids" => $a_rec[
"Id"])
341 if ($a_entity ==
"mob")
343 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
345 $a_set[
"Dir"] = $dir;
357 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
368 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
370 $newObj->setType(
"mob");
371 $newObj->setTitle($a_rec[
"Title"]);
372 $newObj->setDescription($a_rec[
"Description"]);
376 $newObj->setImportId($a_rec[
"ImportId"]);
383 $newObj->createDirectory();
385 $this->current_mob = $newObj;
387 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
394 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
398 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
400 $a_mapping->addMapping(
"Services/MetaData",
"md",
401 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
404 case "mob_media_item":
407 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
408 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
409 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
411 $mob = $this->current_mob;
418 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
420 $newObj->setMobId($mob_id);
421 $newObj->setWidth($a_rec[
"Width"]);
422 $newObj->setHeight($a_rec[
"Height"]);
423 $newObj->setCaption($a_rec[
"Caption"]);
424 $newObj->setNr($a_rec[
"Nr"]);
425 $newObj->setPurpose($a_rec[
"Purpose"]);
426 $newObj->setLocation($a_rec[
"Location"]);
427 $newObj->setLocationType($a_rec[
"LocationType"]);
428 $newObj->setFormat($a_rec[
"Format"]);
429 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
431 $this->current_media_item = $newObj;
433 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
437 case "mob_mi_parameter":
440 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
441 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
442 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
444 $med = $this->current_media_item;
450 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
454 case "mob_mi_map_area":
456 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
457 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
458 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
460 $med = $this->current_media_item;
467 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
469 $map_area->setItemId($med_id);
470 $map_area->setNr($a_rec[
"Nr"]);
471 $map_area->setShape($a_rec[
"Shape"]);
472 $map_area->setCoords($a_rec[
"Coords"]);
473 $map_area->setLinkType($a_rec[
"LinkType"]);
474 $map_area->setTitle($a_rec[
"Title"]);
475 $map_area->setHref($a_rec[
"Href"]);
476 $map_area->setTarget($a_rec[
"Target"]);
477 $map_area->setType($a_rec[
"Type"]);
478 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
479 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
480 $map_area->setHighlightClass($a_rec[
"HighlightClass"]);
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static _lookupTitle($a_id)
lookup object title
getImportDirectory()
Get import directory.
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
getCurrentInstallationId()
Get current installation id.
static _lookupImportId($a_obj_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
A dataset contains in data in a common structure that can be shared and transformed for different pur...