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") {
53 "Description" =>
"text",
54 "PublicFiles" =>
"integer",
55 "Downloadable" =>
"integer",
56 "DefaultAccess" =>
"integer");
62 "Description" =>
"text",
63 "PublicFiles" =>
"integer",
64 "Downloadable" =>
"integer",
65 "DefaultAccess" =>
"integer",
66 "Sortmode" =>
"integer",
68 "PublicFeed" =>
"integer",
69 "KeepRssMin" =>
"integer",
82 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
86 if (!is_array($a_ids)) {
87 $a_ids = array($a_ids);
90 if ($a_entity ==
"mcst") {
94 " public_files, downloadable, def_access default_access" .
95 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
97 $ilDB->in(
"id", $a_ids,
false,
"integer"));
102 " public_files, downloadable, def_access default_access, sortmode, viewmode" .
103 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
105 $ilDB->in(
"id", $a_ids,
false,
"integer"));
109 $set =
$ilDB->query(
"SELECT * FROM il_media_cast_data_ord" .
110 " WHERE " .
$ilDB->in(
"obj_id", $a_ids,
false,
"integer") .
113 $order[
$row[
"obj_id"]][] = $row[
"item_id"];
116 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
117 foreach ($this->
data as $k => $v) {
122 if ($this->
data[$k][
"Sortmode"] == 4 &&
123 array_key_exists($v[
"Id"], $order)) {
124 $this->
data[$k][
"Order"] = implode(
";", $order[$v[
"Id"]]);
147 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
154 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCast.php");
156 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
160 $newObj->setType(
"mcst");
161 $newObj->create(
true);
164 $newObj->setTitle($a_rec[
"Title"]);
165 $newObj->setDescription($a_rec[
"Description"]);
166 $newObj->setDefaultAccess($a_rec[
"DefaultAccess"]);
167 $newObj->setDownloadable($a_rec[
"Downloadable"]);
168 $newObj->setPublicFiles($a_rec[
"PublicFiles"]);
170 if ($a_schema_version ==
"5.0.0") {
171 $newObj->setOrder($a_rec[
"Sortmode"]);
172 $newObj->setViewMode($a_rec[
"Viewmode"]);
174 if ($a_rec[
"Order"]) {
175 $this->order[$newObj->getId()] = explode(
";", $a_rec[
"Order"]);
178 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
182 $a_rec[
"PublicFeed"],
190 $a_rec[
"KeepRssMin"],
196 $newObj->update(
true);
197 $this->current_obj = $newObj;
198 $a_mapping->addMapping(
"Modules/MediaCast",
"mcst", $a_rec[
"Id"], $newObj->getId());
199 $a_mapping->addMapping(
202 $a_rec[
"Id"] .
":mcst:0:",
203 $newObj->getId() .
":mcst:0:"
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
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 _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
A dataset contains in data in a common structure that can be shared and transformed for different pur...