5 require_once
"./Services/Object/classes/class.ilObject.php";
16 public static $purposes = array (
"Standard",
"VideoAlternative",
"VideoPortable",
"AudioPortable");
47 $this->
ilObject($a_id,$a_call_by_reference);
50 $this->
setOrder(self::ORDER_CREATION_DATE_DESC);
60 $this->online = $a_online;
80 $this->publicfiles = $a_publicfiles;
100 $this->view_mode = $a_val;
119 $this->itemsarray = $a_itemsarray;
129 return $this->itemsarray;
154 $med_items =
ilUtil::sortArray($med_items,
"creation_date",
"desc",
false,
true);
160 foreach(array_keys($med_items) as $idx)
162 if(array_key_exists($idx,
$order))
164 $med_items[$idx][
"order"] = (
$order[$idx]+1)*10;
169 $med_items[$idx][
"order"] = (++$pos)*10;
188 $this->downloadable = $a_downloadable;
215 $this->defaultAccess = (int) $value == 0 ? 0 : 1;
225 $this->order = $a_value;
245 require_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
258 $query =
"INSERT INTO il_media_cast_data (".
267 $ilDB->quote($this->
getId(),
"integer")
268 .
",".$ilDB->quote((
int) $this->
getOnline(),
"integer")
272 .
",".$ilDB->quote((
int) $this->
getOrder(),
"integer")
273 .
",".$ilDB->quote((
int) $this->
getViewMode(),
"text")
275 $ilDB->manipulate(
$query);
289 if (!parent::update())
295 $query =
"UPDATE il_media_cast_data SET ".
296 " is_online = ".$ilDB->quote((
int) $this->
getOnline(),
"integer").
297 ", public_files = ".$ilDB->quote((
int) $this->
getPublicFiles(),
"integer").
298 ", downloadable = ".$ilDB->quote((
int) $this->
getDownloadable(),
"integer").
300 ", sortmode = ".$ilDB->quote((
int) $this->
getOrder(),
"integer").
301 ", viewmode = ".$ilDB->quote($this->
getViewMode(),
"text").
302 " WHERE id = ".$ilDB->quote((
int) $this->
getId(),
"integer");
304 $ilDB->manipulate(
$query);
319 $query =
"SELECT * FROM il_media_cast_data WHERE id = ".
320 $ilDB->quote($this->
getId(),
"integer");
321 $set = $ilDB->query(
$query);
322 $rec = $ilDB->fetchAssoc($set);
345 if (!parent::delete())
352 foreach ($med_items as $item)
354 include_once(
"./Services/News/classes/class.ilNewsItem.php");
356 $news_item->delete();
362 $query =
"DELETE FROM il_media_cast_data".
363 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
364 $ilDB->manipulate(
$query);
383 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
423 if ($a_node_id==
$_GET[
"ref_id"])
425 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
426 $parent_type = $parent_obj->getType();
427 if($parent_type == $this->
getType())
429 $a_node_id = (int) $tree->getParentId($a_node_id);
433 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
442 include_once(
"./Services/News/classes/class.ilNewsItem.php");
444 $it->setContextObjId($this->
getId());
445 $it->setContextObjType($this->
getType());
446 $this->itemsarray = $it->queryNewsForContext(
false, 0,
"",
false, $a_oldest_first);
448 return $this->itemsarray;
460 $sql =
"DELETE FROM il_media_cast_data_ord".
461 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
462 $ilDB->manipulate($sql);
475 $sql =
"SELECT item_id FROM il_media_cast_data_ord".
476 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer").
478 $res = $ilDB->query($sql);
479 while(
$row = $ilDB->fetchAssoc(
$res))
481 $all[] =
$row[
"item_id"];
498 foreach($a_items as $item_id)
502 $sql =
"INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)".
503 " VALUES (".$ilDB->quote($this->
getId(),
"integer").
",".
504 $ilDB->quote($item_id,
"integer").
",".
505 $ilDB->quote($pos,
"integer").
")";
506 $ilDB->manipulate($sql);
525 if(!$cp_options->isRootNode($this->getRefId()))
534 $new_obj->setOrder($this->
getOrder());
538 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
562 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
566 $mob_id = $item[
"mob_id"];
568 $new_mob = $mob->duplicate();
572 include_once(
"./Services/News/classes/class.ilNewsItem.php");
574 $mc_item->setMobId($new_mob->getId());
576 $mc_item->setContextObjId($a_new_obj->getId());
577 $mc_item->setContextObjType($a_new_obj->getType());
578 $mc_item->setUserId($ilUser->getId());
579 $mc_item->setPlaytime($item[
"playtime"]);
580 $mc_item->setTitle($item[
"title"]);
581 $mc_item->setContent($item[
"content"]);
582 $mc_item->setVisibility($item[
"visibility"]);