ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 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
 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"
 
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

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

59 {
60 global $DIC;
61
62 $this->db = $DIC->database();
63 $this->user = $DIC->user();
64 $this->type = "mcst";
65 $mcst_set = new ilSetting("mcst");
66 $this->setDefaultAccess($mcst_set->get("defaultaccess") == "users" ? 0 : 1);
67 $this->setOrder(self::ORDER_CREATION_DATE_DESC);
68 $this->mob_tracking = $DIC->mediaObjects()->internal()
69 ->domain()
70 ->tracking();
71 $this->notes = $DIC->notes();
72 $this->domain = $DIC->mediaCast()->internal()->domain();
73 parent::__construct($a_id, $a_call_by_reference);
74 }
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 518 of file class.ilObjMediaCast.php.

523 : int {
524 $mob = new ilObjMediaObject($mob_id);
525 if ($extract) {
526 try {
527 $mob->getExternalMetadata();
528 } catch (Exception $e) {
529 }
530 }
531 $news_set = new ilSetting("news");
532 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
533
534 // create new media cast item
535 $mc_item = new ilNewsItem();
536 $mc_item->setMobId($mob->getId());
537 $mc_item->setContentType(NEWS_AUDIO);
538 $mc_item->setContextObjId($this->getId());
539 $mc_item->setContextObjType($this->getType());
540 $mc_item->setUserId($user_id);
541 $med_item = $mob->getMediaItem("Standard");
542 $mc_item->setPlaytime($this->getPlaytimeForSeconds($med_item->getDuration()));
543 $mc_item->setTitle($mob->getTitle());
544 $mc_item->setContent($mob->getLongDescription());
545 if ($long_desc != "") {
546 $mc_item->setContent($long_desc);
547 }
548 $mc_item->setLimitation(false);
549 $mc_item->setVisibility($this->getDefaultAccess() == 0 ? "users" : "public");
550 $mc_item->create();
551
552 $lp = $this->domain->learningProgress($this);
553 $lp->addItemToLP($mob_id);
554
555 return $mc_item->getId();
556 }
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 474 of file class.ilObjMediaCast.php.

474 : array
475 {
476 $ilUser = $this->user;
477
478 $item_mapping = [];
479 foreach ($this->readItems(true) as $item) {
480 // copy media object
481 $mob_id = $item["mob_id"];
482 $mob = new ilObjMediaObject($mob_id);
483 $new_mob = $mob->duplicate();
484
485 // copy news item
486 // create new media cast item
487 $mc_item = new ilNewsItem();
488 $mc_item->setMobId($new_mob->getId());
489 $mc_item->setContentType(NEWS_AUDIO);
490 $mc_item->setContextObjId($a_new_obj->getId());
491 $mc_item->setContextObjType($a_new_obj->getType());
492 $mc_item->setUserId($ilUser->getId());
493 $mc_item->setPlaytime($item["playtime"] ?? "");
494 $mc_item->setTitle($item["title"] ?? "");
495 $mc_item->setContent($item["content"] ?? "");
496 $mc_item->setVisibility($item["visibility"] ?? "users");
497 $mc_item->create();
498 $this->mob_mapping[$mob_id] = $new_mob->getId();
499 $item_mapping[$item["id"]] = $mc_item->getId();
500 }
501 return $item_mapping;
502 }
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 409 of file class.ilObjMediaCast.php.

412 : void {
413 $items = [];
414 foreach ($this->readOrder() as $i) {
415 if (!array_key_exists($i, $mapping)) {
416 continue;
417 }
418 $items[] = $mapping[$i];
419 }
420 $newObj->saveOrder($items);
421 }
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 226 of file class.ilObjMediaCast.php.

