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 $this->
lng->loadLanguageModule(
'dash');
126
127 if (!$this->fav_manager->ifIsFavourite($ilUser->getId(),
$ref_id)) {
128 if ($ilAccess->checkAccess(
'read',
'',
$ref_id)) {
129 $this->
ctrl->setParameter($this->parent_obj,
'item_ref_id',
$ref_id);
130 $this->
ctrl->setParameter($this->parent_obj,
'item_id',
$ref_id);
131 $this->
ctrl->setParameter($this->parent_obj,
'type', $type);
132 $url = $this->
ctrl->getLinkTarget($this->parent_obj,
'addToDesk');
133 $actions[
$url] = $this->
lng->txt(
"add_to_favourites");
134 }
135 } else {
136 $this->
ctrl->setParameter($this->parent_obj,
'item_ref_id',
$ref_id);
137 $this->
ctrl->setParameter($this->parent_obj,
'item_id',
$ref_id);
138 $this->
ctrl->setParameter($this->parent_obj,
'type', $type);
139 $url = $this->
ctrl->getLinkTarget($this->parent_obj,
'removeFromDesk');
140 $actions[
$url] = $this->
lng->txt(
"remove_from_favourites");
141 }
142 }
143
144 $default_params = null;
145 if ($type === "tst") {
146 $default_params[
"crs_show_result"] =
$ref_id;
147 }
148
149
150
151
152
153
154
155
156
157 if ($accomplished === 'accomplished') {
158 $icon = "assets/images/standard/icon_ok.svg";
159 } else {
160 $icon = "assets/images/standard/icon_not_ok.svg";
161 }
162
163 $items[] = [
165 "obj_id" => $obj_id,
167 "type" => $type,
168 "append_default" => $default_params,
169 "title" => $ilObjDataCache->lookupTitle($obj_id),
170 "description" => $ilObjDataCache->lookupDescription($obj_id),
171 "status" => $this->
lng->txt(
'crs_objective_' . $accomplished),
172 "status_img" => $icon,
173 "actions" => $actions
174 ];
175 }
176
178 foreach ($items as $item) {
179 $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
180 }
181 $preloader->preload();
182 unset($preloader);
183
184 return $items;
185 }
ilObjectDataCache $obj_data_cache
Preloader for object list GUIs.