62 bool $a_enable_desktop =
true 66 $this->
user = $DIC->user();
67 $this->obj_data_cache = $DIC[
"ilObjDataCache"];
68 $this->
access = $DIC->access();
69 $this->obj_definition = $DIC[
"objDefinition"];
72 $lng = $DIC->language();
73 $ilCtrl = $DIC->ctrl();
76 $this->
lng->loadLanguageModule(
'rep');
77 $this->
ctrl = $ilCtrl;
79 $this->parent_obj = $a_parent_obj;
80 $this->start_object = $a_start_objects;
81 $this->enable_desktop = $a_enable_desktop;
92 $lm_continue =
new ilCourseLMHistory($this->start_object->getRefId(), $ilUser->getId());
93 $continue_data = $lm_continue->getLMHistory();
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);
102 if (!$ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
107 if ($this->start_object->isFullfilled($ilUser->getId(),
$ref_id)) {
108 $accomplished =
'accomplished';
110 $accomplished =
'not_accomplished';
116 if (isset($continue_data[
$ref_id])) {
117 $url = ilLink::_getLink($ref_id,
'', [
119 $continue_data[$ref_id][
'lm_page_id']
121 $actions[
$url] = $this->
lng->txt(
'continue_work');
124 if ($this->enable_desktop) {
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");
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");
143 $default_params =
null;
144 if ($type ===
"tst") {
145 $default_params[
"crs_show_result"] =
$ref_id;
156 if ($accomplished ===
'accomplished') {
157 $icon =
"assets/images/standard/icon_ok.svg";
159 $icon =
"assets/images/standard/icon_not_ok.svg";
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
177 foreach ($items as $item) {
178 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
180 $preloader->preload();
190 if (!isset($this->item_list_guis[$a_type])) {
197 $location = $objDefinition->getLocation($a_type);
201 $full_class =
"ilObj" . $class .
"ListGUI";
202 $item_list_gui =
new $full_class();
203 $this->item_list_guis[$a_type] = $item_list_gui;
205 $item_list_gui = $this->item_list_guis[$a_type];
208 $item_list_gui->setDefaultCommandParameters([]);
210 return $item_list_gui;
217 if (!$item_list_gui) {
221 $item_list_gui->setContainerObject($this);
222 $item_list_gui->enableCommands(
true,
true);
227 $item_list_gui->enableNotes(
false);
228 $item_list_gui->enableComments(
false);
229 $item_list_gui->enableTags(
false);
231 $item_list_gui->enableIcon(
true);
232 $item_list_gui->enableDelete(
false);
233 $item_list_gui->enableCut(
false);
234 $item_list_gui->enableCopy(
false);
235 $item_list_gui->enableLink(
false);
236 $item_list_gui->enableInfoScreen(
true);
237 $item_list_gui->enableSubscribe(
false);
242 $item_list_gui->enableDescription(
false);
243 $item_list_gui->enableProperties(
false);
244 $item_list_gui->enablePreconditions(
false);
247 if ($a_item[
"append_default"]) {
248 $item_list_gui->setDefaultCommandParameters($a_item[
"append_default"]);
250 if (is_object($item_list_gui)) {
251 return $item_list_gui->getListItemHTML(
255 $a_item[
"description"]
263 $status_icon = $this->ui_factory->symbol()->icon()->custom(
269 foreach ($item[
'actions'] as
$url => $caption) {
270 $actions[] = $this->ui_factory->button()->shy($caption,
$url);
273 $secondary_info = $this->ui_factory->listing()->property()->withItems([
274 [$this->
lng->txt(
'crs_objective_accomplished'), $status_icon],
275 [$this->
lng->txt(
'actions'), $this->ui_renderer->render($actions)]
278 return $this->ui_factory->panel()->sub(
280 $this->ui_factory->legacy()->content($this->
getListItem($item))
281 )->withFurtherInformation(
282 $this->ui_factory->panel()->secondary()->legacy(
284 $this->ui_factory->legacy()->content($this->ui_renderer->render($secondary_info))
291 $info = $this->ui_factory->panel()->sub(
293 $this->ui_factory->legacy()->content($this->
lng->txt(
'crs_info_start'))
296 foreach ($this->
getData() as $datum) {
300 $panel = $this->ui_factory->panel()->standard(
301 $this->
lng->txt(
'crs_table_start_objects'),
304 return $this->ui_renderer->render($panel);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectDataCache $obj_data_cache
ilContainerStartObjects $start_object
ilContainerGUI $parent_obj
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilFavouritesManager $fav_manager
getItemListGUI(string $a_type)
getClassName(string $obj_name)
ilObjectDefinition $obj_definition
getItemAsSubPanel(array $item)
getListItem(array $a_item)
__construct(ilContainerGUI $a_parent_obj, ilContainerStartObjects $a_start_objects, UIFactory $ui_factory, UIRenderer $ui_renderer, bool $a_enable_desktop=true)