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")
142 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
146 if (!is_array($a_ids))
148 $a_ids = array($a_ids);
152 if ($a_entity ==
"mob")
154 $this->data = array();
156 foreach ($a_ids as $mob_id)
160 $this->data[] = array (
"Id" => $mob_id,
168 if ($a_entity ==
"mob_media_item")
174 "caption, nr, purpose, location, location_type, format, text_representation".
175 " FROM media_item WHERE ".
176 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
183 if ($a_entity ==
"mob_mi_map_area")
189 " ,shape, coords, link_type, title, href, target, type, target_frame ".
192 $ilDB->in(
"item_id", $a_ids,
false,
"integer").
199 if ($a_entity ==
"mob_mi_parameter")
205 " FROM mob_parameter ".
207 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
223 "mob_media_item" => array(
"ids" => $a_rec[
"Id"])
226 case "mob_media_item":
228 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"]),
229 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"])
243 if ($a_entity ==
"mob")
245 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
247 $a_set[
"Dir"] =
$dir;
259 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
270 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
272 $newObj->setType(
"mob");
273 $newObj->setTitle($a_rec[
"Title"]);
274 $newObj->setDescription($a_rec[
"Description"]);
276 $newObj->createDirectory();
278 $this->current_mob = $newObj;
280 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
288 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
290 $a_mapping->addMapping(
"Services/MetaData",
"md",
291 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
294 case "mob_media_item":
297 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
298 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
299 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
301 $mob = $this->current_mob;
308 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
310 $newObj->setMobId($mob_id);
311 $newObj->setWidth($a_rec[
"Width"]);
312 $newObj->setHeight($a_rec[
"Height"]);
313 $newObj->setCaption($a_rec[
"Caption"]);
314 $newObj->setNr($a_rec[
"Nr"]);
315 $newObj->setPurpose($a_rec[
"Purpose"]);
316 $newObj->setLocation($a_rec[
"Location"]);
317 $newObj->setLocationType($a_rec[
"LocationType"]);
318 $newObj->setFormat($a_rec[
"Format"]);
319 $newObj->setFormat($a_rec[
"Format"]);
320 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
322 $this->current_media_item = $newObj;
324 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
328 case "mob_mi_parameter":
331 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
332 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
333 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
335 $med = $this->current_media_item;
341 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
345 case "mob_mi_map_area":
347 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
348 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
349 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
351 $med = $this->current_media_item;
358 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
360 $map_area->setItemId($med_id);
361 $map_area->setNr($a_rec[
"Nr"]);
362 $map_area->setShape($a_rec[
"Shape"]);
363 $map_area->setCoords($a_rec[
"Coords"]);
364 $map_area->setLinkType($a_rec[
"LinkType"]);
365 $map_area->setTitle($a_rec[
"Title"]);
366 $map_area->setHref($a_rec[
"Href"]);
367 $map_area->setTarget($a_rec[
"Target"]);
368 $map_area->setType($a_rec[
"Type"]);
369 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);