86 : array
87 {
91
92 $lm_continue =
new ilCourseLMHistory($this->start_object->getRefId(), $ilUser->getId());
93 $continue_data = $lm_continue->getLMHistory();
94
95 $items = [];
97 foreach ($this->start_object->getStartObjects() as $start) {
98 $obj_id = $ilObjDataCache->lookupObjId((int) $start['item_ref_id']);
99 $ref_id = $start[
'item_ref_id'];
100 $type = $ilObjDataCache->lookupType($obj_id);
101
102 if (!$ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
103 continue;
104 }
105
106
107 if ($this->start_object->isFullfilled($ilUser->getId(),
$ref_id)) {
108 $accomplished = 'accomplished';
109 } else {
110 $accomplished = 'not_accomplished';
111 }
112
113
114 $actions = [];
115
116 if (isset($continue_data[
$ref_id])) {
118 'obj_id',
119 $continue_data[
$ref_id][
'lm_page_id']
120 ]);
121 $actions[
$url] = $this->
lng->txt(
'continue_work');
122 }
123
124 if ($this->enable_desktop) {
125
126 if (!$this->fav_manager->ifIsFavourite($ilUser->getId(),
$ref_id)) {
127 if ($ilAccess->checkAccess(
'read',
'',
$ref_id)) {
128 $this->
ctrl->setParameter($this->parent_obj,
'item_ref_id',
$ref_id);
129 $this->
ctrl->setParameter($this->parent_obj,
'item_id',
$ref_id);
130 $this->
ctrl->setParameter($this->parent_obj,
'type', $type);
131 $url = $this->
ctrl->getLinkTarget($this->parent_obj,
'addToDesk');
132 $actions[
$url] = $this->
lng->txt(
"rep_add_to_favourites");
133 }
134 } else {
135 $this->
ctrl->setParameter($this->parent_obj,
'item_ref_id',
$ref_id);
136 $this->
ctrl->setParameter($this->parent_obj,
'item_id',
$ref_id);
137 $this->
ctrl->setParameter($this->parent_obj,
'type', $type);
138 $url = $this->
ctrl->getLinkTarget($this->parent_obj,
'removeFromDesk');
139 $actions[
$url] = $this->
lng->txt(
"rep_remove_from_favourites");
140 }
141 }
142
143 $default_params = null;
144 if ($type === "tst") {
145 $default_params[
"crs_show_result"] =
$ref_id;
146 }
147
148
149
150
151
152
153
154
155
156 if ($accomplished === 'accomplished') {
157 $icon = "assets/images/standard/icon_ok.svg";
158 } else {
159 $icon = "assets/images/standard/icon_not_ok.svg";
160 }
161
162 $items[] = [
164 "obj_id" => $obj_id,
166 "type" => $type,
167 "append_default" => $default_params,
168 "title" => $ilObjDataCache->lookupTitle($obj_id),
169 "description" => $ilObjDataCache->lookupDescription($obj_id),
170 "status" => $this->
lng->txt(
'crs_objective_' . $accomplished),
171 "status_img" => $icon,
172 "actions" => $actions
173 ];
174 }
175
177 foreach ($items as $item) {
178 $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
179 }
180 $preloader->preload();
181 unset($preloader);
182
183 return $items;
184 }
ilObjectDataCache $obj_data_cache
Preloader for object list GUIs.