4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
26 $this->start_object = $a_start_objects;
27 $this->enable_desktop = (bool)$a_enable_desktop;
31 $this->
addColumn($this->lng->txt(
'crs_nr'),
'nr');
32 $this->
addColumn($this->lng->txt(
'title'),
'title');
33 $this->
addColumn($this->lng->txt(
'crs_objective_accomplished'),
'status');
34 $this->
addColumn($this->lng->txt(
'actions'),
'');
36 $this->
setTitle($this->lng->txt(
'crs_table_start_objects'));
39 $this->
setRowTemplate(
"tpl.start_objects_content_row.html",
"Services/Container");
40 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
50 global
$ilUser, $ilObjDataCache, $ilAccess;
52 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
53 include_once
'./Services/Link/classes/class.ilLink.php';
55 $lm_continue =
new ilCourseLMHistory($this->start_object->getRefId(),$ilUser->getId());
60 foreach($this->start_object->getStartObjects() as $start)
62 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
63 $ref_id = $start[
'item_ref_id'];
64 $type = $ilObjDataCache->lookupType($obj_id);
66 if(!$ilAccess->checkAccess(
"visible",
"",
$ref_id))
72 if($this->start_object->isFullfilled($ilUser->getId(),
$ref_id))
74 $accomplished =
'accomplished';
78 $accomplished =
'not_accomplished';
83 if((
bool)$this->enable_desktop)
86 if(!$ilUser->isDesktopItem(
$ref_id,$type))
88 if ($ilAccess->checkAccess(
'read',
'',
$ref_id))
93 $url = $this->ctrl->getLinkTarget($this->
getParentObject(),
'addToDesk');
94 $actions[$url] = $this->lng->txt(
"to_desktop");
102 $url = $this->ctrl->getLinkTarget($this->
getParentObject(),
'removeFromDesk');
103 $actions[$url] = $this->lng->txt(
"unsubscribe");
107 $default_params = null;
110 $default_params[
"crs_show_result"] =
$ref_id;
121 if ($accomplished ==
'accomplished')
130 $items[] = array(
"nr" => ++$counter,
134 "append_default" => $default_params,
135 "title" => $ilObjDataCache->lookupTitle($obj_id),
136 "description" => $ilObjDataCache->lookupDescription($obj_id),
137 "status" => $this->lng->txt(
'crs_objective_'.$accomplished),
138 "status_img" =>
$icon,
139 "actions" => $actions);
142 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
144 foreach($items as $item)
146 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
148 $preloader->preload();
165 global $objDefinition;
167 if (!isset($this->item_list_guis[$a_type]))
169 $class = $objDefinition->getClassName($a_type);
176 $location = $objDefinition->getLocation($a_type);
181 $full_class =
"ilObj".$class.
"ListGUI";
182 include_once(
$location.
"/class.".$full_class.
".php");
183 $item_list_gui =
new $full_class();
184 $this->item_list_guis[$a_type] = $item_list_gui;
188 $item_list_gui = $this->item_list_guis[$a_type];
191 $item_list_gui->setDefaultCommandParameters(array());
193 return $item_list_gui;
210 $item_list_gui->setContainerObject($this);
211 $item_list_gui->enableCommands(
true,
true);
216 $item_list_gui->enableNotes(
false);
217 $item_list_gui->enableComments(
false);
218 $item_list_gui->enableTags(
false);
220 $item_list_gui->enableIcon(
true);
221 $item_list_gui->enableDelete(
false);
222 $item_list_gui->enableCut(
false);
223 $item_list_gui->enableCopy(
false);
224 $item_list_gui->enablePayment(
false);
225 $item_list_gui->enableLink(
false);
226 $item_list_gui->enableInfoScreen(
true);
227 $item_list_gui->enableSubscribe(
false);
233 $item_list_gui->enableDescription(
false);
234 $item_list_gui->enableProperties(
false);
235 $item_list_gui->enablePreconditions(
false);
238 if($a_item[
"append_default"])
240 $item_list_gui->setDefaultCommandParameters($a_item[
"append_default"]);
242 if (is_object($item_list_gui))
244 return $item_list_gui->getListItemHTML($a_item[
"ref_id"],
245 $a_item[
"obj_id"], $a_item[
"title"], $a_item[
"description"]);
251 $this->tpl->setVariable(
"VAL_NR", $a_set[
"nr"]);
254 $this->tpl->setVariable(
"TXT_TITLE", $this->
getListItem($a_set));
274 $this->tpl->setVariable(
"TXT_STATUS", $a_set[
"status"]);
275 $this->tpl->setVariable(
"IMG_STATUS", $a_set[
"status_img"]);
277 if($a_set[
"actions"])
279 $this->tpl->setCurrentBlock(
"link");
280 foreach($a_set[
"actions"] as $url => $caption)
282 $this->tpl->setVariable(
"LINK_HREF", $url);
283 $this->tpl->setVariable(
"LINK_NAME", $caption);
285 $this->tpl->parseCurrentBlock();