ILIAS  release_8 Revision v8.24
ilObjMediaCast Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjMediaCast:
+ Collaboration diagram for ilObjMediaCast:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 setOnline (bool $a_online)
 
 getOnline ()
 
 setPublicFiles (bool $a_publicfiles)
 
 getPublicFiles ()
 
 setViewMode (string $a_val)
 
 getViewMode ()
 
 setItemsArray (array $a_itemsarray)
 
 getItemsArray ()
 
 setAutoplayMode (int $a_val)
 
 getAutoplayMode ()
 
 setNumberInitialVideos (int $a_val)
 
 getNumberInitialVideos ()
 
 setNewItemsInLearningProgress (bool $a_val)
 Set new items automatically in lp. More...
 
 getNewItemsInLearningProgress ()
 
 getSortedItemsArray ()
 
 setDownloadable (bool $a_downloadable)
 
 getDownloadable ()
 
 getDefaultAccess ()
 
 setDefaultAccess (int $value)
 
 setOrder (int $a_value)
 
 getOrder ()
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 read ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 readItems (bool $a_oldest_first=false)
 
 deleteOrder ()
 
 readOrder ()
 
 saveOrder (array $a_items)
 
 copyItems (ilObjMediaCast $a_new_obj)
 
 handleLPUpdate (int $a_user_id, int $a_mob_id)
 
 addMobToCast (int $mob_id, int $user_id, string $long_desc="", bool $extract=false)
 Add media object to media cast. More...
 
 getPlaytimeForSeconds (int $seconds)
 Get playtime for seconds. More...
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Data Fields

const ORDER_TITLE = 1
 
const ORDER_CREATION_DATE_ASC = 2
 
const ORDER_CREATION_DATE_DESC = 3
 
const ORDER_MANUAL = 4
 
const VIEW_LIST = ""
 
const VIEW_GALLERY = "gallery"
 
const VIEW_IMG_GALLERY = "img_gallery"
 
const VIEW_PODCAST = "podcast"
 
const VIEW_VCAST = "video"
 
const AUTOPLAY_NO = 0
 
const AUTOPLAY_ACT = 1
 
const AUTOPLAY_INACT = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Static Public Attributes

static array $purposes = array("Standard")
 

Protected Member Functions

 copyOrder (ilObjMediaCast $newObj, array $mapping)
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ILIAS MediaCast InternalDomainService $domain
 
ILIAS MediaObjects Tracking TrackingManager $mob_tracking
 
array $itemsarray
 
ilObjUser $user
 
bool $online = false
 
bool $publicfiles = false
 
bool $downloadable = true
 
int $order = 0
 
string $view_mode = self::VIEW_VCAST
 
int $defaultAccess = 0
 
array $mob_mapping = []
 
int $nr_initial_videos = 5
 
bool $new_items_in_lp = true
 
int $autoplay_mode = self::AUTOPLAY_ACT
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjMediaCast

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilObjMediaCast.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaCast::__construct ( int  $id = 0,
bool  $reference = true 
)
Parameters
int$idreference_id or object_id
bool$referencebool treat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject.

Definition at line 54 of file class.ilObjMediaCast.php.

