31 return array(
"8.0",
"5.0.0",
"4.1.0");
34 public function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
36 return "https://www.ilias.de/xml/Modules/MediaCast/" . $a_entity;
39 protected function getTypes(
string $a_entity,
string $a_version): array
41 if ($a_entity ==
"mcst") {
47 "Description" =>
"text",
48 "PublicFiles" =>
"integer",
49 "Downloadable" =>
"integer",
50 "DefaultAccess" =>
"integer");
56 "Description" =>
"text",
57 "PublicFiles" =>
"integer",
58 "Downloadable" =>
"integer",
59 "DefaultAccess" =>
"integer",
60 "Sortmode" =>
"integer",
62 "PublicFeed" =>
"integer",
63 "KeepRssMin" =>
"integer",
71 "Description" =>
"text",
72 "PublicFiles" =>
"integer",
73 "Downloadable" =>
"integer",
74 "DefaultAccess" =>
"integer",
75 "Sortmode" =>
"integer",
77 "PublicFeed" =>
"integer",
78 "KeepRssMin" =>
"integer",
80 "Autoplaymode" =>
"integer",
81 "NrInitialVideos" =>
"integer",
82 "NewItemsInLp" =>
"integer" 97 if ($a_entity ==
"mcst") {
101 " public_files, downloadable, def_access default_access" .
102 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
104 $ilDB->in(
"id", $a_ids,
false,
"integer"));
109 " public_files, downloadable, def_access default_access, sortmode, viewmode" .
110 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
112 $ilDB->in(
"id", $a_ids,
false,
"integer"));
116 $set =
$ilDB->query(
"SELECT * FROM il_media_cast_data_ord" .
117 " WHERE " .
$ilDB->in(
"obj_id", $a_ids,
false,
"integer") .
119 while ($row =
$ilDB->fetchAssoc($set)) {
120 $order[$row[
"obj_id"]][] = $row[
"item_id"];
123 foreach ($this->data as $k => $v) {
128 if ($this->data[$k][
"Sortmode"] == 4 &&
129 array_key_exists($v[
"Id"], $order)) {
130 $this->data[$k][
"Order"] = implode(
";", $order[$v[
"Id"]]);
137 " public_files, downloadable, def_access default_access, sortmode, viewmode," .
138 " autoplaymode,nr_initial_videos,new_items_in_lp" .
139 " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
141 $ilDB->in(
"id", $a_ids,
false,
"integer"));
145 $set =
$ilDB->query(
"SELECT * FROM il_media_cast_data_ord" .
146 " WHERE " .
$ilDB->in(
"obj_id", $a_ids,
false,
"integer") .
148 while ($row =
$ilDB->fetchAssoc($set)) {
149 $order[$row[
"obj_id"]][] = $row[
"item_id"];
152 foreach ($this->data as $k => $v) {
157 if ($this->data[$k][
"Sortmode"] == 4 &&
158 array_key_exists($v[
"Id"], $order)) {
159 $this->data[$k][
"Order"] = implode(
";", $order[$v[
"Id"]]);
170 ?array $a_rec =
null,
181 string $a_schema_version
187 if ($new_id = $a_mapping->
getMapping(
'components/ILIAS/Container',
'objs', $a_rec[
'Id'])) {
191 $newObj->setType(
"mcst");
195 $newObj->setTitle($a_rec[
"Title"] ??
"");
196 $newObj->setDescription($a_rec[
"Description"] ??
"");
197 $newObj->setDefaultAccess((
int) ($a_rec[
"DefaultAccess"] ?? 0));
198 $newObj->setDownloadable((
bool) (
int) ($a_rec[
"Downloadable"] ??
false));
199 $newObj->setPublicFiles((
bool) (
int) ($a_rec[
"PublicFiles"] ??
false));
201 if (in_array($a_schema_version, [
"5.0.0",
"8.0"])) {
202 $newObj->setOrder((
int) ($a_rec[
"Sortmode"] ?? 0));
203 $newObj->setViewMode((
string) ($a_rec[
"Viewmode"] ??
""));
205 if ($a_rec[
"Order"] ??
false) {
206 $this->order[$newObj->getId()] = explode(
";", $a_rec[
"Order"]);
212 $a_rec[
"PublicFeed"],
220 $a_rec[
"KeepRssMin"],
225 if (in_array($a_schema_version, [
"8.0"])) {
226 $newObj->setAutoplayMode((
int) ($a_rec[
"Autoplaymode"] ?? 0));
227 $newObj->setNumberInitialVideos((
int) ($a_rec[
"NrInitialVideos"] ?? 0));
228 $newObj->setNewItemsInLearningProgress((
bool) (
int) ($a_rec[
"NewItemsInLp"] ??
false));
232 $this->current_obj = $newObj;
233 $a_mapping->
addMapping(
"components/ILIAS/MediaCast",
"mcst", $a_rec[
"Id"], $newObj->getId());
235 "components/ILIAS/News",
237 $a_rec[
"Id"] .
":mcst:0:",
238 $newObj->getId() .
":mcst:0:" 241 "components/ILIAS/MetaData",
243 $a_rec[
"Id"] .
":0:mcst",
244 $newObj->getId() .
":0:mcst"
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
stripTags(array $rec, array $omit_keys=[])