4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
32 return array(
"4.1.0");
33 case "mob_media_item":
34 return array(
"4.1.0");
35 case "mob_mi_map_area":
36 return array(
"4.1.0");
37 case "mob_mi_parameter":
38 return array(
"4.1.0");
50 return "http://www.ilias.de/xml/Services/MediaObject/".$a_entity;
59 protected function getTypes($a_entity, $a_version)
62 if ($a_entity ==
"mob")
70 "Description" =>
"text",
77 if ($a_entity ==
"mob_media_item")
86 "Height" =>
"integer",
92 "LocationType" =>
"text",
94 "TextRepresentation" =>
"text"
100 if ($a_entity ==
"mob_mi_map_area")
110 "LinkType" =>
"text",
115 "TargetFrame" =>
"text"
121 if ($a_entity ==
"mob_mi_parameter")
141 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
145 if (!is_array($a_ids))
147 $a_ids = array($a_ids);
151 if ($a_entity ==
"mob")
153 $this->data = array();
155 foreach ($a_ids as $mob_id)
159 $this->data[] = array (
"Id" => $mob_id,
167 if ($a_entity ==
"mob_media_item")
173 "caption, nr, purpose, location, location_type, format, text_representation".
174 " FROM media_item WHERE ".
175 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
182 if ($a_entity ==
"mob_mi_map_area")
188 " ,shape, coords, link_type, title, href, target, type, target_frame ".
191 $ilDB->in(
"item_id", $a_ids,
false,
"integer").
198 if ($a_entity ==
"mob_mi_parameter")
204 " FROM mob_parameter ".
206 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
222 "mob_media_item" => array(
"ids" => $a_rec[
"Id"])
225 case "mob_media_item":
227 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"]),
228 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"])
242 if ($a_entity ==
"mob")
244 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
246 $a_set[
"Dir"] =
$dir;
258 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
269 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
271 $newObj->setType(
"mob");
272 $newObj->setTitle($a_rec[
"Title"]);
273 $newObj->setDescription($a_rec[
"Description"]);
275 $newObj->createDirectory();
277 $this->current_mob = $newObj;
279 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
287 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
289 $a_mapping->addMapping(
"Services/MetaData",
"md",
290 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
293 case "mob_media_item":
296 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
297 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
298 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
300 $mob = $this->current_mob;
307 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
309 $newObj->setMobId($mob_id);
310 $newObj->setWidth($a_rec[
"Width"]);
311 $newObj->setHeight($a_rec[
"Height"]);
312 $newObj->setCaption($a_rec[
"Caption"]);
313 $newObj->setNr($a_rec[
"Nr"]);
314 $newObj->setPurpose($a_rec[
"Purpose"]);
315 $newObj->setLocation($a_rec[
"Location"]);
316 $newObj->setLocationType($a_rec[
"LocationType"]);
317 $newObj->setFormat($a_rec[
"Format"]);
318 $newObj->setFormat($a_rec[
"Format"]);
319 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
321 $this->current_media_item = $newObj;
323 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
327 case "mob_mi_parameter":
330 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
331 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
332 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
334 $med = $this->current_media_item;
340 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
344 case "mob_mi_map_area":
346 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
347 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
348 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
350 $med = $this->current_media_item;
357 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
359 $map_area->setItemId($med_id);
360 $map_area->setNr($a_rec[
"Nr"]);
361 $map_area->setShape($a_rec[
"Shape"]);
362 $map_area->setCoords($a_rec[
"Coords"]);
363 $map_area->setLinkType($a_rec[
"LinkType"]);
364 $map_area->setTitle($a_rec[
"Title"]);
365 $map_area->setHref($a_rec[
"Href"]);
366 $map_area->setTarget($a_rec[
"Target"]);
367 $map_area->setType($a_rec[
"Type"]);
368 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);