57 {
58 global $DIC;
59
60 $this->db = $DIC->database();
61 $this->user = $DIC->user();
62 $this->type = "mcst";
63 $mcst_set = new ilSetting("mcst");
64 $this->setDefaultAccess($mcst_set->get("defaultaccess") == "users" ? 0 : 1);
65 $this->setOrder(self::ORDER_CREATION_DATE_DESC);
66 $this->mob_tracking = $DIC->mediaObjects()->internal()
67 ->domain()
68 ->tracking();
69 $this->domain = $DIC->mediaCast()->internal()->domain();
70 parent::__construct($a_id, $a_call_by_reference);
71 }
setOrder(int $a_value)
setDefaultAccess(int $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), setDefaultAccess(), setOrder(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addMobToCast()

ilObjMediaCast::addMobToCast ( int  $mob_id,
int  $user_id,
string  $long_desc = "",
bool  $extract = false 
)

Add media object to media cast.

Definition at line 493 of file class.ilObjMediaCast.php.

498 : int {
499 $mob = new ilObjMediaObject($mob_id);
500 if ($extract) {
501 try {
502 $mob->getExternalMetadata();
503 } catch (Exception $e) {
504 }
505 }
506 $news_set = new ilSetting("news");
507 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
508
509 // create new media cast item
510 $mc_item = new ilNewsItem();
511 $mc_item->setMobId($mob->getId());
512 $mc_item->setContentType(NEWS_AUDIO);
513 $mc_item->setContextObjId($this->getId());
514 $mc_item->setContextObjType($this->getType());
515 $mc_item->setUserId($user_id);
516 $med_item = $mob->getMediaItem("Standard");
517 $mc_item->setPlaytime($this->getPlaytimeForSeconds($med_item->getDuration()));
518 $mc_item->setTitle($mob->getTitle());
519 $mc_item->setContent($mob->getLongDescription());
520 if ($long_desc != "") {
521 $mc_item->setContent($long_desc);
522 }
523 $mc_item->setLimitation(false);
524 $mc_item->setVisibility($this->getDefaultAccess() == 0 ? "users" : "public");
525 $mc_item->create();
526
527 $lp = $this->domain->learningProgress($this);
528 $lp->addItemToLP($mob_id);
529
530 return $mc_item->getId();
531 }
const NEWS_AUDIO
A news item can be created by different sources.
getPlaytimeForSeconds(int $seconds)
Get playtime for seconds.
string $long_desc

References Vendor\Package\$e, and ilObjMediaObject\getExternalMetadata().

+ Here is the call graph for this function:

◆ copyItems()

ilObjMediaCast::copyItems ( ilObjMediaCast  $a_new_obj)

Definition at line 449 of file class.ilObjMediaCast.php.

449 : array
450 {
452
453 $item_mapping = [];
454 foreach ($this->readItems(true) as $item) {
455 // copy media object
456 $mob_id = $item["mob_id"];
457 $mob = new ilObjMediaObject($mob_id);
458 $new_mob = $mob->duplicate();
459
460 // copy news item
461 // create new media cast item
462 $mc_item = new ilNewsItem();
463 $mc_item->setMobId($new_mob->getId());
464 $mc_item->setContentType(NEWS_AUDIO);
465 $mc_item->setContextObjId($a_new_obj->getId());
466 $mc_item->setContextObjType($a_new_obj->getType());
467 $mc_item->setUserId($ilUser->getId());
468 $mc_item->setPlaytime($item["playtime"] ?? "");
469 $mc_item->setTitle($item["title"] ?? "");
470 $mc_item->setContent($item["content"] ?? "");
471 $mc_item->setVisibility($item["visibility"] ?? "users");
472 $mc_item->create();
473 $this->mob_mapping[$mob_id] = $new_mob->getId();
474 $item_mapping[$item["id"]] = $mc_item->getId();
475 }
476 return $item_mapping;
477 }
readItems(bool $a_oldest_first=false)
$ilUser
Definition: imgupload.php:34

References $ilUser, ilObject\getId(), ilObject\getType(), and NEWS_AUDIO.

+ Here is the call graph for this function:

◆ copyOrder()

ilObjMediaCast::copyOrder ( ilObjMediaCast  $newObj,
array  $mapping 
)
protected

Definition at line 387 of file class.ilObjMediaCast.php.

390 : void {
391 $items = [];
392 foreach ($this->readOrder() as $i) {
393 if (!array_key_exists($i, $mapping)) {
394 continue;
395 }
396 $items[] = $mapping[$i];
397 }
398 $newObj->saveOrder($items);
399 }
saveOrder(array $a_items)
$i
Definition: metadata.php:41

References $i.

◆ create()

ilObjMediaCast::create ( )

note: title, description and type should be set when this function is called

Reimplemented from ilObject.

Definition at line 214 of file class.ilObjMediaCast.php.

214 : int
215 {
217
218 $id = parent::create();
219
220 $query = "INSERT INTO il_media_cast_data (" .
221 " id" .
222 ", is_online" .
223 ", public_files" .
224 ", downloadable" .
225 ", def_access" .
226 ", sortmode" .
227 ", viewmode" .
228 ", autoplaymode" .
229 ", nr_initial_videos" .
230 ", new_items_in_lp" .
231 " ) VALUES (" .
232 $ilDB->quote($this->getId(), "integer")
233 . "," . $ilDB->quote((int) $this->getOnline(), "integer")
234 . "," . $ilDB->quote((int) $this->getPublicFiles(), "integer")
235 . "," . $ilDB->quote((int) $this->getDownloadable(), "integer")
236 . "," . $ilDB->quote((int) $this->getDefaultAccess(), "integer")
237 . "," . $ilDB->quote((int) $this->getOrder(), "integer")
238 . "," . $ilDB->quote($this->getViewMode(), "text")
239 . "," . $ilDB->quote((int) $this->getAutoplayMode(), "integer")
240 . "," . $ilDB->quote((int) $this->getNumberInitialVideos(), "integer")
241 . "," . $ilDB->quote((int) $this->getNewItemsInLearningProgress(), "integer")
242 . ")";
243 $ilDB->manipulate($query);
244 return $id;
245 }
ilDBInterface $db
$query

References ilObject\$db, ilObject\$id, $ilDB, $query, getAutoplayMode(), getDefaultAccess(), getDownloadable(), ilObject\getId(), getNewItemsInLearningProgress(), getNumberInitialVideos(), getOnline(), getOrder(), getPublicFiles(), and getViewMode().

+ Here is the call graph for this function:

◆ delete()

ilObjMediaCast::delete ( )

delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!!

Returns
bool true if object was removed completely; false if only a references was removed

Reimplemented from ilObject.

Definition at line 297 of file class.ilObjMediaCast.php.

297 : bool
298 {
300
301 // always call parent delete function first!!
302 if (!parent::delete()) {
303 return false;
304 }
305
306 // delete all items
307 $med_items = $this->getItemsArray();
308 foreach ($med_items as $item) {
309 $news_item = new ilNewsItem($item["id"]);
310 $news_item->delete();
311 }
312
313 $this->deleteOrder();
314
315 // delete record of table il_media_cast_data
316 $query = "DELETE FROM il_media_cast_data" .
317 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
318 $ilDB->manipulate($query);
319
320 return true;
321 }

References ilObject\$db, $ilDB, $query, deleteOrder(), ilObject\getId(), and getItemsArray().

+ Here is the call graph for this function:

◆ deleteOrder()

ilObjMediaCast::deleteOrder ( )

Definition at line 334 of file class.ilObjMediaCast.php.

334 : void
335 {
337
338 if (!$this->getId()) {
339 return;
340 }
341
342 $sql = "DELETE FROM il_media_cast_data_ord" .
343 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
344 $ilDB->manipulate($sql);
345 }

References ilObject\$db, $ilDB, and ilObject\getId().

Referenced by delete(), and saveOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoplayMode()

ilObjMediaCast::getAutoplayMode ( )

Definition at line 118 of file class.ilObjMediaCast.php.

118 : int
119 {
121 }

References $autoplay_mode.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getDefaultAccess()

ilObjMediaCast::getDefaultAccess ( )

Definition at line 193 of file class.ilObjMediaCast.php.

193 : int
194 {
196 }

References $defaultAccess.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getDownloadable()

ilObjMediaCast::getDownloadable ( )

Definition at line 188 of file class.ilObjMediaCast.php.

188 : bool
189 {
190 return $this->downloadable;
191 }

References $downloadable.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getItemsArray()

ilObjMediaCast::getItemsArray ( )

Definition at line 108 of file class.ilObjMediaCast.php.

108 : array
109 {
110 return $this->itemsarray;
111 }

References $itemsarray.

Referenced by delete(), and getSortedItemsArray().

+ Here is the caller graph for this function:

◆ getNewItemsInLearningProgress()

ilObjMediaCast::getNewItemsInLearningProgress ( )

Definition at line 141 of file class.ilObjMediaCast.php.

141 : bool
142 {
144 }

References $new_items_in_lp.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getNumberInitialVideos()

ilObjMediaCast::getNumberInitialVideos ( )

Definition at line 128 of file class.ilObjMediaCast.php.

128 : int
129 {
131 }

References $nr_initial_videos.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOnline()

ilObjMediaCast::getOnline ( )

Definition at line 78 of file class.ilObjMediaCast.php.

78 : bool
79 {
80 return $this->online;
81 }

References $online.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOrder()

ilObjMediaCast::getOrder ( )

Definition at line 208 of file class.ilObjMediaCast.php.

208 : int
209 {
210 return $this->order;
211 }

References $order.

Referenced by create(), getSortedItemsArray(), and update().

+ Here is the caller graph for this function:

◆ getPlaytimeForSeconds()

ilObjMediaCast::getPlaytimeForSeconds ( int  $seconds)

Get playtime for seconds.

Definition at line 536 of file class.ilObjMediaCast.php.

536 : string
537 {
538 $hours = floor($seconds / 3600);
539 $minutes = floor(($seconds % 3600) / 60);
540 $seconds = $seconds % 60;
541 $duration = str_pad($hours, 2, "0", STR_PAD_LEFT) . ":" .
542 str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":" .
543 str_pad($seconds, 2, "0", STR_PAD_LEFT);
544 return $duration;
545 }

◆ getPublicFiles()

ilObjMediaCast::getPublicFiles ( )

Definition at line 88 of file class.ilObjMediaCast.php.

88 : bool
89 {
90 return $this->publicfiles;
91 }

References $publicfiles.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getSortedItemsArray()

ilObjMediaCast::getSortedItemsArray ( )

Definition at line 146 of file class.ilObjMediaCast.php.

146 : array
147 {
148 $med_items = $this->getItemsArray();
149
150 // sort by order setting
151 switch ($this->getOrder()) {
153 $med_items = ilArrayUtil::sortArray($med_items, "title", "asc", false, true);
154 break;
155
157 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "asc", false, true);
158 break;
159
161 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "desc", false, true);
162 break;
163
165 $order = array_flip($this->readOrder());
166 $pos = sizeof($order);
167 foreach (array_keys($med_items) as $idx) {
168 if (array_key_exists($idx, $order)) {
169 $med_items[$idx]["order"] = ($order[$idx] + 1) * 10;
170 }
171 // item has no order yet
172 else {
173 $med_items[$idx]["order"] = (++$pos) * 10;
174 }
175 }
176
177 $med_items = ilArrayUtil::sortArray($med_items, "order", "asc", true, true);
178 break;
179 }
180 return $med_items;
181 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)

