4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
25 return array(
"5.0.0",
"4.1.0");
36 return "http://www.ilias.de/xml/Modules/MediaCast/".$a_entity;
45 protected function getTypes($a_entity, $a_version)
47 if ($a_entity ==
"mcst")
55 "Description" =>
"text",
56 "PublicFiles" =>
"integer",
57 "Downloadable" =>
"integer",
58 "DefaultAccess" =>
"integer");
64 "Description" =>
"text",
65 "PublicFiles" =>
"integer",
66 "Downloadable" =>
"integer",
67 "DefaultAccess" =>
"integer",
68 "Sortmode" =>
"integer",
70 "PublicFeed" =>
"integer",
71 "KeepRssMin" =>
"integer",
85 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
89 if (!is_array($a_ids))
91 $a_ids = array($a_ids);
94 if ($a_entity ==
"mcst")
100 " public_files, downloadable, def_access default_access".
101 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) ".
103 $ilDB->in(
"id", $a_ids,
false,
"integer"));
108 " public_files, downloadable, def_access default_access, sortmode, viewmode".
109 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) ".
111 $ilDB->in(
"id", $a_ids,
false,
"integer"));
115 $set = $ilDB->query(
"SELECT * FROM il_media_cast_data_ord".
116 " WHERE ".$ilDB->in(
"obj_id", $a_ids,
false,
"integer").
118 while(
$row = $ilDB->fetchAssoc($set))
120 $order[
$row[
"obj_id"]][] = $row[
"item_id"];
123 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
124 foreach ($this->data as $k => $v)
130 if($this->data[$k][
"Sortmode"] == 4 &&
131 array_key_exists($v[
"Id"], $order))
133 $this->data[$k][
"Order"] = implode(
";", $order[$v[
"Id"]]);
157 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
165 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCast.php");
167 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
174 $newObj->setType(
"mcst");
175 $newObj->create(
true);
178 $newObj->setTitle($a_rec[
"Title"]);
179 $newObj->setDescription($a_rec[
"Description"]);
180 $newObj->setDefaultAccess($a_rec[
"DefaultAccess"]);
181 $newObj->setDownloadable($a_rec[
"Downloadable"]);
182 $newObj->setPublicFiles($a_rec[
"PublicFiles"]);
184 if ($a_schema_version ==
"5.0.0")
186 $newObj->setOrder($a_rec[
"Sortmode"]);
187 $newObj->setViewMode($a_rec[
"Viewmode"]);
191 $this->order[$newObj->getId()] = explode(
";", $a_rec[
"Order"]);
194 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
196 $a_rec[
"PublicFeed"],
197 0, $newObj->getId());
200 $a_rec[
"KeepRssMin"],
201 0, $newObj->getId());
204 $newObj->update(
true);
205 $this->current_obj = $newObj;
206 $a_mapping->addMapping(
"Modules/MediaCast",
"mcst", $a_rec[
"Id"], $newObj->getId());
207 $a_mapping->addMapping(
"Services/News",
"news_context",
208 $a_rec[
"Id"].
":mcst:0:",
209 $newObj->getId().
":mcst:0:");