ILIAS  release_8 Revision v8.24
class.ilLPCollectionOfMediaObjects.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=0);
4/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
5
12{
13 protected static array $possible_items = array();
14
15 public function getPossibleItems(): array
16 {
17 if (!isset(self::$possible_items[$this->obj_id])) {
18 $items = array();
19
20 $cast = new ilObjMediaCast($this->obj_id, false);
21
22 foreach ($cast->getSortedItemsArray() as $item) {
23 $items[$item["mob_id"]] = array("title" => $item["title"]);
24 }
25 self::$possible_items[$this->obj_id] = $items;
26 }
27 return self::$possible_items[$this->obj_id];
28 }
29
30 public function getTableGUIData(int $a_parent_ref_id): array
31 {
32 $data = array();
33
34 foreach ($this->getPossibleItems() as $mob_id => $item) {
35 $tmp = array();
36 $tmp['id'] = $mob_id;
37 $tmp['ref_id'] = 0;
38 $tmp['type'] = 'mob';
39 $tmp['title'] = $item['title'];
40 $tmp['status'] = $this->isAssignedEntry($mob_id);
41
42 $data[] = $tmp;
43 }
44
45 return $data;
46 }
47
54 public function cloneCollection(int $a_target_id, int $a_copy_id): void
55 {
56 $target_obj_id = ilObject::_lookupObjId($a_target_id);
57 $new_collection = new static($target_obj_id, $this->mode);
58 $possible_items = $new_collection->getPossibleItems();
59 foreach ($this->items as $item_id) {
60 if (isset($mob_mapping[$item_id]) && isset($possible_items[$mob_mapping[$item_id]])) {
61 $new_collection->addEntry($mob_mapping[$item_id]);
62 }
63 }
64 }
65}
cloneCollection(int $a_target_id, int $a_copy_id)
Scorm items are not copied, they are newly created by reading the manifest.
LP collection base class.
isAssignedEntry(int $a_item_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)