References $order, getItemsArray(), getOrder(), ORDER_CREATION_DATE_ASC, ORDER_CREATION_DATE_DESC, ORDER_MANUAL, ORDER_TITLE, readOrder(), and ilArrayUtil\sortArray().

+ Here is the call graph for this function:

◆ getViewMode()

ilObjMediaCast::getViewMode ( )

Definition at line 98 of file class.ilObjMediaCast.php.

98 : string
99 {
100 return $this->view_mode;
101 }

References $view_mode.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ handleLPUpdate()

ilObjMediaCast::handleLPUpdate ( int  $a_user_id,
int  $a_mob_id 
)

Definition at line 479 of file class.ilObjMediaCast.php.

482 : void {
483 $this->mob_tracking->saveCompletion(
484 $a_mob_id,
485 $this->getRefId(),
486 $a_user_id
487 );
488 }

◆ read()

ilObjMediaCast::read ( )

Reimplemented from ilObject.

Definition at line 273 of file class.ilObjMediaCast.php.

273 : void
274 {
276
277 parent::read();
278 $this->readItems();
279
280 $query = "SELECT * FROM il_media_cast_data WHERE id = " .
281 $ilDB->quote($this->getId(), "integer");
282 $set = $ilDB->query($query);
283 $rec = $ilDB->fetchAssoc($set);
284
285 $this->setOnline((bool) $rec["is_online"]);
286 $this->setPublicFiles((bool) $rec["public_files"]);
287 $this->setDownloadable((bool) $rec["downloadable"]);
288 $this->setDefaultAccess((int) $rec["def_access"]);
289 $this->setOrder((int) $rec["sortmode"]);
290 $this->setViewMode((string) $rec["viewmode"]);
291 $this->setAutoplayMode((int) $rec["autoplaymode"]);
292 $this->setNumberInitialVideos((int) $rec["nr_initial_videos"]);
293 $this->setNewItemsInLearningProgress((bool) $rec["new_items_in_lp"]);
294 }
setDownloadable(bool $a_downloadable)
setPublicFiles(bool $a_publicfiles)
setNumberInitialVideos(int $a_val)
setAutoplayMode(int $a_val)
setViewMode(string $a_val)
setNewItemsInLearningProgress(bool $a_val)
Set new items automatically in lp.
setOnline(bool $a_online)

