/** * show information screen */ public function getInfoScreen(ilObjCloudGUI $gui_class) { include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $this->info = new ilInfoScreenGUI($gui_class); $this->info->enablePrivateNotes(); $this->info->addMetaDataSections($gui_class->object->getId(), 0, $gui_class->object->getType()); $this->getPluginInfo(); return $this->info; }
/** * Prepares and displays the info screen. * * @global ilAccessHandler $ilAccess * @global ilCtrl2 $ilCtrl * @global ilLanguage $lng * @param string $method */ public function executeDefault($method) { global $ilAccess, $ilCtrl, $lng; include_once 'Modules/Chatroom/classes/class.ilChatroom.php'; if (!ilChatroom::checkUserPermissions('read', $this->gui->ref_id)) { $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", ROOT_FOLDER_ID); $ilCtrl->redirectByClass("ilrepositorygui", ""); } $this->gui->switchToVisibleMode(); if (!$ilAccess->checkAccess("visible", "", $this->gui->ref_id)) { $this->gui->ilias->raiseError($lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } $info = new ilInfoScreenGUI($this->gui); $info->enablePrivateNotes(); if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $info->enableNews(); } $info->addMetaDataSections($this->gui->object->getId(), 0, $this->gui->object->getType()); if (!$method) { $ilCtrl->setCmd('showSummary'); } else { $ilCtrl->setCmd($method); } $ilCtrl->forwardCommand($info); }
/** * info screen */ function outputInfoScreen($a_standard_locator = true) { global $ilBench, $ilLocator, $ilAccess, $ilTabs; $ilTabs->activateTab('id_info'); $this->lng->loadLanguageModule("meta"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->enableLearningProgress(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } // add read / back button if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $info->addButton($this->lng->txt("view"), "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID(), ' target="ilContObj' . $this->object->getId() . '" '); } // show standard meta data section $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreenForward() { global $ilTabs, $ilErr, $ilToolbar; $ilTabs->activateTab("id_info"); if (!$this->checkPermissionBool("visible")) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } $this->lng->loadLanguageModule("cntr"); $ilToolbar->addButton($this->lng->txt("prtf_create_portfolio_from_template"), $this->ctrl->getLinkTarget($this, "createfromtemplate"), "", "", "", "", "submit emphsubmit"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); if ($this->checkPermissionBool("read")) { $info->enableNews(); } // no news editing for files, just notifications $info->enableNewsEditing(false); if ($this->checkPermissionBool("write")) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); $info->setBlockProperty("news", "public_notifications_option", true); } } // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreen($session_lock = "") { /** * @var $ilAccess ilAccessHandler * @var $ilUser ilObjUser * @var $ilToolbar ilToolbarGUI */ global $ilAccess, $ilUser, $ilToolbar; require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSetFilterSelection.php'; $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig(); $testSession = $this->testSessionFactory->getSession(); $testSequence = $this->testSequenceFactory->getSequenceByTestSession($testSession); $testSequence->loadFromDb(); $testSequence->loadQuestions($testQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection()); $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI(); if ($_GET['createRandomSolutions']) { $this->object->createRandomSolutions($_GET['createRandomSolutions']); } if (!$ilAccess->checkAccess("read", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $this->ctrl->setParameter($testPlayerGUI, "sequence", $testSession->getLastSequence()); $info->setFormAction($this->ctrl->getFormAction($testPlayerGUI)); if (strlen($session_lock)) { $info->addHiddenElement("lock", $session_lock); } else { $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time())); } $online_access = false; if ($this->object->getFixedParticipants()) { include_once "./Modules/Test/classes/class.ilObjTestAccess.php"; $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId()); if ($online_access_result === true) { $online_access = true; } else { ilUtil::sendInfo($online_access_result); } } $enter_anonymous_code = false; if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) { if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) { $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE); if ($executable["executable"]) { if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) { ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions')); } if ($testSession->getActiveId() > 0) { // resume test require_once 'Modules/Test/classes/class.ilTestPassesSelector.php'; $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object); $testPassesSelector->setActiveId($testSession->getActiveId()); $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass()); $closedPasses = $testPassesSelector->getReportablePasses(); $existingPasses = $testPassesSelector->getExistingPasses(); if ($existingPasses > $closedPasses) { $resumeTestLabel = $this->lng->txt("tst_resume_test"); $big_button[] = array('resumePlayer', $resumeTestLabel, true); } else { $resumeTestLabel = $this->object->getStartTestLabel($testSession->getActiveId()); $big_button[] = array('startPlayer', $resumeTestLabel, true); } } else { // start new test $big_button[] = array("startPlayer", $this->object->getStartTestLabel($testSession->getActiveId()), true); } } else { ilUtil::sendInfo($executable["errormessage"]); } if ($testSession->getActiveId() > 0) { // test results button require_once 'Modules/Test/classes/class.ilTestPassesSelector.php'; $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object); $testPassesSelector->setActiveId($testSession->getActiveId()); $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass()); if ($this->object->canShowTestResults($testSession, $ilUser->getId()) && count($testPassesSelector->getReportablePasses())) { //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results")); $big_button[] = array(array('ilTestEvaluationGUI', 'outUserResultsOverview'), $this->lng->txt("tst_show_results"), false); if ($this->object->getHighscoreEnabled()) { // Can also compare results then $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"), false); } if ($this->object->isSkillServiceToBeConsidered()) { require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php'; $big_button[] = array(array('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW), $this->lng->txt("tst_show_comp_results"), false); } } } } if ($testSession->getActiveId() > 0) { if ($this->object->canShowSolutionPrintview($ilUser->getId())) { //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show")); $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"), false); } } if ($this->isDeleteDynamicTestResultsButtonRequired($testSession, $testSequence)) { $this->populateDeleteDynamicTestResultsButton($testSession, $big_button); } if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { $enter_anonymous_code = true; } } if (!$this->object->isOnline()) { $message = $this->lng->txt("test_is_offline"); if ($ilAccess->checkAccess("write", "", $this->ref_id)) { $message .= "<br /><a href=\"" . $this->ctrl->getLinkTargetByClass('ilobjtestsettingsgeneralgui') . "\">" . $this->lng->txt("test_edit_settings") . "</a>"; } ilUtil::sendInfo($message); } if ($this->areSkillLevelThresholdsMissing()) { ilUtil::sendFailure($this->getSkillLevelThresholdsMissingInfo()); } if ($ilAccess->checkAccess("write", "", $this->ref_id)) { $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig(); if ($testQuestionSetConfig->areDepenciesBroken()) { ilUtil::sendFailure($testQuestionSetConfig->getDepenciesBrokenMessage($this->lng)); $big_button = array(); $enter_anonymous_code = false; } elseif ($testQuestionSetConfig->areDepenciesInVulnerableState()) { ilUtil::sendInfo($testQuestionSetConfig->getDepenciesInVulnerableStateMessage($this->lng)); } } if ($this->object->getShowInfo()) { $info->enablePrivateNotes(); } if ($big_button || $enter_anonymous_code) { $ilToolbar->setFormAction($this->ctrl->getFormAction($testPlayerGUI)); foreach ($big_button as $button) { if (is_array($button[0])) { $link = $this->ctrl->getLinkTargetByClass($button[0][0], $button[0][1]); $ilToolbar->addButton($button[1], $link, '', '', '', '', $button[2] ? 'submit emphSubmit' : 'submit'); } else { $ilToolbar->addFormButton($button[1], $button[0], "", $button[2]); } } if ($enter_anonymous_code) { if ($big_button) { $ilToolbar->addSeparator(); } require_once 'Services/Form/classes/class.ilTextInputGUI.php'; $anonymous_id = new ilTextInputGUI($this->lng->txt('enter_anonymous_code'), 'anonymous_id'); $anonymous_id->setSize(8); $ilToolbar->addInputItem($anonymous_id, true); $ilToolbar->addFormButton($this->lng->txt('submit'), 'setAnonymousId'); } $ilToolbar->setCloseFormTag(false); $info->setOpenFormTag(false); } if (strlen($this->object->getIntroduction())) { $info->addSection($this->lng->txt("tst_introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction(), true) . $info->getHiddenToggleButton()); } else { $info->addSection(""); $info->addProperty("", $info->getHiddenToggleButton()); } $info->addSection($this->lng->txt("tst_general_properties")); if ($this->object->getShowInfo()) { $info->addProperty($this->lng->txt("author"), $this->object->getAuthor()); $info->addProperty($this->lng->txt("title"), $this->object->getTitle()); } if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) { if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) { if ($this->object->getShowInfo() || !$this->object->getForceJS()) { // use javascript $checked_javascript = false; if ($this->object->getJavaScriptOutput()) { $checked_javascript = true; } } // hide previous results if (!$this->object->isRandomTest() && !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { if ($this->object->getNrOfTries() != 1) { if ($this->object->getUsePreviousAnswers() == 0) { if ($this->object->getShowInfo()) { $info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers")); } } else { $use_previous_answers = FALSE; if ($ilUser->prefs["tst_use_previous_answers"]) { $checked_previous_answers = TRUE; } $info->addPropertyCheckbox($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers", 1, $this->lng->txt("tst_use_previous_answers_user"), $checked_previous_answers); } } } } } $info->hideFurtherSections(false); if ($this->object->getShowInfo()) { $info->addSection($this->lng->txt("tst_sequence_properties")); $info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone")); $info->addSection($this->lng->txt("tst_heading_scoring")); $info->addProperty($this->lng->txt("tst_text_count_system"), $this->lng->txt($this->object->getCountSystem() == COUNT_PARTIAL_SOLUTIONS ? "tst_count_partial_solutions" : "tst_count_correct_solutions")); $info->addProperty($this->lng->txt("tst_score_mcmr_questions"), $this->lng->txt($this->object->getMCScoring() == SCORE_ZERO_POINTS_WHEN_UNANSWERED ? "tst_score_mcmr_zero_points_when_unanswered" : "tst_score_mcmr_use_scoring_system")); if ($this->object->isRandomTest()) { $info->addProperty($this->lng->txt("tst_pass_scoring"), $this->lng->txt($this->object->getPassScoring() == SCORE_BEST_PASS ? "tst_pass_best_pass" : "tst_pass_last_pass")); } $info->addSection($this->lng->txt("tst_score_reporting")); $score_reporting_text = ""; switch ($this->object->getScoreReporting()) { case REPORT_AFTER_TEST: $score_reporting_text = $this->lng->txt("tst_report_after_test"); break; case REPORT_ALWAYS: $score_reporting_text = $this->lng->txt("tst_report_after_first_question"); break; case REPORT_AFTER_DATE: $score_reporting_text = $this->lng->txt("tst_report_after_date"); break; case 4: $score_reporting_text = $this->lng->txt("tst_report_never"); break; } $info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text); $reporting_date = $this->object->getReportingDate(); if ($reporting_date) { #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches); #$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1])); #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date); $info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP))); } $info->addSection($this->lng->txt("tst_session_settings")); $info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries()); if ($this->object->getNrOfTries() != 1) { $info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $testSession->getPass() == false ? $this->lng->txt("tst_no_tries") : $testSession->getPass()); } if ($this->object->getEnableProcessingTime()) { $info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime()); } if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) { $info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers()); } $starting_time = $this->object->getStartingTime(); if ($starting_time) { $info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP))); } $ending_time = $this->object->getEndingTime(); if ($ending_time) { $info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP))); } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command } $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreenForward() { global $ilTabs, $ilErr; $ilTabs->activateTab("id_info"); if (!$this->checkPermissionBool("visible")) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); if ($this->checkPermissionBool("read", "sendfile")) { // 9876 $this->lng->loadLanguageModule("file"); $info->addButton($this->lng->txt("file_download"), $this->ctrl->getLinkTarget($this, "sendfile")); } $info->enablePrivateNotes(); if ($this->checkPermissionBool("read")) { $info->enableNews(); } // no news editing for files, just notifications $info->enableNewsEditing(false); if ($this->checkPermissionBool("write")) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); $info->setBlockProperty("news", "public_notifications_option", true); } } // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $info->addSection($this->lng->txt("file_info")); $info->addProperty($this->lng->txt("filename"), $this->object->getFileName()); // BEGIN WebDAV Guess file type. $info->addProperty($this->lng->txt("type"), $this->object->guessFileType()); // END WebDAV Guess file type. $info->addProperty($this->lng->txt("size"), ilFormat::formatSize(ilObjFile::_lookupFileSize($this->object->getId()), 'long')); $info->addProperty($this->lng->txt("version"), $this->object->getVersion()); include_once "./Services/History/classes/class.ilHistory.php"; $uploader = ilHistory::_getEntriesForObject($this->object->getId(), $this->object->getType()); $uploader = array_shift($uploader); $uploader = $uploader["user_id"]; $this->lng->loadLanguageModule("file"); include_once "Services/User/classes/class.ilUserUtil.php"; $info->addProperty($this->lng->txt("file_uploaded_by"), ilUserUtil::getNamePresentation($uploader)); if ($this->id_type == self::WORKSPACE_NODE_ID) { $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget()); } // forward the command // $this->ctrl->setCmd("showSummary"); // $this->ctrl->setCmdClass("ilinfoscreengui"); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreenForward() { global $ilTabs, $ilErr; $ilTabs->activateTab("id_info"); if (!$this->checkPermissionBool("visible")) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); if ($this->checkPermissionBool("read")) { $info->enableNews(); } // no news editing for files, just notifications $info->enableNewsEditing(false); if ($this->checkPermissionBool("write")) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); $info->setBlockProperty("news", "public_notifications_option", true); } } // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); if ($this->id_type == self::WORKSPACE_NODE_ID) { $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget()); } $this->ctrl->forwardCommand($info); }
/** * show information screen */ public function infoScreenForward() { global $ilTabs, $ilErr; $ilTabs->activateTab("id_info"); if (!$this->checkPermissionBool("visible")) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreenForward() { global $ilErr, $ilAccess; if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
public function infoScreen() { /** * @var $ilAccess ilAccessHandler */ global $ilAccess; if (!$ilAccess->checkAccess('visible', '', $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilias->error_obj->MESSAGE); } include_once 'Services/InfoScreen/classes/class.ilInfoScreenGUI.php'; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command $this->ctrl->forwardCommand($info); }
/** * Show info screen * * @param * @return */ function showInfoScreen() { global $ilAccess; $this->getTemplate(); $this->setTabs(); $this->setLocator(); $this->lng->loadLanguageModule("meta"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); ilObjGlossaryGUI::addUsagesToInfo($info, $this->object->getId()); $this->ctrl->forwardCommand($info); }
/** * info screen */ function outputInfoScreen($a_standard_locator = false) { global $ilBench, $ilLocator, $ilAccess; $this->renderPageTitle(); // set style sheets if (!$this->offlineMode()) { $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation()); } else { $style_name = $this->ilias->account->prefs["style"] . ".css"; $this->tpl->setStyleSheetLocation("./" . $style_name); } $this->tpl->getStandardTemplate(); $this->tpl->setTitle($this->lm->getTitle()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm_b.png")); $this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode(), $this->getExportFormat(), "info", true)); // Full locator, if read permission is given if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $this->ilLocator(); } else { $ilLocator->addRepositoryItems(); $this->tpl->setLocator(); } $this->lng->loadLanguageModule("meta"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this->lm_gui); $info->enablePrivateNotes(); $info->enableLearningProgress(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); $info->enableNewsEditing(); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } // add read / back button /* if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if ($_GET["obj_id"] > 0) { $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]); $info->addButton($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "layout")); } else { $info->addButton($this->lng->txt("view"), $this->ctrl->getLinkTarget($this, "layout")); } }*/ // show standard meta data section $info->addMetaDataSections($this->lm->getId(), 0, $this->lm->getType()); if ($this->offlineMode()) { $this->tpl->setContent($info->getHTML()); return $this->tpl->get(); } else { // forward the command $this->ctrl->forwardCommand($info); //$this->tpl->setContent("aa"); $this->tpl->show(); } }
/** * info screen */ function outputInfoScreen() { global $ilAccess; //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle()); // set style sheets /* if (!$this->offlineMode()) { $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation()); } else { $style_name = $this->ilias->account->prefs["style"].".css";; $this->tpl->setStyleSheetLocation("./".$style_name); }*/ $this->setInfoTabs("info_short"); $this->lng->loadLanguageModule("meta"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this->slm_gui); $info->enablePrivateNotes(); //$info->enableLearningProgress(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } // add read / back button if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php'; $sahs_obj = new ilObjSAHSLearningModule($_GET["ref_id"]); $om = $sahs_obj->getOpenMode(); $width = $sahs_obj->getWidth(); $height = $sahs_obj->getHeight(); if ($om != 0) { $info->addButton($this->lng->txt("view"), "javascript:void(0); onclick=startSAHS('" . $this->ctrl->getLinkTarget($this, "") . "','ilContObj" . $this->slm_gui->object->getId() . "'," . $om . "," . $width . "," . $height . ");", ''); } else { $info->addButton($this->lng->txt("view"), $this->ctrl->getLinkTarget($this, ""), ' target="ilContObj' . $this->slm_gui->object->getId() . '" '); } } // show standard meta data section $info->addMetaDataSections($this->slm_gui->object->getId(), 0, $this->slm_gui->object->getType()); /* if ($this->offlineMode()) { $this->tpl->setContent($info->getHTML()); return $this->tpl->get(); } else {*/ // forward the command $this->ctrl->forwardCommand($info); //$this->tpl->setContent("aa"); $this->tpl->show(); //} }
/** * show information screen */ function infoScreen($session_lock = "") { global $ilAccess; global $ilUser; // Disabled if ($_GET['crs_show_result']) { $this->object->hideCorrectAnsweredQuestions(); } else { if ($this->object->getTestSequence()->hasHiddenQuestions()) { $this->object->getTestSequence()->clearHiddenQuestions(); $this->object->getTestSequence()->saveToDb(); } } if ($_GET['createRandomSolutions']) { $this->object->createRandomSolutions($_GET['createRandomSolutions']); } if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $seq = $this->object->getTestSession()->getLastSequence(); include_once "./Modules/Test/classes/class.ilTestOutputGUI.php"; $output_gui =& new ilTestOutputGUI($this->object); $this->ctrl->setParameter($output_gui, "sequence", $seq); $info->setFormAction($this->ctrl->getFormAction($output_gui)); if (strlen($session_lock)) { $info->addHiddenElement("lock", $session_lock); } else { $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time())); } $online_access = false; if ($this->object->getFixedParticipants()) { include_once "./Modules/Test/classes/class.ilObjTestAccess.php"; $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId()); if ($online_access_result === true) { $online_access = true; } else { ilUtil::sendInfo($online_access_result); } } if ($this->object->isOnline() && $this->object->isComplete()) { if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) { $executable = $this->object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE); if ($executable["executable"]) { if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) { ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions')); } if ($this->object->getTestSession()->getActiveId() > 0) { // resume test $resume_text = $this->lng->txt("tst_resume_test"); if ($seq < 1 || $seq == $this->object->getTestSequence()->getFirstSequence()) { $resume_text = $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()); } //$info->addFormButton("resume", $resume_text); $big_button[] = array('resume', $resume_text); } else { // start new test //$info->addFormButton("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId())); $big_button[] = array("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId())); } } else { ilUtil::sendInfo($executable["errormessage"]); } if ($this->object->getTestSession()->getActiveId() > 0) { // test results button if ($this->object->canShowTestResults($ilUser->getId())) { //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results")); $big_button[] = array("outUserResultsOverview", $this->lng->txt("tst_show_results")); if ($this->object->getHighscoreEnabled()) { // Can also compare results then $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist")); } } } } if ($this->object->getTestSession()->getActiveId() > 0) { if ($this->object->canShowSolutionPrintview($ilUser->getId())) { //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show")); $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show")); } } } if (!$this->object->isOnline()) { $message = $this->lng->txt("test_is_offline"); if ($ilAccess->checkAccess("write", "", $this->ref_id)) { $message .= "<br /><a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">" . $this->lng->txt("test_edit_settings") . "</a>"; } ilUtil::sendInfo($message); } if ($this->object->getShowInfo()) { $info->enablePrivateNotes(); } /* if (strlen($this->object->getIntroduction())) { $info->addSection($this->lng->txt("tst_introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction())); } * */ if ($big_button) { $out = '<div class="il_ButtonGroup il_BigButton">'; foreach ($big_button as $button) { $out .= '<input type="submit" class="submit il_BigButton" name="cmd[' . $button[0] . ']" value="' . $button[1] . '" />'; } $out .= '</div>'; $big_button = $out; } if (strlen($this->object->getIntroduction())) { $introduction = $this->object->getIntroduction(); $info->addSection($this->lng->txt("tst_introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()) . $big_button . "<br />" . $info->getHiddenToggleButton()); } else { $info->addSection(""); $info->addProperty("", $big_button . $info->getHiddenToggleButton()); } $info->addSection($this->lng->txt("tst_general_properties")); if ($this->object->getShowInfo()) { $info->addProperty($this->lng->txt("author"), $this->object->getAuthor()); $info->addProperty($this->lng->txt("title"), $this->object->getTitle()); } if ($this->object->isOnline() && $this->object->isComplete()) { if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) { if ($this->object->getShowInfo() || !$this->object->getForceJS()) { // use javascript $checked_javascript = false; if ($this->object->getJavaScriptOutput()) { $checked_javascript = true; } if ($this->object->getForceJS()) { $info->addProperty($this->lng->txt("tst_test_output"), $this->lng->txt("tst_use_javascript")); } else { $info->addPropertyCheckbox($this->lng->txt("tst_test_output"), "chb_javascript", 1, $this->lng->txt("tst_use_javascript"), $checked_javascript); } } // hide previous results if (!$this->object->isRandomTest()) { if ($this->object->getNrOfTries() != 1) { if ($this->object->getUsePreviousAnswers() == 0) { if ($this->object->getShowInfo()) { $info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers")); } } else { $use_previous_answers = FALSE; if ($ilUser->prefs["tst_use_previous_answers"]) { $checked_previous_answers = TRUE; } $info->addPropertyCheckbox($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers", 1, $this->lng->txt("tst_use_previous_answers_user"), $checked_previous_answers); } } } if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { $info->addPropertyTextinput($this->lng->txt("enter_anonymous_code"), "anonymous_id", "", 8, "setAnonymousId", $this->lng->txt("submit")); } } } $info->hideFurtherSections(false); if ($this->object->getShowInfo()) { $info->addSection($this->lng->txt("tst_sequence_properties")); $info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone")); $info->addSection($this->lng->txt("tst_heading_scoring")); $info->addProperty($this->lng->txt("tst_text_count_system"), $this->lng->txt($this->object->getCountSystem() == COUNT_PARTIAL_SOLUTIONS ? "tst_count_partial_solutions" : "tst_count_correct_solutions")); $info->addProperty($this->lng->txt("tst_score_mcmr_questions"), $this->lng->txt($this->object->getMCScoring() == SCORE_ZERO_POINTS_WHEN_UNANSWERED ? "tst_score_mcmr_zero_points_when_unanswered" : "tst_score_mcmr_use_scoring_system")); if ($this->object->isRandomTest()) { $info->addProperty($this->lng->txt("tst_pass_scoring"), $this->lng->txt($this->object->getPassScoring() == SCORE_BEST_PASS ? "tst_pass_best_pass" : "tst_pass_last_pass")); } $info->addSection($this->lng->txt("tst_score_reporting")); $score_reporting_text = ""; switch ($this->object->getScoreReporting()) { case REPORT_AFTER_TEST: $score_reporting_text = $this->lng->txt("tst_report_after_test"); break; case REPORT_ALWAYS: $score_reporting_text = $this->lng->txt("tst_report_after_first_question"); break; case REPORT_AFTER_DATE: $score_reporting_text = $this->lng->txt("tst_report_after_date"); break; case 4: $score_reporting_text = $this->lng->txt("tst_report_never"); break; } $info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text); $reporting_date = $this->object->getReportingDate(); if ($reporting_date) { #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches); #$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1])); #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date); $info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP))); } $info->addSection($this->lng->txt("tst_session_settings")); $info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries()); if ($this->object->getNrOfTries() != 1) { $info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $this->object->getTestSession()->getPass() == false ? $this->lng->txt("tst_no_tries") : $this->object->getTestSession()->getPass()); } if ($this->object->getEnableProcessingTime()) { $info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime()); } if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) { $info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers()); } $starting_time = $this->object->getStartingTime(); if ($starting_time) { $info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP))); } $ending_time = $this->object->getEndingTime(); if ($ending_time) { $info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP))); } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command if ($_GET['crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence()) { #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully')); } } $this->ctrl->forwardCommand($info); }
/** * execute command */ function &executeCommand() { global $ilAccess, $ilTabs, $ilErr; if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $this->prepareOutput(); } else { $this->getTemplate(); $this->setLocator(); $this->setTabs(); } $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); switch ($next_class) { 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); break; case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "ilfilesystemgui": $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory()); $this->fs_gui->setTableId("sahsfs" . $this->object->getId()); $ret =& $this->ctrl->forwardCommand($this->fs_gui); break; case "ilcertificategui": include_once "./Services/Certificate/classes/class.ilCertificateGUI.php"; include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php"; $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object)); $ret =& $this->ctrl->forwardCommand($output_gui); break; case "illearningprogressgui": include_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 'illicensegui': include_once "./Services/License/classes/class.ilLicenseGUI.php"; $license_gui =& new ilLicenseGUI($this); $ret =& $this->ctrl->forwardCommand($license_gui); break; case "ilinfoscreengui": include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->enableLearningProgress(); // add read / back button if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if (!$this->object->getEditable()) { $info->addButton($this->lng->txt("view"), "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->object->getRefID(), ' target="ilContObj' . $this->object->getId() . '" '); } } $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } // show standard meta data section $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command $this->ctrl->forwardCommand($info); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case "ilobjstylesheetgui": //$this->addLocations(); $this->ctrl->setReturn($this, "properties"); $ilTabs->clearTargets(); $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false); $style_gui->omitLocator(); if ($cmd == "create" || $_GET["new_type"] == "sty") { $style_gui->setCreationMode(true); } //$ret =& $style_gui->executeCommand(); if ($cmd == "confirmedDelete") { $this->object->setStyleSheetId(0); $this->object->update(); } $ret =& $this->ctrl->forwardCommand($style_gui); if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") { $style_id = $ret; $this->object->setStyleSheetId($style_id); $this->object->update(); $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit"); } break; default: if ($this->object && !$this->object->getEditable()) { $cmd = $this->ctrl->getCmd("properties"); } else { $cmd = $this->ctrl->getCmd("frameset"); } if ((strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) && $cmd != "frameset") { $cmd .= "Object"; } // #9225 if ($cmd == "redrawHeaderAction") { $cmd .= "Object"; } $ret =& $this->{$cmd}(); break; } }
/** * info screen */ function outputInfoScreen() { global $ilBench, $ilAccess, $ilTabs; $this->setTabs(); $ilTabs->activateTab("info"); $this->lng->loadLanguageModule("meta"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this->glossary_gui); $info->enablePrivateNotes(); //$info->enableLearningProgress(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); } } // add read / back button if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { /* if ($_GET["obj_id"] > 0) { $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]); $info->addButton($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "layout")); } else { $info->addButton($this->lng->txt("view"), $this->ctrl->getLinkTarget($this, "layout")); }*/ } // show standard meta data section $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType()); include_once "./Modules/Glossary/classes/class.ilObjGlossaryGUI.php"; ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId()); if ($this->offlineMode()) { $this->tpl->setContent($info->getHTML()); return $this->tpl->get(); } else { // forward the command $this->ctrl->forwardCommand($info); } }
/** * show information screen */ public function infoScreenForward() { global $ilTabs, $ilErr, $lng; if (!$this->checkPermissionBool("visible")) { ilUtil::sendFailure($lng->txt("msg_no_perm_read"), true); $this->ctrl->redirectByClass('ilPersonalDesktopGUI', ''); } $ilTabs->activateTab("id_info"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreen() { global $ilAccess, $ilTabs, $ilUser, $ilToolbar; if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } $ilTabs->activateTab("info_short"); include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php"; $output_gui =& new ilSurveyExecutionGUI($this->object); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // "active" survey? $canStart = $this->object->canStartSurvey(null, $this->external_rater_360); $showButtons = $canStart["result"]; if (!$showButtons) { if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) { $canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>"; } ilUtil::sendInfo(implode("<br />", $canStart["messages"])); } $big_button = false; if ($showButtons) { // closing survey? $is_appraisee = false; if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) { $info->addSection($this->lng->txt("survey_360_appraisee_info")); $appr_data = $this->object->getAppraiseesData(); $appr_data = $appr_data[$ilUser->getId()]; $info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]); if (!$appr_data["closed"]) { include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption("survey_360_appraisee_close_action"); $button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose")); $close_button_360 = '<div>' . $button->render() . '</div>'; $txt = "survey_360_appraisee_close_action_info"; if ($this->object->get360SkillService()) { $txt .= "_skill"; } $info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt)); } else { ilDatePresentation::setUseRelativeDates(false); $dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX); $info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt))); } $is_appraisee = true; } // handle code // validate incoming $code_input = false; $anonymous_code = $_POST["anonymous_id"]; if ($anonymous_code) { $code_input = true; // if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId())) if (!$this->object->checkSurveyCode($anonymous_code)) { $anonymous_code = null; } else { // #15860 $this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code); } } if ($anonymous_code) { $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code; } else { $anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()]; if ($anonymous_code) { $code_input = true; } } // try to find code for current (registered) user from existing run if ($this->object->getAnonymize() && !$anonymous_code) { $anonymous_code = $this->object->findCodeForUser($ilUser->getId()); } // get existing runs for current user, might generate code $participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code); if ($participant_status) { $anonymous_code = $participant_status["code"]; $participant_status = $participant_status["runs"]; } // (final) check for proper anonymous code if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) { $anonymous_code = null; ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used")); } // :TODO: really save in session? $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code; // code is mandatory and not given yet if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) { $info->setFormAction($this->ctrl->getFormAction($this, "infoScreen")); $info->addSection($this->lng->txt("anonymization")); $info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction")); $info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true); } else { // trunk/default if (!$this->object->get360Mode()) { if ($anonymous_code) { $info->addHiddenElement("anonymous_id", $anonymous_code); } $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymous_code); if ($survey_started === 1) { if ($ilUser->getId() != ANONYMOUS_USER_ID) { if ($this->object->hasViewOwnResults()) { include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption("svy_view_own_results"); $button->setUrl($this->ctrl->getLinkTarget($this, "viewUserResults")); $ilToolbar->addButtonInstance($button); } if ($this->object->hasMailOwnResults()) { if ($this->object->hasViewOwnResults()) { $ilToolbar->addSeparator(); } require_once "Services/Form/classes/class.ilTextInputGUI.php"; $mail = new ilTextInputGUI($this->lng->txt("email"), "mail"); $mail->setSize(25); $mail->setValue($ilUser->getEmail()); $ilToolbar->addInputItem($mail, true); $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "mailUserResults")); include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php"; $button = ilSubmitButton::getInstance(); $button->setCaption("svy_mail_own_results"); $button->setCommand("mailUserResults"); $ilToolbar->addButtonInstance($button); } } ilUtil::sendInfo($this->lng->txt("already_completed_survey")); } elseif ($survey_started === 0) { $big_button = array("resume", $this->lng->txt("resume_survey")); } elseif ($survey_started === FALSE) { $big_button = array("start", $this->lng->txt("start_survey")); } } else { $appr_ids = array(); // use given code (if proper external one) if ($anonymous_code) { $anonymous_id = $this->object->getAnonymousIdByCode($anonymous_code); if ($anonymous_id) { $appr_ids = $this->object->getAppraiseesToRate(0, $anonymous_id); } } // registered user // if an auto-code was generated, we still have to check for the original user id if (!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID) { $appr_ids = $this->object->getAppraiseesToRate($ilUser->getId()); } if (sizeof($appr_ids)) { // map existing runs to appraisees $active_appraisees = array(); if ($participant_status) { foreach ($participant_status as $item) { $active_appraisees[$item["appr_id"]] = $item["finished"]; } } $list = array(); foreach ($appr_ids as $appr_id) { if ($this->object->isAppraiseeClosed($appr_id)) { // closed $list[$appr_id] = $this->lng->txt("survey_360_appraisee_is_closed"); } else { if (array_key_exists($appr_id, $active_appraisees)) { // already done if ($active_appraisees[$appr_id]) { $list[$appr_id] = $this->lng->txt("already_completed_survey"); } else { $list[$appr_id] = array("resume", $this->lng->txt("resume_survey")); } } else { // start $list[$appr_id] = array("start", $this->lng->txt("start_survey")); } } } $info->addSection($this->lng->txt("survey_360_rate_other_appraisees")); include_once "Services/User/classes/class.ilUserUtil.php"; foreach ($list as $appr_id => $item) { $appr_name = ilUserUtil::getNamePresentation($appr_id, false, false, "", true); if (!is_array($item)) { $info->addProperty($appr_name, $item); } else { $this->ctrl->setParameter($output_gui, "appr_id", $appr_id); $href = $this->ctrl->getLinkTarget($output_gui, $item[0]); $this->ctrl->setParameter($output_gui, "appr_id", ""); include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption($item[1], false); $button->setUrl($href); $big_button_360 = '<div>' . $button->render() . '</div>'; $info->addProperty($appr_name, $big_button_360); } } } else { if (!$is_appraisee) { ilUtil::sendFailure($this->lng->txt("survey_360_no_appraisees")); } } } } if ($this->object->get360Mode() && $this->object->get360SelfAppraisee() && !$this->object->isAppraisee($ilUser->getId()) && $ilUser->getId() != ANONYMOUS_USER_ID) { $link = $this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "addSelfAppraisee"); $link = '<a href="' . $link . '">' . $this->lng->txt("survey_360_add_self_appraisee") . '</a>'; $info->addProperty(" ", $link); } } if ($big_button) { $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen")); include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php"; $button = ilSubmitButton::getInstance(); $button->setCaption($big_button[1], false); $button->setCommand($big_button[0]); $button->setPrimary(true); $ilToolbar->addButtonInstance($button); $ilToolbar->setCloseFormTag(false); $info->setOpenFormTag(false); } /* #12016 else { $info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen")); } */ if (strlen($this->object->getIntroduction())) { $introduction = $this->object->getIntroduction(); $info->addSection($this->lng->txt("introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($introduction) . "<br />" . $info->getHiddenToggleButton()); } else { $info->addSection(""); $info->addProperty("", $info->getHiddenToggleButton()); } $info->hideFurtherSections(false); if (!$this->object->get360Mode()) { $info->addSection($this->lng->txt("svy_general_properties")); $info->addProperty($this->lng->txt("survey_results_anonymization"), !$this->object->hasAnonymizedResults() ? $this->lng->txt("survey_results_personalized_info") : $this->lng->txt("survey_results_anonymized_info")); include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php"; if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) { $info->addProperty($this->lng->txt("evaluation_access"), $this->lng->txt("evaluation_access_info")); } } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreenForward() { global $ilTabs; $this->checkPermission('visible'); $ilTabs->activateTab('id_info'); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); if ($this->id_type == self::WORKSPACE_NODE_ID) { $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget()); } // forward the command $this->ctrl->forwardCommand($info); }
/** * execute command */ function &executeCommand() { global $ilAccess, $lng, $ilTabs, $ilCtrl, $ilErr; if ($this->ctrl->getRedirectSource() == "ilinternallinkgui") { $this->explorer(); return; } if ($this->ctrl->getCmdClass() == "ilinternallinkgui") { $this->ctrl->setReturn($this, "explorer"); } // get next class that processes or forwards current command $next_class = $this->ctrl->getNextClass($this); // get current command // $cmd = $this->ctrl->getCmd("", array("downloadExportFile")); if ($_GET["to_props"] == 1) { $cmd = $this->ctrl->getCmd("properties"); } else { $cmd = $this->ctrl->getCmd("chapters"); } //echo "-$cmd-".$next_class."-"; switch ($next_class) { case "illearningprogressgui": $this->addHeaderAction(); $this->addLocations(); include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $this->setTabs("learning_progress"); $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId()); $new_gui->activateStatistics(); $this->ctrl->forwardCommand($new_gui); break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->addHeaderAction(); $this->addLocations(); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $this->setTabs("meta"); $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 "ilobjstylesheetgui": $this->addLocations(); include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php"; $this->ctrl->setReturn($this, "editStyleProperties"); $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false); $style_gui->omitLocator(); if ($cmd == "create" || $_GET["new_type"] == "sty") { $style_gui->setCreationMode(true); } $ret =& $this->ctrl->forwardCommand($style_gui); //$ret =& $style_gui->executeCommand(); if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") { $style_id = $ret; $this->object->setStyleSheetId($style_id); $this->object->update(); $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit"); } break; case "illmpageobjectgui": $ilTabs->setBackTarget($lng->txt("learning module"), $ilCtrl->getLinkTarget($this, "chapters")); $this->ctrl->saveParameter($this, array("obj_id")); $this->addLocations(); $this->ctrl->setReturn($this, "chapters"); //echo "!"; //$this->lm_obj =& $this->ilias->obj_factory->getInstanceByRefId($this->ref_id); $pg_gui =& new ilLMPageObjectGUI($this->object); if ($_GET["obj_id"] != "") { $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]); $pg_gui->setLMPageObject($obj); } //$ret =& $pg_gui->executeCommand(); $ret =& $this->ctrl->forwardCommand($pg_gui); if ($cmd == "save" || $cmd == "cancel") { // $this->ctrl->redirect($this, "pages"); } break; case "ilstructureobjectgui": $ilTabs->setBackTarget($lng->txt("learning module"), $ilCtrl->getLinkTarget($this, "chapters")); $this->ctrl->saveParameter($this, array("obj_id")); $this->addLocations(); $this->ctrl->setReturn($this, "chapters"); $st_gui =& new ilStructureObjectGUI($this->object, $this->object->lm_tree); if ($_GET["obj_id"] != "") { $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]); $st_gui->setStructureObject($obj); } //$ret =& $st_gui->executeCommand(); $ret =& $this->ctrl->forwardCommand($st_gui); if ($cmd == "save" || $cmd == "cancel") { if ($_GET["obj_id"] == "") { $this->ctrl->redirect($this, "chapters"); } else { $this->ctrl->setCmd("subchap"); $this->executeCommand(); } } break; case 'ilpermissiongui': if (strtolower($_GET["baseClass"]) == "iladministrationgui") { $this->prepareOutput(); } else { $this->addHeaderAction(); $this->addLocations(true); $this->setTabs("perm"); } include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; // infoscreen // infoscreen case 'ilinfoscreengui': $this->addHeaderAction(); $this->addLocations(true); $this->setTabs("info"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->enableLearningProgress(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $info->setBlockProperty("news", "settings", true); } // show standard meta data section $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $ret =& $this->ctrl->forwardCommand($info); break; case "ilexportgui": $this->addHeaderAction(); $this->addLocations(true); $this->setTabs("export"); include_once "./Services/Export/classes/class.ilExportGUI.php"; $exp_gui = new ilExportGUI($this); $exp_gui->addFormat("xml", "", $this, "export"); $exp_gui->addFormat("html", "", $this, "exportHTML"); $exp_gui->addFormat("scorm", "", $this, "exportSCORM"); $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue"); $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile"); $ret = $this->ctrl->forwardCommand($exp_gui); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case "ilpagemultilanggui": $this->addHeaderAction(); $this->addLocations(true); $ilCtrl->setReturn($this, "properties"); include_once "./Services/COPage/classes/class.ilPageMultiLangGUI.php"; $ml_gui = new ilPageMultiLangGUI("lm", $this->object->getId()); $this->setTabs("settings"); $this->setSubTabs("cont_multilinguality"); $ret = $this->ctrl->forwardCommand($ml_gui); break; default: $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"]; if ($cmd == "create" && !in_array($new_type, array("dbk", "lm"))) { //$this->addLocations(); switch ($new_type) { case "pg": $this->setTabs(); $this->ctrl->setCmdClass("ilLMPageObjectGUI"); $ret =& $this->executeCommand(); break; case "st": $this->setTabs(); $this->ctrl->setCmdClass("ilStructureObjectGUI"); $ret =& $this->executeCommand(); break; } } else { // creation of new dbk/lm in repository if ($this->getCreationMode() == true && in_array($new_type, array("dbk", "lm"))) { $this->prepareOutput(); if ($cmd == "") { $cmd = "create"; } $cmd .= "Object"; $ret =& $this->{$cmd}(); } else { $this->addHeaderAction(); $this->addLocations(); $ret =& $this->{$cmd}(); } } break; } return $ret; }
/** * show information screen */ function infoScreenForward() { global $ilTabs, $ilErr, $ilToolbar; $ilTabs->activateTab("id_info"); if (!$this->checkPermissionBool("visible")) { $ilErr->raiseError($this->lng->txt("msg_no_perm_read")); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); if ($this->checkPermissionBool("read", "sendfile")) { // #9876 $this->lng->loadLanguageModule("file"); // #14378 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption("file_download"); $button->setPrimary(true); // get permanent download link for repository if ($this->id_type == self::REPOSITORY_NODE_ID) { $button->setUrl(ilObjFileAccess::_getPermanentDownloadLink($this->node_id)); } else { $button->setUrl($this->ctrl->getLinkTarget($this, "sendfile")); } $ilToolbar->addButtonInstance($button); } $info->enablePrivateNotes(); if ($this->checkPermissionBool("read")) { $info->enableNews(); } // no news editing for files, just notifications $info->enableNewsEditing(false); if ($this->checkPermissionBool("write")) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); $info->setBlockProperty("news", "public_notifications_option", true); } } // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $info->addSection($this->lng->txt("file_info")); $info->addProperty($this->lng->txt("filename"), $this->object->getFileName()); // BEGIN WebDAV Guess file type. $info->addProperty($this->lng->txt("type"), $this->object->guessFileType()); // END WebDAV Guess file type. $info->addProperty($this->lng->txt("size"), ilFormat::formatSize(ilObjFile::_lookupFileSize($this->object->getId()), 'long')); $info->addProperty($this->lng->txt("version"), $this->object->getVersion()); // using getVersions function instead of ilHistory direct $uploader = $this->object->getVersions(); $uploader = array_shift($uploader); $uploader = $uploader["user_id"]; $this->lng->loadLanguageModule("file"); include_once "Services/User/classes/class.ilUserUtil.php"; $info->addProperty($this->lng->txt("file_uploaded_by"), ilUserUtil::getNamePresentation($uploader)); // download link added in repository if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read", "sendfile")) { $tpl = new ilTemplate("tpl.download_link.html", true, true, "Modules/File"); $tpl->setVariable("LINK", ilObjFileAccess::_getPermanentDownloadLink($this->node_id)); $info->addProperty($this->lng->txt("download_link"), $tpl->get()); } if ($this->id_type == self::WORKSPACE_NODE_ID) { $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget()); } // display previews include_once "./Services/Preview/classes/class.ilPreview.php"; if (!$this->ctrl->isAsynch() && ilPreview::hasPreview($this->object->getId(), $this->object->getType()) && $this->checkPermissionBool("read")) { include_once "./Services/Preview/classes/class.ilPreviewGUI.php"; // get context for access checks later on $context; switch ($this->id_type) { case self::WORKSPACE_NODE_ID: case self::WORKSPACE_OBJECT_ID: $context = ilPreviewGUI::CONTEXT_WORKSPACE; break; default: $context = ilPreviewGUI::CONTEXT_REPOSITORY; break; } $preview = new ilPreviewGUI($this->node_id, $context, $this->object->getId(), $this->access_handler); $info->addProperty($this->lng->txt("preview"), $preview->getInlineHTML()); } // forward the command // $this->ctrl->setCmd("showSummary"); // $this->ctrl->setCmdClass("ilinfoscreengui"); $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreen() { global $ilAccess; if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $info->enableNews(); } // no news editing for files, just notifications $info->enableNewsEditing(false); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); if ($enable_internal_rss) { $info->setBlockProperty("news", "settings", true); $info->setBlockProperty("news", "public_notifications_option", true); } } // standard meta data $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); // forward the command $this->ctrl->forwardCommand($info); }
/** * show information screen */ function infoScreen() { global $ilAccess; global $ilUser; if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php"; $output_gui =& new ilSurveyExecutionGUI($this->object); $info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen")); $info->enablePrivateNotes(); $anonymize_key = NULL; if ($this->object->getAnonymize() == 1) { if ($_SESSION["anonymous_id"][$this->object->getId()]) { $anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()]; } else { if ($_POST["anonymous_id"]) { $anonymize_key = $_POST["anonymous_id"]; } } } $canStart = $this->object->canStartSurvey($anonymize_key); $showButtons = $canStart["result"]; if (!$showButtons) { if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) { $canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>"; } ilUtil::sendInfo(implode("<br />", $canStart["messages"])); } $big_button = false; if ($showButtons) { // output of start/resume buttons for personalized surveys if (!$this->object->getAnonymize()) { $survey_started = $this->object->isSurveyStarted($ilUser->getId(), ""); // Anonymous User tries to start a personalized survey if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { ilUtil::sendInfo($this->lng->txt("anonymous_with_personalized_survey")); } else { if ($survey_started === 1) { ilUtil::sendInfo($this->lng->txt("already_completed_survey")); } elseif ($survey_started === 0) { $big_button = array("resume", $this->lng->txt("resume_survey")); } elseif ($survey_started === FALSE) { $big_button = array("start", $this->lng->txt("start_survey")); } } } else { if ($this->object->getAnonymize() && !$this->object->isAccessibleWithoutCode()) { if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID || $this->object->isAccessibleWithCodeForAll()) && strlen($_POST["anonymous_id"]) == 0 && strlen($_SESSION["anonymous_id"][$this->object->getId()]) == 0) { $info->setFormAction($this->ctrl->getFormAction($this, "infoScreen")); $info->addSection($this->lng->txt("anonymization")); $info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction")); $info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit")); } else { if (strlen($_POST["anonymous_id"]) > 0) { if (!$this->object->checkSurveyCode($_POST["anonymous_id"])) { ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used")); } else { $anonymize_key = $_POST["anonymous_id"]; } } else { if (strlen($_SESSION["anonymous_id"][$this->object->getId()]) > 0) { if (!$this->object->checkSurveyCode($_SESSION["anonymous_id"][$this->object->getId()])) { ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used")); } else { $anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()]; } } else { // registered users do not need to know that there is an anonymous key. The data is anonymized automatically $anonymize_key = $this->object->getUserAccessCode($ilUser->getId()); if (!strlen($anonymize_key)) { $anonymize_key = $this->object->createNewAccessCode(); $this->object->saveUserAccessCode($ilUser->getId(), $anonymize_key); } } } $info->addHiddenElement("anonymous_id", $anonymize_key); $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymize_key); if ($survey_started === 1) { ilUtil::sendInfo($this->lng->txt("already_completed_survey")); } elseif ($survey_started === 0) { $big_button = array("resume", $this->lng->txt("resume_survey")); } elseif ($survey_started === FALSE) { $big_button = array("start", $this->lng->txt("start_survey")); } } } else { // free access $survey_started = $this->object->isSurveyStarted($ilUser->getId(), ""); if ($survey_started === 1) { ilUtil::sendInfo($this->lng->txt("already_completed_survey")); } elseif ($survey_started === 0) { $big_button = array("resume", $this->lng->txt("resume_survey")); } elseif ($survey_started === FALSE) { $big_button = array("start", $this->lng->txt("start_survey")); } } } } if ($big_button) { $big_button = '<div class="il_ButtonGroup il_BigButton">' . '<input type="submit" class="submit il_BigButton" name="cmd[' . $big_button[0] . ']" value="' . $big_button[1] . '" /></div>'; } if (strlen($this->object->getIntroduction())) { $introduction = $this->object->getIntroduction(); $info->addSection($this->lng->txt("introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($introduction) . $big_button . "<br />" . $info->getHiddenToggleButton()); } else { $info->addSection(""); $info->addProperty("", $big_button . $info->getHiddenToggleButton()); } $info->hideFurtherSections(false); $info->addSection($this->lng->txt("svy_general_properties")); if (strlen($this->object->getAuthor())) { $info->addProperty($this->lng->txt("author"), $this->object->getAuthor()); } $info->addProperty($this->lng->txt("title"), $this->object->getTitle()); switch ($this->object->getAnonymize()) { case ANONYMIZE_OFF: $info->addProperty($this->lng->txt("anonymization"), $this->lng->txt("anonymize_personalized")); break; case ANONYMIZE_ON: if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { $info->addProperty($this->lng->txt("anonymization"), $this->lng->txt("info_anonymize_with_code")); } else { $info->addProperty($this->lng->txt("anonymization"), $this->lng->txt("info_anonymize_registered_user")); } break; case ANONYMIZE_FREEACCESS: $info->addProperty($this->lng->txt("anonymization"), $this->lng->txt("info_anonymize_without_code")); break; } include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php"; if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) { $info->addProperty($this->lng->txt("evaluation_access"), $this->lng->txt("evaluation_access_info")); } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }