/**
  * @return string
  */
 public static function getAudioScript()
 {
     $script = self::getDirectory() . '/securimage_play.swf';
     $script = ilUtil::appendUrlParameterString($script, 'audio_file=' . self::getDirectory() . '/il_securimage_play.php', true);
     $script = ilUtil::appendUrlParameterString($script, 'icon_file=' . ilUtil::getImagePath('icon_audiocaptcha-19.png'), true);
     return $script;
 }
 function getNodeHref($a_node)
 {
     if ($this->getSetLinkTargetScript() == "") {
         return "#";
     } else {
         $link = ilUtil::appendUrlParameterString($this->getSetLinkTargetScript(), "linktype=RepositoryItem" . "&linktarget=il__" . $a_node["type"] . "_" . $a_node["child"]);
         return $link;
     }
 }
 function buildLinkTarget($a_node_id, $a_type)
 {
     if ($this->getSetLinkTargetScript() == "") {
         return "#";
     } else {
         //$tpl->setVariable("LINK_TARGET", "content");
         $link = ilUtil::appendUrlParameterString($this->getSetLinkTargetScript(), "linktype=RepositoryItem" . "&linktarget=il__" . $a_type . "_" . $a_node_id);
         return $link;
     }
 }
 /**
  * Get command link url.
  *
  * @param	int			$a_ref_id		reference id
  * @param	string		$a_cmd			command
  *
  */
 function getCommandLink($a_cmd)
 {
     global $ilCtrl;
     $a_cmd = explode('::', $a_cmd);
     if (count($a_cmd) == 2) {
         $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjTestGUI', $a_cmd[0]), $a_cmd[1]);
     } else {
         $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjTestGUI', $a_cmd[0]);
     }
     $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
     foreach ($params as $param => $value) {
         $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "{$param}={$value}", true);
     }
     return $cmd_link;
 }
 /**
  * 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}();
 }
 static function getLanguageSelection($a_in_topbar = false)
 {
     global $lng;
     global $ilUser;
     include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
     $gr_list = new ilGroupedListGUI();
     $gr_list->setAsDropDown(true);
     $languages = $lng->getInstalledLanguages();
     if (sizeof($languages) > 1) {
         foreach ($languages as $lang_key) {
             $base = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], "/") + 1);
             $base = preg_replace("/&*lang=[a-z]{2}&*/", "", $base);
             $link = ilUtil::appendUrlParameterString($base, "lang=" . $lang_key);
             $link = str_replace("?&", "?", $link);
             $gr_list->addEntry($lng->_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key), $link);
         }
         return $gr_list->getHTML();
     }
 }
Example #7
0
 /**
  * Get URL parameters for a class and append them to a string
  */
 public function getUrlParameters($a_class, $a_str, $a_cmd = "", $xml_style = false)
 {
     // note: $a_class may be an array!
     //$a_class = strtolower($a_class);
     $params = $this->getParameterArrayByClass($a_class, $a_cmd);
     foreach ($params as $par => $value) {
         if (strlen((string) $value)) {
             $a_str = ilUtil::appendUrlParameterString($a_str, $par . "=" . $value, $xml_style);
         }
     }
     return $a_str;
 }