References ilObject\$db, $ilDB, $query, ilObject\getId(), readItems(), setAutoplayMode(), setDefaultAccess(), setDownloadable(), setNewItemsInLearningProgress(), setNumberInitialVideos(), setOnline(), setOrder(), setPublicFiles(), and setViewMode().

+ Here is the call graph for this function:

◆ readItems()

ilObjMediaCast::readItems ( bool  $a_oldest_first = false)

Definition at line 323 of file class.ilObjMediaCast.php.

323 : array
324 {
325 //
326 $it = new ilNewsItem();
327 $it->setContextObjId($this->getId());
328 $it->setContextObjType($this->getType());
329 $this->itemsarray = $it->queryNewsForContext(false, 0, "", false, $a_oldest_first);
330
331 return $this->itemsarray;
332 }

References $itemsarray, ilObject\getId(), and ilObject\getType().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readOrder()

ilObjMediaCast::readOrder ( )

Definition at line 347 of file class.ilObjMediaCast.php.

347 : ?array
348 {
350
351 if (!$this->getId()) {
352 return null;
353 }
354
355 $all = array();
356 $sql = "SELECT item_id FROM il_media_cast_data_ord" .
357 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer") .
358 " ORDER BY pos";
359 $res = $ilDB->query($sql);
360 while ($row = $ilDB->fetchAssoc($res)) {
361 $all[] = $row["item_id"];
362 }
363 return $all;
364 }
$res
Definition: ltiservices.php:69