226 : int
227 {
229
230 $id = parent::create();
231
232 $this->createMetaData();
233
234 $query = "INSERT INTO il_media_cast_data (" .
235 " id" .
236 ", is_online" .
237 ", public_files" .
238 ", downloadable" .
239 ", def_access" .
240 ", sortmode" .
241 ", viewmode" .
242 ", autoplaymode" .
243 ", nr_initial_videos" .
244 ", new_items_in_lp" .
245 " ) VALUES (" .
246 $ilDB->quote($this->getId(), "integer")
247 . "," . $ilDB->quote((int) $this->getOnline(), "integer")
248 . "," . $ilDB->quote((int) $this->getPublicFiles(), "integer")
249 . "," . $ilDB->quote((int) $this->getDownloadable(), "integer")
250 . "," . $ilDB->quote((int) $this->getDefaultAccess(), "integer")
251 . "," . $ilDB->quote((int) $this->getOrder(), "integer")
252 . "," . $ilDB->quote($this->getViewMode(), "text")
253 . "," . $ilDB->quote((int) $this->getAutoplayMode(), "integer")
254 . "," . $ilDB->quote((int) $this->getNumberInitialVideos(), "integer")
255 . "," . $ilDB->quote((int) $this->getNewItemsInLearningProgress(), "integer")
256 . ")";
257 $ilDB->manipulate($query);
258 return $id;
259 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
ilDBInterface $db

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

317 : bool
318 {
320
321 // always call parent delete function first!!
322 if (!parent::delete()) {
323 return false;
324 }
325
326 $this->deleteMetaData();
327
328 // delete all items
329 $med_items = $this->getItemsArray();
330 foreach ($med_items as $item) {
331 $news_item = new ilNewsItem($item["id"]);
332 $news_item->delete();
333 }
334
335 $this->deleteOrder();
336
337 // delete record of table il_media_cast_data
338 $query = "DELETE FROM il_media_cast_data" .
339 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
340 $ilDB->manipulate($query);
341
342 return true;
343 }

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

356 : void
357 {
359
360 if (!$this->getId()) {
361 return;
362 }
363
364 $sql = "DELETE FROM il_media_cast_data_ord" .
365 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
366 $ilDB->manipulate($sql);
367 }

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

131 : int
132 {
134 }

References $autoplay_mode.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getComments()

ilObjMediaCast::getComments ( )

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

91 : bool
92 {
93 return $this->comments;
94 }

References $comments.

Referenced by update().

+ Here is the caller graph for this function:

◆ getDefaultAccess()

ilObjMediaCast::getDefaultAccess ( )

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

205 : int
206 {
208 }

References $defaultAccess.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getDownloadable()

ilObjMediaCast::getDownloadable ( )

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

200 : bool
201 {
202 return $this->downloadable;
203 }

References $downloadable.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getItemsArray()

ilObjMediaCast::getItemsArray ( )

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

121 : array
122 {
123 return $this->itemsarray;
124 }

References $itemsarray.

Referenced by delete(), and getSortedItemsArray().

+ Here is the caller graph for this function:

◆ getNewItemsInLearningProgress()

ilObjMediaCast::getNewItemsInLearningProgress ( )

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

154 : bool
155 {
157 }

References $new_items_in_lp.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getNumberInitialVideos()

ilObjMediaCast::getNumberInitialVideos ( )

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

141 : int
142 {
144 }

References $nr_initial_videos.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOnline()

ilObjMediaCast::getOnline ( )

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

81 : bool
82 {
83 return $this->online;
84 }

References $online.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getOrder()

ilObjMediaCast::getOrder ( )

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

220 : int
221 {
222 return $this->order;
223 }

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

561 : string
562 {
563 $hours = floor($seconds / 3600);
564 $minutes = floor(($seconds % 3600) / 60);
565 $seconds = $seconds % 60;
566 $duration = str_pad($hours, 2, "0", STR_PAD_LEFT) . ":" .
567 str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":" .
568 str_pad($seconds, 2, "0", STR_PAD_LEFT);
569 return $duration;
570 }
$duration

References $duration.

◆ getPublicFiles()

ilObjMediaCast::getPublicFiles ( )

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

101 : bool
102 {
103 return $this->publicfiles;
104 }

References $publicfiles.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getSortedItemsArray()

ilObjMediaCast::getSortedItemsArray ( )

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

159 : array
160 {
161 $med_items = $this->getItemsArray();
162 // sort by order setting
163 switch ($this->getOrder()) {
165 $med_items = ilArrayUtil::sortArray($med_items, "title", "asc", false, true);
166 break;
167
169 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "asc", false, true);
170 break;
171
173 $med_items = ilArrayUtil::sortArray($med_items, "creation_date", "desc", false, true);
174 break;
175
177 $order = array_flip($this->readOrder());
178 $pos = sizeof($order);
179 foreach (array_keys($med_items) as $idx) {
180 if (array_key_exists($idx, $order)) {
181 $med_items[$idx]["order"] = ($order[$idx] + 1) * 10;
182 }
183 // item has no order yet
184 else {
185 $med_items[$idx]["order"] = (++$pos) * 10;
186 }
187 }
188
189 $med_items = ilArrayUtil::sortArray($med_items, "order", "asc", true, true);
190 break;
191 }
192 return $med_items;
193 }
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 111 of file class.ilObjMediaCast.php.

