ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 ()
 
 setComments (bool $comments)
 
 getComments ()
 
 setPublicFiles (bool $a_publicfiles)
 
 getPublicFiles ()
 
 setViewMode (string $a_val)
 
 getViewMode ()
 
 setItemsArray (array $a_itemsarray)
 
 getItemsArray ()
 
 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
 getObjectProperties ()
 
 flushObjectProperties ()
 
 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 $description)
 
 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, int $new_obj_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"
 
- 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

bool $comments = false
 
ILIAS Notes Service $notes
 
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
 
- 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
 
LOMServices $lom_services
 
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 = ""
 
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 getIconForType (string $type)
 
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  $a_id = 0,
bool  $a_call_by_reference = true 
)

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

55 {
56 global $DIC;
57
58 $this->db = $DIC->database();
59 $this->user = $DIC->user();
60 $this->type = "mcst";
61 $mcst_set = new ilSetting("mcst");
62 $this->setDefaultAccess($mcst_set->get("defaultaccess") == "users" ? 0 : 1);
63 $this->setOrder(self::ORDER_CREATION_DATE_DESC);
64 $this->mob_tracking = $DIC->mediaObjects()->internal()
65 ->domain()
66 ->tracking();
67 $this->notes = $DIC->notes();
68 $this->domain = $DIC->mediaCast()->internal()->domain();
69 parent::__construct($a_id, $a_call_by_reference);
70 }
setOrder(int $a_value)
setDefaultAccess(int $value)
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 502 of file class.ilObjMediaCast.php.

507 : int {
508 $mob = new ilObjMediaObject($mob_id);
509 if ($extract) {
510 try {
511 $mob->getExternalMetadata();
512 } catch (Exception $e) {
513 }
514 }
515 $news_set = new ilSetting("news");
516 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
517
518 // create new media cast item
519 $mc_item = new ilNewsItem();
520 $mc_item->setMobId($mob->getId());
521 $mc_item->setContentType(NEWS_AUDIO);
522 $mc_item->setContextObjId($this->getId());
523 $mc_item->setContextObjType($this->getType());
524 $mc_item->setUserId($user_id);
525 $med_item = $mob->getMediaItem("Standard");
526 $mc_item->setPlaytime($this->getPlaytimeForSeconds($med_item->getDuration()));
527 $mc_item->setTitle($mob->getTitle());
528 $mc_item->setContent($mob->getLongDescription());
529 if ($long_desc != "") {
530 $mc_item->setContent($long_desc);
531 }
532 $mc_item->setLimitation(false);
533 $mc_item->setVisibility($this->getDefaultAccess() == 0 ? "users" : "public");
534 $mc_item->create();
535
536 $lp = $this->domain->learningProgress($this);
537 $lp->addItemToLP($mob_id);
538
539 return $mc_item->getId();
540 }
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 458 of file class.ilObjMediaCast.php.

458 : array
459 {
460 $ilUser = $this->user;
461
462 $item_mapping = [];
463 foreach ($this->readItems(true) as $item) {
464 // copy media object
465 $mob_id = $item["mob_id"];
466 $mob = new ilObjMediaObject($mob_id);
467 $new_mob = $mob->duplicate();
468
469 // copy news item
470 // create new media cast item
471 $mc_item = new ilNewsItem();
472 $mc_item->setMobId($new_mob->getId());
473 $mc_item->setContentType(NEWS_AUDIO);
474 $mc_item->setContextObjId($a_new_obj->getId());
475 $mc_item->setContextObjType($a_new_obj->getType());
476 $mc_item->setUserId($ilUser->getId());
477 $mc_item->setPlaytime($item["playtime"] ?? "");
478 $mc_item->setTitle($item["title"] ?? "");
479 $mc_item->setContent($item["content"] ?? "");
480 $mc_item->setVisibility($item["visibility"] ?? "users");
481 $mc_item->create();
482 $this->mob_mapping[$mob_id] = $new_mob->getId();
483 $item_mapping[$item["id"]] = $mc_item->getId();
484 }
485 return $item_mapping;
486 }
readItems(bool $a_oldest_first=false)

References 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 394 of file class.ilObjMediaCast.php.

397 : void {
398 $items = [];
399 foreach ($this->readOrder() as $i) {
400 if (!array_key_exists($i, $mapping)) {
401 continue;
402 }
403 $items[] = $mapping[$i];
404 }
405 $newObj->saveOrder($items);
406 }
saveOrder(array $a_items)

◆ create()

ilObjMediaCast::create ( )

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

Reimplemented from ilObject.

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

