function ilLMPresentationGUI() { global $ilias, $lng, $tpl, $rbacsystem, $ilCtrl, $ilAccess; // load language vars $lng->loadLanguageModule("content"); $this->ilias =& $ilias; $this->lng =& $lng; $this->tpl =& $tpl; $this->offline = false; $this->frames = array(); $this->ctrl =& $ilCtrl; $this->ctrl->saveParameter($this, array("ref_id")); $this->lm_set = new ilSetting("lm"); // Todo: check lm id $type = $this->ilias->obj_factory->getTypeByRefId($_GET["ref_id"]); // TODO: WE NEED AN OBJECT FACTORY FOR GUI CLASSES switch ($type) { case "dbk": include_once "./Modules/LearningModule/classes/class.ilObjDlBookGUI.php"; $this->lm_gui = new ilObjDlBookGUI($data, $_GET["ref_id"], true, false); break; case "lm": include_once "./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php"; $this->lm_gui = new ilObjLearningModuleGUI($data, $_GET["ref_id"], true, false); break; } $this->lm =& $this->lm_gui->object; if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; $this->needs_to_be_purchased = ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm->getRefId()); } else { $this->needs_to_be_purchased = false; } // check, if learning module is online if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) { if (!$this->lm->getOnline()) { $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING); } } $this->lm_tree = new ilTree($this->lm->getId()); $this->lm_tree->setTableNames('lm_tree', 'lm_data'); $this->lm_tree->setTreeTablePK("lm_id"); // do digilib book initialisation stuff if ($type == "dbk") { $this->abstract = true; $this->setSessionVars(); if (count($_POST["tr_id"]) > 1 or !$_POST["target"] and ($_POST["action"] == "show" or $_POST["action"] == "show_citation")) { $this->abstract = true; } else { if ($_GET["obj_id"] or $_POST["action"] == "show" or $_POST["action"] == "show_citation") { $this->abstract = false; } } } }
function ilLMPresentationGUI() { global $ilUser, $lng, $tpl, $rbacsystem, $ilCtrl, $ilAccess; // load language vars $lng->loadLanguageModule("content"); $this->lng = $lng; $this->tpl = $tpl; $this->offline = false; $this->frames = array(); $this->ctrl = $ilCtrl; $this->ctrl->saveParameter($this, array("ref_id", "transl", "focus_id", "focus_return")); $this->lm_set = new ilSetting("lm"); include_once "./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php"; $this->lm_gui = new ilObjLearningModuleGUI($data, $_GET["ref_id"], true, false); $this->lm = $this->lm_gui->object; // language translation include_once "./Services/Object/classes/class.ilObjectTranslation.php"; $this->ot = ilObjectTranslation::getInstance($this->lm->getId()); //include_once("./Services/COPage/classes/class.ilPageMultiLang.php"); //$this->ml = new ilPageMultiLang("lm", $this->lm->getId()); $this->lang = "-"; if ($this->ot->getContentActivated()) { $langs = $this->ot->getLanguages(); if (isset($langs[$_GET["transl"]]) || $_GET["transl"] == $this->ot->getMasterLanguage()) { $this->lang = $_GET["transl"]; } else { if (isset($langs[$ilUser->getCurrentLanguage()])) { $this->lang = $ilUser->getCurrentLanguage(); } } if ($this->lang == $this->ot->getMasterLanguage()) { $this->lang = "-"; } } if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; $this->needs_to_be_purchased = ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm->getRefId()); } else { $this->needs_to_be_purchased = false; } // check, if learning module is online if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) { if (!$this->lm->getOnline()) { $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING); } } include_once "./Modules/LearningModule/classes/class.ilLMTree.php"; $this->lm_tree = ilLMTree::getInstance($this->lm->getId()); /*$this->lm_tree = new ilTree($this->lm->getId()); $this->lm_tree->setTableNames('lm_tree','lm_data'); $this->lm_tree->setTreeTablePK("lm_id");*/ if ((int) $_GET["focus_id"] > 0 && $this->lm_tree->isInTree((int) $_GET["focus_id"])) { $this->focus_id = (int) $_GET["focus_id"]; } }
/** * check if links for certain object type are activated * * @param string $a_type object type * * @return boolean true if linking is activated */ function isClickable($a_type, $a_obj_id = 0) { global $ilUser; // in this standard implementation // only the type determines, wether an object should be clickable or not // but this method can be overwritten and make use of the ref id // (this happens e.g. in class ilRepositoryExplorerGUI) if ($this->is_clickable[$a_type] == "n") { return false; } // check public access include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm_obj->getRefId())) && !ilLMObject::_isPagePublic($a_obj_id, true)) { return false; } return true; }
function isClickable($a_type, $a_node_id) { global $ilUser; $orig_node_id = $a_node_id; if ($a_type == "st") { if (!$this->offlineMode()) { $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg"); $a_node_id = $a_node["child"]; if ($a_node_id == 0) { return false; } } else { // get next activated page $found = false; while (!$found) { $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg"); $a_node_id = $a_node["child"]; include_once "./Modules/LearningModule/classes/class.ilLMPage.php"; $active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(), $this->lm_set->get("time_scheduled_page_activation")); if ($a_node_id > 0 && !$active) { $found = false; } else { $found = true; } } if ($a_node_id <= 0) { return false; } else { $path = $this->tree->getPathId($a_node_id); if (!in_array($orig_node_id, $path)) { return false; } } } } if ($a_type == "pg") { // check public area mode include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm_obj->getRefId())) && !ilLMObject::_isPagePublic($a_node_id, true)) { return false; } } return true; }
/** * get lm menu html */ function setilLMMenu($a_offline = false, $a_export_format = "", $a_active = "content", $a_use_global_tabs = false, $a_as_subtabs = false, $a_cur_page = 0) { global $ilCtrl, $ilUser, $ilAccess, $ilTabs, $rbacsystem, $ilPluginAdmin; if ($a_as_subtabs) { $addcmd = "addSubTabTarget"; $getcmd = "getSubTabHTML"; } else { $addcmd = "addTarget"; $getcmd = "getHTML"; } $active[$a_active] = true; if (!$this->object->isActiveLMMenu()) { return ""; } if ($a_use_global_tabs) { $tabs_gui = $ilTabs; } else { $tabs_gui = new ilTabsGUI(); } // Determine whether the view of a learning resource should // be shown in the frameset of ilias, or in a separate window. //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame"; $showViewInFrameset = true; if ($showViewInFrameset && !$a_offline) { $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent"); } else { $buttonTarget = "_top"; } if ($a_export_format == "scorm") { $buttonTarget = ""; } include_once "./Services/Payment/classes/class.ilPaymentObject.php"; $requires_purchase_to_access = ilPaymentObject::_requiresPurchaseToAccess((int) $_GET['ref_id']); // content if (!$a_offline && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $tabs_gui->{$addcmd}("content", $ilCtrl->getLinkTargetByClass("illmpresentationgui", "layout"), "", "", $buttonTarget, $active["content"]); } // table of contents if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if (!$a_offline) { $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showTableOfContents"); } else { $link = "./table_of_contents.html"; } $tabs_gui->{$addcmd}("cont_toc", $link, "", "", $buttonTarget, $active["toc"]); } // print view if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if (!$a_offline) { $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showPrintViewSelection"); $tabs_gui->{$addcmd}("cont_print_view", $link, "", "", $buttonTarget, $active["print"]); } } // download if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID) { $is_public = $this->object->isActiveDownloadsPublic(); } else { if (!$requires_purchase_to_access) { $is_public = true; } } if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showDownloadList"); $tabs_gui->{$addcmd}("download", $link, "", "", $buttonTarget, $active["download"]); } // info button if ($a_export_format != "scorm" && !$a_offline) { if (!$a_offline) { $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $link = $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "ilinfoscreengui"), "showSummary"); } else { $link = "./info.html"; } $tabs_gui->{$addcmd}($requires_purchase_to_access ? 'buy' : 'info_short', $link, "", "", $buttonTarget, $active["info"]); } include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php'; if (ilLearningProgressAccess::checkAccess($_GET["ref_id"])) { include_once './Services/Object/classes/class.ilObjectLP.php'; $olp = ilObjectLP::getInstance($this->object->getId()); if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL) { $tabs_gui->{$addcmd}("learning_progress", $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "editmanual"), "", "", $buttonTarget, $active["learning_progress"]); } else { if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) { $tabs_gui->{$addcmd}("learning_progress", $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "showtlt"), "", "", $buttonTarget, $active["learning_progress"]); } } } // edit learning module if (!$a_offline && $a_cur_page > 0) { if ($rbacsystem->checkAccess("write", $_GET["ref_id"])) { //$page_id = $this->getCurrentPageId(); $page_id = $a_cur_page; $tabs_gui->{$addcmd}("edit_page", ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $_GET["ref_id"] . "&obj_id=" . $page_id . "&to_page=1", "", "", $buttonTarget, $active["edit_page"]); } } if (!$requires_purchase_to_access) { // get user defined menu entries $this->__initLMMenuEditor(); $entries = $this->lmme_obj->getMenuEntries(true); if (count($entries) > 0 && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { foreach ($entries as $entry) { // build goto-link for internal resources if ($entry["type"] == "intern") { $entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"]; } // add http:// prefix if not exist if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) { $entry["link"] = "http://" . $entry["link"]; } if (!strstr($entry["link"], 'mailto:')) { $entry["link"] = ilUtil::appendUrlParameterString($entry["link"], "ref_id=" . $this->ref_id . "&structure_id=" . $this->obj_id); } $tabs_gui->{$addcmd}($entry["title"], $entry["link"], "", "", "_blank", "", true); } } } // user interface hook [uihk] $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk"); $plugin_html = false; foreach ($pl_names as $pl) { $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl); $gui_class = $ui_plugin->getUIClassInstance(); $resp = $gui_class->modifyGUI("Modules/LearningModule", "lm_menu_tabs", array("lm_menu_tabs" => $tabs_gui)); } return $tabs_gui->{$getcmd}(); }
/** * execute command */ function executeCommand() { global $lng, $ilAccess, $ilias; $lng->loadLanguageModule("content"); $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd("listTerms"); // check write permission if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !($ilAccess->checkAccess("visible", "", $_GET["ref_id"]) && ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui"))) { $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } if ($cmd != "listDefinitions") { $this->prepareOutput(); } include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (IS_PAYMENT_ENABLED == true && ilPaymentObject::_requiresPurchaseToAccess($_GET["ref_id"], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); } else { switch ($next_class) { case "ilnotegui": $this->setTabs(); $ret =& $this->listDefinitions(); break; case "ilinfoscreengui": $ret =& $this->outputInfoScreen(); break; case "ilpresentationlisttablegui": $prtab = $this->getPresentationTable(); $this->ctrl->forwardCommand($prtab); return; break; default: $ret =& $this->{$cmd}(); break; } } $this->tpl->show(); }
/** * execute command */ function executeCommand() { global $ilUser, $ilLocator, $ilTabs; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $this->prepareOutput(); } else { if (!in_array($cmd, array("", "framset")) || $next_class != "") { $this->getTemplate(); $this->setLocator(); $this->setTabs(); } } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); return true; } } } switch ($next_class) { case 'ilmdeditorgui': $this->checkPermission("write"); $ilTabs->activateTab('id_meta_data'); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "ilfilesystemgui": $this->checkPermission("write"); $ilTabs->activateTab('id_list_files'); $fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory()); $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose")); $fs_gui->setTableId("htlmfs" . $this->object->getId()); if ($this->object->getStartFile() != "") { $fs_gui->labelFile($this->object->getStartFile(), $this->lng->txt("cont_startfile")); } $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file")); $ret =& $this->ctrl->forwardCommand($fs_gui); break; case "ilinfoscreengui": $ret =& $this->outputInfoScreen(); break; case "illearningprogressgui": $ilTabs->activateTab('id_learning_progress'); include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()); $this->ctrl->forwardCommand($new_gui); break; case 'ilpermissiongui': $ilTabs->activateTab('id_permissions'); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case 'illicensegui': $ilTabs->activateTab('id_license'); include_once "./Services/License/classes/class.ilLicenseGUI.php"; $license_gui =& new ilLicenseGUI($this); $ret =& $this->ctrl->forwardCommand($license_gui); break; case "ilexportgui": $ilTabs->activateTab("export"); include_once "./Services/Export/classes/class.ilExportGUI.php"; $exp_gui = new ilExportGUI($this); $exp_gui->addFormat("xml"); $exp_gui->addFormat("html", "", $this, "exportHTML"); $ret = $this->ctrl->forwardCommand($exp_gui); // $this->tpl->show(); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; default: $cmd = $this->ctrl->getCmd("frameset"); if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $cmd .= "Object"; } $ret =& $this->{$cmd}(); break; } $this->addHeaderAction(); }
/** * execute command */ function executeCommand() { global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr, $tpl, $lng, $ilTabs, $ilPluginAdmin, $ilDB, $tree, $ilias, $ilUser; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } $cmd = $this->ctrl->getCmd("infoScreen"); $cmdsDisabledDueToOfflineStatus = array('resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'); if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) { $cmd = 'infoScreen'; } $next_class = $this->ctrl->getNextClass($this); $this->ctrl->setReturn($this, "infoScreen"); if (method_exists($this->object, "getTestStyleLocation")) { $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen"); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst"); } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { require_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->setLocator(); $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); $this->tpl->show(); exit; } } } // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } if (!$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) { if (!$this->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) { $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen'); } } $this->determineObjectiveOrientedContainer(); switch ($next_class) { case 'iltestexportgui': if (!$ilAccess->checkAccess('write', '', $this->ref_id)) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestExportGUI.php'; $ilCtrl->forwardCommand(new ilTestExportGUI($this)); break; case "ilinfoscreengui": $this->prepareOutput(); $this->addHeaderAction(); $this->infoScreen(); // forwards command break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "iltestplayerfixedquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerFixedQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestplayerrandomquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerRandomQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestplayerdynamicquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerDynamicQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestevaluationgui": $this->forwardToEvaluationGUI(); break; case "iltestevalobjectiveorientedgui": $this->forwardToEvalObjectiveOrientedGUI(); break; case "iltestservicegui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Modules/Test/classes/class.ilTestServiceGUI.php"; $serviceGUI =& new ilTestServiceGUI($this->object); $this->ctrl->forwardCommand($serviceGUI); break; case 'ilpermissiongui': $this->prepareOutput(); $this->addHeaderAction(); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "illearningprogressgui": $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId()); $this->ctrl->forwardCommand($new_gui); break; case "ilcertificategui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Services/Certificate/classes/class.ilCertificateGUI.php"; require_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php"; $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object)); $this->ctrl->forwardCommand($output_gui); break; case "iltestscoringgui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Modules/Test/classes/class.ilTestScoringGUI.php"; $output_gui = new ilTestScoringGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case 'ilmarkschemagui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true); $this->ctrl->redirect($this, 'infoScreen'); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilMarkSchemaGUI.php'; $mark_schema_gui = new ilMarkSchemaGUI($this->object); $this->ctrl->forwardCommand($mark_schema_gui); break; case 'iltestscoringbyquestionsgui': $this->prepareOutput(); $this->addHeaderAction(); include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php'; $output_gui = new ilTestScoringByQuestionsGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case 'ilobjtestsettingsgeneralgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php'; $gui = new ilObjTestSettingsGeneralGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this); $this->ctrl->forwardCommand($gui); break; case 'ilobjtestsettingsscoringresultsgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php'; $gui = new ilObjTestSettingsScoringResultsGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $this); $this->ctrl->forwardCommand($gui); break; case 'ilobjtestdynamicquestionsetconfiggui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php'; $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object); $this->ctrl->forwardCommand($gui); break; case 'iltestrandomquestionsetconfiggui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php'; $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object); $this->ctrl->forwardCommand($gui); break; case 'iltestquestionbrowsertablegui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php'; $gui = new ilTestQuestionBrowserTableGUI($this->ctrl, $this->tpl, $ilTabs, $this->lng, $tree, $ilDB, $ilPluginAdmin, $this->object); $gui->setWriteAccess($ilAccess->checkAccess("write", "", $this->ref_id)); $gui->init(); $this->ctrl->forwardCommand($gui); break; case 'iltestskilladministrationgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php'; $gui = new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $tree, $ilPluginAdmin, $this->object, $this->ref_id); $this->ctrl->forwardCommand($gui); break; case 'iltestskillevaluationgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php'; if ($this->object->isDynamicTest()) { require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php'; $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object); $dynamicQuestionSetConfig->loadFromDb(); $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin); $questionList->setParentObjId($dynamicQuestionSetConfig->getSourceQuestionPoolId()); $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS); } else { $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin); $questionList->setParentObjId($this->object->getId()); $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES); } $questionList->load(); require_once 'Modules/Test/classes/class.ilTestSessionFactory.php'; $testSessionFactory = new ilTestSessionFactory($this->object); $testSession = $testSessionFactory->getSession(); $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true); require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php'; $gui = new ilTestSkillEvaluationGUI($this->ctrl, $ilTabs, $this->tpl, $this->lng, $ilDB, $this->object->getTestId(), $this->object->getRefId(), $this->object->getId()); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $gui->setQuestionList($questionList); $gui->setTestSession($testSession); $gui->setTestResults($testResults); $this->ctrl->forwardCommand($gui); break; case 'ilobjectcopygui': $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('tst'); $this->ctrl->forwardCommand($cp); break; case 'ilrepositorysearchgui': $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search =& new ilRepositorySearchGUI(); $rep_search->setCallback($this, 'addParticipantsObject', array()); // Set tabs $this->ctrl->setReturn($this, 'participants'); $ret =& $this->ctrl->forwardCommand($rep_search); $this->tabs_gui->setTabActive('participants'); break; case 'ilpageeditorgui': case 'iltestexpresspageobjectgui': require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php'; $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB); $incompleteQuestionPurger->setOwnerId($ilUser->getId()); $incompleteQuestionPurger->purge(); $qid = $_REQUEST['q_id']; // :FIXME: does not work // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode'); if (!$qid || $qid == 'Array') { $questions = $this->object->getQuestionTitlesAndIndexes(); if (!is_array($questions)) { $questions = array(); } $keys = array_keys($questions); $qid = $keys[0]; $_REQUEST['q_id'] = $qid; $_GET['q_id'] = $qid; $_POST['q_id'] = $qid; } $this->prepareOutput(); if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) { $this->buildPageViewToolbar($qid); } if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) { require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $pageObject = new ilTestExpressPageObjectGUI(0); $pageObject->test_object = $this->object; $ret =& $this->ctrl->forwardCommand($pageObject); break; } require_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $qid); if (!$q_gui instanceof assQuestionGUI) { $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', ''); $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd()); } $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question = $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); #$this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view"); $this->ctrl->setReturn($this, "questions"); require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php"; require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $page_gui = new ilTestExpressPageObjectGUI($qid); $page_gui->test_object = $this->object; $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen")); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this)); $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']'); $ret =& $this->ctrl->forwardCommand($page_gui); global $ilTabs; $ilTabs->activateTab('assQuestions'); $this->tpl->setContent($ret); break; case 'ilassquestionpreviewgui': $this->prepareOutput(); $this->ctrl->saveParameter($this, "q_id"); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php'; $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB); $gui->initQuestion((int) $_GET['q_id'], $this->object->getId()); $gui->initPreviewSettings($this->object->getRefId()); $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']); $gui->initHintTracking(); $gui->initStyleSheets(); $this->ctrl->forwardCommand($gui); break; case 'ilassquestionpagegui': require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; //echo $_REQUEST['prev_qid']; if ($_REQUEST['prev_qid']) { $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } $this->prepareOutput(); //global $___test_express_mode; //$___test_express_mode = true; $_GET['calling_test'] = $this->object->getRefId(); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]); $q_gui->setQuestionTabs(); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question =& $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); $this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view"); $this->ctrl->setReturn($this, "questions"); $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]); $page_gui->setEditPreview(true); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']'); $ret =& $this->ctrl->forwardCommand($page_gui); $this->tpl->setContent($ret); break; case 'ilassspecfeedbackpagegui': require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php"; $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]); $this->ctrl->forwardCommand($pg_gui); break; case 'ilassgenfeedbackpagegui': require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php"; $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]); $this->ctrl->forwardCommand($pg_gui); break; case 'illocalunitconfigurationgui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php'; require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php'; $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id'])); $this->ctrl->forwardCommand($gui); break; case "ilcommonactiondispatchergui": require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ilassquestionhintsgui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); // forward to ilAssQuestionHintsGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php'; $gui = new ilAssQuestionHintsGUI($questionGUI); $ilCtrl->forwardCommand($gui); break; case 'ilassquestionfeedbackeditinggui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); // forward to ilAssQuestionFeedbackGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php'; $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng); $ilCtrl->forwardCommand($gui); break; case 'iltesttoplistgui': $this->prepareOutput(); require_once './Modules/Test/classes/class.ilTestToplistGUI.php'; $gui = new ilTestToplistGUI($this); $this->ctrl->forwardCommand($gui); break; case 'ilscoringadjustmentgui': $this->prepareOutput(); require_once './Modules/Test/classes/class.ilScoringAdjustmentGUI.php'; $gui = new ilScoringAdjustmentGUI($this->object); $this->ctrl->forwardCommand($gui); break; case '': case 'ilobjtestgui': $this->prepareOutput(); $this->addHeaderAction(); if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) { $this->questionBrowser(); return; } if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) { $this->questionsObject(); return; } $cmd .= "Object"; $ret =& $this->{$cmd}(); break; default: // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']); } $this->create_question_mode = true; $this->prepareOutput(); $this->ctrl->setReturn($this, "questions"); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); if (!$_GET['sel_question_types']) { $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']); } else { $qType = $_GET['sel_question_types']; } $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']); $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']); if ($_REQUEST['test_express_mode']) { $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1); } #global $___test_express_mode; #$___test_express_mode = true; if (!$q_gui->isSaveCommand()) { $_GET['calling_test'] = $this->object->getRefId(); } $q_gui->setQuestionTabs(); #unset($___test_express_mode); $ret =& $this->ctrl->forwardCommand($q_gui); break; } if (!in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) && $this->getCreationMode() != true) { $this->tpl->show(); } }
function executeCommand() { global $ilNavigationHistory, $ilCtrl, $ilUser, $ilTabs, $ilAccess, $ilErr; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); if ($this->id_type == self::WORKSPACE_NODE_ID) { include_once "Services/Form/classes/class.ilFileInputGUI.php"; ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true); } if (!$this->getCreationMode()) { // do not move this payment block!! if (IS_PAYMENT_ENABLED) { include_once './Services/Payment/classes/class.ilPaymentObject.php'; if (ANONYMOUS_USER_ID == $ilUser->getId() && isset($_GET['transaction'])) { $transaction = $_GET['transaction']; include_once './Services/Payment/classes/class.ilPaymentBookings.php'; $valid_transaction = ilPaymentBookings::_readBookingByTransaction($transaction); } if (ilPaymentObject::_requiresPurchaseToAccess($this->node_id, $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->setLocator(); $this->tpl->getStandardTemplate(); include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $this->node_id); $ret = $this->ctrl->forwardCommand($pp); return true; } } else { if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read")) { $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->node_id); $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen"); $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]); // add entry to navigation history $ilNavigationHistory->addItem($this->node_id, $link, "file"); } } } $this->prepareOutput(); switch ($next_class) { case "ilinfoscreengui": $this->infoScreenForward(); // forwards command break; case 'ilmdeditorgui': if (!$this->checkPermissionBool("write")) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $ilTabs->activateTab("id_meta"); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); // todo: make this work $md_gui->addObserver($this->object, 'MDUpdateListener', 'Technical'); $this->ctrl->forwardCommand($md_gui); break; // repository permissions // repository permissions case 'ilpermissiongui': $ilTabs->activateTab("id_permissions"); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "ilexportgui": $ilTabs->activateTab("export"); include_once "./Services/Export/classes/class.ilExportGUI.php"; $exp_gui = new ilExportGUI($this); $exp_gui->addFormat("xml"); $ret = $this->ctrl->forwardCommand($exp_gui); break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('file'); $this->ctrl->forwardCommand($cp); break; // personal workspace permissions // personal workspace permissions case "ilworkspaceaccessgui": $ilTabs->activateTab("id_permissions"); include_once './Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php'; $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler()); $this->ctrl->forwardCommand($wspacc); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; default: // in personal workspace use object2gui if ($this->id_type == self::WORKSPACE_NODE_ID) { $this->addHeaderAction(); // coming from goto we need default command if (empty($cmd)) { $ilCtrl->setCmd("infoScreen"); } $ilTabs->clearTargets(); return parent::executeCommand(); } if (empty($cmd)) { $cmd = "infoScreen"; } $this->{$cmd}(); break; } $this->addHeaderAction(); }
/** * execute command */ function executeCommand() { global $ilUser, $ilLocator, $ilTabs; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $this->prepareOutput(); } else { if (!in_array($cmd, array("", "framset")) || $next_class != "") { $this->getTemplate(); $this->setLocator(); $this->setTabs(); } } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); return true; } } } switch ($next_class) { case 'ilmdeditorgui': $this->checkPermission("write"); $ilTabs->activateTab('id_meta_data'); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "ilfilesystemgui": $this->checkPermission("write"); $ilTabs->activateTab('id_list_files'); $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory()); $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose")); $fs_gui->setUseUploadDirectory(true); $fs_gui->setTableId("htlmfs" . $this->object->getId()); if ($this->object->getStartFile() != "") { $fs_gui->labelFile($this->object->getStartFile(), $this->lng->txt("cont_startfile")); } $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file")); $this->ctrl->forwardCommand($fs_gui); // try to set start file automatically require_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php"; if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId())) { $do_update = false; $pcommand = $fs_gui->getLastPerformedCommand(); if (is_array($pcommand)) { $valid = array("index.htm", "index.html", "start.htm", "start.html"); if ($pcommand["cmd"] == "create_file") { $file = strtolower(basename($pcommand["name"])); if (in_array($file, $valid)) { $this->object->setStartFile($pcommand["name"]); $do_update = $pcommand["name"]; } } else { if ($pcommand["cmd"] == "unzip_file") { $zip_file = strtolower(basename($pcommand["name"])); $suffix = strrpos($zip_file, "."); if ($suffix) { $zip_file = substr($zip_file, 0, $suffix); } foreach ($pcommand["added"] as $file) { $chk_file = null; if (stristr($file, ".htm")) { $chk_file = strtolower(basename($file)); $suffix = strrpos($chk_file, "."); if ($suffix) { $chk_file = substr($chk_file, 0, $suffix); } } if (in_array(basename($file), $valid) || $zip_file && $chk_file && $chk_file == $zip_file) { $this->object->setStartFile($file); $do_update = $file; break; } } } } } if ($do_update) { ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true); $this->object->update(); $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles"); } } break; case "ilinfoscreengui": $ret =& $this->outputInfoScreen(); break; case "illearningprogressgui": $ilTabs->activateTab('id_learning_progress'); include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()); $this->ctrl->forwardCommand($new_gui); break; case 'ilpermissiongui': $ilTabs->activateTab('id_permissions'); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case 'illicensegui': $ilTabs->activateTab('id_license'); include_once "./Services/License/classes/class.ilLicenseGUI.php"; $license_gui =& new ilLicenseGUI($this); $ret =& $this->ctrl->forwardCommand($license_gui); break; case "ilexportgui": $ilTabs->activateTab("export"); include_once "./Services/Export/classes/class.ilExportGUI.php"; $exp_gui = new ilExportGUI($this); $exp_gui->addFormat("xml"); $exp_gui->addFormat("html", "", $this, "exportHTML"); $ret = $this->ctrl->forwardCommand($exp_gui); // $this->tpl->show(); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; default: $cmd = $this->ctrl->getCmd("frameset"); if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $cmd .= "Object"; } $ret =& $this->{$cmd}(); break; } $this->addHeaderAction(); }
function executeCommand() { global $rbacsystem, $ilUser, $ilAccess, $ilErr, $ilTabs, $ilNavigationHistory, $ilCtrl; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); $this->prepareOutput(); // show repository tree $this->showRepTree(true); // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) { $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"); $ilNavigationHistory->addItem($_GET['ref_id'], $link, 'crs'); } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $ilTabs->setTabActive('info_short'); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $this->ctrl->setReturn($this, ''); $pp_gui = new ilShopPurchaseGUI($this->object->getRefId()); $this->ctrl->forwardCommand($pp_gui); return true; } } } switch ($next_class) { case "ilinfoscreengui": $this->infoScreen(); // forwards command break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); $this->tabs_gui->setTabActive('meta_data'); break; case 'ilcourseregistrationgui': $this->ctrl->setReturn($this, 'infoScreen'); $this->tabs_gui->setTabActive('join'); include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php'; $registration = new ilCourseRegistrationGUI($this->object); $this->ctrl->forwardCommand($registration); break; case 'ilobjectcustomuserfieldsgui': include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php'; if (isset($_REQUEST['member_id'])) { $this->ctrl->setReturn($this, 'members'); } $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId()); $this->setSubTabs('properties'); $this->tabs_gui->setTabActive('settings'); $this->ctrl->forwardCommand($cdf_gui); break; case "ilcourseobjectivesgui": include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php'; $this->ctrl->setReturn($this, ""); $reg_gui =& new ilCourseObjectivesGUI($this->object->getRefId()); $ret =& $this->ctrl->forwardCommand($reg_gui); break; case 'ilobjcoursegroupinggui': include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php'; $this->ctrl->setReturn($this, 'edit'); $this->setSubTabs('properties'); $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']); $this->ctrl->forwardCommand($crs_grp_gui); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('groupings'); break; case "ilcolumngui": $this->tabs_gui->setTabActive('none'); $this->checkPermission("read"); //$this->prepareOutput(); //include_once("./Services/Style/classes/class.ilObjStyleSheet.php"); //$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", // ilObjStyleSheet::getContentStylePath(0)); //$this->renderObject(); $this->viewObject(); break; case "ilconditionhandlergui": include_once './Services/AccessControl/classes/class.ilConditionHandlerGUI.php'; // preconditions for whole course $this->setSubTabs("properties"); $this->tabs_gui->setTabActive('settings'); $new_gui =& new ilConditionHandlerGUI($this); $this->ctrl->forwardCommand($new_gui); break; case "illearningprogressgui": include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()); $this->ctrl->forwardCommand($new_gui); $this->tabs_gui->setTabActive('learning_progress'); break; case 'illicenseoverviewgui': include_once "./Services/License/classes/class.ilLicenseOverviewGUI.php"; $license_gui =& new ilLicenseOverviewGUI($this, ilLicenseOverviewGUI::LIC_MODE_REPOSITORY); $ret =& $this->ctrl->forwardCommand($license_gui); $this->tabs_gui->setTabActive('licenses'); break; case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $this->tabs_gui->setTabActive('perm_settings'); $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case 'ilrepositorysearchgui': include_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search =& new ilRepositorySearchGUI(); if (ilCourseParticipant::_getInstanceByObjId($this->object->getId(), $GLOBALS['ilUser']->getId())->isAdmin() or $this->checkPermissionBool('edit_permission')) { $rep_search->setCallback($this, 'assignMembersObject', $this->getLocalRoles()); } else { $rep_search->setCallback($this, 'assignMembersObject', array(ilCourseConstants::CRS_MEMBER => $this->lng->txt('crs_member'), ilCourseConstants::CRS_TUTOR => $this->lng->txt('crs_tutor'))); } $this->checkLicenses(); // Set tabs $this->ctrl->setReturn($this, 'members'); $ret =& $this->ctrl->forwardCommand($rep_search); $this->setSubTabs('members'); $this->tabs_gui->setTabActive('members'); $this->tabs_gui->setSubTabActive('crs_member_administration'); break; case 'ilcoursecontentinterface': $this->initCourseContentInterface(); $this->cci_obj->cci_setContainer($this); $this->ctrl->forwardCommand($this->cci_obj); $this->setSubTabs('content'); $this->tabs_gui->setTabActive('content'); break; case 'ilcoursecontentgui': $this->ctrl->setReturn($this, 'members'); include_once './Modules/Course/classes/class.ilCourseContentGUI.php'; $course_content_obj = new ilCourseContentGUI($this); $this->ctrl->forwardCommand($course_content_obj); break; case 'ilpublicuserprofilegui': $this->tpl->enableDragDropFileUpload(null); require_once './Services/User/classes/class.ilPublicUserProfileGUI.php'; $profile_gui = new ilPublicUserProfileGUI($_GET["user"]); $this->setSubTabs('members'); $this->tabs_gui->setTabActive('members'); $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery")); $this->tabs_gui->setSubTabActive('crs_members_gallery'); $html = $this->ctrl->forwardCommand($profile_gui); $this->tpl->setVariable("ADM_CONTENT", $html); break; case 'ilmemberexportgui': include_once './Services/Membership/classes/Export/class.ilMemberExportGUI.php'; $this->setSubTabs('members'); $this->tabs_gui->setTabActive('members'); $this->tabs_gui->setSubTabActive('export_members'); $export = new ilMemberExportGUI($this->object->getRefId()); $this->ctrl->forwardCommand($export); break; case 'ilmemberagreementgui': include_once 'Services/Membership/classes/class.ilMemberAgreementGUI.php'; $this->tabs_gui->clearTargets(); $this->ctrl->setReturn($this, ''); $agreement = new ilMemberAgreementGUI($this->object->getRefId()); $this->ctrl->forwardCommand($agreement); break; case 'ilsessionoverviewgui': $this->setSubTabs('members'); $this->tabs_gui->setTabActive('members'); $this->tabs_gui->setSubTabActive('events'); include_once './Modules/Course/classes/class.ilCourseParticipants.php'; $prt = ilCourseParticipants::_getInstanceByObjId($this->object->getId()); include_once './Modules/Session/classes/class.ilSessionOverviewGUI.php'; $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt); $this->ctrl->forwardCommand($overview); break; // container page editing // container page editing case "ilcontainerpagegui": $ret = $this->forwardToPageObject(); if ($ret != "") { $this->tpl->setContent($ret); } break; case "ilcontainerstartobjectspagegui": // file downloads, etc. (currently not active) include_once "Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $pgui = new ilContainerStartObjectsPageGUI($this->object->getId()); $ret = $this->ctrl->forwardCommand($pgui); if ($ret) { $this->tpl->setContent($ret); } break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('crs'); $this->ctrl->forwardCommand($cp); break; case "ilobjstylesheetgui": $this->forwardToStyleSheet(); break; case 'ilcourseparticipantsgroupsgui': include_once './Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php'; $cmg_gui = new ilCourseParticipantsGroupsGUI($this->object->getRefId()); $this->setSubTabs('members'); $this->tabs_gui->setTabActive('members'); $this->ctrl->forwardCommand($cmg_gui); break; case 'ilexportgui': $this->tabs_gui->setTabActive('export'); include_once './Services/Export/classes/class.ilExportGUI.php'; $exp = new ilExportGUI($this); $exp->addFormat('xml'); $this->ctrl->forwardCommand($exp); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ildidactictemplategui': $this->ctrl->setReturn($this, 'edit'); include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php'; $did = new ilDidacticTemplateGUI($this); $this->ctrl->forwardCommand($did); break; case "ilcertificategui": $this->tabs_gui->activateTab("settings"); $this->setSubTabs("properties"); include_once "./Services/Certificate/classes/class.ilCertificateGUI.php"; include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php"; $output_gui = new ilCertificateGUI(new ilCourseCertificateAdapter($this->object)); $this->ctrl->forwardCommand($output_gui); break; case 'ilobjectservicesettingsgui': $this->ctrl->setReturn($this, 'edit'); $this->setSubTabs("properties"); $this->tabs_gui->activateTab('settings'); $this->tabs_gui->acltivateSubTab('tool_settings'); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; $service = new ilObjectServiceSettingsGUI($this, $this->object->getId(), array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY)); $this->ctrl->forwardCommand($service); break; case 'illoeditorgui': #$this->tabs_gui->clearTargets(); #$this->tabs_gui->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'')); $this->tabs_gui->activateTab('crs_objectives'); include_once './Modules/Course/classes/Objectives/class.ilLOEditorGUI.php'; $editor = new ilLOEditorGUI($this->object); $this->ctrl->forwardCommand($editor); break; case 'ilcontainerstartobjectsgui': $this->ctrl->setReturn($this, 'edit'); $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt("back_to_crs_content"), $this->ctrl->getLinkTarget($this, "edit")); $this->tabs_gui->addTab("start", $this->lng->txt("crs_start_objects"), $this->ctrl->getLinkTargetByClass("ilcontainerstartobjectsgui", "listStructure")); include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php'; $stgui = new ilContainerStartObjectsGUI($this->object); $this->ctrl->forwardCommand($stgui); break; case 'illomembertestresultgui': include_once './Modules/Course/classes/Objectives/class.ilLOMemberTestResultGUI.php'; $GLOBALS['ilCtrl']->setReturn($this, 'members'); $GLOBALS['ilTabs']->clearTargets(); $GLOBALS['ilTabs']->setBackTarget($GLOBALS['lng']->txt('back'), $GLOBALS['ilCtrl']->getLinkTarget($this, 'members')); $result_view = new ilLOMemberTestResultGUI($this, $this->object, (int) $_REQUEST['uid']); $this->ctrl->forwardCommand($result_view); break; default: /* if(!$this->creation_mode) { $this->checkPermission('visible'); }*/ /* if(!$this->creation_mode and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'crs')) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE); } */ // #9401 - see also ilStartupGUI::_checkGoto() if ($cmd == 'infoScreenGoto') { if (ilObjCourse::_isActivated($this->object->getId()) && ilObjCourse::_registrationEnabled($this->object->getId())) { $cmd = 'join'; } else { $cmd = 'infoScreen'; } } if (!$this->creation_mode) { if ($cmd == "infoScreen") { $this->checkPermission("visible"); } else { // $this->checkPermission("read"); } } if (!$this->creation_mode && $cmd != 'infoScreen' && $cmd != 'sendfile' && $cmd != 'unsubscribe' && $cmd != 'performUnsubscribe' && !$ilAccess->checkAccess("read", '', $this->object->getRefId()) || $cmd == 'join' || $cmd == 'subscribe') { include_once './Modules/Course/classes/class.ilCourseParticipants.php'; if ($rbacsystem->checkAccess('join', $this->object->getRefId()) && !ilCourseParticipants::_isParticipant($this->object->getRefId(), $ilUser->getId())) { include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php'; $this->ctrl->redirectByClass("ilCourseRegistrationGUI"); } else { $this->infoScreenObject(); break; } } if ($cmd == 'listObjectives') { include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php'; $this->ctrl->setReturn($this, ""); $obj_gui =& new ilCourseObjectivesGUI($this->object->getRefId()); $ret =& $this->ctrl->forwardCommand($obj_gui); break; } // Dirty hack for course timings view if ($this->forwardToTimingsView()) { break; } if (!$cmd) { $cmd = 'view'; } $cmd .= 'Object'; $this->{$cmd}(); break; } $this->addHeaderAction(); return true; }
/** * Is node clickable * * @param array $a_node node array * @return bool clickable? */ function isNodeClickable($a_node) { global $ilUser; $orig_node_id = $a_node["child"]; // if navigation is restricted based on correct answered questions // check if we have preceeding pages including unsanswered/incorrect answered questions if (!$this->getOfflineMode()) { if ($this->lm->getRestrictForwardNavigation()) { if ($this->getTracker()->hasPredIncorrectAnswers($orig_node_id)) { return false; } } } if ($a_node["type"] == "st") { if (!$this->getOfflineMode()) { if ($this->lm->getTOCMode() != "pages") { $a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg"); } else { // faster, but needs pages to be in explorer $a_node = $this->getSuccessorNode($a_node["child"], "pg"); } if ($a_node["child"] == 0) { return false; } } else { // get next activated page $found = false; while (!$found) { if ($this->lm->getTOCMode() != "pages") { $a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg"); } else { $a_node = $this->getSuccessorNode($a_node["child"], "pg"); } include_once "./Modules/LearningModule/classes/class.ilLMPage.php"; $active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation")); if ($a_node["child"] > 0 && !$active) { $found = false; } else { $found = true; } } if ($a_node["child"] <= 0) { return false; } else { $path = $this->getTree()->getPathId($a_node["child"]); if (!in_array($orig_node_id, $path)) { return false; } } } } if ($a_node["type"] == "pg") { // check public area mode include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm->getRefId())) && !ilLMObject::_isPagePublic($a_node["child"], true)) { return false; } } return true; }
/** * execute command */ function &executeCommand() { global $lng, $ilAccess, $ilNavigationHistory, $ilCtrl, $ilLocator, $ilObjDataCache; include_once "./Services/Object/classes/class.ilObjectGUI.php"; include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php"; $lng->loadLanguageModule("content"); $obj_id = ilObject::_lookupObjectId($_GET['ref_id']); // add entry to navigation history if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php"; if (!ilObjSAHSLearningModuleAccess::_lookupEditable($obj_id)) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=" . $_GET["ref_id"], "lm"); } } include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $ilLocator->addRepositoryItems(); $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($_GET['ref_id'])), 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $_GET['ref_id'], '', $_GET['ref_id'], 'sahs'); $this->tpl->setLocator(); $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $this->ctrl->setReturn($this, ''); $pp_gui = new ilShopPurchaseGUI($_GET['ref_id']); $this->ctrl->forwardCommand($pp_gui); $this->tpl->show(); exit; } $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); $type = ilObjSAHSLearningModule::_lookupSubType($obj_id); if ($cmd == "downloadCertificate") { require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php"; $scorm_gui = new ilSCORMPresentationGUI(); $ret =& $this->ctrl->forwardCommand($scorm_gui); } switch ($type) { case "scorm2004": include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php"; $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false); break; case "scorm": include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php"; $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false); break; case "aicc": include_once "./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php"; $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"], true, false); break; case "hacp": include_once "./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php"; $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"], true, false); break; } if ($next_class != "ilinfoscreengui" && $cmd != "infoScreen" && $next_class != "illearningprogressgui") { include_once "./Services/License/classes/class.ilLicense.php"; ilLicense::_noteAccess($obj_id, "sahs", $_GET["ref_id"]); switch ($type) { case "scorm2004": $this->ctrl->setCmdClass("ilscorm13player"); $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false); break; case "scorm": $this->ctrl->setCmdClass("ilscormpresentationgui"); $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false); break; case "aicc": $this->ctrl->setCmdClass("ilaiccpresentationgui"); break; case "hacp": $this->ctrl->setCmdClass("ilhacppresentationgui"); break; } $next_class = $this->ctrl->getNextClass($this); } switch ($next_class) { case "ilinfoscreengui": $ret =& $this->outputInfoScreen(); break; case "ilscorm13player": require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php"; $scorm_gui = new ilSCORM13Player(); $ret =& $this->ctrl->forwardCommand($scorm_gui); break; case "ilscormpresentationgui": require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php"; $scorm_gui = new ilSCORMPresentationGUI(); $ret =& $this->ctrl->forwardCommand($scorm_gui); break; case "ilaiccpresentationgui": require_once "./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php"; $aicc_gui = new ilAICCPresentationGUI(); $ret =& $this->ctrl->forwardCommand($aicc_gui); break; case "ilhacppresentationgui": require_once "./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php"; $hacp_gui = new ilHACPPresentationGUI(); $ret =& $this->ctrl->forwardCommand($hacp_gui); break; case "illearningprogressgui": $this->setInfoTabs("learning_progress"); include_once "./Services/Tracking/classes/class.ilLearningProgressGUI.php"; $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $_GET['ref_id']); $this->ctrl->forwardCommand($new_gui); $this->tpl->show(); break; default: $this->{$cmd}(); } }
/** * execute command */ function executeCommand() { global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) { global $ilias; $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } $cmd = $this->ctrl->getCmd("properties"); $cmdsDisabledDueToOfflineStatus = array('resume', 'start', 'outUserResultsOverview', 'outUserListOfAnswerPasses'); if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) { $cmd = 'infoScreen'; } $next_class = $this->ctrl->getNextClass($this); $this->ctrl->setReturn($this, "properties"); if (method_exists($this->object, "getTestStyleLocation")) { $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen"); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst"); } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { include_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->setLocator(); $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); $this->tpl->show(); exit; } } } // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } switch ($next_class) { case "ilinfoscreengui": $this->prepareOutput(); $this->addHeaderAction(); $this->infoScreen(); // forwards command break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->prepareOutput(); $this->addHeaderAction(); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "iltestoutputgui": include_once "./Modules/Test/classes/class.ilTestOutputGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $output_gui =& new ilTestOutputGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case "iltestevaluationgui": $this->prepareOutput(); $this->addHeaderAction(); include_once "./Modules/Test/classes/class.ilTestEvaluationGUI.php"; $evaluation_gui =& new ilTestEvaluationGUI($this->object); $this->ctrl->forwardCommand($evaluation_gui); break; case "iltestservicegui": $this->prepareOutput(); $this->addHeaderAction(); include_once "./Modules/Test/classes/class.ilTestServiceGUI.php"; $serviceGUI =& new ilTestServiceGUI($this->object); $this->ctrl->forwardCommand($serviceGUI); break; case 'ilpermissiongui': $this->prepareOutput(); $this->addHeaderAction(); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "illearningprogressgui": $this->prepareOutput(); $this->addHeaderAction(); include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $this->object->getRefId()); $this->ctrl->forwardCommand($new_gui); break; case "ilcertificategui": $this->prepareOutput(); $this->addHeaderAction(); include_once "./Services/Certificate/classes/class.ilCertificateGUI.php"; include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php"; $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object)); $this->ctrl->forwardCommand($output_gui); break; case "iltestscoringgui": $this->prepareOutput(); $this->addHeaderAction(); include_once "./Modules/Test/classes/class.ilTestScoringGUI.php"; $output_gui = new ilTestScoringGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case 'ilobjectcopygui': $this->prepareOutput(); $this->addHeaderAction(); include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('tst'); $this->ctrl->forwardCommand($cp); break; case 'ilrepositorysearchgui': $this->prepareOutput(); $this->addHeaderAction(); include_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search =& new ilRepositorySearchGUI(); $rep_search->setCallback($this, 'addParticipantsObject', array()); // Set tabs $this->ctrl->setReturn($this, 'participants'); $ret =& $this->ctrl->forwardCommand($rep_search); $this->tabs_gui->setTabActive('participants'); break; case 'ilpageeditorgui': case 'iltestexpresspageobjectgui': $qid = $_REQUEST['q_id']; // :FIXME: does not work // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode'); if (!$qid || $qid == 'Array') { $questions = $this->object->getQuestionTitlesAndIndexes(); if (!is_array($questions)) { $questions = array(); } $keys = array_keys($questions); $qid = $keys[0]; $_REQUEST['q_id'] = $qid; $_GET['q_id'] = $qid; $_POST['q_id'] = $qid; } $this->prepareOutput(); if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) { $this->buildPageViewToolbar($qid); } if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) { include_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $pageObject = new ilTestExpressPageObjectGUI("qpl", 0); $pageObject->test_object = $this->object; $ret =& $this->ctrl->forwardCommand($pageObject); break; } include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui =& assQuestionGUI::_getQuestionGUI("", $qid); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question =& $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); #$this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view"); $this->ctrl->setReturn($this, "questions"); //$page =& new ilPageObject("qpl", $_GET["q_id"]); include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $page_gui =& new ilTestExpressPageObjectGUI("qpl", $qid); $page_gui->test_object = $this->object; $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); $page_gui->setEnabledInternalLinks(false); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen")); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this)); $page_gui->setPresentationTitle($question->getTitle()); $ret =& $this->ctrl->forwardCommand($page_gui); global $ilTabs; $ilTabs->activateTab('assQuestions'); $this->tpl->setContent($ret); break; case 'ilpageobjectgui': include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; //echo $_REQUEST['prev_qid']; if ($_REQUEST['prev_qid']) { $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } $this->prepareOutput(); //global $___test_express_mode; //$___test_express_mode = true; $_GET['calling_test'] = $this->object->getRefId(); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]); $q_gui->setQuestionTabs(); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question =& $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; $this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilPageObjectGUI", "view"); $this->ctrl->setReturn($this, "questions"); //$page =& new ilPageObject("qpl", $_GET["q_id"]); $page_gui =& new ilPageObjectGUI("qpl", $_GET["q_id"]); $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); $page_gui->setEnabledInternalLinks(false); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } //$page_gui->setQuestionXML($question->toXML(false, false, true)); $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen")); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this)); $page_gui->setPresentationTitle($question->getTitle()); $ret =& $this->ctrl->forwardCommand($page_gui); $this->tpl->setContent($ret); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ilassquestionhintsgui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); // forward to ilAssQuestionHintsGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php'; $gui = new ilAssQuestionHintsGUI($questionGUI); $ilCtrl->forwardCommand($gui); break; case 'iltesttoplistgui': $this->prepareOutput(); require_once 'Modules/Test/classes/class.ilTestToplistGUI.php'; $gui = new ilTestToplistGUI($this); $this->ctrl->forwardCommand($gui); break; case '': case 'ilobjtestgui': $this->prepareOutput(); $this->addHeaderAction(); if (preg_match("/deleteqpl_\\d+/", $cmd)) { $cmd = "randomQuestions"; } if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) { $this->questionBrowser(); return; } if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) { $this->questionsObject(); return; } $cmd .= "Object"; $ret =& $this->{$cmd}(); break; default: // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameterByClass('ilpageobjectgui', 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']); } $this->create_question_mode = true; $this->prepareOutput(); $this->ctrl->setReturn($this, "questions"); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); if (!$_GET['sel_question_types']) { $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']); } else { $qType = $_GET['sel_question_types']; } $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']); $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']); if ($_REQUEST['test_express_mode']) { $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1); } #global $___test_express_mode; #$___test_express_mode = true; if (!$q_gui->isSaveCommand()) { $_GET['calling_test'] = $this->object->getRefId(); } $q_gui->setQuestionTabs(); #unset($___test_express_mode); $ret =& $this->ctrl->forwardCommand($q_gui); break; } if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) { $this->tpl->show(); } }