References ilObject\$db, $ilDB, $res, and ilObject\getId().

Referenced by getSortedItemsArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOrder()

ilObjMediaCast::saveOrder ( array  $a_items)

Definition at line 366 of file class.ilObjMediaCast.php.

366 : void
367 {
369
370 if (!$this->getId()) {
371 return;
372 }
373 $this->deleteOrder();
374
375 $pos = 0;
376 foreach ($a_items as $item_id) {
377 $pos++;
378
379 $sql = "INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)" .
380 " VALUES (" . $ilDB->quote($this->getId(), "integer") . "," .
381 $ilDB->quote($item_id, "integer") . "," .
382 $ilDB->quote($pos, "integer") . ")";
383 $ilDB->manipulate($sql);
384 }
385 }

References ilObject\$db, $ilDB, deleteOrder(), and ilObject\getId().

+ Here is the call graph for this function:

◆ setAutoplayMode()

ilObjMediaCast::setAutoplayMode ( int  $a_val)

Definition at line 113 of file class.ilObjMediaCast.php.

113 : void
114 {
115 $this->autoplay_mode = $a_val;
116 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDefaultAccess()

ilObjMediaCast::setDefaultAccess ( int  $value)

Definition at line 198 of file class.ilObjMediaCast.php.

198 : void
199 {
200 $this->defaultAccess = ($value === 0) ? 0 : 1;
201 }

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setDownloadable()

ilObjMediaCast::setDownloadable ( bool  $a_downloadable)

Definition at line 183 of file class.ilObjMediaCast.php.

183 : void
184 {
185 $this->downloadable = $a_downloadable;
186 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setItemsArray()

ilObjMediaCast::setItemsArray ( array  $a_itemsarray)

Definition at line 103 of file class.ilObjMediaCast.php.

103 : void
104 {
105 $this->itemsarray = $a_itemsarray;
106 }

◆ setNewItemsInLearningProgress()

ilObjMediaCast::setNewItemsInLearningProgress ( bool  $a_val)

Set new items automatically in lp.

Definition at line 136 of file class.ilObjMediaCast.php.

136 : void
137 {
138 $this->new_items_in_lp = $a_val;
139 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setNumberInitialVideos()

ilObjMediaCast::setNumberInitialVideos ( int  $a_val)

Definition at line 123 of file class.ilObjMediaCast.php.

123 : void
124 {
125 $this->nr_initial_videos = $a_val;
126 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjMediaCast::setOnline ( bool  $a_online)

Definition at line 73 of file class.ilObjMediaCast.php.

73 : void
74 {
75 $this->online = $a_online;
76 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setOrder()

ilObjMediaCast::setOrder ( int  $a_value)

Definition at line 203 of file class.ilObjMediaCast.php.

203 : void
204 {
205 $this->order = $a_value;
206 }

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setPublicFiles()

ilObjMediaCast::setPublicFiles ( bool  $a_publicfiles)

Definition at line 83 of file class.ilObjMediaCast.php.

83 : void
84 {
85 $this->publicfiles = $a_publicfiles;
86 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setViewMode()

ilObjMediaCast::setViewMode ( string  $a_val)

Definition at line 93 of file class.ilObjMediaCast.php.

93 : void
94 {
95 $this->view_mode = $a_val;
96 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilObjMediaCast::update ( )

Reimplemented from ilObject.

Definition at line 247 of file class.ilObjMediaCast.php.

247 : bool
248 {
250
251 if (!parent::update()) {
252 return false;
253 }
254
255 // update media cast data
256 $query = "UPDATE il_media_cast_data SET " .
257 " is_online = " . $ilDB->quote((int) $this->getOnline(), "integer") .
258 ", public_files = " . $ilDB->quote((int) $this->getPublicFiles(), "integer") .
259 ", downloadable = " . $ilDB->quote((int) $this->getDownloadable(), "integer") .
260 ", def_access = " . $ilDB->quote($this->getDefaultAccess(), "integer") .
261 ", sortmode = " . $ilDB->quote($this->getOrder(), "integer") .
262 ", viewmode = " . $ilDB->quote($this->getViewMode(), "text") .
263 ", autoplaymode = " . $ilDB->quote($this->getAutoplayMode(), "integer") .
264 ", nr_initial_videos = " . $ilDB->quote($this->getNumberInitialVideos(), "integer") .
265 ", new_items_in_lp = " . $ilDB->quote($this->getNewItemsInLearningProgress(), "integer") .
266 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
267
268 $ilDB->manipulate($query);
269
270 return true;
271 }

References ilObject\$db, $ilDB, $query, getAutoplayMode(), getDefaultAccess(), getDownloadable(), ilObject\getId(), getNewItemsInLearningProgress(), getNumberInitialVideos(), getOnline(), getOrder(), getPublicFiles(), and getViewMode().

+ Here is the call graph for this function:

Field Documentation

◆ $autoplay_mode

int ilObjMediaCast::$autoplay_mode = self::AUTOPLAY_ACT
protected

Definition at line 52 of file class.ilObjMediaCast.php.

Referenced by getAutoplayMode().

◆ $defaultAccess

int ilObjMediaCast::$defaultAccess = 0
protected

Definition at line 48 of file class.ilObjMediaCast.php.

Referenced by getDefaultAccess().

◆ $domain

ILIAS MediaCast InternalDomainService ilObjMediaCast::$domain
protected

Definition at line 37 of file class.ilObjMediaCast.php.

◆ $downloadable

bool ilObjMediaCast::$downloadable = true
protected

Definition at line 45 of file class.ilObjMediaCast.php.

Referenced by getDownloadable().

◆ $itemsarray

array ilObjMediaCast::$itemsarray
protected

Definition at line 40 of file class.ilObjMediaCast.php.

Referenced by getItemsArray(), and readItems().

◆ $mob_mapping

array ilObjMediaCast::$mob_mapping = []
protected

Definition at line 49 of file class.ilObjMediaCast.php.

◆ $mob_tracking

ILIAS MediaObjects Tracking TrackingManager ilObjMediaCast::$mob_tracking
protected

Definition at line 38 of file class.ilObjMediaCast.php.

◆ $new_items_in_lp

bool ilObjMediaCast::$new_items_in_lp = true
protected

Definition at line 51 of file class.ilObjMediaCast.php.

Referenced by getNewItemsInLearningProgress().

◆ $nr_initial_videos

int ilObjMediaCast::$nr_initial_videos = 5
protected

Definition at line 50 of file class.ilObjMediaCast.php.

Referenced by getNumberInitialVideos().

◆ $online

bool ilObjMediaCast::$online = false
protected

Definition at line 43 of file class.ilObjMediaCast.php.

Referenced by getOnline().

◆ $order

int ilObjMediaCast::$order = 0
protected

Definition at line 46 of file class.ilObjMediaCast.php.

Referenced by getOrder(), and getSortedItemsArray().

◆ $publicfiles

bool ilObjMediaCast::$publicfiles = false
protected

Definition at line 44 of file class.ilObjMediaCast.php.

Referenced by getPublicFiles().

◆ $purposes

◆ $user

ilObjUser ilObjMediaCast::$user
protected

Definition at line 41 of file class.ilObjMediaCast.php.

◆ $view_mode

string ilObjMediaCast::$view_mode = self::VIEW_VCAST
protected

Definition at line 47 of file class.ilObjMediaCast.php.

Referenced by getViewMode().

◆ AUTOPLAY_ACT

const ilObjMediaCast::AUTOPLAY_ACT = 1

◆ AUTOPLAY_INACT

const ilObjMediaCast::AUTOPLAY_INACT = 2

Definition at line 36 of file class.ilObjMediaCast.php.

Referenced by ilObjMediaCastGUI\initSettingsForm().

◆ AUTOPLAY_NO

◆ ORDER_CREATION_DATE_ASC

const ilObjMediaCast::ORDER_CREATION_DATE_ASC = 2

◆ ORDER_CREATION_DATE_DESC

const ilObjMediaCast::ORDER_CREATION_DATE_DESC = 3

◆ ORDER_MANUAL

◆ ORDER_TITLE

const ilObjMediaCast::ORDER_TITLE = 1

◆ VIEW_GALLERY

const ilObjMediaCast::VIEW_GALLERY = "gallery"

Definition at line 30 of file class.ilObjMediaCast.php.

Referenced by ilObjMediaCastGUI\showContentObject().

◆ VIEW_IMG_GALLERY

const ilObjMediaCast::VIEW_IMG_GALLERY = "img_gallery"

◆ VIEW_LIST

const ilObjMediaCast::VIEW_LIST = ""

Definition at line 29 of file class.ilObjMediaCast.php.

◆ VIEW_PODCAST

◆ VIEW_VCAST


The documentation for this class was generated from the following file: