/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl; $lng->loadLanguageModule("assessment"); include_once "./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php"; $node_object = ilSCORM2004NodeFactory::getInstance($this->slm_object, $a_set["child"], false); $tr_data = $node_object->getObjectives(); // learning objectives foreach ($tr_data as $data) { $this->tpl->setCurrentBlock("objective"); $this->tpl->setVariable("TXT_LEARNING_OBJECTIVE", ilSCORM2004Sco::convertLists($data->getObjectiveID())); $this->tpl->setVariable("IMG_LOBJ", ilUtil::getImagePath("icon_lobj.svg")); $this->tpl->parseCurrentBlock(); } // pages include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php"; include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $childs = $this->tree->getChilds($a_set["child"]); foreach ($childs as $child) { // get question ids include_once "./Services/COPage/classes/class.ilPCQuestion.php"; $qids = ilPCQuestion::_getQuestionIdsForPage("sahs", $child["child"]); if (count($qids) > 0) { // output questions foreach ($qids as $qid) { $this->tpl->setCurrentBlock("question"); //$qtitle = assQuestion::_getTitle($qid); $qtype = assQuestion::_getQuestionType($qid); //$qtext = assQuestion::_getQuestionText($qid); $qtext = assQuestion::_getQuestionTitle($qid); $this->tpl->setVariable("TXT_QUESTION", $qtext); $this->tpl->setVariable("TXT_QTYPE", $lng->txt($qtype)); $this->tpl->setVariable("IMG_QST", ilUtil::getImagePath("icon_tst.svg")); $this->tpl->parseCurrentBlock(); } // output page title $page_title = ilSCORM2004Node::_lookupTitle($child["child"]); $this->tpl->setCurrentBlock("page"); $this->tpl->setVariable("TXT_PAGE_TITLE", $page_title); $this->tpl->setVariable("IMG_PAGE", ilUtil::getImagePath("icon_pg.svg")); $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $child["child"]); $this->tpl->setVariable("HREF_EDIT_PAGE", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit")); $this->tpl->parseCurrentBlock(); } } // sco title $this->tpl->setVariable("TXT_SCO_TITLE", $a_set["title"]); $this->tpl->setVariable("IMG_SCO", ilUtil::getImagePath("icon_sco.svg")); $ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id", $a_set["child"]); $this->tpl->setVariable("HREF_EDIT_SCO", $ilCtrl->getLinkTargetByClass("ilscorm2004scogui", "showProperties")); }
/** * Copy a set of chapters/pages/scos into the clipboard */ static function clipboardCopy($a_slm_obj_id, $a_ids) { global $ilUser; $tree = ilSCORM2004Node::getTree($a_slm_obj_id); $ilUser->clipboardDeleteObjectsOfType("page"); $ilUser->clipboardDeleteObjectsOfType("chap"); $ilUser->clipboardDeleteObjectsOfType("sco"); $ilUser->clipboardDeleteObjectsOfType("ass"); // put them into the clipboard $time = date("Y-m-d H:i:s", time()); foreach ($a_ids as $id) { $curnode = ""; if ($tree->isInTree($id)) { $curnode = $tree->getNodeData($id); $subnodes = $tree->getSubTree($curnode); foreach ($subnodes as $subnode) { if ($subnode["child"] != $id) { $ilUser->addObjectToClipboard($subnode["child"], $subnode["type"], $subnode["title"], $subnode["parent"], $time, $subnode["lft"]); } } } $order = $curnode["lft"] > 0 ? $curnode["lft"] : (int) ($order + 1); $ilUser->addObjectToClipboard($id, ilSCORM2004Node::_lookupType($id), ilSCORM2004Node::_lookupTitle($id), 0, $time, $order); } }
/** * 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(); } } } } }