4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
48 $this->
user = $DIC->user();
49 $this->obj_data_cache = $DIC[
"ilObjDataCache"];
50 $this->access = $DIC->access();
51 $this->obj_definition = $DIC[
"objDefinition"];
52 $lng = $DIC->language();
58 $this->start_object = $a_start_objects;
59 $this->enable_desktop = (bool) $a_enable_desktop;
61 parent::__construct($a_parent_obj, $a_parent_cmd);
63 $this->
addColumn($this->lng->txt(
'crs_nr'),
'nr');
64 $this->
addColumn($this->lng->txt(
'title'),
'title');
65 $this->
addColumn($this->lng->txt(
'crs_objective_accomplished'),
'status');
66 $this->
addColumn($this->lng->txt(
'actions'),
'');
68 $this->
setTitle($this->lng->txt(
'crs_table_start_objects'));
71 $this->
setRowTemplate(
"tpl.start_objects_content_row.html",
"Services/Container");
72 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
86 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
87 include_once
'./Services/Link/classes/class.ilLink.php';
94 foreach ($this->start_object->getStartObjects() as $start) {
95 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
96 $ref_id = $start[
'item_ref_id'];
97 $type = $ilObjDataCache->lookupType($obj_id);
99 if (!$ilAccess->checkAccess(
"visible",
"", $ref_id)) {
104 if ($this->start_object->isFullfilled(
$ilUser->getId(), $ref_id)) {
105 $accomplished =
'accomplished';
107 $accomplished =
'not_accomplished';
112 if ((
bool) $this->enable_desktop) {
115 if ($ilAccess->checkAccess(
'read',
'', $ref_id)) {
116 $this->ctrl->setParameter($this->
getParentObject(),
'item_ref_id', $ref_id);
117 $this->ctrl->setParameter($this->
getParentObject(),
'item_id', $ref_id);
120 $actions[
$url] = $this->lng->txt(
"to_desktop");
123 $this->ctrl->setParameter($this->
getParentObject(),
'item_ref_id', $ref_id);
124 $this->ctrl->setParameter($this->
getParentObject(),
'item_id', $ref_id);
127 $actions[
$url] = $this->lng->txt(
"unsubscribe");
131 $default_params = null;
132 if (
$type ==
"tst") {
133 $default_params[
"crs_show_result"] = $ref_id;
144 if ($accomplished ==
'accomplished') {
154 "append_default" => $default_params,
155 "title" => $ilObjDataCache->lookupTitle($obj_id),
156 "description" => $ilObjDataCache->lookupDescription($obj_id),
157 "status" => $this->lng->txt(
'crs_objective_' . $accomplished),
158 "status_img" =>
$icon,
159 "actions" => $actions);
162 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
164 foreach ($items as $item) {
165 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
167 $preloader->preload();
186 if (!isset($this->item_list_guis[
$a_type])) {
187 $class = $objDefinition->getClassName($a_type);
193 $location = $objDefinition->getLocation($a_type);
197 $full_class =
"ilObj" . $class .
"ListGUI";
198 include_once(
$location .
"/class." . $full_class .
".php");
199 $item_list_gui =
new $full_class();
200 $this->item_list_guis[
$a_type] = $item_list_gui;
202 $item_list_gui = $this->item_list_guis[
$a_type];
205 $item_list_gui->setDefaultCommandParameters(
array());
207 return $item_list_gui;
219 if (!$item_list_gui) {
223 $item_list_gui->setContainerObject($this);
224 $item_list_gui->enableCommands(
true,
true);
229 $item_list_gui->enableNotes(
false);
230 $item_list_gui->enableComments(
false);
231 $item_list_gui->enableTags(
false);
233 $item_list_gui->enableIcon(
true);
234 $item_list_gui->enableDelete(
false);
235 $item_list_gui->enableCut(
false);
236 $item_list_gui->enableCopy(
false);
237 $item_list_gui->enableLink(
false);
238 $item_list_gui->enableInfoScreen(
true);
239 $item_list_gui->enableSubscribe(
false);
244 $item_list_gui->enableDescription(
false);
245 $item_list_gui->enableProperties(
false);
246 $item_list_gui->enablePreconditions(
false);
249 if ($a_item[
"append_default"]) {
250 $item_list_gui->setDefaultCommandParameters($a_item[
"append_default"]);
252 if (is_object($item_list_gui)) {
253 return $item_list_gui->getListItemHTML(
257 $a_item[
"description"]
264 $this->tpl->setVariable(
"VAL_NR", $a_set[
"nr"]);
267 $this->tpl->setVariable(
"TXT_TITLE", $this->
getListItem($a_set));
287 $this->tpl->setVariable(
"TXT_STATUS", $a_set[
"status"]);
288 $this->tpl->setVariable(
"IMG_STATUS", $a_set[
"status_img"]);
290 if ($a_set[
"actions"]) {
291 $this->tpl->setCurrentBlock(
"link");
292 foreach ($a_set[
"actions"] as
$url => $caption) {
293 $this->tpl->setVariable(
"LINK_HREF",
$url);
294 $this->tpl->setVariable(
"LINK_NAME", $caption);
296 $this->tpl->parseCurrentBlock();
setDescription($a_val)
Set description.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
__construct($a_parent_obj, $a_parent_cmd, ilContainerStartObjects $a_start_objects, $a_enable_desktop=true)
getParentObject()
Get parent object.
getItemListGUI($a_type)
Get list gui for object type.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Preloader for object list GUIs.
getListItem($a_item)
Get list gui for object instance.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
ilContainerStartObjectsContentTableGUI