Example #8
0
 /**
  * Called when a new question should be created from a test after confirmation
  *
  * Called when a new question should be created from a test after confirmation
  *
  * @access    public
  */
 function executeCreateQuestionObject()
 {
     $qpl_ref_id = $_REQUEST["sel_qpl"];
     $qpl_mode = $_REQUEST['usage'];
     if (isset($_REQUEST['qtype'])) {
         include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
         $sel_question_types = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST["qtype"]);
     } else {
         if (isset($_REQUEST['sel_question_types'])) {
             $sel_question_types = $_REQUEST["sel_question_types"];
         }
     }
     if (!$qpl_mode || $qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") == 0 || $qpl_mode == 3 && strcmp($qpl_ref_id, "") == 0) {
         // Mantis #14890
         $_REQUEST['sel_question_types'] = $sel_question_types;
         ilUtil::sendInfo($this->lng->txt("questionpool_not_entered"));
         $this->createQuestionObject();
         return;
     } else {
         $_SESSION["test_id"] = $this->object->getRefId();
         if ($qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") != 0) {
             // create a new question pool and return the reference id
             $qpl_ref_id = $this->createQuestionPool($_REQUEST["txt_qpl"]);
         } else {
             if ($qpl_mode == 1) {
                 $qpl_ref_id = $_GET["ref_id"];
             }
         }
         include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
         $baselink = "ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $qpl_ref_id . "&cmd=createQuestionForTest&test_ref_id=" . $_GET["ref_id"] . "&calling_test=" . $_GET["ref_id"] . "&sel_question_types=" . $sel_question_types;
         if (isset($_REQUEST['prev_qid'])) {
             $baselink .= '&prev_qid=' . $_REQUEST['prev_qid'];
         } else {
             if (isset($_REQUEST['position'])) {
                 $baselink .= '&prev_qid=' . $_REQUEST['position'];
             }
         }
         if ($_REQUEST['test_express_mode']) {
             $baselink .= '&test_express_mode=1';
         }
         if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
             $baselink = ilUtil::appendUrlParameterString($baselink, "add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}", false);
         }
         #var_dump($_REQUEST['prev_qid']);
         ilUtil::redirect($baselink);
         exit;
     }
 }
 static function getLanguageSelection($a_in_topbar = false)
 {
     global $lng;
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setFormSelectMode("change_lang_to", "ilLanguageSelection", true, "#", "ilNavHistory", "ilNavHistoryForm", "", $lng->txt("ok"), "ilLogin");
     //$selection->setListTitle($lng->txt("choose_language"));
     $selection->setListTitle($lng->txt("language"));
     $selection->setItemLinkClass("small");
     if ($a_in_topbar) {
         $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_TOPBAR);
     }
     $languages = $lng->getInstalledLanguages();
     if (sizeof($languages) > 1) {
         foreach ($languages as $lang_key) {
             $base = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], "/") + 1);
             $base = preg_replace("/&*lang=[a-z]{2}&*/", "", $base);
             $link = ilUtil::appendUrlParameterString($base, "lang=" . $lang_key);
             $link = str_replace("?&", "?", $link);
             $selection->addItem($lng->_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key), $lang_key, $link, "", "", "");
         }
         return $selection->getHTML();
     }
 }
 /**
  * Set tabs
  */
 function setTabs()
 {
     if ($this->getSelfAssessmentMode()) {
         return;
     }
     global $ilTabs, $ilCtrl, $lng;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     if ($this->content_obj != "") {
         $q_ref = $this->content_obj->getQuestionReference();
     }
     if ($q_ref != "") {
         $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
         if (!($inst_id > 0)) {
             $q_id = ilInternalLink::_extractObjIdOfTarget($q_ref);
         }
     }
     $ilTabs->addTarget("question", $ilCtrl->getLinkTarget($this, "edit"), array("editQuestion", "save", "cancel", "addSuggestedSolution", "cancelExplorer", "linkChilds", "removeSuggestedSolution", "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload", "saveEdit", "uploadingImage", "uploadingImagemap", "addArea", "deletearea", "saveShape", "back", "saveEdit", "changeGapType", "createGaps", "addItem", "addYesNo", "addTrueFalse", "toggleGraphicalAnswers", "setMediaMode"), "");
     if ($q_id > 0) {
         if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
             $tabLink = ilUtil::appendUrlParameterString($ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW), "q_id=" . (int) $q_id);
             $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
         }
     }
 }
 /**
  * Performs a hint request and invokes the (re-)saving the question solution.
  * Redirects to local showHint command
  * 
  * @access	private
  * @global	ilCtrl $ilCtrl
  */
 private function performRequestCmd()
 {
     global $ilCtrl;
     if (!isset($_GET['hintId']) || !(int) $_GET['hintId']) {
         throw new ilTestException('no hint id given');
     }
     $nextRequestableHint = ilAssQuestionHintTracking::getNextRequestableHint($this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass());
     if ($nextRequestableHint->getId() != (int) $_GET['hintId']) {
         throw new ilTestException('given hint id does not relate to the next requestable hint');
     }
     ilAssQuestionHintTracking::storeRequest($nextRequestableHint, $this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass());
     $this->testOutputGUI->saveQuestionSolution();
     $redirectTarget = ilUtil::appendUrlParameterString($ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT, '', false, false), "hintId={$nextRequestableHint->getId()}");
     ilUtil::redirect($redirectTarget);
 }
 protected function buildMemberResultLinkTarget($refId, $activeId)
 {
     global $ilCtrl;
     $link = $ilCtrl->getLinkTargetByClass(array('ilObjTestOverviewGUI', 'ilobjtestgui', 'iltestevaluationgui'), 'outParticipantsPassDetails');
     $link = ilUtil::appendUrlParameterString($link, "ref_id={$refId}");
     $link = ilUtil::appendUrlParameterString($link, "active_id={$activeId}");
     return $link;
 }
 private function getDeleteHref($sourcePoolDefinitionId)
 {
     $href = $this->ctrl->getLinkTarget($this->parent_obj, ilTestRandomQuestionSetConfigGUI::CMD_DELETE_SINGLE_SRC_POOL_DEF);
     $href = ilUtil::appendUrlParameterString($href, "src_pool_def_id=" . $sourcePoolDefinitionId, true);
     return $href;
 }
 /**
  * shows a confirmation screen for a hint request
  * 
  * @access	private
  * @global	ilCtrl $ilCtrl
  * @global	ilTemplate $tpl
  * @global	ilLanguage $lng
  */
 private function confirmRequestCmd()
 {
     global $ilCtrl, $tpl, $lng;
     $nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
     require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
     $confirmation = new ilConfirmationGUI();
     $formAction = ilUtil::appendUrlParameterString($ilCtrl->getFormAction($this), "hintId={$nextRequestableHint->getId()}");
     $confirmation->setFormAction($formAction);
     $confirmation->setConfirm($lng->txt('tst_question_hints_confirm_request'), self::CMD_PERFORM_REQUEST);
     $confirmation->setCancel($lng->txt('tst_question_hints_cancel_request'), self::CMD_BACK_TO_QUESTION);
     $confirmation->setHeaderText(sprintf($lng->txt('tst_question_hints_request_confirmation'), $nextRequestableHint->getIndex(), $nextRequestableHint->getPoints()));
     $this->populateContent($ilCtrl->getHtml($confirmation));
 }
 public function requestAdobeConnectContent()
 {
     /**
      * @var $ilSetting ilSetting
      */
     global $ilSetting;
     if (!isset($_GET['record_url']) || !strlen($_GET['record_url'])) {
         $this->showContent();
         return;
     }
     $url = ilUtil::stripSlashes($_GET['record_url']);
     $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php');
     $this->pluginObj->includeClass('class.ilAdobeConnectQuota.php');
     $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId());
     $ilAdobeConnectUser->ensureAccountExistance();
     $xmlAPI = ilXMLApiFactory::getApiByAuthMode();
     $xmlAPI->logout($_SESSION['xavc_last_sso_sessid']);
     $session = $ilAdobeConnectUser->loginUser();
     $_SESSION['xavc_last_sso_sessid'] = $session;
     $url = ilUtil::appendUrlParameterString($url, 'session=' . $session);
     $presentation_url = ilAdobeConnectServer::getPresentationUrl(true);
     $logout_url = $presentation_url . '/api/xml?action=logout';
     if ($ilSetting->get('short_inst_name') != "") {
         $title_prefix = $ilSetting->get('short_inst_name');
     } else {
         $title_prefix = 'ILIAS';
     }
     $sso_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.perform_sso.html", true, true);
     $sso_tpl->setVariable('SPINNER_SRC', $this->pluginObj->getDirectory() . '/templates/js/spin.js');
     $sso_tpl->setVariable('TITLE_PREFIX', $title_prefix);
     $sso_tpl->setVariable('LOGOUT_URL', $logout_url);
     $sso_tpl->setVariable('URL', $url);
     $sso_tpl->setVariable('INFO_TXT', $this->pluginObj->txt('redirect_in_progress'));
     $sso_tpl->setVariable('OBJECT_TITLE', $this->object->getTitle());
     $sso_tpl->show();
     exit;
 }
Example #16
0
 /**
  * show related objects as links
  */
 function showTargets(&$tpl, $a_rep_obj_id, $a_note_id, $a_obj_type, $a_obj_id)
 {
     global $tree, $ilAccess, $objDefinition, $ilUser;
     if ($this->targets_enabled) {
         if ($a_rep_obj_id > 0) {
             // get all visible references of target object
             // repository
             $ref_ids = ilObject::_getAllReferences($a_rep_obj_id);
             if ($ref_ids) {
                 $vis_ref_ids = array();
                 foreach ($ref_ids as $ref_id) {
                     if ($ilAccess->checkAccess("visible", "", $ref_id)) {
                         $vis_ref_ids[] = $ref_id;
                     }
                 }
                 // output links to targets
                 if (count($vis_ref_ids) > 0) {
                     foreach ($vis_ref_ids as $vis_ref_id) {
                         $type = ilObject::_lookupType($vis_ref_id, true);
                         $sub_link = $sub_title = "";
                         if ($type == "sahs") {
                             $link = "goto.php?target=sahs_" . $vis_ref_id;
                             $title = ilObject::_lookupTitle($a_rep_obj_id);
                             if ($a_obj_type == "sco" || $a_obj_type == "seqc" || $a_obj_type == "chap" || $a_obj_type == "pg") {
                                 $sub_link = "goto.php?target=sahs_" . $vis_ref_id . "_" . $a_obj_id;
                                 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Node.php";
                                 $sub_title = ilSCORM2004Node::_lookupTitle($a_obj_id);
                                 $sub_icon = ilUtil::getImagePath("icon_" . $a_obj_type . ".svg");
                             }
                         } else {
                             if ($type == "poll") {
                                 include_once "Services/Link/classes/class.ilLink.php";
                                 $title = ilObject::_lookupTitle($a_rep_obj_id);
                                 $link = ilLink::_getLink($vis_ref_id, "poll");
                             } else {
                                 if ($a_obj_type != "pg") {
                                     if (!is_object($this->item_list_gui[$type])) {
                                         $class = $objDefinition->getClassName($type);
                                         $location = $objDefinition->getLocation($type);
                                         $full_class = "ilObj" . $class . "ListGUI";
                                         include_once $location . "/class." . $full_class . ".php";
                                         $this->item_list_gui[$type] = new $full_class();
                                     }
                                     // for references, get original title
                                     // (link will lead to orignal, which basically is wrong though)
                                     if ($a_obj_type == "crsr" || $a_obj_type == "catr") {
                                         include_once "Services/ContainerReference/classes/class.ilContainerReference.php";
                                         $tgt_obj_id = ilContainerReference::_lookupTargetId($a_rep_obj_id);
                                         $title = ilObject::_lookupTitle($tgt_obj_id);
                                     } else {
                                         $title = ilObject::_lookupTitle($a_rep_obj_id);
                                     }
                                     $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, $title);
                                     $link = $this->item_list_gui[$type]->getCommandLink("infoScreen");
                                     // workaround, because # anchor can't be passed through frameset
                                     $link = ilUtil::appendUrlParameterString($link, "anchor=note_" . $a_note_id);
                                     $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link) . "#note_" . $a_note_id;
                                 } else {
                                     $title = ilObject::_lookupTitle($a_rep_obj_id);
                                     $link = "goto.php?target=pg_" . $a_obj_id . "_" . $vis_ref_id;
                                 }
                             }
                         }
                         $par_id = $tree->getParentId($vis_ref_id);
                         // sub object link
                         if ($sub_link != "") {
                             if ($this->export_html || $this->print) {
                                 $tpl->setCurrentBlock("exp_target_sub_object");
                             } else {
                                 $tpl->setCurrentBlock("target_sub_object");
                                 $tpl->setVariable("LINK_SUB_TARGET", $sub_link);
                             }
                             $tpl->setVariable("TXT_SUB_TARGET", $sub_title);
                             $tpl->setVariable("IMG_SUB_TARGET", $sub_icon);
                             $tpl->parseCurrentBlock();
                         }
                         // container and object link
                         if ($this->export_html || $this->print) {
                             $tpl->setCurrentBlock("exp_target_object");
                         } else {
                             $tpl->setCurrentBlock("target_object");
                             $tpl->setVariable("LINK_TARGET", $link);
                         }
                         $tpl->setVariable("TXT_CONTAINER", ilObject::_lookupTitle(ilObject::_lookupObjId($par_id)));
                         $tpl->setVariable("IMG_CONTAINER", ilObject::_getIcon(ilObject::_lookupObjId($par_id), "tiny"));
                         $tpl->setVariable("TXT_TARGET", $title);
                         $tpl->setVariable("IMG_TARGET", ilObject::_getIcon($a_rep_obj_id, "tiny"));
                         $tpl->parseCurrentBlock();
                     }
                     $tpl->touchBlock("target_objects");
                 }
             } else {
                 // we only need 1 instance
                 if (!$this->wsp_tree) {
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
                     $this->wsp_tree = new ilWorkspaceTree($ilUser->getId());
                     $this->wsp_access_handler = new ilWorkspaceAccessHandler($this->wsp_tree);
                 }
                 $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
                 if ($this->wsp_access_handler->checkAccess("visible", "", $node_id)) {
                     $path = $this->wsp_tree->getPathFull($node_id);
                     if ($path) {
                         $item = array_pop($path);
                         $parent = array_pop($path);
                         if (!$parent["title"]) {
                             $parent["title"] = $this->lng->txt("wsp_personal_workspace");
                         }
                         // sub-objects
                         $additional = null;
                         if ($a_obj_id) {
                             $sub_title = $this->getSubObjectTitle($a_rep_obj_id, $a_obj_id);
                             if ($sub_title) {
                                 $item["title"] .= " (" . $sub_title . ")";
                                 $additional = "_" . $a_obj_id;
                             }
                         }
                         $link = ilWorkspaceAccessHandler::getGotoLink($node_id, $a_rep_obj_id, $additional);
                     } else {
                         $owner = ilObject::_lookupOwner($a_rep_obj_id);
                         $parent["title"] = $this->lng->txt("wsp_tab_shared") . " (" . ilObject::_lookupOwnerName($owner) . ")";
                         $item["title"] = ilObject::_lookupTitle($a_rep_obj_id);
                         $link = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner;
                     }
                     // container and object link
                     if ($this->export_html || $this->print) {
                         $tpl->setCurrentBlock("exp_target_object");
                     } else {
                         $tpl->setCurrentBlock("target_object");
                         $tpl->setVariable("LINK_TARGET", $link);
                     }
                     // :TODO: no images in template ?
                     $tpl->setVariable("TXT_CONTAINER", $parent["title"]);
                     $tpl->setVariable("IMG_CONTAINER", ilObject::_getIcon($parent["obj_id"], "tiny"));
                     $tpl->setVariable("TXT_TARGET", $item["title"]);
                     $tpl->setVariable("IMG_TARGET", ilObject::_getIcon($a_rep_obj_id, "tiny"));
                     $tpl->parseCurrentBlock();
                 }
             }
         }
     }
 }
 /**
  * Render output
  */
 public function render()
 {
     /**
      * @var $lng ilLanguage
      */
     global $lng;
     $tpl = new ilTemplate('tpl.prop_captchainput.html', true, true, 'Services/Captcha');
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock('prop_text_propval');
         $tpl->setVariable('PROPERTY_VALUE', ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     $tpl->setVariable('POST_VAR', $this->getPostVar());
     $tpl->setVariable('CAPTCHA_ID', $this->getFieldId());
     $tpl->setVariable('SIZE', $this->getSize());
     $script = ilSecurImageUtil::getImageScript();
     $script = ilUtil::appendUrlParameterString($script, 'height=' . (int) $this->getImageHeight(), true);
     $script = ilUtil::appendUrlParameterString($script, 'width=' . (int) $this->getImageWidth(), true);
     $tpl->setVariable('IMAGE_SCRIPT', $script);
     $tpl->setVariable('AUDIO_SCRIPT', ilSecurImageUtil::getAudioScript());
     $tpl->setVariable('SRC_RELOAD', ilSecurImageUtil::getDirectory() . '/images/refresh.png');
     $tpl->setVariable('TXT_CAPTCHA_ALT', $lng->txt('captcha_alt_txt'));
     $tpl->setVariable('TXT_RELOAD', $lng->txt('captcha_code_reload'));
     $tpl->setVariable('TXT_CAPTCHA_AUDIO_TITLE', $lng->txt('captcha_audio_title'));
     $tpl->setVariable('TXT_CONSTR_PROP', $lng->txt('cont_constrain_proportions'));
     $tpl->setVariable('TXT_CAPTCHA_INFO', $lng->txt('captcha_code_info'));
     return $tpl->get();
 }
 /**
  * workaround: all links into the repository (from outside)
  * must tell repository to setup the frameset
  */
 function appendRepositoryFrameParameter($a_link)
 {
     $script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
     // we should get rid of this nonsense with 4.4 (alex)
     if (strtolower($_GET["baseClass"]) != "ilrepositorygui" && is_int(strpos($a_link, "baseClass=ilRepositoryGUI"))) {
         if ($this->type != "frm") {
             $a_link = ilUtil::appendUrlParameterString($a_link, "rep_frame=1");
         }
     }
     return $a_link;
 }
 /**
  * Render internal link item
  */
 function renderLink($tpl, $a_title, $a_obj_id, $a_type, $a_type_short, $a_bb_type, $a_anchors = array())
 {
     $chapterRowBlock = "chapter_row";
     $anchor_row_block = "anchor_link";
     if ($this->isEnabledJavaScript()) {
         $chapterRowBlock .= "_js";
         $anchor_row_block .= "_js";
     }
     $target_str = $this->link_target == "" ? "" : " target=\"" . $this->link_target . "\"";
     if (count($a_anchors) > 0) {
         foreach ($a_anchors as $anchor) {
             $tpl->setCurrentBlock($anchor_row_block);
             $tpl->setVariable("ALINK_BEGIN", $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"" . $target_str . " anchor=\"{$anchor}\"]"));
             $tpl->setVariable("ALINK_END", "[/iln]");
             $tpl->setVariable("TXT_LINK", "#" . $anchor);
             $tpl->parseCurrentBlock();
         }
     }
     $this->css_row = $this->css_row == "tblrow1" ? "tblrow2" : "tblrow1";
     if ($this->getSetLinkTargetScript() != "") {
         require_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
         require_once "./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php";
         ilImageMapEditorGUI::_recoverParameters();
         if ($a_type == "MediaObject") {
             $this->outputThumbnail($tpl, $a_obj_id);
         }
         $tpl->setCurrentBlock("link_row");
         $tpl->setVariable("ROWCLASS", $this->css_row);
         $tpl->setVariable("TXT_CHAPTER", $a_title);
         //$tpl->setVariable("LINK_TARGET", "content");
         $tpl->setVariable("LINK", ilUtil::appendUrlParameterString($this->getSetLinkTargetScript(), "linktype=" . $a_type . "&linktarget=il__" . $a_type_short . "_" . $a_obj_id . "&linktargetframe=" . $this->link_target));
         $tpl->parseCurrentBlock();
     } else {
         $tpl->setCurrentBlock($chapterRowBlock);
         if ($a_type == "MediaObject") {
             $this->outputThumbnail($tpl, $a_obj_id);
         }
         $tpl->setVariable("ROWCLASS", $this->css_row);
         $tpl->setVariable("TXT_CHAPTER", $a_title);
         if ($this->isEnabledJavaScript()) {
             //				$tpl->setVariable("TXT_CHAPTER_JS", htmlspecialchars(str_replace("'", "\'", $a_title)));
         }
         if ($a_type == "MediaObject" && empty($target_str)) {
             $tpl->setVariable("LINK_BEGIN", $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"/]"));
             $tpl->setVariable("LINK_END", "");
         } else {
             $tpl->setVariable("LINK_BEGIN", $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"" . $target_str . "]"));
             $tpl->setVariable("LINK_END", "[/iln]");
         }
         $tpl->parseCurrentBlock();
     }
     $tpl->setCurrentBlock("row");
     $tpl->parseCurrentBlock();
 }
Example #20
0
 /**
  * add ILIAS footer
  */
 function addILIASFooter()
 {
     global $ilAuth;
     if (!$this->getAddFooter()) {
         return;
     }
     global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
     $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
     $ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
     $link_items = array();
     // imprint
     include_once "Services/Imprint/classes/class.ilImprint.php";
     if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
         include_once "Services/Link/classes/class.ilLink.php";
         $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
     }
     $link_items["mailto:" . ilUtil::prepareFormOutput($ilSetting->get("feedback_recipient"))] = array($lng->txt("contact_sysadmin"), false);
     if (DEVMODE && version_compare(PHP_VERSION, '5', '>=')) {
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
     }
     // output translation link (extended language maintenance)
     if ($ilSetting->get("lang_ext_maintenance") == "1") {
         include_once "Services/Language/classes/class.ilObjLanguageAccess.php";
         if (ilObjLanguageAccess::_checkTranslate() and !ilObjLanguageAccess::_isPageTranslation()) {
             ilObjLanguageAccess::_saveUsages();
             $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
         }
     }
     $cnt = 0;
     foreach ($link_items as $url => $caption) {
         $cnt++;
         if ($caption[1]) {
             $ftpl->touchBlock("blank");
         }
         if ($cnt < sizeof($link_items)) {
             $ftpl->touchBlock("item_separator");
         }
         $ftpl->setCurrentBlock("items");
         $ftpl->setVariable("URL_ITEM", $url);
         $ftpl->setVariable("TXT_ITEM", $caption[0]);
         $ftpl->parseCurrentBlock();
     }
     if (DEVMODE) {
         // execution time
         $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
         $t2 = explode(" ", microtime());
         $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
         $mem_usage = array();
         if (function_exists("memory_get_usage")) {
             $mem_usage[] = "Memory Usage: " . memory_get_usage() . " Bytes";
         }
         if (function_exists("xdebug_peak_memory_usage")) {
             $mem_usage[] = "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
         }
         $mem_usage[] = round($diff, 4) . " Seconds";
         if (sizeof($mem_usage)) {
             $ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
         }
         if (is_object($ilAuth) && isset($_SESSION[$ilAuth->_sessionName]) && isset($_SESSION[$ilAuth->_sessionName]["timestamp"])) {
             $ftpl->setVariable("SESS_INFO", "<br />maxlifetime: " . ini_get("session.gc_maxlifetime") . " (" . ini_get("session.gc_maxlifetime") / 60 . "), id: " . session_id() . "<br />" . "timestamp: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["timestamp"]) . ", idle: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"]) . "<br />expire: " . ($exp = $ilClientIniFile->readVariable("session", "expire")) . " (" . $exp / 60 . "), session ends at: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"] + $exp));
         }
         if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
             require_once "Services/XHTMLValidator/classes/class.ilValidatorAdapter.php";
             $template2 = clone $this;
             //echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
             $ftpl->setCurrentBlock("xhtml_validation");
             $ftpl->setVariable("VALIDATION", ilValidatorAdapter::validate($template2->get("DEFAULT", false, false, false, true), $_GET["do_dev_validate"]));
             $ftpl->parseCurrentBlock();
         }
         // controller history
         if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") && $ftpl->blockExists("call_history")) {
             $hist = $ilCtrl->getCallHistory();
             foreach ($hist as $entry) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $entry["class"]);
                 if (is_object($ilDB)) {
                     $file = $ilCtrl->lookupClassPath($entry["class"]);
                     $add = $entry["mode"] . " - " . $entry["cmd"];
                     if ($file != "") {
                         $add .= " - " . $file;
                     }
                     $ftpl->setVariable("C_FILE", $add);
                 }
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
             // debug hack
             $debug = $ilCtrl->getDebug();
             foreach ($debug as $d) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $d);
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
         }
         // included files
         if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") && $ftpl->blockExists("included_files")) {
             $fs = get_included_files();
             $ifiles = array();
             $total = 0;
             foreach ($fs as $f) {
                 $ifiles[] = array("file" => $f, "size" => filesize($f));
                 $total += filesize($f);
             }
             $ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
             foreach ($ifiles as $f) {
                 $ftpl->setCurrentBlock("i_entry");
                 $ftpl->setVariable("I_ENTRY", $f["file"] . " (" . $f["size"] . " Bytes, " . round(100 / $total * $f["size"], 2) . "%)");
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("i_entry");
             $ftpl->setVariable("I_ENTRY", "Total (" . $total . " Bytes, 100%)");
             $ftpl->parseCurrentBlock();
             $ftpl->setCurrentBlock("included_files");
             $ftpl->parseCurrentBlock();
         }
     }
     // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
     // The corresponding $ilBench->start invocation is in inc.header.php
     global $ilBench;
     $ilBench->stop("Core", "ElapsedTimeUntilFooter");
     $ftpl->setVariable("ELAPSED_TIME", ", " . number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"), 1) . ' seconds');
     // END Usability: Non-Delos Skins can display the elapsed time in the footer
     $this->setVariable("FOOTER", $ftpl->get());
 }
 /**
  * renders a table row by filling wor data to table row template
  * 
  * @access	public
  * @global	ilCtrl		$ilCtrl
  * @global	ilLanguage	$lng
  * @param	array		$rowData
  */
 public function fillRow($rowData)
 {
     global $ilCtrl, $lng;
     if ($this->tableMode == self::TBL_MODE_ADMINISTRATION) {
         $editHref = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintGUI', ilAssQuestionHintGUI::CMD_SHOW_FORM);
         $editHref = ilUtil::appendUrlParameterString($editHref, "hint_id={$rowData['hint_id']}", true);
         $deleteHref = $ilCtrl->getLinkTarget($this->parent_obj, ilAssQuestionHintsGUI::CMD_CONFIRM_DELETE);
         $deleteHref = ilUtil::appendUrlParameterString($deleteHref, "hint_id={$rowData['hint_id']}", true);
         $list = new ilAdvancedSelectionListGUI();
         $list->setListTitle($lng->txt('actions'));
         $list->setId("advsl_hint_{$rowData['hint_id']}_actions");
         $list->addItem($lng->txt('tst_question_hints_table_link_edit_hint'), '', $editHref);
         $list->addItem($lng->txt('tst_question_hints_table_link_delete_hint'), '', $deleteHref);
         $this->tpl->setVariable('ACTIONS', $list->getHTML());
         $this->tpl->setVariable('HINT_ID', $rowData['hint_id']);
         $hintIndex = $rowData['hint_index'] * self::INDEX_TO_POSITION_FACTOR;
     } else {
         $showHref = $ilCtrl->getLinkTarget($this->parent_obj, ilAssQuestionHintRequestGUI::CMD_SHOW_HINT);
         $showHref = ilUtil::appendUrlParameterString($showHref, "hintId={$rowData['hint_id']}", true);
         $this->tpl->setVariable('HINT_HREF', $showHref);
         $hintIndex = sprintf($lng->txt('tst_question_hints_index_column_label'), $rowData['hint_index']);
     }
     $this->tpl->setVariable('HINT_INDEX', $hintIndex);
     $this->tpl->setVariable('HINT_TEXT', $rowData['hint_text']);
     $this->tpl->setVariable('HINT_POINTS', $rowData['hint_points']);
 }
 function getSourcecodeDownloadLink()
 {
     if (!$this->offlineMode()) {
         //$this->ctrl->setParameter($this, session_name(), session_id());
         $target = $this->ctrl->getLinkTarget($this, "");
         $target = ilUtil::appendUrlParameterString($target, session_name() . "=" . session_id());
         return $this->ctrl->getLinkTarget($this, "");
     } else {
         return "";
     }
 }