5 require_once
"./Services/Object/classes/class.ilObject.php";
16 public static $purposes =
array (
"Standard",
"VideoAlternative",
"VideoPortable",
"AudioPortable");
47 parent::__construct($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);
375 include_once(
"./Services/News/classes/class.ilNewsItem.php");
377 $it->setContextObjId($this->
getId());
378 $it->setContextObjType($this->
getType());
379 $this->itemsarray = $it->queryNewsForContext(
false, 0,
"",
false, $a_oldest_first);
381 return $this->itemsarray;
393 $sql =
"DELETE FROM il_media_cast_data_ord".
394 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
395 $ilDB->manipulate($sql);
408 $sql =
"SELECT item_id FROM il_media_cast_data_ord".
409 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer").
411 $res = $ilDB->query($sql);
412 while(
$row = $ilDB->fetchAssoc(
$res))
414 $all[] =
$row[
"item_id"];
431 foreach($a_items as $item_id)
435 $sql =
"INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)".
436 " VALUES (".$ilDB->quote($this->
getId(),
"integer").
",".
437 $ilDB->quote($item_id,
"integer").
",".
438 $ilDB->quote($pos,
"integer").
")";
439 $ilDB->manipulate($sql);
449 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
453 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
458 if(!$cp_options->isRootNode($this->getRefId()))
467 $new_obj->setOrder($this->
getOrder());
471 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
483 include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
485 $obj_settings->cloneSettings($new_obj->getId());
486 unset($obj_settings);
501 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
505 $mob_id = $item[
"mob_id"];
507 $new_mob = $mob->duplicate();
511 include_once(
"./Services/News/classes/class.ilNewsItem.php");
513 $mc_item->setMobId($new_mob->getId());
515 $mc_item->setContextObjId($a_new_obj->getId());
516 $mc_item->setContextObjType($a_new_obj->getType());
517 $mc_item->setUserId($ilUser->getId());
518 $mc_item->setPlaytime($item[
"playtime"]);
519 $mc_item->setTitle($item[
"title"]);
520 $mc_item->setContent($item[
"content"]);
521 $mc_item->setVisibility($item[
"visibility"]);
530 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
532 $a_mob_id, $a_user_id);
535 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
Class ilObject Basic functions for all objects.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static _recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
getType()
get object type public
Create styles array
The data for the language used.
getRefId()
get reference id public