111 : string
112 {
113 return $this->view_mode;
114 }

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

507 : void {
508 $this->mob_tracking->saveCompletion(
509 $a_mob_id,
510 $this->getRefId(),
511 $a_user_id
512 );
513 }

◆ read()

ilObjMediaCast::read ( )

Reimplemented from ilObject.

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

291 : void
292 {
294
295 parent::read();
296 $this->readItems();
297
298 $query = "SELECT * FROM il_media_cast_data WHERE id = " .
299 $ilDB->quote($this->getId(), "integer");
300 $set = $ilDB->query($query);
301 $rec = $ilDB->fetchAssoc($set);
302
303 $this->setOnline((bool) $rec["is_online"]);
304 $this->setPublicFiles((bool) $rec["public_files"]);
305 $this->setDownloadable((bool) $rec["downloadable"]);
306 $this->setDefaultAccess((int) $rec["def_access"]);
307 $this->setOrder((int) $rec["sortmode"]);
308 $this->setViewMode((string) $rec["viewmode"]);
309 $this->setAutoplayMode((int) $rec["autoplaymode"]);
310 $this->setNumberInitialVideos((int) $rec["nr_initial_videos"]);
311 $this->setNewItemsInLearningProgress((bool) $rec["new_items_in_lp"]);
312
313 $this->setComments($this->notes->domain()->commentsActive($this->getId()));
314 }
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.
setComments(bool $comments)
setOnline(bool $a_online)

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

345 : array
346 {
347 //
348 $it = new ilNewsItem();
349 $it->setContextObjId($this->getId());
350 $it->setContextObjType($this->getType());
351 $this->itemsarray = $it->queryNewsForContext(false, 0, "", false, $a_oldest_first);
352
353 return $this->itemsarray;
354 }

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

369 : ?array
370 {
372
373 if (!$this->getId()) {
374 return null;
375 }
376
377 $all = array();
378 $sql = "SELECT item_id FROM il_media_cast_data_ord" .
379 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer") .
380 " ORDER BY pos";
381 $res = $ilDB->query($sql);
382 while ($row = $ilDB->fetchAssoc($res)) {
383 $all[] = $row["item_id"];
384 }
385 return $all;
386 }
$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 388 of file class.ilObjMediaCast.php.

388 : void
389 {
391
392 if (!$this->getId()) {
393 return;
394 }
395 $this->deleteOrder();
396
397 $pos = 0;
398 foreach ($a_items as $item_id) {
399 $pos++;
400
401 $sql = "INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)" .
402 " VALUES (" . $ilDB->quote($this->getId(), "integer") . "," .
403 $ilDB->quote($item_id, "integer") . "," .
404 $ilDB->quote($pos, "integer") . ")";
405 $ilDB->manipulate($sql);
406 }
407 }

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

126 : void
127 {
128 $this->autoplay_mode = $a_val;
129 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setComments()

ilObjMediaCast::setComments ( bool  $comments)

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

86 : void
87 {
88 $this->comments = $comments;
89 }

References $comments.

Referenced by read().

+ Here is the caller graph for this function:

◆ setDefaultAccess()

ilObjMediaCast::setDefaultAccess ( int  $value)

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

210 : void
211 {
212 $this->defaultAccess = ($value === 0) ? 0 : 1;
213 }

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setDownloadable()

ilObjMediaCast::setDownloadable ( bool  $a_downloadable)

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

195 : void
196 {
197 $this->downloadable = $a_downloadable;
198 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setItemsArray()

ilObjMediaCast::setItemsArray ( array  $a_itemsarray)

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

116 : void
117 {
118 $this->itemsarray = $a_itemsarray;
119 }

◆ setNewItemsInLearningProgress()

ilObjMediaCast::setNewItemsInLearningProgress ( bool  $a_val)

Set new items automatically in lp.

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

149 : void
150 {
151 $this->new_items_in_lp = $a_val;
152 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setNumberInitialVideos()

ilObjMediaCast::setNumberInitialVideos ( int  $a_val)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjMediaCast::setOnline ( bool  $a_online)

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

76 : void
77 {
78 $this->online = $a_online;
79 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setOrder()

ilObjMediaCast::setOrder ( int  $a_value)

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

215 : void
216 {
217 $this->order = $a_value;
218 }

Referenced by __construct(), and read().

+ Here is the caller graph for this function:

◆ setPublicFiles()

ilObjMediaCast::setPublicFiles ( bool  $a_publicfiles)

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

96 : void
97 {
98 $this->publicfiles = $a_publicfiles;
99 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setViewMode()

ilObjMediaCast::setViewMode ( string  $a_val)

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

106 : void
107 {
108 $this->view_mode = $a_val;
109 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilObjMediaCast::update ( )

Reimplemented from ilObject.

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

261 : bool
262 {
264
265 if (!parent::update()) {
266 return false;
267 }
268
269 $this->updateMetaData();
270
271 // update media cast data
272 $query = "UPDATE il_media_cast_data SET " .
273 " is_online = " . $ilDB->quote((int) $this->getOnline(), "integer") .
274 ", public_files = " . $ilDB->quote((int) $this->getPublicFiles(), "integer") .
275 ", downloadable = " . $ilDB->quote((int) $this->getDownloadable(), "integer") .
276 ", def_access = " . $ilDB->quote($this->getDefaultAccess(), "integer") .
277 ", sortmode = " . $ilDB->quote($this->getOrder(), "integer") .
278 ", viewmode = " . $ilDB->quote($this->getViewMode(), "text") .
279 ", autoplaymode = " . $ilDB->quote($this->getAutoplayMode(), "integer") .
280 ", nr_initial_videos = " . $ilDB->quote($this->getNumberInitialVideos(), "integer") .
281 ", new_items_in_lp = " . $ilDB->quote($this->getNewItemsInLearningProgress(), "integer") .
282 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
283
284 $ilDB->manipulate($query);
285
286 $this->notes->domain()->activateComments($this->getId(), $this->getComments());
287
288 return true;
289 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $autoplay_mode

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

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

Referenced by getAutoplayMode().

◆ $comments

bool ilObjMediaCast::$comments = false
protected

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

Referenced by getComments(), and setComments().

◆ $defaultAccess

int ilObjMediaCast::$defaultAccess = 0
protected

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

Referenced by getDefaultAccess().

◆ $domain

ILIAS MediaCast InternalDomainService ilObjMediaCast::$domain
protected

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

◆ $downloadable

bool ilObjMediaCast::$downloadable = true
protected

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

Referenced by getDownloadable().

◆ $itemsarray

array ilObjMediaCast::$itemsarray
protected

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

Referenced by getItemsArray(), and readItems().

◆ $mob_mapping

array ilObjMediaCast::$mob_mapping = []
protected

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

◆ $mob_tracking

ILIAS MediaObjects Tracking TrackingManager ilObjMediaCast::$mob_tracking
protected

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

◆ $new_items_in_lp

bool ilObjMediaCast::$new_items_in_lp = true
protected

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

Referenced by getNewItemsInLearningProgress().

◆ $notes

ILIAS Notes Service ilObjMediaCast::$notes
protected

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

◆ $nr_initial_videos

int ilObjMediaCast::$nr_initial_videos = 5
protected

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

Referenced by getNumberInitialVideos().

◆ $online

bool ilObjMediaCast::$online = false
protected

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

Referenced by getOnline().

◆ $order

int ilObjMediaCast::$order = 0
protected

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

Referenced by getOrder(), and getSortedItemsArray().

◆ $publicfiles

bool ilObjMediaCast::$publicfiles = false
protected

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

Referenced by getPublicFiles().

◆ $purposes

◆ $user

ilObjUser ilObjMediaCast::$user
protected

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

◆ $view_mode

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

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

Referenced by getViewMode().

◆ AUTOPLAY_ACT

const ilObjMediaCast::AUTOPLAY_ACT = 1

◆ AUTOPLAY_INACT

const ilObjMediaCast::AUTOPLAY_INACT = 2

◆ 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

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