/**
  * Delete references 
  *
  * @static
  */
 public static function deleteReferences($a_target_id)
 {
     global $ilLog;
     include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
     if (!($source_id = ilContainerReference::_lookupSourceId($a_target_id))) {
         return true;
     }
     foreach (ilObject::_getAllReferences($source_id) as $ref_id) {
         if (!($instance = ilObjectFactory::getInstanceByRefId($ref_id, false))) {
             continue;
         }
         switch ($instance->getType()) {
             case 'crsr':
             case 'catr':
                 $instance->delete();
                 $ilLog->write(__METHOD__ . ': Deleted reference object of type ' . $instance->getType() . ' with Id ' . $instance->getId());
                 break;
             default:
                 $ilLog->write(__METHOD__ . ': Unexpected object type ' . $instance->getType() . ' with Id ' . $instance->getId());
                 break;
         }
     }
     return true;
 }
 /**
  * get data of parent node from tree and object_data
  * @access	private
  * @param	object	db	db result object containing node_data
  * @return	array		2-dim (int/str) node_data
  * TODO: select description twice for compability. Please use 'desc' in future only
  */
 function fetchNodeData($a_row)
 {
     global $objDefinition, $lng, $ilBench, $ilDB;
     //$ilBench->start("Tree", "fetchNodeData_getRow");
     $data = $a_row;
     $data["desc"] = $a_row["description"];
     // for compability
     //$ilBench->stop("Tree", "fetchNodeData_getRow");
     // multilingual support systemobjects (sys) & categories (db)
     //$ilBench->start("Tree", "fetchNodeData_readDefinition");
     if (is_object($objDefinition)) {
         $translation_type = $objDefinition->getTranslationType($data["type"]);
     }
     //$ilBench->stop("Tree", "fetchNodeData_readDefinition");
     if ($translation_type == "sys") {
         //$ilBench->start("Tree", "fetchNodeData_getLangData");
         if ($data["type"] == "rolf" and $data["obj_id"] != ROLE_FOLDER_ID) {
             $data["description"] = $lng->txt("obj_" . $data["type"] . "_local_desc") . $data["title"] . $data["desc"];
             $data["desc"] = $lng->txt("obj_" . $data["type"] . "_local_desc") . $data["title"] . $data["desc"];
             $data["title"] = $lng->txt("obj_" . $data["type"] . "_local");
         } else {
             $data["title"] = $lng->txt("obj_" . $data["type"]);
             $data["description"] = $lng->txt("obj_" . $data["type"] . "_desc");
             $data["desc"] = $lng->txt("obj_" . $data["type"] . "_desc");
         }
         //$ilBench->stop("Tree", "fetchNodeData_getLangData");
     } elseif ($translation_type == "db") {
         // Try to retrieve object translation from cache
         if ($this->isCacheUsed() && array_key_exists($data["obj_id"] . '.' . $lang_code, $this->translation_cache)) {
             $key = $data["obj_id"] . '.' . $lang_code;
             $data["title"] = $this->translation_cache[$key]['title'];
             $data["description"] = $this->translation_cache[$key]['description'];
             $data["desc"] = $this->translation_cache[$key]['desc'];
         } else {
             // Object translation is not in cache, read it from database
             //$ilBench->start("Tree", "fetchNodeData_getTranslation");
             $query = 'SELECT title,description FROM object_translation ' . 'WHERE obj_id = %s ' . 'AND lang_code = %s ' . 'AND NOT lang_default = %s';
             $res = $ilDB->queryF($query, array('integer', 'text', 'integer'), array($data['obj_id'], $this->lang_code, 1));
             $row = $ilDB->fetchObject($res);
             if ($row) {
                 $data["title"] = $row->title;
                 $data["description"] = ilUtil::shortenText($row->description, MAXLENGTH_OBJ_DESC, true);
                 $data["desc"] = $row->description;
             }
             //$ilBench->stop("Tree", "fetchNodeData_getTranslation");
             // Store up to 1000 object translations in cache
             if ($this->isCacheUsed() && count($this->translation_cache) < 1000) {
                 $key = $data["obj_id"] . '.' . $lang_code;
                 $this->translation_cache[$key] = array();
                 $this->translation_cache[$key]['title'] = $data["title"];
                 $this->translation_cache[$key]['description'] = $data["description"];
                 $this->translation_cache[$key]['desc'] = $data["desc"];
             }
         }
     }
     // TODO: Handle this switch by module.xml definitions
     if ($data['type'] == 'crsr' or $data['type'] == 'catr') {
         include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
         $data['title'] = ilContainerReference::_lookupTargetTitle($data['obj_id']);
     }
     return $data ? $data : array();
 }
 /**
  * inititialize new item
  * Course reference inits the course item
  *
  * @param	int			$a_ref_id		reference id
  * @param	int			$a_obj_id		object id
  * @param	string		$a_title		title
  * @param	string		$a_description	description
  */
 function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
 {
     global $ilBench, $ilAccess, $tree;
     $this->reference_ref_id = $a_ref_id;
     $this->reference_obj_id = $a_obj_id;
     include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
     $target_obj_id = ilContainerReference::_lookupTargetId($a_obj_id);
     $target_ref_ids = ilObject::_getAllReferences($target_obj_id);
     $target_ref_id = current($target_ref_ids);
     $target_title = ilContainerReference::_lookupTitle($a_obj_id);
     $target_description = ilObject::_lookupDescription($target_obj_id);
     $this->deleted = $tree->isDeleted($target_ref_id);
     $ilBench->start("ilObjCourseListGUI", "1000_checkAllConditions");
     $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id);
     $ilBench->stop("ilObjCourseListGUI", "1000_checkAllConditions");
     parent::initItem($target_ref_id, $target_obj_id, $target_title, $target_description);
     // general commands array
     include_once './Modules/CourseReference/classes/class.ilObjCourseReferenceAccess.php';
     $this->commands = ilObjCourseReferenceAccess::_getCommands($this->reference_ref_id);
     if ($ilAccess->checkAccess('write', '', $this->reference_ref_id) or $this->deleted) {
         $this->info_screen_enabled = false;
     } else {
         $this->info_screen_enabled = true;
     }
 }
 /**
  * Overwitten from base class
  * @param int $a_obj_id
  * @return 
  */
 public static function _lookupTitle($a_obj_id)
 {
     global $ilDB;
     $query = 'SELECT title,title_type FROM container_reference cr ' . 'JOIN object_data od ON cr.obj_id = od.obj_id ' . 'WHERE cr.obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
     $res = $ilDB->query($query);
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         if ($row->title_type == ilContainerReference::TITLE_TYPE_CUSTOM) {
             return $row->title;
         }
     }
     return ilContainerReference::_lookupTargetTitle($a_obj_id);
 }
 /**
  * fill row
  *
  * @access protected
  * @param array row data
  * @return
  */
 protected function fillRow($a_set)
 {
     $this->tpl->setVariable('VAL_ID', $a_set['id']);
     $this->tpl->setVariable('VAL_POSITION', $a_set['position']);
     // begin-patch lok
     if ($a_set['online']) {
         $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('online'));
         $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallgreen');
     } else {
         $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('offline'));
         $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallred');
     }
     if ($a_set['passes']) {
         $this->tpl->setVariable('PASSES_TXT', $this->lng->txt('crs_loc_passes_info'));
         $this->tpl->setVariable('PASSES_VAL', $a_set['passes']);
     }
     // begin-patch lok
     $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
     $this->tpl->setVariable('VAL_TITLE_LINKED', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // end-patch lok
     $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     if (strlen($a_set['description'])) {
         $this->tpl->setVariable('VAL_DESC', $a_set['description']);
     }
     // materials
     foreach ($a_set['materials'] as $ref_id => $data) {
         if ($data['items']) {
             $this->tpl->touchBlock('ul_begin');
             foreach ($data['items'] as $pg_st) {
                 $this->tpl->setCurrentBlock('st_pg');
                 $this->tpl->setVariable('MAT_IMG', ilObject::_getIcon($pg_st['obj_id'], "tiny", $pg_st['type']));
                 $this->tpl->setVariable('MAT_ALT', $this->lng->txt('obj_' . $pg_st['type']));
                 include_once 'Modules/LearningModule/classes/class.ilLMObject.php';
                 $title = ilLMObject::_lookupTitle($pg_st['obj_id']);
                 $this->tpl->setVariable('MAT_TITLE', $title);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->touchBlock('ul_end');
         } else {
             $this->tpl->touchBlock('new_line');
         }
         $this->tpl->setCurrentBlock('mat_row');
         $this->tpl->setVariable('LM_IMG', ilObject::_getIcon($data['obj_id'], "tiny", $data['type']));
         $this->tpl->setVariable('LM_ALT', $this->lng->txt('obj_' . $data['type']));
         if ($data['type'] == 'catr' or $data['type'] == 'crsr') {
             include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
             $this->tpl->setVariable('LM_TITLE', ilContainerReference::_lookupTargetTitle($data['obj_id']));
         } else {
             $this->tpl->setVariable('LM_TITLE', ilObject::_lookupTitle($data['obj_id']));
         }
         $this->tpl->parseCurrentBlock();
     }
     // self assessment
     // begin-patch lok
     if ($this->getSettings()->worksWithInitialTest()) {
         foreach ($a_set['self'] as $test) {
             // begin-patch lok
             foreach ((array) $test['questions'] as $question) {
                 $this->tpl->setCurrentBlock('self_qst_row');
                 $this->tpl->setVariable('SELF_QST_TITLE', $question['title']);
                 $this->tpl->parseCurrentBlock();
             }
             #$this->tpl->setCurrentBlock('self_test_row');
             #$this->tpl->setVariable('SELF_TST_ALT',$this->lng->txt('obj_tst'));
             #$this->tpl->setVariable('SELF_TST_TITLE',ilObject::_lookupTitle($test['obj_id']));
             #$this->tpl->parseCurrentBlock();
             // end-patch lok
         }
         // begin-patch lok
         if (!count($a_set['self'])) {
             $this->tpl->touchBlock('self_qst_row');
         }
         // end-patch lok
     }
     // end-patch lok
     // final test questions
     foreach ((array) $a_set['final'] as $test) {
         foreach ((array) $test['questions'] as $question) {
             $this->tpl->setCurrentBlock('final_qst_row');
             $this->tpl->setVariable('FINAL_QST_TITLE', $question['title']);
             $this->tpl->parseCurrentBlock();
         }
         // begin-patch lok
         #$this->tpl->setCurrentBlock('final_test_row');
         #$this->tpl->setVariable('FINAL_TST_ALT',$this->lng->txt('obj_tst'));
         #$this->tpl->setVariable('FINAL_TST_TITLE',ilObject::_lookupTitle($test['obj_id']));
         #$this->tpl->parseCurrentBlock();
         // end-patch lok
     }
     // begin-patch lok
     // Edit Link
     #$this->ctrl->setParameterByClass(get_class($this->getParentObject()),'objective_id',$a_set['id']);
     $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
     #$this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()),'edit'));
     $this->tpl->setVariable('EDIT_LINK', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // end-patch lok
     $this->tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $alist = new ilAdvancedSelectionListGUI();
     $alist->setId($a_set['id']);
     $alist->setListTitle($this->lng->txt("actions"));
     $alist->addItem($this->lng->txt('edit'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // materials
     $alist->addItem($this->lng->txt('crs_objective_action_materials'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'materialAssignment'));
     // itest
     if ($this->getSettings()->worksWithInitialTest()) {
         $alist->addItem($this->lng->txt('crs_objective_action_itest'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'selfAssessmentAssignment'));
     }
     // qtest
     $alist->addItem($this->lng->txt('crs_objective_action_qtest'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment'));
     if ($this->getSettings()->isQualifiedTestPerObjectiveVisible()) {
         $this->ctrl->setParameterByClass('ilconditionhandlerinterface', 'objective_id', $a_set['id']);
         $alist->addItem($this->lng->txt('preconditions'), '', $this->ctrl->getLinkTargetByClass('ilconditionhandlerinterface', 'listConditions'));
     }
     $this->ctrl->setParameterByClass('illopagegui', 'objective_id', $a_set['id']);
     $alist->addItem($this->lng->txt('edit_page'), '', $this->ctrl->getLinkTargetByClass('illopagegui', 'edit'));
     $this->tpl->setVariable('VAL_ACTIONS', $alist->getHTML());
     // end-patch lok
 }
 /**
  * Constructor 
  * @param int $a_id reference id
  * @param bool $a_call_by_reference  
  * @return void
  */
 public function __construct($a_id = 0, $a_call_by_reference = true)
 {
     global $ilDB;
     $this->type = 'crsr';
     parent::__construct($a_id, $a_call_by_reference);
 }
 /**
  * Support for goto php 
  *
  * @return void
  * @static
  */
 public static function _goto($a_target)
 {
     global $ilAccess, $ilErr, $lng;
     include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
     $target_ref_id = ilContainerReference::_lookupTargetRefId(ilObject::_lookupObjId($a_target));
     include_once './Modules/Category/classes/class.ilObjCategoryGUI.php';
     ilObjCategoryGUI::_goto($target_ref_id);
 }
Esempio n. 8
0
 /**
  * show related objects as links
  */
 function showTargets(&$tpl, $a_rep_obj_id, $a_note_id, $a_obj_type, $a_obj_id)
 {
     global $tree, $ilAccess, $objDefinition, $ilUser;
     if ($this->targets_enabled) {
         if ($a_rep_obj_id > 0) {
             // get all visible references of target object
             // repository
             $ref_ids = ilObject::_getAllReferences($a_rep_obj_id);
             if ($ref_ids) {
                 $vis_ref_ids = array();
                 foreach ($ref_ids as $ref_id) {
                     if ($ilAccess->checkAccess("visible", "", $ref_id)) {
                         $vis_ref_ids[] = $ref_id;
                     }
                 }
                 // output links to targets
                 if (count($vis_ref_ids) > 0) {
                     foreach ($vis_ref_ids as $vis_ref_id) {
                         $type = ilObject::_lookupType($vis_ref_id, true);
                         $sub_link = $sub_title = "";
                         if ($type == "sahs") {
                             $link = "goto.php?target=sahs_" . $vis_ref_id;
                             $title = ilObject::_lookupTitle($a_rep_obj_id);
                             if ($a_obj_type == "sco" || $a_obj_type == "seqc" || $a_obj_type == "chap" || $a_obj_type == "pg") {
                                 $sub_link = "goto.php?target=sahs_" . $vis_ref_id . "_" . $a_obj_id;
                                 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Node.php";
                                 $sub_title = ilSCORM2004Node::_lookupTitle($a_obj_id);
                                 $sub_icon = ilUtil::getImagePath("icon_" . $a_obj_type . ".svg");
                             }
                         } else {
                             if ($type == "poll") {
                                 include_once "Services/Link/classes/class.ilLink.php";
                                 $title = ilObject::_lookupTitle($a_rep_obj_id);
                                 $link = ilLink::_getLink($vis_ref_id, "poll");
                             } else {
                                 if ($a_obj_type != "pg") {
                                     if (!is_object($this->item_list_gui[$type])) {
                                         $class = $objDefinition->getClassName($type);
                                         $location = $objDefinition->getLocation($type);
                                         $full_class = "ilObj" . $class . "ListGUI";
                                         include_once $location . "/class." . $full_class . ".php";
                                         $this->item_list_gui[$type] = new $full_class();
                                     }
                                     // for references, get original title
                                     // (link will lead to orignal, which basically is wrong though)
                                     if ($a_obj_type == "crsr" || $a_obj_type == "catr") {
                                         include_once "Services/ContainerReference/classes/class.ilContainerReference.php";
                                         $tgt_obj_id = ilContainerReference::_lookupTargetId($a_rep_obj_id);
                                         $title = ilObject::_lookupTitle($tgt_obj_id);
                                     } else {
                                         $title = ilObject::_lookupTitle($a_rep_obj_id);
                                     }
                                     $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, $title);
                                     $link = $this->item_list_gui[$type]->getCommandLink("infoScreen");
                                     // workaround, because # anchor can't be passed through frameset
                                     $link = ilUtil::appendUrlParameterString($link, "anchor=note_" . $a_note_id);
                                     $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link) . "#note_" . $a_note_id;
                                 } else {
                                     $title = ilObject::_lookupTitle($a_rep_obj_id);
                                     $link = "goto.php?target=pg_" . $a_obj_id . "_" . $vis_ref_id;
                                 }
                             }
                         }
                         $par_id = $tree->getParentId($vis_ref_id);
                         // sub object link
                         if ($sub_link != "") {
                             if ($this->export_html || $this->print) {
                                 $tpl->setCurrentBlock("exp_target_sub_object");
                             } else {
                                 $tpl->setCurrentBlock("target_sub_object");
                                 $tpl->setVariable("LINK_SUB_TARGET", $sub_link);
                             }
                             $tpl->setVariable("TXT_SUB_TARGET", $sub_title);
                             $tpl->setVariable("IMG_SUB_TARGET", $sub_icon);
                             $tpl->parseCurrentBlock();
                         }
                         // container and object link
                         if ($this->export_html || $this->print) {
                             $tpl->setCurrentBlock("exp_target_object");
                         } else {
                             $tpl->setCurrentBlock("target_object");
                             $tpl->setVariable("LINK_TARGET", $link);
                         }
                         $tpl->setVariable("TXT_CONTAINER", ilObject::_lookupTitle(ilObject::_lookupObjId($par_id)));
                         $tpl->setVariable("IMG_CONTAINER", ilObject::_getIcon(ilObject::_lookupObjId($par_id), "tiny"));
                         $tpl->setVariable("TXT_TARGET", $title);
                         $tpl->setVariable("IMG_TARGET", ilObject::_getIcon($a_rep_obj_id, "tiny"));
                         $tpl->parseCurrentBlock();
                     }
                     $tpl->touchBlock("target_objects");
                 }
             } else {
                 // we only need 1 instance
                 if (!$this->wsp_tree) {
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
                     $this->wsp_tree = new ilWorkspaceTree($ilUser->getId());
                     $this->wsp_access_handler = new ilWorkspaceAccessHandler($this->wsp_tree);
                 }
                 $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
                 if ($this->wsp_access_handler->checkAccess("visible", "", $node_id)) {
                     $path = $this->wsp_tree->getPathFull($node_id);
                     if ($path) {
                         $item = array_pop($path);
                         $parent = array_pop($path);
                         if (!$parent["title"]) {
                             $parent["title"] = $this->lng->txt("wsp_personal_workspace");
                         }
                         // sub-objects
                         $additional = null;
                         if ($a_obj_id) {
                             $sub_title = $this->getSubObjectTitle($a_rep_obj_id, $a_obj_id);
                             if ($sub_title) {
                                 $item["title"] .= " (" . $sub_title . ")";
                                 $additional = "_" . $a_obj_id;
                             }
                         }
                         $link = ilWorkspaceAccessHandler::getGotoLink($node_id, $a_rep_obj_id, $additional);
                     } else {
                         $owner = ilObject::_lookupOwner($a_rep_obj_id);
                         $parent["title"] = $this->lng->txt("wsp_tab_shared") . " (" . ilObject::_lookupOwnerName($owner) . ")";
                         $item["title"] = ilObject::_lookupTitle($a_rep_obj_id);
                         $link = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner;
                     }
                     // container and object link
                     if ($this->export_html || $this->print) {
                         $tpl->setCurrentBlock("exp_target_object");
                     } else {
                         $tpl->setCurrentBlock("target_object");
                         $tpl->setVariable("LINK_TARGET", $link);
                     }
                     // :TODO: no images in template ?
                     $tpl->setVariable("TXT_CONTAINER", $parent["title"]);
                     $tpl->setVariable("IMG_CONTAINER", ilObject::_getIcon($parent["obj_id"], "tiny"));
                     $tpl->setVariable("TXT_TARGET", $item["title"]);
                     $tpl->setVariable("IMG_TARGET", ilObject::_getIcon($a_rep_obj_id, "tiny"));
                     $tpl->parseCurrentBlock();
                 }
             }
         }
     }
 }
 /**
  * fill row
  *
  * @access protected
  * @param array row data
  * @return
  */
 protected function fillRow($a_set)
 {
     $GLOBALS['ilLog']->write(__METHOD__ . ': ' . print_r($a_set, TRUE));
     $this->tpl->setVariable('VAL_ID', $a_set['id']);
     $this->tpl->setVariable('VAL_POSITION', $a_set['position']);
     // begin-patch lok
     if ($a_set['online']) {
         $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('online'));
         $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallgreen');
     } else {
         $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('offline'));
         $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallred');
     }
     if ($a_set['passes']) {
         $this->tpl->setVariable('PASSES_TXT', $this->lng->txt('crs_loc_passes_info'));
         $this->tpl->setVariable('PASSES_VAL', $a_set['passes']);
     }
     // begin-patch lok
     $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
     $this->tpl->setVariable('VAL_TITLE_LINKED', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // end-patch lok
     $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     if (strlen($a_set['description'])) {
         $this->tpl->setVariable('VAL_DESC', $a_set['description']);
     }
     // materials
     foreach ($a_set['materials'] as $ref_id => $data) {
         if ($data['items']) {
             $this->tpl->touchBlock('ul_begin');
             foreach ($data['items'] as $pg_st) {
                 $this->tpl->setCurrentBlock('st_pg');
                 $this->tpl->setVariable('MAT_IMG', ilObject::_getIcon($pg_st['obj_id'], "tiny", $pg_st['type']));
                 $this->tpl->setVariable('MAT_ALT', $this->lng->txt('obj_' . $pg_st['type']));
                 include_once 'Modules/LearningModule/classes/class.ilLMObject.php';
                 $title = ilLMObject::_lookupTitle($pg_st['obj_id']);
                 $this->tpl->setVariable('MAT_TITLE', $title);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->touchBlock('ul_end');
         } else {
             $this->tpl->touchBlock('new_line');
         }
         $this->tpl->setCurrentBlock('mat_row');
         $this->tpl->setVariable('LM_IMG', ilObject::_getIcon($data['obj_id'], "tiny", $data['type']));
         $this->tpl->setVariable('LM_ALT', $this->lng->txt('obj_' . $data['type']));
         if ($data['type'] == 'catr' or $data['type'] == 'crsr') {
             include_once './Services/ContainerReference/classes/class.ilContainerReference.php';
             $this->tpl->setVariable('LM_TITLE', ilContainerReference::_lookupTargetTitle($data['obj_id']));
         } else {
             $this->tpl->setVariable('LM_TITLE', ilObject::_lookupTitle($data['obj_id']));
         }
         $this->tpl->parseCurrentBlock();
     }
     // self assessment
     // begin-patch lok
     if ($this->getSettings()->worksWithInitialTest()) {
         if ($this->getSettings()->hasSeparateInitialTests()) {
             if ($a_set['initial']) {
                 include_once './Services/Link/classes/class.ilLink.php';
                 $obj_id = ilObject::_lookupObjId($a_set['initial']);
                 $this->tpl->setCurrentBlock('initial_test_per_objective');
                 $this->tpl->setVariable('IT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
                 $this->tpl->setVariable('IT_ALT', $this->lng->txt('obj_tst'));
                 $this->tpl->setVariable('IT_TITLE', ilObject::_lookupTitle($obj_id));
                 $this->tpl->setVariable('IT_TITLE_LINK', ilLink::_getLink($a_set['initial']));
                 include_once './Services/Link/classes/class.ilLink.php';
                 $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['initial']);
                 $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
                 $this->tpl->setVariable('IT_TITLE_LINK', $this->ctrl->getLinkTargetByClass('ilobjtestgui'));
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->touchBlock('initial_test_per_objective');
             }
         } else {
             foreach ($a_set['self'] as $test) {
                 // begin-patch lok
                 foreach ((array) $test['questions'] as $question) {
                     $this->tpl->setCurrentBlock('self_qst_row');
                     $this->tpl->setVariable('SELF_QST_TITLE', $question['title']);
                     $this->tpl->parseCurrentBlock();
                 }
                 // end-patch lok
             }
             // begin-patch lok
             if (!count($a_set['self'])) {
                 $this->tpl->touchBlock('self_qst_row');
             }
         }
         // end-patch lok
     }
     // end-patch lok
     // final test questions
     if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
         if ($a_set['final']) {
             $obj_id = ilObject::_lookupObjId($a_set['final']);
             $this->tpl->setCurrentBlock('final_test_per_objective');
             $this->tpl->setVariable('FT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
             $this->tpl->setVariable('FT_ALT', $this->lng->txt('obj_tst'));
             $this->tpl->setVariable('FT_TITLE', ilObject::_lookupTitle($obj_id));
             include_once './Services/Link/classes/class.ilLink.php';
             $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['final']);
             $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
             $this->tpl->setVariable('FT_TITLE_LINK', $this->ctrl->getLinkTargetByClass('ilobjtestgui'));
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->touchBlock('final_test_per_objective');
         }
     } else {
         foreach ((array) $a_set['final'] as $test) {
             foreach ((array) $test['questions'] as $question) {
                 $this->tpl->setCurrentBlock('final_qst_row');
                 $this->tpl->setVariable('FINAL_QST_TITLE', $question['title']);
                 $this->tpl->parseCurrentBlock();
             }
             // begin-patch lok
             #$this->tpl->setCurrentBlock('final_test_row');
             #$this->tpl->setVariable('FINAL_TST_IMG',ilUtil::getImagePath('icon_tst_s.png'));
             #$this->tpl->setVariable('FINAL_TST_ALT',$this->lng->txt('obj_tst'));
             #$this->tpl->setVariable('FINAL_TST_TITLE',ilObject::_lookupTitle($test['obj_id']));
             #$this->tpl->parseCurrentBlock();
             // end-patch lok
         }
     }
     // begin-patch lok
     // Edit Link
     #$this->ctrl->setParameterByClass(get_class($this->getParentObject()),'objective_id',$a_set['id']);
     $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
     #$this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()),'edit'));
     $this->tpl->setVariable('EDIT_LINK', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // end-patch lok
     $this->tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $alist = new ilAdvancedSelectionListGUI();
     $alist->setId($a_set['id']);
     $alist->setListTitle($this->lng->txt("actions"));
     $alist->addItem($this->lng->txt('edit'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
     // materials
     $alist->addItem($this->lng->txt('crs_objective_action_materials'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'materialAssignment'));
     // itest
     if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
         $alist->addItem($this->lng->txt('crs_objective_action_itest'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'selfAssessmentAssignment'));
     }
     // qtest
     if ($this->getSettings()->hasSeparateQualifiedTests()) {
         #$alist->addItem(
         #		$this->lng->txt('crs_objective_action_qtest_sep'),
         #		'',
         #		$this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalSeparatedTestAssignment')
         #);
     } else {
         $alist->addItem($this->lng->txt('crs_objective_action_qtest'), '', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment'));
     }
     $this->ctrl->setParameterByClass('illopagegui', 'objective_id', $a_set['id']);
     $alist->addItem($this->lng->txt('edit_page'), '', $this->ctrl->getLinkTargetByClass('illopagegui', 'edit'));
     $this->tpl->setVariable('VAL_ACTIONS', $alist->getHTML());
     // end-patch lok
 }