4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
30 return array(
"4.1.0");
32 return array(
"4.1.0");
44 return "http://www.ilias.de/xml/Modules/MediaPool/".$a_entity;
53 protected function getTypes($a_entity, $a_version)
56 if ($a_entity ==
"mep")
64 "Description" =>
"text",
65 "DefaultWidth" =>
"integer",
66 "DefaultHeight" =>
"integer");
71 if ($a_entity ==
"mep_tree")
79 "Parent" =>
"integer",
83 "ForeignId" =>
"integer"
95 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
99 if (!is_array($a_ids))
101 $a_ids = array($a_ids);
105 if ($a_entity ==
"mep")
111 " default_width, default_height".
112 " FROM mep_data JOIN object_data ON (mep_data.id = object_data.obj_id) ".
114 $ilDB->in(
"id", $a_ids,
false,
"integer"));
120 if ($a_entity ==
"mep_tree")
126 " ,parent,depth,type,title,foreign_id ".
127 " FROM mep_tree JOIN mep_item ON (child = obj_id) ".
129 $ilDB->in(
"mep_id", $a_ids,
false,
"integer").
145 "mep_tree" => array(
"ids" => $a_rec[
"Id"])
162 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
170 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
172 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
179 $newObj->setType(
"mep");
180 $newObj->create(
true);
183 $newObj->setTitle($a_rec[
"Title"]);
184 $newObj->setDescription($a_rec[
"Description"]);
185 $newObj->setDefaultWidth($a_rec[
"DefaultWidth"]);
186 $newObj->setDefaultHeight($a_rec[
"DefaultHeight"]);
189 $this->current_obj = $newObj;
190 $a_mapping->addMapping(
"Modules/MediaPool",
"mep", $a_rec[
"Id"], $newObj->getId());
194 switch ($a_rec[
"Type"])
197 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool",
"mep_tree", $a_rec[
"Parent"]);
199 $this->current_obj->createFolder($a_rec[
"Title"], $parent);
200 $a_mapping->addMapping(
"Modules/MediaPool",
"mep_tree", $a_rec[
"Child"],
205 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool",
"mep_tree", $a_rec[
"Parent"]);
206 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"ForeignId"]);
208 $item->setType(
"mob");
209 $item->setForeignId($mob_id);
210 $item->setTitle($a_rec[
"Title"]);
212 if ($item->getId() > 0)
214 $this->current_obj->insertInTree($item->getId(), $parent);
219 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool",
"mep_tree", $a_rec[
"Parent"]);
222 $item->setType(
"pg");
223 $item->setTitle($a_rec[
"Title"]);
225 $a_mapping->addMapping(
"Services/COPage",
"pg",
"mep:".$a_rec[
"Child"],
226 "mep:".$item->getId());
227 if ($item->getId() > 0)
229 $this->current_obj->insertInTree($item->getId(), $parent);