212 : int
213 {
215
216 $id = parent::create();
217
218 $this->createMetaData();
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(0, "integer")
240 . "," . $ilDB->quote((int) $this->getNumberInitialVideos(), "integer")
241 . "," . $ilDB->quote((int) $this->getNewItemsInLearningProgress(), "integer")
242 . ")";
243 $ilDB->manipulate($query);
244 return $id;
245 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
ilDBInterface $db

References ilObject\$db, $id, $ilDB, ilObject\createMetaData(), 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 302 of file class.ilObjMediaCast.php.

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

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

+ Here is the call graph for this function:

◆ deleteOrder()

ilObjMediaCast::deleteOrder ( )

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

341 : void
342 {
344
345 if (!$this->getId()) {
346 return;
347 }
348
349 $sql = "DELETE FROM il_media_cast_data_ord" .
350 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
351 $ilDB->manipulate($sql);
352 }

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:

◆ getComments()

ilObjMediaCast::getComments ( )

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

87 : bool
88 {
89 return $this->comments;
90 }

References $comments.

Referenced by update().

+ Here is the caller graph for this function:

◆ getDefaultAccess()

ilObjMediaCast::getDefaultAccess ( )

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

191 : int
192 {
194 }

References $defaultAccess.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getDownloadable()

ilObjMediaCast::getDownloadable ( )

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

186 : bool
187 {
188 return $this->downloadable;
189 }

References $downloadable.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getItemsArray()

ilObjMediaCast::getItemsArray ( )

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

117 : array
118 {
119 return $this->itemsarray;
120 }

References $itemsarray.

Referenced by delete(), and getSortedItemsArray().

+ Here is the caller graph for this function:

◆ getNewItemsInLearningProgress()

ilObjMediaCast::getNewItemsInLearningProgress ( )

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

140 : bool
141 {
143 }

References $new_items_in_lp.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getNumberInitialVideos()

ilObjMediaCast::getNumberInitialVideos ( )

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

127 : int
128 {
130 }

References $nr_initial_videos.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOnline()

ilObjMediaCast::getOnline ( )

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

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

References $online.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOrder()

ilObjMediaCast::getOrder ( )

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

206 : int
207 {
208 return $this->order;
209 }

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 545 of file class.ilObjMediaCast.php.

545 : string
546 {
547 $hours = floor($seconds / 3600);
548 $minutes = floor(($seconds % 3600) / 60);
549 $seconds = $seconds % 60;
550 $duration = str_pad($hours, 2, "0", STR_PAD_LEFT) . ":" .
551 str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":" .
552 str_pad($seconds, 2, "0", STR_PAD_LEFT);
553 return $duration;
554 }
$duration

References $duration.

◆ getPublicFiles()

ilObjMediaCast::getPublicFiles ( )

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

97 : bool
98 {
99 return $this->publicfiles;
100 }

References $publicfiles.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getSortedItemsArray()

ilObjMediaCast::getSortedItemsArray ( )

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

145 : array
146 {
147 $med_items = $this->getItemsArray();
148 // sort by order setting
149 switch ($this->getOrder()) {
151 $med_items = ilArrayUtil::sortArray($med_items, "title", "asc", false, true);
152 break;
153
155 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "asc", false, true);
156 break;
157
159 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "desc", false, true);
160 break;
161
163 $order = array_flip($this->readOrder());
164 $pos = sizeof($order);
165 foreach (array_keys($med_items) as $idx) {
166 if (array_key_exists($idx, $order)) {
167 $med_items[$idx]["order"] = ($order[$idx] + 1) * 10;
168 }
169 // item has no order yet
170 else {
171 $med_items[$idx]["order"] = (++$pos) * 10;
172 }
173 }
174
175 $med_items = ilArrayUtil::sortArray($med_items, "order", "asc", true, true);
176 break;
177 }
178 return $med_items;
179 }
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 107 of file class.ilObjMediaCast.php.

107 : string
108 {
109 return $this->view_mode;
110 }

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 488 of file class.ilObjMediaCast.php.

491 : void {
492 $this->mob_tracking->saveCompletion(
493 $a_mob_id,
494 $this->getRefId(),
495 $a_user_id
496 );
497 }

◆ read()

ilObjMediaCast::read ( )

Reimplemented from ilObject.

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

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

References ilObject\$db, $ilDB, ilObject\getId(), readItems(), setComments(), 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 330 of file class.ilObjMediaCast.php.

330 : array
331 {
332 //
333 $it = new ilNewsItem();
334 $it->setContextObjId($this->getId());
335 $it->setContextObjType($this->getType());
336 $this->itemsarray = $it->queryNewsForContext(false, 0, "", false, $a_oldest_first);
337
338 return $this->itemsarray;
339 }

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 354 of file class.ilObjMediaCast.php.

354 : ?array
355 {
357
358 if (!$this->getId()) {
359 return null;
360 }
361
362 $all = array();
363 $sql = "SELECT item_id FROM il_media_cast_data_ord" .
364 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer") .
365 " ORDER BY pos";
366 $res = $ilDB->query($sql);
367 while ($row = $ilDB->fetchAssoc($res)) {
368 $all[] = $row["item_id"];
369 }
370 return $all;
371 }
$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 373 of file class.ilObjMediaCast.php.

