function getSelectableColumns() { global $ilObjDataCache; $columns = array(); if ($this->obj_ids === NULL) { $this->obj_ids = $this->getItems(); } if ($this->obj_ids) { $tmp_cols = array(); foreach ($this->obj_ids as $obj_id) { if ($obj_id == $this->obj_id) { $parent = array("txt" => $this->lng->txt("status"), "default" => true); } else { $title = $ilObjDataCache->lookupTitle($obj_id); $type = $ilObjDataCache->lookupType($obj_id); $icon = ilObject::_getIcon("", "tiny", $type); if ($type == "sess") { include_once "Modules/Session/classes/class.ilObjSession.php"; $sess = new ilObjSession($obj_id, false); $title = $sess->getPresentationTitle(); } $tmp_cols[strtolower($title) . "#~#obj_" . $obj_id] = array("txt" => $title, "icon" => $icon, "type" => $type, "default" => true); } } if (sizeof($this->objective_ids)) { foreach ($this->objective_ids as $obj_id => $title) { $tmp_cols[strtolower($title) . "#~#objtv_" . $obj_id] = array("txt" => $title, "default" => true); } } if (sizeof($this->sco_ids)) { foreach ($this->sco_ids as $obj_id => $title) { $icon = ilUtil::getTypeIconPath("sco", $obj_id, "tiny"); $tmp_cols[strtolower($title) . "#~#objsco_" . $obj_id] = array("txt" => $title, "icon" => $icon, "default" => true); } } // alex, 5 Nov 2011: Do not sort SCORM items if (!sizeof($this->sco_ids)) { ksort($tmp_cols); } foreach ($tmp_cols as $id => $def) { $id = explode('#~#', $id); $columns[$id[1]] = $def; } unset($tmp_cols); if ($parent) { $columns["obj_" . $this->obj_id] = $parent; } } $columns["status_changed"] = array("txt" => $this->lng->txt("trac_status_changed"), "id" => "status_changed", "default" => false); include_once 'Services/Tracking/classes/class.ilObjUserTracking.php'; $tracking = new ilObjUserTracking(); if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) { $columns["last_access"] = array("txt" => $this->lng->txt("last_access"), "id" => "last_access", "default" => false); } if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) { $columns["spent_seconds"] = array("txt" => $this->lng->txt("trac_spent_seconds"), "id" => "spent_seconds", "default" => false); } return $columns; }
function getSelectableColumns() { global $ilObjDataCache, $rbacsystem; $user_cols = $this->getSelectableUserColumns($this->in_course, $this->in_group); if ($this->obj_ids === NULL) { // we cannot use the selected columns because they are not ready yet // so we use all available columns, should be ok anyways $this->obj_ids = $this->getItems(array_keys($user_cols[0]), $user_cols[1]); } if ($this->obj_ids) { $tmp_cols = array(); foreach ($this->obj_ids as $obj_id) { if ($obj_id == $this->obj_id) { $parent = array("txt" => $this->lng->txt("status"), "default" => true); } else { $no_perm = false; $ref_id = $this->ref_ids[$obj_id]; if ($ref_id && !$rbacsystem->checkAccess('read_learning_progress', $ref_id)) { $no_perm = true; $this->privacy_cols[] = $obj_id; } $title = $ilObjDataCache->lookupTitle($obj_id); $type = $ilObjDataCache->lookupType($obj_id); $icon = ilObject::_getIcon("", "tiny", $type); if ($type == "sess") { include_once "Modules/Session/classes/class.ilObjSession.php"; $sess = new ilObjSession($obj_id, false); $title = $sess->getPresentationTitle(); } $tmp_cols[strtolower($title) . "#~#obj_" . $obj_id] = array("txt" => $title, "icon" => $icon, "type" => $type, "default" => true, "no_permission" => $no_perm); } } if (sizeof($this->objective_ids)) { foreach ($this->objective_ids as $obj_id => $title) { $tmp_cols[strtolower($title) . "#~#objtv_" . $obj_id] = array("txt" => $title, "default" => true); } } if (sizeof($this->sco_ids)) { foreach ($this->sco_ids as $obj_id => $title) { $icon = ilUtil::getTypeIconPath("sco", $obj_id, "tiny"); $tmp_cols[strtolower($title) . "#~#objsco_" . $obj_id] = array("txt" => $title, "icon" => $icon, "default" => true); } } if (sizeof($this->subitem_ids)) { foreach ($this->subitem_ids as $obj_id => $title) { $icon = ilUtil::getTypeIconPath("st", $obj_id, "tiny"); $tmp_cols[strtolower($title) . "#~#objsub_" . $obj_id] = array("txt" => $title, "icon" => $icon, "default" => true); } } // alex, 5 Nov 2011: Do not sort SCORM items or "chapters" if (!sizeof($this->sco_ids) && !sizeof($this->subitem_ids)) { ksort($tmp_cols); } foreach ($tmp_cols as $id => $def) { $id = explode('#~#', $id); $columns[$id[1]] = $def; } unset($tmp_cols); if ($parent) { $columns["obj_" . $this->obj_id] = $parent; } } unset($user_cols[0]["status"]); unset($user_cols[0]["login"]); foreach ($user_cols[0] as $col_id => $col_def) { if (!isset($columns[$col_id])) { // these are all additional fields, no default $col_def["default"] = false; $columns[$col_id] = $col_def; } } return $columns; }