373 : void
374 {
376
377 if (!$this->getId()) {
378 return;
379 }
380 $this->deleteOrder();
381
382 $pos = 0;
383 foreach ($a_items as $item_id) {
384 $pos++;
385
386 $sql = "INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)" .
387 " VALUES (" . $ilDB->quote($this->getId(), "integer") . "," .
388 $ilDB->quote($item_id, "integer") . "," .
389 $ilDB->quote($pos, "integer") . ")";
390 $ilDB->manipulate($sql);
391 }
392 }

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

+ Here is the call graph for this function:

◆ setComments()

ilObjMediaCast::setComments ( bool  $comments)

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

82 : void
83 {
84 $this->comments = $comments;
85 }

References $comments.

Referenced by read().

+ Here is the caller graph for this function:

◆ setDefaultAccess()

ilObjMediaCast::setDefaultAccess ( int  $value)

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

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

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setDownloadable()

ilObjMediaCast::setDownloadable ( bool  $a_downloadable)

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

181 : void
182 {
183 $this->downloadable = $a_downloadable;
184 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setItemsArray()

ilObjMediaCast::setItemsArray ( array  $a_itemsarray)

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

112 : void
113 {
114 $this->itemsarray = $a_itemsarray;
115 }

◆ setNewItemsInLearningProgress()

ilObjMediaCast::setNewItemsInLearningProgress ( bool  $a_val)

Set new items automatically in lp.

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setNumberInitialVideos()

ilObjMediaCast::setNumberInitialVideos ( int  $a_val)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjMediaCast::setOnline ( bool  $a_online)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setOrder()

ilObjMediaCast::setOrder ( int  $a_value)

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

201 : void
202 {
203 $this->order = $a_value;
204 }

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setPublicFiles()

ilObjMediaCast::setPublicFiles ( bool  $a_publicfiles)

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

92 : void
93 {
94 $this->publicfiles = $a_publicfiles;
95 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setViewMode()

ilObjMediaCast::setViewMode ( string  $a_val)

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

102 : void
103 {
104 $this->view_mode = $a_val;
105 }

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 $this->updateMetaData();
256
257 // update media cast data
258 $query = "UPDATE il_media_cast_data SET " .
259 " is_online = " . $ilDB->quote((int) $this->getOnline(), "integer") .
260 ", public_files = " . $ilDB->quote((int) $this->getPublicFiles(), "integer") .
261 ", downloadable = " . $ilDB->quote((int) $this->getDownloadable(), "integer") .
262 ", def_access = " . $ilDB->quote($this->getDefaultAccess(), "integer") .
263 ", sortmode = " . $ilDB->quote($this->getOrder(), "integer") .
264 ", viewmode = " . $ilDB->quote($this->getViewMode(), "text") .
265 ", autoplaymode = " . $ilDB->quote(0, "integer") .
266 ", nr_initial_videos = " . $ilDB->quote($this->getNumberInitialVideos(), "integer") .
267 ", new_items_in_lp = " . $ilDB->quote($this->getNewItemsInLearningProgress(), "integer") .
268 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
269
270 $ilDB->manipulate($query);
271
272 $this->notes->domain()->activateComments($this->getId(), $this->getComments());
273
274 return true;
275 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $comments

bool ilObjMediaCast::$comments = false
protected

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

Referenced by getComments(), and setComments().

◆ $defaultAccess

int ilObjMediaCast::$defaultAccess = 0
protected

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

Referenced by getDefaultAccess().

◆ $domain

ILIAS MediaCast InternalDomainService ilObjMediaCast::$domain
protected

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

◆ $downloadable

bool ilObjMediaCast::$downloadable = true
protected

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

Referenced by getDownloadable().

◆ $itemsarray

array ilObjMediaCast::$itemsarray
protected

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

Referenced by getItemsArray(), and readItems().

◆ $mob_mapping

array ilObjMediaCast::$mob_mapping = []
protected

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

◆ $mob_tracking

ILIAS MediaObjects Tracking TrackingManager ilObjMediaCast::$mob_tracking
protected

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

◆ $new_items_in_lp

bool ilObjMediaCast::$new_items_in_lp = true
protected

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

Referenced by getNewItemsInLearningProgress().

◆ $notes

ILIAS Notes Service ilObjMediaCast::$notes
protected

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

◆ $nr_initial_videos

int ilObjMediaCast::$nr_initial_videos = 5
protected

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

Referenced by getNumberInitialVideos().

◆ $online

bool ilObjMediaCast::$online = false
protected

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

Referenced by getOnline().

◆ $order

int ilObjMediaCast::$order = 0
protected

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

Referenced by getOrder(), and getSortedItemsArray().

◆ $publicfiles

bool ilObjMediaCast::$publicfiles = false
protected

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

Referenced by getPublicFiles().

◆ $purposes

◆ $user

ilObjUser ilObjMediaCast::$user
protected

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

◆ $view_mode

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

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

Referenced by getViewMode().

◆ 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

◆ 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: