/** * Export * * @param * @return */ function export() { global $ilUser; $this->createDirectories(); // export system style sheet $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem"); $style_name = $ilUser->prefs["style"] . ".css"; copy($location_stylesheet, $this->style_dir . "/" . $style_name); $fh = fopen($location_stylesheet, "r"); $css = fread($fh, filesize($location_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { $fileref = dirname($location_stylesheet) . "/" . $fileref; if (is_file($fileref)) { copy($fileref, $this->style_img_dir . "/" . basename($fileref)); } } fclose($fh); // export (icon) images foreach ($this->images as $im) { $from = $to = $im["file"]; if ($im["exp_file_name"] != "") { $to = $im["exp_file_name"]; } copy(ilUtil::getImagePath($from, false, "filesystem"), $this->img_dir . "/" . $to); } }
function show() { global $lng, $tree; $tpl = new ilTemplate("tpl.container_link_help.html", true, true, "Services/Container"); $type_ordering = array("cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres", "glo", "webr", "file", "exc", "tst", "svy", "mep", "qpl", "spl"); $childs = $tree->getChilds($_GET["ref_id"]); foreach ($childs as $child) { if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm"))) { $cnt["lres"]++; } else { $cnt[$child["type"]]++; } } $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help")); foreach ($type_ordering as $type) { $tpl->setCurrentBlock("row"); $tpl->setVariable("ROWCOL", "tblrow" . ($i++ % 2 + 1)); if ($type != "lres") { $tpl->setVariable("TYPE", $lng->txt("objs_" . $type) . " (" . (int) $cnt[$type] . ")"); } else { $tpl->setVariable("TYPE", $lng->txt("learning_resources") . " (" . (int) $cnt["lres"] . ")"); } $tpl->setVariable("TXT_LINK", "[list-" . $type . "]"); $tpl->parseCurrentBlock(); } $tpl->show(); exit; }
/** * Initializes the file upload and loads the needed javascripts and styles. */ public static function initFileUpload() { global $tpl; // needed scripts $tpl->addJavaScript("./Services/FileUpload/js/tmpl.js"); $tpl->addJavaScript("./Services/FileUpload/js/jquery.ui.widget.js"); $tpl->addJavaScript("./Services/FileUpload/js/jquery.iframe-transport.js"); $tpl->addJavaScript("./Services/FileUpload/js/jquery.fileupload.js"); $tpl->addJavaScript("./Services/FileUpload/js/jquery.ba-dotimeout.min.js"); $tpl->addJavaScript("./Services/FileUpload/js/ilFileUpload.js"); // needed styles $tpl->addCss(ilUtil::getStyleSheetLocation("filesystem", "fileupload.css", "Services/FileUpload")); }
/** * Save file link */ function saveFileLink() { $mtpl =& new ilTemplate("tpl.link_help.html", true, true, "Modules/LearningModule"); $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); if ($_FILES["link_file"]["name"] != "") { include_once "./Modules/File/classes/class.ilObjFile.php"; $fileObj = new ilObjFile(); $fileObj->setType("file"); $fileObj->setTitle($_FILES["link_file"]["name"]); $fileObj->setDescription(""); $fileObj->setFileName($_FILES["link_file"]["name"]); $fileObj->setFileType($_FILES["link_file"]["type"]); $fileObj->setFileSize($_FILES["link_file"]["size"]); $fileObj->setMode("filelist"); $fileObj->create(); // upload file to filesystem $fileObj->createDirectory(); $fileObj->raiseUploadError(false); $fileObj->getUploadFile($_FILES["link_file"]["tmp_name"], $_FILES["link_file"]["name"]); $this->uploaded_file = $fileObj; } $this->showLinkHelp(); }
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $user_post_solution = FALSE) { // shuffle output $keys = array(); if (is_array($user_post_solution)) { $keys = $_SESSION["ordering_keys"]; } else { $keys = array_keys($this->object->answers); shuffle($keys); } $_SESSION["ordering_keys"] = $keys; // generate the question output include_once "./Services/UICore/classes/class.ilTemplate.php"; $template = new ilTemplate("tpl.il_as_qpl_ordering_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) { // BEGIN: add javascript code for javascript enabled ordering questions $this->tpl->addBlockFile("CONTENT_BLOCK", "head_content", "tpl.il_as_qpl_ordering_output_javascript.html", "Modules/TestQuestionPool"); $this->tpl->setCurrentBlock("head_content"); $this->tpl->setVariable("JS_LOCATION", "./Modules/TestQuestionPool/js/toolman/"); $this->tpl->parseCurrentBlock(); // END: add javascript code for javascript enabled ordering questions // BEGIN: add additional stylesheet for javascript enabled ordering questions $this->tpl->setCurrentBlock("AdditionalStyle"); $this->tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilUtil::getStyleSheetLocation("output", "test_javascript.css", "Modules/TestQuestionPool")); $this->tpl->parseCurrentBlock(); // END: add additional stylesheet for javascript enabled ordering questions // BEGIN: onsubmit form action for javascript enabled ordering questions $this->tpl->setVariable("ON_SUBMIT", "return saveOrder('orderlist');"); // END: onsubmit form action for javascript enabled ordering questions } // get the solution of the user for the active pass or from the last pass if allowed if ($active_id) { $solutions = NULL; include_once "./Modules/Test/classes/class.ilObjTest.php"; if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) { if (is_null($pass)) { $pass = ilObjTest::_getPass($active_id); } } if (is_array($user_post_solution)) { $solutions = array(); foreach ($user_post_solution as $key => $value) { if (preg_match("/order_(\\d+)/", $key, $matches)) { foreach ($this->object->getAnswers() as $answeridx => $answer) { if ($answer->getRandomID() == $matches[1]) { array_push($solutions, array("value1" => $answeridx, "value2" => $value)); } } } } } else { $solutions =& $this->object->getSolutionValues($active_id, $pass); } if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) { $solution_script .= ""; $jssolutions = array(); foreach ($solutions as $idx => $solution_value) { if (strcmp($solution_value["value2"], "") != 0 && strcmp($solution_value["value1"], "") != 0) { $jssolutions[$solution_value["value2"]] = $solution_value["value1"]; } } if (count($jssolutions)) { ksort($jssolutions); $js = ""; foreach ($jssolutions as $key => $value) { if (is_object($this->object->getAnswer($value))) { $js .= "initialorder.push('id_" . $this->object->getAnswer($value)->getRandomID() . "');"; } } $js .= "restoreInitialOrder();"; } if (strlen($js)) { $template->setCurrentBlock("javascript_restore_order"); $template->setVariable("RESTORE_ORDER", $js); $template->parseCurrentBlock(); } } } if ($this->object->getOutputType() != OUTPUT_JAVASCRIPT) { foreach ($keys as $idx) { $answer = $this->object->answers[$idx]; if ($this->object->getOrderingType() == OQ_PICTURES) { $template->setCurrentBlock("ordering_row_standard_pictures"); $template->setVariable("PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext()); $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $answer->getAnswertext(); $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $answer->getAnswertext(); if (!@file_exists($thumb)) { $this->object->rebuildThumbnails(); } $template->setVariable("THUMB_HREF", $thumbweb); $template->setVariable("THUMB_ALT", $this->lng->txt("thumbnail")); $template->setVariable("THUMB_TITLE", $this->lng->txt("enlarge")); $template->setVariable("ANSWER_ID", $answer->getRandomID()); $template->parseCurrentBlock(); } else { $template->setCurrentBlock("ordering_row_standard_text"); $template->setVariable("ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE)); $template->setVariable("ANSWER_ID", $answer->getRandomID()); $template->parseCurrentBlock(); } $template->setCurrentBlock("ordering_row_standard"); $template->setVariable("ANSWER_ID", $answer->getRandomID()); if (is_array($solutions)) { foreach ($solutions as $solution) { if ($solution["value1"] == $idx && strlen($solution["value2"])) { $template->setVariable("ANSWER_ORDER", " value=\"" . $solution["value2"] . "\""); } } } $template->parseCurrentBlock(); } } else { foreach ($keys as $idx) { $answer = $this->object->answers[$idx]; if ($this->object->getOrderingType() == OQ_PICTURES) { $template->setCurrentBlock("ordering_row_javascript_pictures"); $template->setVariable("PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext()); $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $answer->getAnswertext(); $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $answer->getAnswertext(); if (!@file_exists($thumb)) { $this->object->rebuildThumbnails(); } $template->setVariable("THUMB_HREF", $thumbweb); $template->setVariable("THUMB_ALT", $this->lng->txt("thumbnail")); $template->setVariable("THUMB_TITLE", $this->lng->txt("thumbnail")); $template->setVariable("ENLARGE_HREF", ilUtil::getImagePath("enlarge.png", FALSE)); $template->setVariable("ENLARGE_ALT", $this->lng->txt("enlarge")); $template->setVariable("ENLARGE_TITLE", $this->lng->txt("enlarge")); $template->setVariable("ANSWER_ID", $answer->getRandomID()); $template->parseCurrentBlock(); } else { $template->setCurrentBlock("ordering_row_javascript_text"); $template->setVariable("ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE)); $template->setVariable("ANSWER_ID", $answer->getRandomID()); $template->parseCurrentBlock(); } } $template->setCurrentBlock("ordering_with_javascript"); if ($this->object->getOrderingType() == OQ_PICTURES) { $template->setVariable("RESET_POSITIONS", $this->lng->txt("reset_pictures")); } else { $template->setVariable("RESET_POSITIONS", $this->lng->txt("reset_definitions")); } $template->parseCurrentBlock(); } $questiontext = $this->object->getQuestion(); $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE)); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); return $pageoutput; }
/** * show abstract of digilib book */ function showAbstract($a_target_id) { if (count($_POST["tr_id"]) > 1) { $message = true; $message_text = $this->lng->txt("cont_select_one_translation_warning"); $show_full = false; } else { if (!$a_target_id and ($_POST["action"] == "show" or $_POST["action"] == "details")) { $message = true; $message_text = $this->lng->txt("cont_select_one_edition"); $show_full = false; } else { if (is_array($a_target_id) and count($a_target_id) > 1) { $message = true; $message_text = $this->lng->txt("cont_msg_multiple_editions"); $show_full = false; } else { if (is_array($a_target_id)) { $a_target_id = $a_target_id[0]; $show_full = true; } else { $a_target_id = 0; $show_full = false; } } } } $this->object->initBibItemObject(); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setCurrentBlock("ilPage"); $tmp_tpl = new ilTemplate("tpl.bibliography.xsl", true, true, "Modules/LearningModule"); $tmp_tpl->setVariable("TITLE", $this->lng->txt("title")); $tmp_tpl->setVariable("EDITION", $this->lng->txt("cont_edition")); $tmp_tpl->setVariable("AUTHORS", $this->lng->txt("authors")); if ($show_full) { $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent"); $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout"); $params = array('mode' => "view_full", 'action' => $action, 'target_id' => "{$a_target_id}"); $tmp_tpl->setVariable("BOOKTITLE", $this->lng->txt("cont_booktitle")); $tmp_tpl->setVariable("CROSS_REFERENCE", $this->lng->txt("cont_cross_reference")); $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details")); $tmp_tpl->setVariable("EDITOR", $this->lng->txt("editor")); $tmp_tpl->setVariable("HOW_PUBLISHED", $this->lng->txt("cont_how_published")); $tmp_tpl->setVariable("WHERE_PUBLISHED", $this->lng->txt("cont_where_published")); $tmp_tpl->setVariable("INSTITUTION", $this->lng->txt("institution")); $tmp_tpl->setVariable("JOURNAL", $this->lng->txt("cont_journal")); $tmp_tpl->setVariable("KEYWORD", $this->lng->txt("cont_keyword")); $tmp_tpl->setVariable("PAGES", $this->lng->txt("cont_pages")); $tmp_tpl->setVariable("SCHOOL", $this->lng->txt("cont_school")); $tmp_tpl->setVariable("MONTH", $this->lng->txt("cont_month")); $tmp_tpl->setVariable("PUBLISHER", $this->lng->txt("cont_publisher")); $tmp_tpl->setVariable("SERIES", $this->lng->txt("cont_series")); $tmp_tpl->setVariable("SERIES_TITLE", $this->lng->txt("cont_series_title")); $tmp_tpl->setVariable("SERIES_EDITOR", $this->lng->txt("cont_series_editor")); $tmp_tpl->setVariable("SERIES_VOLUME", $this->lng->txt("cont_series_volume")); $tmp_tpl->setVariable("YEAR", $this->lng->txt("cont_year")); $tmp_tpl->setVariable("ISBN", $this->lng->txt("cont_isbn")); $tmp_tpl->setVariable("URL", $this->lng->txt("cont_url")); } else { $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent"); $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout"); $params = array('mode' => "view_simple", 'action' => $action); $this->ctrl->clearParametersByClass("illmpresentationgui"); if ($translations = $this->object->getTranslations()) { foreach ($translations as $tr_id) { $tmp_obj = ilObjectFactory::getInstanceByRefId($tr_id); $tmp_tpl->setCurrentBlock("TRANSLATION_ROW"); $tmp_tpl->setVariable("ROW_TITLE", $tmp_obj->getTitle()); $tmp_tpl->setVariable("ROW_ID", $tr_id); $tmp_tpl->parseCurrentBlock(); unset($tmp_obj); } $tmp_tpl->setCurrentBlock("TRANSLATION"); $tmp_tpl->setVariable("TRANSLATION_HEADER", $this->lng->txt("cont_translations")); $tmp_tpl->parseCurrentBlock(); } $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details")); $tmp_tpl->setVariable("SHOW", $this->lng->txt("cont_show")); $tmp_tpl->setVariable("SHOW_CITATION", $this->lng->txt("cont_show_citation")); $tmp_tpl->setVariable("GO", $this->lng->txt("go")); } // SHOW MESSAGE if ($message) { ilUtil::sendInfo($message_text); } $xsl = $tmp_tpl->get(); $xml = $this->object->bib_obj->getXML(); if (empty($xml)) { return true; } $args = array('/_xml' => $xml, '/_xsl' => $xsl); $xh = xslt_create(); $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params); $this->tpl->setVariable("PAGE_CONTENT", $output); return $output; }
/** * Builds a learnlink seminar members gallery as a layer of left-floating images * @author Arturo Gonzalez <*****@*****.**> * @access public */ public function membersGalleryObject() { global $rbacsystem; $is_admin = (bool) $rbacsystem->checkAccess('write', $this->object->getRefId()); $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.icrs_members_gallery.html', 'Modules/ILinc'); $this->__setSubTabs('members'); $this->lng->loadLanguageModule('ilinc'); $member_ids = $this->object->getMemberIds(); // fetch all user data in one shot to improve performance (from ILIAS db) $members = $this->object->getMemberData($member_ids); // fetch docent or student assignment form all coursemembers from iLinc server $admin_ids = $this->object->getiLincMemberIds(true); // MEMBERS if (count($members)) { foreach ($members as $member) { // get user object if (!($usr_obj = ilObjectFactory::getInstanceByObjId($member['id'], false))) { continue; } $public_profile = $usr_obj->getPref('public_profile'); // SET LINK TARGET FOR USER PROFILE $this->ctrl->setParameterByClass('ilpublicuserprofilegui', 'user', $member['id']); $profile_target = $this->ctrl->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML'); // GET USER IMAGE $file = $usr_obj->getPersonalPicturePath('xsmall'); switch (in_array($member['ilinc_id'], $admin_ids)) { //admins case 1: if ($public_profile == 'y' || $public_profile == 'g') { $this->tpl->setCurrentBlock('tutor_linked'); $this->tpl->setVariable('LINK_PROFILE', $profile_target); $this->tpl->setVariable('SRC_USR_IMAGE', $file); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('tutor_not_linked'); $this->tpl->setVariable('SRC_USR_IMAGE', $file); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('tutor'); break; case 0: if ($public_profile == 'y' || $public_profile == 'g') { $this->tpl->setCurrentBlock('member_linked'); $this->tpl->setVariable('LINK_PROFILE', $profile_target); $this->tpl->setVariable('SRC_USR_IMAGE', $file); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('member_not_linked'); $this->tpl->setVariable('SRC_USR_IMAGE', $file); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('member'); break; } // do not show name, if public profile is not activated if ($public_profile == 'y' || $public_profile == 'g') { $this->tpl->setVariable('FIRSTNAME', $member['firstname']); $this->tpl->setVariable('LASTNAME', $member['lastname']); } $this->tpl->setVariable('LOGIN', $usr_obj->getLogin()); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('members'); $this->tpl->setVariable('MEMBERS_TABLE_HEADER', $this->lng->txt('ilinc_involved_users')); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable('TITLE', $this->lng->txt('icrs_members_print_title')); $this->tpl->setVariable('CSS_PATH', ilUtil::getStyleSheetLocation()); $headline = $this->object->getTitle() . '<br />' . $this->object->getDescription(); $this->tpl->setVariable('HEADLINE', $headline); $this->tpl->show(); exit; }
/** * set all template variables (images, scripts, target frames, ...) */ function setTemplateVars() { global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin; if ($this->logo_only) { $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL()); $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg")); return; } // get user interface plugins $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk"); if ($this->getMode() != self::MODE_TOPBAR_REDUCED && $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) { // search include_once 'Services/Search/classes/class.ilSearchSettings.php'; if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) { include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php'; $main_search = new ilMainMenuSearchGUI(); $html = ""; // user interface plugin slot + default rendering include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php"; $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search", array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search)); if (!$uip->replaced()) { $html = $main_search->getHTML(); } $html = $uip->getHTML($html); if (strlen($html)) { $this->tpl->setVariable('SEARCHBOX', $html); } } $this->renderStatusBox($this->tpl); // online help $this->renderHelpButtons(); } if ($this->getMode() == self::MODE_FULL) { $mmle_html = ""; // user interface plugin slot + default rendering include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php"; $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries", array("main_menu_gui" => $this)); if (!$uip->replaced()) { $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu"); $mmle_html = $this->renderMainMenuListEntries($mmle_tpl); } $mmle_html = $uip->getHTML($mmle_html); $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html); } if ($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) { $link_dir = defined("ILIAS_MODULE") ? "../" : ""; // login stuff if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php'; if (ilRegistrationSettings::_lookupRegistrationType() != IL_REG_DISABLED) { $this->tpl->setCurrentBlock("registration_link"); $this->tpl->setVariable("TXT_REGISTER", $lng->txt("register")); $this->tpl->setVariable("LINK_REGISTER", $link_dir . "register.php?client_id=" . rawurlencode(CLIENT_ID) . "&lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->parseCurrentBlock(); } // language selection $selection = self::getLanguageSelection(); if ($selection) { // bs-patch start global $ilUser, $lng; $this->tpl->setVariable("TXT_LANGSELECT", $lng->txt("language")); // bs-patch end $this->tpl->setVariable("LANG_SELECT", $selection); } $this->tpl->setCurrentBlock("userisanonymous"); $this->tpl->setVariable("TXT_NOT_LOGGED_IN", $lng->txt("not_logged_in")); $this->tpl->setVariable("TXT_LOGIN", $lng->txt("log_in")); // #13058 $target_str = $this->getLoginTargetPar() != "" ? $this->getLoginTargetPar() : ilTemplate::buildLoginTarget(); $this->tpl->setVariable("LINK_LOGIN", $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->parseCurrentBlock(); } else { if ($this->getMode() != self::MODE_TOPBAR_REDUCED) { $notificationSettings = new ilSetting('notifications'); $chatSettings = new ilSetting('chatroom'); /** * @var $tpl ilTemplate */ global $tpl; if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) { $this->tpl->touchBlock('osd_enabled'); $this->tpl->touchBlock('osd_container'); include_once "Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); include_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php'; ilPlayerUtil::initMediaElementJs(); $tpl->addJavaScript('Services/Notifications/templates/default/notifications.js'); $tpl->addCSS('Services/Notifications/templates/default/osd.css'); require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php'; require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php'; $notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId()); $this->tpl->setVariable('NOTIFICATION_CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $lng->txt('close')))); $this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications)); $this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5'); $this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') && $ilUser->getPref('chat_play_invitation_sound') ? 'true' : 'false'); foreach ($notifications as $notification) { if ($notification['type'] == 'osd_maint') { continue; } $this->tpl->setCurrentBlock('osd_notification_item'); $this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath); $this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title); $this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link); $this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget); $this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']); $this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription); $this->tpl->parseCurrentBlock(); } } } $this->tpl->setCurrentBlock("userisloggedin"); $this->tpl->setVariable("TXT_LOGIN_AS", $lng->txt("login_as")); $user_img_src = $ilias->account->getPersonalPicturePath("small", true); $user_img_alt = $ilias->account->getFullname(); $this->tpl->setVariable("USER_IMG", ilUtil::img($user_img_src, $user_img_alt)); $this->tpl->setVariable("USR_LINK_PROFILE", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile"); $this->tpl->setVariable("USR_TXT_PROFILE", $lng->txt("personal_profile")); $this->tpl->setVariable("USR_LINK_SETTINGS", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings"); $this->tpl->setVariable("USR_TXT_SETTINGS", $lng->txt("personal_settings")); $this->tpl->setVariable("TXT_LOGOUT2", $lng->txt("logout")); $this->tpl->setVariable("LINK_LOGOUT2", $link_dir . "logout.php?lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->setVariable("USERNAME", $ilias->account->getFullname()); $this->tpl->setVariable("LOGIN", $ilias->account->getLogin()); $this->tpl->setVariable("MATRICULATION", $ilias->account->getMatriculation()); $this->tpl->setVariable("EMAIL", $ilias->account->getEmail()); $this->tpl->parseCurrentBlock(); } } else { // member view info $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader"); $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long")); } if (!$this->topbar_back_url) { include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php"; $header_top_title = ilObjSystemFolder::_getHeaderTitle(); if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title")) { $this->tpl->setCurrentBlock("header_top_title"); $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title); $this->tpl->parseCurrentBlock(); } } else { $this->tpl->setCurrentBlock("header_back_bl"); $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url); $this->tpl->setVariable("TXT_HEADER_BACK", $this->topbar_back_caption ? $this->topbar_back_caption : $lng->txt("back")); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); if ($this->getMode() == self::MODE_FULL) { // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout")); $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL()); $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg")); } include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php"; // set link to return to desktop, not depending on a specific position in the hierarchy //$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php")); /* else { $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL()); $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg")); } */ $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu")); $this->tpl->parseCurrentBlock(); }
public function executeCommand() { global $ilAccess, $ilNavigationHistory, $ilErr, $ilTabs; $this->external_rater_360 = false; if (!$this->creation_mode && $this->object->get360Mode() && $_SESSION["anonymous_id"][$this->object->getId()] && ilObjSurvey::validateExternalRaterCode($this->object->getRefId(), $_SESSION["anonymous_id"][$this->object->getId()])) { $this->external_rater_360 = true; } if (!$this->external_rater_360) { if (!$ilAccess->checkAccess("read", "", $this->ref_id) && !$ilAccess->checkAccess("visible", "", $this->ref_id)) { $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $this->ref_id)) { $this->ctrl->setParameterByClass("ilobjsurveygui", "ref_id", $this->ref_id); $link = $this->ctrl->getLinkTargetByClass("ilobjsurveygui", ""); $ilNavigationHistory->addItem($this->ref_id, $link, "svy"); } } $cmd = $this->ctrl->getCmd("properties"); // workaround for bug #6288, needs better solution if ($cmd == "saveTags") { $this->ctrl->setCmdClass("ilinfoscreengui"); } // deep link from repository - "redirect" to page view if (!$this->ctrl->getCmdClass() && $cmd == "questionsrepo") { $_REQUEST["pgov"] = 1; $this->ctrl->setCmd("questions"); $this->ctrl->setCmdClass("ilsurveyeditorgui"); } $next_class = $this->ctrl->getNextClass($this); $this->ctrl->setReturn($this, "properties"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen"); $this->prepareOutput(); switch ($next_class) { case "ilinfoscreengui": if (!in_array($this->ctrl->getCmdClass(), array('ilpublicuserprofilegui', 'ilobjportfoliogui'))) { $this->addHeaderAction(); $this->infoScreen(); // forwards command } else { // #16891 $ilTabs->clearTargets(); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $this->ctrl->forwardCommand($info); } break; case 'ilmdeditorgui': $this->handleWriteAccess(); $ilTabs->activateTab("meta_data"); $this->addHeaderAction(); include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "ilsurveyevaluationgui": $ilTabs->activateTab("svy_results"); $this->addHeaderAction(); include_once "./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php"; $eval_gui = new ilSurveyEvaluationGUI($this->object); $this->ctrl->forwardCommand($eval_gui); break; case "ilsurveyexecutiongui": $ilTabs->clearTargets(); include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php"; $exec_gui = new ilSurveyExecutionGUI($this->object); $this->ctrl->forwardCommand($exec_gui); break; case 'ilpermissiongui': $ilTabs->activateTab("perm_settings"); $this->addHeaderAction(); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $this->ctrl->forwardCommand($perm_gui); break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('svy'); $this->ctrl->forwardCommand($cp); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; // 360, skill service // 360, skill service case 'ilsurveyskillgui': $ilTabs->activateTab("survey_competences"); include_once "./Modules/Survey/classes/class.ilSurveySkillGUI.php"; $gui = new ilSurveySkillGUI($this->object); $this->ctrl->forwardCommand($gui); break; case 'ilsurveyskilldeterminationgui': $ilTabs->activateTab("maintenance"); include_once "./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php"; $gui = new ilSurveySkillDeterminationGUI($this->object); $this->ctrl->forwardCommand($gui); break; case 'ilsurveyeditorgui': $this->handleWriteAccess(); $ilTabs->activateTab("survey_questions"); include_once "./Modules/Survey/classes/class.ilSurveyEditorGUI.php"; $gui = new ilSurveyEditorGUI($this); $this->ctrl->forwardCommand($gui); break; case 'ilsurveyconstraintsgui': $this->handleWriteAccess(); $ilTabs->activateTab("constraints"); include_once "./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php"; $gui = new ilSurveyConstraintsGUI($this); $this->ctrl->forwardCommand($gui); break; case 'ilsurveyparticipantsgui': if (!$this->object->get360Mode()) { $ilTabs->activateTab("maintenance"); } else { $ilTabs->activateTab("survey_360_appraisees"); } include_once "./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php"; $gui = new ilSurveyParticipantsGUI($this); $this->ctrl->forwardCommand($gui); break; default: $this->addHeaderAction(); $cmd .= "Object"; $this->{$cmd}(); break; } if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) { $this->tpl->show(); } }
/** * export html package */ function exportHTML($a_target_dir, $log, $a_zip_file = true, $a_export_format = "html") { global $tpl, $ilBench, $ilLocator, $ilUser; // initialize temporary target directory ilUtil::delDir($a_target_dir); ilUtil::makeDir($a_target_dir); $mob_dir = $a_target_dir . "/mobs"; ilUtil::makeDir($mob_dir); $file_dir = $a_target_dir . "/files"; ilUtil::makeDir($file_dir); $teximg_dir = $a_target_dir . "/teximg"; ilUtil::makeDir($teximg_dir); $style_dir = $a_target_dir . "/style"; ilUtil::makeDir($style_dir); $style_img_dir = $a_target_dir . "/style/images"; ilUtil::makeDir($style_img_dir); $content_style_dir = $a_target_dir . "/content_style"; ilUtil::makeDir($content_style_dir); $content_style_img_dir = $a_target_dir . "/content_style/images"; ilUtil::makeDir($content_style_img_dir); $GLOBALS["teximgcnt"] = 0; // export system style sheet $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem"); $style_name = $ilUser->prefs["style"] . ".css"; copy($location_stylesheet, $style_dir . "/" . $style_name); $fh = fopen($location_stylesheet, "r"); $css = fread($fh, filesize($location_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { $fileref = dirname($location_stylesheet) . "/" . $fileref; if (is_file($fileref)) { copy($fileref, $style_img_dir . "/" . basename($fileref)); } } fclose($fh); $location_stylesheet = ilUtil::getStyleSheetLocation(); // export content style sheet $ilBench->start("ExportHTML", "exportContentStyle"); if ($this->getStyleSheetId() < 1) { $cont_stylesheet = "./Services/COPage/css/content.css"; $css = fread(fopen($cont_stylesheet, 'r'), filesize($cont_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { if (is_file(str_replace("..", ".", $fileref))) { copy(str_replace("..", ".", $fileref), $content_style_img_dir . "/" . basename($fileref)); } $css = str_replace($fileref, "images/" . basename($fileref), $css); } fwrite(fopen($content_style_dir . "/content.css", 'w'), $css); } else { $style = new ilObjStyleSheet($this->getStyleSheetId()); $style->writeCSSFile($content_style_dir . "/content.css", "images"); $style->copyImagesToDir($content_style_img_dir); } $ilBench->stop("ExportHTML", "exportContentStyle"); // export syntax highlighting style $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath(); copy($syn_stylesheet, $a_target_dir . "/syntaxhighlight.css"); // get learning module presentation gui class include_once "./Modules/LearningModule/classes/class.ilLMPresentationGUI.php"; $_GET["cmd"] = "nop"; $lm_gui =& new ilLMPresentationGUI(); $lm_gui->setOfflineMode(true); $lm_gui->setOfflineDirectory($a_target_dir); $lm_gui->setExportFormat($a_export_format); // export pages $ilBench->start("ExportHTML", "exportHTMLPages"); $this->exportHTMLPages($lm_gui, $a_target_dir); $ilBench->stop("ExportHTML", "exportHTMLPages"); // export glossary terms $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms"); $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir); $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms"); // export all media objects $ilBench->start("ExportHTML", "exportHTMLMediaObjects"); $linked_mobs = array(); foreach ($this->offline_mobs as $mob) { if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") { $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs); } } $linked_mobs2 = array(); // mobs linked in link areas foreach ($linked_mobs as $mob) { if (ilObject::_exists($mob)) { $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2); } } $_GET["obj_type"] = "MediaObject"; $_GET["obj_id"] = $a_mob_id; $_GET["cmd"] = ""; $ilBench->stop("ExportHTML", "exportHTMLMediaObjects"); // export all file objects $ilBench->start("ExportHTML", "exportHTMLFileObjects"); foreach ($this->offline_files as $file) { $this->exportHTMLFile($a_target_dir, $file); } $ilBench->stop("ExportHTML", "exportHTMLFileObjects"); // export table of contents $ilBench->start("ExportHTML", "exportHTMLTOC"); $ilLocator->clearItems(); if ($this->isActiveTOC()) { $tpl = new ilTemplate("tpl.main.html", true, true); //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); $content =& $lm_gui->showTableOfContents(); $file = $a_target_dir . "/table_of_contents.html"; // open file if (!($fp = @fopen($file, "w+"))) { die("<b>Error</b>: Could not open \"" . $file . "\" for writing" . " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />"); } chmod($file, 0770); fwrite($fp, $content); fclose($fp); } $ilBench->stop("ExportHTML", "exportHTMLTOC"); // export images $ilBench->start("ExportHTML", "exportHTMLImages"); $image_dir = $a_target_dir . "/images"; ilUtil::makeDir($image_dir); ilUtil::makeDir($image_dir . "/browser"); copy(ilUtil::getImagePath("enlarge.png", false, "filesystem"), $image_dir . "/enlarge.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/plus.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/minus.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/blank.png"); copy(ilUtil::getImagePath("spacer.png", false, "filesystem"), $image_dir . "/spacer.png"); copy(ilUtil::getImagePath("icon_st.png", false, "filesystem"), $image_dir . "/icon_st.png"); copy(ilUtil::getImagePath("icon_pg.png", false, "filesystem"), $image_dir . "/icon_pg.png"); copy(ilUtil::getImagePath("icon_st_s.png", false, "filesystem"), $image_dir . "/icon_st_s.png"); copy(ilUtil::getImagePath("icon_pg_s.png", false, "filesystem"), $image_dir . "/icon_pg_s.png"); copy(ilUtil::getImagePath("icon_lm.png", false, "filesystem"), $image_dir . "/icon_lm.png"); copy(ilUtil::getImagePath("icon_lm_s.png", false, "filesystem"), $image_dir . "/icon_lm_s.png"); copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"), $image_dir . "/nav_arr_L.png"); copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"), $image_dir . "/nav_arr_R.png"); copy(ilUtil::getImagePath("browser/forceexp.png", false, "filesystem"), $image_dir . "/browser/forceexp.png"); copy(ilUtil::getImagePath("download.png", false, "filesystem"), $image_dir . "/download.png"); $ilBench->stop("ExportHTML", "exportHTMLImages"); // export flv/mp3 player $services_dir = $a_target_dir . "/Services"; ilUtil::makeDir($services_dir); $media_service_dir = $services_dir . "/MediaObjects"; ilUtil::makeDir($media_service_dir); include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php"; $flv_dir = $a_target_dir . "/" . ilPlayerUtil::getFlashVideoPlayerDirectory(); ilUtil::makeDir($flv_dir); $mp3_dir = $media_service_dir . "/flash_mp3_player"; ilUtil::makeDir($mp3_dir); // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true), // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename()); ilPlayerUtil::copyPlayerFilesToTargetDirectory($flv_dir); // js files ilUtil::makeDir($a_target_dir . '/js'); ilUtil::makeDir($a_target_dir . '/js/yahoo'); ilUtil::makeDir($a_target_dir . '/css'); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; foreach (self::getSupplyingExportFiles($a_target_dir) as $f) { if ($f["source"] != "") { copy($f["source"], $f["target"]); } } // template workaround: reset of template $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet); $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); // zip everything $ilBench->start("ExportHTML", "zip"); if (true) { if ($a_zip_file) { // zip it all $date = time(); $zip_file = $this->getExportDirectory("html") . "/" . $date . "__" . IL_INST_ID . "__" . $this->getType() . "_" . $this->getId() . ".zip"; ilUtil::zip($a_target_dir, $zip_file); ilUtil::delDir($a_target_dir); } } $ilBench->stop("ExportHTML", "zip"); }
function unloadSahs() { $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc"); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]); $this->tpl->show(); }
/** * show download list */ function showDownloadList() { //$this->tpl = new ilTemplate("tpl.lm_toc.html", true, true, true); $this->tpl->setCurrentBlock("ContentStyle"); if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId())); } else { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css"); } $this->tpl->parseCurrentBlock(); $this->renderPageTitle(); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->getStandardTemplate(); $this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode(), $this->getExportFormat(), "download", true)); $this->ilLocator(); //$this->tpl->stopTitleFloating(); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_download_list.html", "Modules/LearningModule"); // set title header $this->tpl->setTitle($this->lm->getTitle()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg")); /* $this->tpl->setVariable("TXT_BACK", $this->lng->txt("back")); $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]); $this->tpl->setVariable("LINK_BACK", $this->ctrl->getLinkTarget($this, "")); */ // output copyright information include_once 'Services/MetaData/classes/class.ilMD.php'; $md = new ilMD($this->lm->getId(), 0, $this->lm->getType()); if (is_object($md_rights = $md->getRights())) { $copyright = $md_rights->getDescription(); include_once 'Services/MetaData/classes/class.ilMDUtils.php'; $copyright = ilMDUtils::_parseCopyright($copyright); if ($copyright != "") { $this->lng->loadLanguageModule("meta"); $this->tpl->setCurrentBlock("copyright"); $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright")); $this->tpl->setVariable("LM_COPYRIGHT", $copyright); $this->tpl->parseCurrentBlock(); } } // create table require_once "./Services/Table/classes/class.ilTableGUI.php"; $tbl = new ilTableGUI(); // load files templates $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html"); // load template for table content data $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/LearningModule"); $export_files = array(); $types = array("xml", "html", "scorm"); foreach ($types as $type) { if ($this->lm->getPublicExportFile($type) != "") { if (is_file($this->lm->getExportDirectory($type) . "/" . $this->lm->getPublicExportFile($type))) { $dir = $this->lm->getExportDirectory($type); $size = filesize($this->lm->getExportDirectory($type) . "/" . $this->lm->getPublicExportFile($type)); $export_files[] = array("type" => $type, "file" => $this->lm->getPublicExportFile($type), "size" => $size); } } } $num = 0; $tbl->setTitle($this->lng->txt("download")); $tbl->setHeaderNames(array($this->lng->txt("cont_format"), $this->lng->txt("cont_file"), $this->lng->txt("size"), $this->lng->txt("date"), "")); $cols = array("format", "file", "size", "date", "download"); $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"], "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this))); $tbl->setHeaderVars($cols, $header_params); $tbl->setColumnWidth(array("10%", "30%", "20%", "20%", "20%")); $tbl->disable("sort"); // control $tbl->setOrderColumn($_GET["sort_by"]); $tbl->setOrderDirection($_GET["sort_order"]); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount($this->maxcount); // ??? //$this->tpl->setVariable("COLUMN_COUNTS", 5); // footer //$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next")); $tbl->disable("footer"); $tbl->setMaxCount(count($export_files)); $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]); $tbl->render(); if (count($export_files) > 0) { $i = 0; foreach ($export_files as $exp_file) { if (!$exp_file["size"] > 0) { continue; } $this->tpl->setCurrentBlock("tbl_content"); $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]); $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2"); $this->tpl->setVariable("CSS_ROW", $css_row); $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]); $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"])); $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"] . ":" . $exp_file["file"]); $file_arr = explode("__", $exp_file["file"]); $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s", $file_arr[0])); $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download")); $this->ctrl->setParameter($this, "type", $exp_file["type"]); $this->tpl->setVariable("LINK_DOWNLOAD", $this->ctrl->getLinkTarget($this, "downloadExportFile")); $this->tpl->parseCurrentBlock(); } } else { $this->tpl->setCurrentBlock("notfound"); $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found")); $this->tpl->setVariable("NUM_COLS", 5); $this->tpl->parseCurrentBlock(); } $this->tpl->show(); }
/** * SCO preview */ function sco_preview() { global $tpl, $ilCtrl, $lng; // init main template $tpl = new ilTemplate("tpl.main.html", true, true); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $tpl->setBodyClass(""); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId())); $tpl->parseCurrentBlock(); // get javascript include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); iljQueryUtil::initjQueryUI(); $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js"); $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js"); $tpl->addOnLoadCode("pager.Init();"); $tree = new ilTree($this->slm_object->getId()); $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node'); $tree->setTreeTablePK("slm_id"); include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php"; include_once "./Services/MetaData/classes/class.ilMD.php"; $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType()); $desc_ids = $meta->getGeneral()->getDescriptionIds(); $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription(); // get sco template $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004"); // navigation $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId()); ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk); // meta page (description and objectives) ilSCORM2004Asset::renderMetaPage($sco_tpl, $this->node_object, $this->node_object->getType()); // init export (this initialises glossary template) ilSCORM2004PageGUI::initExport(); $terms = $this->node_object->getGlossaryTermIds(); // render page foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) { $page_obj = new ilSCORM2004PageGUI($this->node_object->getType(), $page["obj_id"], 0, $this->slm_object->getId()); $page_obj->setPresentationTitle($page["title"]); $page_obj->setOutputMode(IL_PAGE_PREVIEW); $page_obj->setStyleId($this->slm_object->getStyleSheetId()); if (count($terms) > 1) { $page_obj->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $this->node_object); } $sco_tpl->setCurrentBlock("page_preview"); $html = $ilCtrl->getHTML($page_obj); //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export")); $sco_tpl->setVariable("PAGE_PRV", $html); $sco_tpl->parseCurrentBlock(); } $output = $sco_tpl->get(); // append glossary entries on the sco level $output .= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object); //insert questions require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php'; $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output); // $output = preg_replace("/{/","",$output); // $output = preg_replace("/}/","",$output); $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output; $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId()); // include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php"); // ilSCORM2004PageGUI::addPreparationJavascript($tpl, $lk); $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js"); $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css"); include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php"; ilOverlayGUI::initJavascript(); //inline JS $output .= '<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>'; $tpl->setVariable("CONTENT", $output); }
/** * Adds custom support for an RTE in an ILIAS form * * Adds custom support for an RTE in an ILIAS form * * @param string $editor_selector CSS class of the text input field(s) * @access public */ function addUserTextEditor($editor_selector) { $validtags = array("strong", "em", "p", "br", "div", "span"); $buttontags = array("strong", "em"); include_once "./Services/UICore/classes/class.ilTemplate.php"; $template = new ilTemplate("tpl.usereditor.html", true, true, "Services/RTE"); $this->handleImgContextMenuItem($template); $template->setCurrentBlock("tinymce"); $template->setVariable("JAVASCRIPT_LOCATION", "./Services/RTE/tiny_mce" . $this->vd . "/tiny_mce.js"); include_once "./Services/Object/classes/class.ilObject.php"; $template->setVariable("SELECTOR", $editor_selector); $template->setVariable("BLOCKFORMATS", ""); $template->setVariable("VALID_ELEMENTS", $this->_getValidElementsFromHTMLTags($validtags)); if ($this->getStyleSelect()) { $template->setVariable("STYLE_SELECT", ",styleselect"); } $template->setVariable("BUTTONS", $this->_buildButtonsFromHTMLTags($buttontags) . ",backcolor,removeformat"); include_once "./Services/Utilities/classes/class.ilUtil.php"; //$template->setVariable("STYLESHEET_LOCATION", $this->getContentCSS()); $template->setVariable("STYLESHEET_LOCATION", ilUtil::getNewContentStyleSheetLocation() . "," . ilUtil::getStyleSheetLocation("output", "delos.css")); $template->setVariable("LANG", $this->_getEditorLanguage()); $template->parseCurrentBlock(); $this->tpl->setCurrentBlock("HeadContent"); $this->tpl->setVariable("CONTENT_BLOCK", $template->get()); $this->tpl->parseCurrentBlock(); }
/** * show fullscreen view of media object */ function showMediaFullscreen($a_style_id = 0) { $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage"); $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", 0); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable("PAGETITLE", " - " . ilObject::_lookupTitle($_GET["mob_id"])); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setCurrentBlock("ilMedia"); require_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php"; $media_obj =& new ilObjMediaObject($_GET["mob_id"]); if (!empty($_GET["pg_id"])) { include_once "./Services/COPage/classes/class.ilPageObjectFactory.php"; $pg_obj = ilPageObjectFactory::getInstance($this->obj->getParentType(), $_GET["pg_id"]); $pg_obj->buildDom(); $xml = "<dummy>"; // todo: we get always the first alias now (problem if mob is used multiple // times in page) $xml .= $pg_obj->getMediaAliasElement($_GET["mob_id"]); $xml .= $media_obj->getXML(IL_MODE_OUTPUT); $xml .= "</dummy>"; } else { $xml = "<dummy>"; $xml .= $media_obj->getXML(IL_MODE_ALIAS); $xml .= $media_obj->getXML(IL_MODE_OUTPUT); $xml .= "</dummy>"; } //echo htmlentities($xml); exit; $xsl = file_get_contents("./Services/COPage/xsl/page.xsl"); $args = array('/_xml' => $xml, '/_xsl' => $xsl); $xh = xslt_create(); //echo "<b>XML:</b>".htmlentities($xml); // determine target frames for internal links //$pg_frame = $_GET["frame"]; $wb_path = ilUtil::getWebspaceDir("output") . "/"; $mode = "fullscreen"; $params = array('mode' => $mode, 'webspace_path' => $wb_path); $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params); echo xslt_error($xh); xslt_free($xh); // unmask user html $this->tpl->setVariable("MEDIA_CONTENT", $output); }
/** * execute command * * @global ilLocatorGUI $ilLocator * @global ilAccessHandler $ilAccess * @global ilNavigationHistory $ilNavigationHistory * @global ilTemplate $tpl * @global ilCtrl $ilCtrl * @global ilTabsGUI $ilTabs * @global ilLanguage $lng * @global ILIAS $ilias */ function executeCommand() { global $ilUser, $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) { global $ilias; $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if ('qpl' == $this->object->getType()) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl"); } } $cmd = $this->ctrl->getCmd("questions"); $next_class = $this->ctrl->getNextClass($this); if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') { $_GET['q_id'] = ''; } $this->prepareOutput(); $this->ctrl->setReturn($this, "questions"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen"); if ($_GET["q_id"] < 1) { $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"]; } if ($cmd != "createQuestion" && $cmd != "createQuestionForTest" && $next_class != "ilassquestionpagegui") { if ($_GET["test_ref_id"] != "" or $_GET["calling_test"]) { $ref_id = $_GET["test_ref_id"]; if (!$ref_id) { $ref_id = $_GET["calling_test"]; } } } switch ($next_class) { case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case 'ilassquestionpreviewgui': $this->ctrl->saveParameter($this, "q_id"); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php'; $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB); $gui->initQuestion((int) $_GET['q_id'], $this->object->getId()); $gui->initPreviewSettings($this->object->getRefId()); $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']); $gui->initHintTracking(); $gui->initStyleSheets(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); $this->ctrl->forwardCommand($gui); break; case "ilassquestionpagegui": include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]); $q_gui->setQuestionTabs(); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $q_gui->setTargetGuiClass(null); $q_gui->setQuestionActionCmd(null); $question = $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; $this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view"); $this->ctrl->setReturn($this, "questions"); $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]); $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode("edit"); $page_gui->setHeader($question->getTitle()); $page_gui->setPresentationTitle($question->getTitle()); $ret = $this->ctrl->forwardCommand($page_gui); $tpl->setContent($ret); break; case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui = new ilPermissionGUI($this); $ret = $this->ctrl->forwardCommand($perm_gui); break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('qpl'); $this->ctrl->forwardCommand($cp); break; case "ilquestionpoolexportgui": require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php'; $exp_gui = new ilQuestionPoolExportGUI($this); $exp_gui->addFormat('zip', $this->lng->txt('qpl_export_xml'), $this, 'createExportQTI'); $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel'); $ret = $this->ctrl->forwardCommand($exp_gui); break; case "ilinfoscreengui": $this->infoScreenForward(); break; case 'ilassquestionhintsgui': // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); // forward to ilAssQuestionHintsGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php'; $gui = new ilAssQuestionHintsGUI($questionGUI); $ilCtrl->forwardCommand($gui); break; case 'illocalunitconfigurationgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); $this->ctrl->setReturn($this, 'questions'); require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php'; require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php'; $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id'])); $ilCtrl->forwardCommand($gui); break; case 'ilassquestionfeedbackeditinggui': // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); // forward to ilAssQuestionFeedbackGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php'; $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng); $ilCtrl->forwardCommand($gui); break; case 'ilobjquestionpoolsettingsgeneralgui': require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php'; $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this); $this->ctrl->forwardCommand($gui); break; case "ilobjtaxonomygui": require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php'; $forwarder = new ilObjQuestionPoolTaxonomyEditingCommandForwarder($this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng); $forwarder->forward(); break; case 'ilquestionbrowsertablegui': $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required break; case "ilobjquestionpoolgui": case "": if ($cmd == 'questions') { $this->ctrl->setParameter($this, 'q_id', ''); } $cmd .= "Object"; $ret = $this->{$cmd}(); break; default: $this->ctrl->setReturn($this, "questions"); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); if ($this->object->getType() == 'qpl') { $q_gui->setTaxonomyIds($this->object->getTaxonomyIds()); $this->object->addQuestionChangeListeners($q_gui->object); } $q_gui->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); $ret = $this->ctrl->forwardCommand($q_gui); break; } if (!(strtolower($_GET["baseClass"]) == "iladministrationgui" || strtolower($_GET['baseClass']) == 'ilrepositorygui') && $this->getCreationMode() != true) { $this->tpl->show(); } }
/** * Creates output * recursive method * @access public * @return string */ function getOutput() { global $ilBench, $tpl, $lng; $ilBench->start("Explorer", "getOutput"); $this->format_options[0]["tab"] = array(); $depth = $this->getMaximumTreeDepth(); for ($i = 0; $i < $depth; ++$i) { $this->createLines($i); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnection(); $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js"); $tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html"); //echo "hh"; // set global body class // $tpl->setBodyClass("il_Explorer"); $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer"); // updater if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "") { $tpl_tree->setCurrentBlock("updater"); $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame); $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script); if (is_array($this->up_params)) { $up_str = $lim = ""; foreach ($this->up_params as $p) { $up_str .= $lim . "'" . $p . "'"; $lim = ","; } $tpl_tree->setVariable("UPDATE_PARAMS", $up_str); } $tpl_tree->parseCurrentBlock(); } $cur_depth = -1; foreach ($this->format_options as $key => $options) { //echo "-".$options["depth"]."-"; if (!$options["visible"]) { continue; } // end tags $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]); // start tags $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]); $cur_depth = $options["depth"]; if ($options["visible"] and $key != 0) { $this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']); } if ($key == 0) { $this->formatHeader($tpl_tree, $options["child"], $options); } } //if ($GLOBALS["ilUser"]->getLogin() == "alex") var_dump($this->format_options); $this->handleListEndTags($tpl_tree, $cur_depth, -1); $ilBench->stop("Explorer", "getOutput"); $tpl_tree->setVariable("TREE_LEAD", ""); if ($this->tree_lead != "") { $tpl_tree->setCurrentBlock("tree_lead"); $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead); $tpl_tree->parseCurrentBlock(); } if ($this->getId() != "") { $tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"'); } $html = $tpl_tree->get(); if ($this->getUseStandardFrame()) { $mtpl = new ilTemplate("tpl.main.html", true, true); $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $mtpl->setVariable("BODY_CLASS", "il_Explorer"); $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); if ($this->getTitle() != "") { $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle()); } if ($this->getId() != "") { $mtpl->setVariable("ID", 'id="' . $this->getId() . '"'); } $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false)); $mtpl->setCurrentBlock("content"); $mtpl->setVariable("EXPLORER", $html); $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh")); $mtpl->parseCurrentBlock(); $html = $mtpl->get(); } return $html; }
/** * execute command */ public function executeCommand() { global $ilAccess, $ilNavigationHistory, $ilErr; if ($this->ctrl->getCmd("questions") != "questions") { // #11186 $rbac_ref_id = $_REQUEST["calling_survey"]; if (!$rbac_ref_id) { $rbac_ref_id = $_REQUEST["new_for_survey"]; } if (!$rbac_ref_id) { $rbac_ref_id = $_REQUEST["ref_id"]; } } else { $rbac_ref_id = $_REQUEST["ref_id"]; } if (!$ilAccess->checkAccess("read", "", $rbac_ref_id) && !$ilAccess->checkAccess("visible", "", $rbac_ref_id)) { global $ilias; $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "spl"); } $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen"); $this->prepareOutput(); $cmd = $this->ctrl->getCmd("questions"); $next_class = $this->ctrl->getNextClass($this); $this->ctrl->setReturn($this, "questions"); if ($_GET["q_id"] < 1) { $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"]; } 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 "ilsurveyphrasesgui": include_once "./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php"; $phrases_gui =& new ilSurveyPhrasesGUI($this); $ret =& $this->ctrl->forwardCommand($phrases_gui); break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('spl'); $this->ctrl->forwardCommand($cp); break; case 'ilinfoscreengui': $this->infoScreenForward(); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case "": $cmd .= "Object"; $ret =& $this->{$cmd}(); break; default: include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php"; $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); $q_gui->setQuestionTabs(); $ret =& $this->ctrl->forwardCommand($q_gui); break; } if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) { $this->tpl->show(); } }
/** * set all template variables (images, scripts, target frames, ...) */ function setTemplateVars() { global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin; if ($this->logo_only) { $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png")); return; } // get user interface plugins $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk"); // search include_once 'Services/Search/classes/class.ilSearchSettings.php'; if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) { include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php'; $main_search = new ilMainMenuSearchGUI(); $html = ""; // user interface plugin slot + default rendering include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php"; $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search", array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search)); if (!$uip->replaced()) { $html = $main_search->getHTML(); } $html = $uip->getHTML($html); if (strlen($html)) { $this->tpl->setVariable('SEARCHBOX', $html); } } $this->renderStatusBox($this->tpl); // online help $this->renderHelpButtons(); $mmle_html = ""; // user interface plugin slot + default rendering include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php"; $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries", array("main_menu_gui" => $this)); if (!$uip->replaced()) { $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu"); $mmle_html = $this->renderMainMenuListEntries($mmle_tpl); } $mmle_html = $uip->getHTML($mmle_html); $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html); $link_dir = defined("ILIAS_MODULE") ? "../" : ""; if (!$this->small) { // login stuff if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) { include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php'; if (ilRegistrationSettings::_lookupRegistrationType() != IL_REG_DISABLED) { $this->tpl->setCurrentBlock("registration_link"); $this->tpl->setVariable("TXT_REGISTER", $lng->txt("register")); $this->tpl->setVariable("LINK_REGISTER", $link_dir . "register.php?client_id=" . rawurlencode(CLIENT_ID) . "&lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->parseCurrentBlock(); } // language selection $selection = self::getLanguageSelection(); if ($selection) { $this->tpl->setVariable("LANG_SELECT", $selection); } $this->tpl->setCurrentBlock("userisanonymous"); $this->tpl->setVariable("TXT_NOT_LOGGED_IN", $lng->txt("not_logged_in")); $this->tpl->setVariable("TXT_LOGIN", $lng->txt("log_in")); $target_str = ""; if ($this->getLoginTargetPar() != "") { $target_str = $this->getLoginTargetPar(); } else { if ($_GET["ref_id"] != "") { if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId()) { $obj_id = ilObject::_lookupObjId($_GET["ref_id"]); $type = ilObject::_lookupType($obj_id); $target_str = $type . "_" . $_GET["ref_id"]; } } } $this->tpl->setVariable("LINK_LOGIN", $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->parseCurrentBlock(); } else { $notificationSettings = new ilSetting('notifications'); $chatSettings = new ilSetting('chatroom'); /** * @var $tpl ilTemplate */ global $tpl; if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) { $this->tpl->touchBlock('osd_enabled'); $this->tpl->touchBlock('osd_container'); include_once "Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); include_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php'; ilPlayerUtil::initMediaElementJs(); $tpl->addJavaScript('Services/Notifications/templates/default/notifications.js'); $tpl->addCSS('Services/Notifications/templates/default/osd.css'); require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php'; $notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId()); $this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications)); $this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5'); $this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') ? 'true' : 'false'); foreach ($notifications as $notification) { if ($notification['type'] == 'osd_maint') { continue; } $this->tpl->setCurrentBlock('osd_notification_item'); $this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath); $this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title); $this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link); $this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget); $this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']); $this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription); $this->tpl->parseCurrentBlock(); } } $this->tpl->setCurrentBlock("userisloggedin"); $this->tpl->setVariable("TXT_LOGIN_AS", $lng->txt("login_as")); $this->tpl->setVariable("TXT_LOGOUT2", $lng->txt("logout")); $this->tpl->setVariable("LINK_LOGOUT2", $link_dir . "logout.php?lang=" . $ilias->account->getCurrentLanguage()); $this->tpl->setVariable("USERNAME", $ilias->account->getFullname()); $this->tpl->parseCurrentBlock(); } include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php"; $header_top_title = ilObjSystemFolder::_getHeaderTitle(); if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title")) { $this->tpl->setCurrentBlock("header_top_title"); $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout")); $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png")); $this->tpl->setVariable("HEADER_BG_IMAGE", ilUtil::getImagePath("HeaderBackground.png")); include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php"; // set link to return to desktop, not depending on a specific position in the hierarchy //$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php")); } else { $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png")); } $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu")); $this->tpl->parseCurrentBlock(); }
/** * Show Editing Tree */ function showTree() { global $ilUser, $ilias, $ilCtrl, $lng; $mtree = new ilTree($this->object->getId()); $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node'); $mtree->setTreeTablePK("slm_id"); if ($_POST["expandAll"] != "") { $_GET["scexpand"] = ""; $stree = $mtree->getSubTree($mtree->getNodeData($mtree->readRootId())); $n_arr = array(); foreach ($stree as $n) { $n_arr[] = $n["child"]; } $_SESSION["scexpand"] = $n_arr; } if ($_POST["collapseAll"] != "") { $_GET["scexpand"] = ""; $_SESSION["scexpand"] = array($mtree->readRootId()); } $this->tpl = new ilTemplate("tpl.main.html", true, true); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]); $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false)); $this->tpl->setCurrentBlock("exp2_button"); $this->tpl->setVariable("CMD_EXP2_BTN", "expandAll"); $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("expand_all")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("exp2_button"); $this->tpl->setVariable("CMD_EXP2_BTN", "collapseAll"); $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("collapse_all")); $this->tpl->parseCurrentBlock(); require_once "./Modules/Scorm2004/classes/class.ilSCORM2004EditorExplorer.php"; $exp = new ilSCORM2004EditorExplorer($this->ctrl->getLinkTarget($this, "edit"), $this->object); $exp->setFrameUpdater("content", "ilHierarchyFormUpdater"); $exp->setTargetGet("obj_id"); $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "showTree")); if ($_GET["scexpand"] == "") { $expanded = $mtree->readRootId(); } else { $expanded = $_GET["scexpand"]; } //echo "-".$_GET["active_node"]."-"; if ($_GET["active_node"] != "") { $path = $mtree->getPathId($_GET["active_node"]); $exp->setForceOpenPath($path); $exp->highlightNode($_GET["active_node"]); } $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); // asynchronous output if ($ilCtrl->isAsynch()) { echo $output; exit; } $this->tpl->setCurrentBlock("content"); $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("sahs_organization")); $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh")); $this->tpl->setVariable("EXPLORER", $output); $this->ctrl->setParameter($this, "scexpand", $_GET["scexpand"]); $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "showTree")); $this->tpl->parseCurrentBlock(); include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery($this->tpl); $this->tpl->show(false); exit; }
/** * init HTML output (level 3) */ protected static function initHTML() { global $ilUser; if (ilContext::hasUser()) { // load style definitions // use the init function with plugin hook here, too self::initStyle(); } // $tpl $tpl = new ilTemplate("tpl.main.html", true, true); self::initGlobal("tpl", $tpl); if (ilContext::hasUser() && ilContext::doAuthentication()) { /** * @var $ilUser ilObjUser * @var $ilCtrl ilCtrl */ global $ilUser, $ilCtrl; require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php'; $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $ilCtrl); $request_adjuster->adjust(); } // load style sheet depending on user's settings $location_stylesheet = ilUtil::getStyleSheetLocation(); $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet); require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php"; self::initGlobal("ilNavigationHistory", "ilNavigationHistory", "Services/Navigation/classes/class.ilNavigationHistory.php"); self::initGlobal("ilBrowser", "ilBrowser", "./Services/Utilities/classes/class.ilBrowser.php"); self::initGlobal("ilHelp", "ilHelpGUI", "Services/Help/classes/class.ilHelpGUI.php"); self::initGlobal("ilToolbar", "ilToolbarGUI", "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"); self::initGlobal("ilLocator", "ilLocatorGUI", "./Services/Locator/classes/class.ilLocatorGUI.php"); self::initGlobal("ilTabs", "ilTabsGUI", "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"); if (ilContext::hasUser()) { // $ilMainMenu include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php'; $ilMainMenu = new ilMainMenuGUI("_top"); self::initGlobal("ilMainMenu", $ilMainMenu); unset($ilMainMenu); // :TODO: tableGUI related // set hits per page for all lists using table module $_GET['limit'] = (int) $ilUser->getPref('hits_per_page'); ilSession::set('tbl_limit', $_GET['limit']); // the next line makes it impossible to save the offset somehow in a session for // a specific table (I tried it for the user administration). // its not posssible to distinguish whether it has been set to page 1 (=offset = 0) // or not set at all (then we want the last offset, e.g. being used from a session var). // So I added the wrapping if statement. Seems to work (hopefully). // Alex April 14th 2006 if (isset($_GET['offset']) && $_GET['offset'] != "") { $_GET['offset'] = (int) $_GET['offset']; // old code } } else { // several code parts rely on ilObjUser being always included include_once "Services/User/classes/class.ilObjUser.php"; } }
/** * Show * * @access public * @param * */ public function show() { $this->tpl->addCss(ilUtil::getStyleSheetLocation('filesystem', 'delos.css', 'Services/Calendar')); }
/** * Delivers a PDF file from XHTML * * @param string $html The XHTML string * @access public */ public function deliverPDFfromHTML($content, $title = NULL) { $content = preg_replace("/href=\".*?\"/", "", $content); $printbody = new ilTemplate("tpl.il_as_tst_print_body.html", TRUE, TRUE, "Modules/Test"); $printbody->setVariable("TITLE", ilUtil::prepareFormOutput($this->getTitle())); $printbody->setVariable("ADM_CONTENT", $content); $printbody->setCurrentBlock("css_file"); $printbody->setVariable("CSS_FILE", $this->getTestStyleLocation("filesystem")); $printbody->parseCurrentBlock(); $printbody->setCurrentBlock("css_file"); $printbody->setVariable("CSS_FILE", ilUtil::getStyleSheetLocation("filesystem", "delos.css")); $printbody->parseCurrentBlock(); $printoutput = $printbody->get(); $html = str_replace("href=\"./", "href=\"" . ILIAS_HTTP_PATH . "/", $printoutput); $html = preg_replace("/<div id=\"dontprint\">.*?<\\/div>/ims", "", $html); if (extension_loaded("tidy")) { $config = array("indent" => false, "output-xml" => true, "numeric-entities" => true); $tidy = new tidy(); $tidy->parseString($html, $config, 'utf8'); $tidy->cleanRepair(); $html = tidy_get_output($tidy); $html = preg_replace("/^.*?(<html)/", "\\1", $html); } else { $html = str_replace(" ", " ", $html); $html = str_replace("⊗", "X", $html); } $html = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html); $this->deliverPDFfromFO($this->processPrintoutput2FO($html), $title); }
/** * Review tab to create a print of all questions without points and solutions * * Review tab to create a print of all questions without points and solutions * * @access public */ function reviewobject() { global $ilAccess, $ilias; if (!$ilAccess->checkAccess("write", "", $this->ref_id)) { // allow only write access ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true); $this->ctrl->redirect($this, "infoScreen"); } $this->getQuestionsSubTabs(); $template = new ilTemplate("tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE, "Modules/Test"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print"); global $ilUser; $print_date = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")); $max_points = 0; $counter = 1; foreach ($this->object->questions as $question) { $template->setCurrentBlock("question"); $question_gui = $this->object->createQuestionGUI("", $question); $template->setVariable("COUNTER_QUESTION", $counter . "."); $template->setVariable("QUESTION_TITLE", ilUtil::prepareFormOutput($question_gui->object->getTitle())); if ($question_gui->object->getMaximumPoints() == 1) { $template->setVariable("QUESTION_POINTS", $question_gui->object->getMaximumPoints() . " " . $this->lng->txt("point")); } else { $template->setVariable("QUESTION_POINTS", $question_gui->object->getMaximumPoints() . " " . $this->lng->txt("points")); } /** @var $question_gui assQuestionGUI */ //$result_output = $question_gui->getTestOutput('', NULL, FALSE, FALSE, FALSE); $result_output = $question_gui->getPreview(false); if (strlen($result_output) == 0) { $result_output = $question_gui->getPreview(FALSE); } $template->setVariable("SOLUTION_OUTPUT", $result_output); $template->parseCurrentBlock("question"); $counter++; $max_points += $question_gui->object->getMaximumPoints(); } $template->setVariable("TITLE", ilUtil::prepareFormOutput($this->object->getTitle())); $template->setVariable("PRINT_TEST", ilUtil::prepareFormOutput($this->lng->txt("review_view"))); $template->setVariable("TXT_PRINT_DATE", ilUtil::prepareFormOutput($this->lng->txt("date"))); $template->setVariable("VALUE_PRINT_DATE", ilUtil::prepareFormOutput(strftime("%c", $print_date))); $template->setVariable("TXT_MAXIMUM_POINTS", ilUtil::prepareFormOutput($this->lng->txt("tst_maximum_points"))); $template->setVariable("VALUE_MAXIMUM_POINTS", ilUtil::prepareFormOutput($max_points)); if (array_key_exists("pdf", $_GET) && $_GET["pdf"] == 1) { //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle()); require_once 'class.ilTestPDFGenerator.php'; $content = $template->get(); ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle()); } else { $this->ctrl->setParameter($this, "pdf", "1"); $template->setCurrentBlock("pdf_export"); $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "review")); $this->ctrl->setParameter($this, "pdf", ""); $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export")); $template->parseCurrentBlock(); $template->setCurrentBlock("navigation_buttons"); $template->setVariable("BUTTON_PRINT", $this->lng->txt("print")); $template->parseCurrentBlock(); $this->tpl->setVariable("PRINT_CONTENT", $template->get()); } }
/** * Initializes the preview and loads the needed javascripts and styles. */ private static function initPreview() { if (self::$initialized) { return; } global $tpl, $lng, $ilCtrl; // jquery include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); // load qtip include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"; ilTooltipGUI::initLibrary(); // needed scripts & styles $tpl->addJavaScript("./Services/Preview/js/jquery.mousewheel.js"); $tpl->addJavaScript("./Services/Preview/js/ilPreview.js"); $tpl->addCss(ilUtil::getStyleSheetLocation("filesystem", "preview.css", "Services/Preview")); // create loading template $tmpl = new ilTemplate("tpl.preview.html", true, true, "Services/Preview"); $tmpl->setCurrentBlock("no_preview"); $tmpl->setVariable("TXT_NO_PREVIEW", "%%0%%"); $tmpl->parseCurrentBlock(); $initialHtml = str_replace(array("\r\n", "\r"), "\n", $tmpl->get()); $lines = explode("\n", $initialHtml); $new_lines = array(); foreach ($lines as $i => $line) { if (!empty($line)) { $new_lines[] = trim($line); } } $initialHtml = implode($new_lines); // add default texts and values include_once "./Services/JSON/classes/class.ilJsonUtil.php"; $tpl->addOnLoadCode("il.Preview.texts.preview = \"" . self::jsonSafeString($lng->txt("preview")) . "\";"); $tpl->addOnLoadCode("il.Preview.texts.showPreview = \"" . self::jsonSafeString($lng->txt("preview_show")) . "\";"); $tpl->addOnLoadCode("il.Preview.texts.close = \"" . self::jsonSafeString($lng->txt("close")) . "\";"); $tpl->addOnLoadCode("il.Preview.previewSize = " . ilPreviewSettings::getImageSize() . ";"); $tpl->addOnLoadCode("il.Preview.initialHtml = " . ilJsonUtil::encode($initialHtml) . ";"); $tpl->addOnLoadCode("il.Preview.highlightClass = \"ilContainerListItemOuterHighlight\";"); $tpl->addOnLoadCode("il.Preview.init();"); self::$initialized = true; }
public function specialPage() { global $lng; $specialpages = array("_COURSECOMPLETE_" => "seq_coursecomplete", "_ENDSESSION_" => "seq_endsession", "_SEQBLOCKED_" => "seq_blocked", "_NOTHING_" => "seq_nothing", "_ERROR_" => "seq_error", "_DEADLOCK_" => "seq_deadlock", "_INVALIDNAVREQ_" => "seq_invalidnavreq", "_SEQABANDON_" => "seq_abandon", "_SEQABANDONALL_" => "seq_abandonall", "_TOC_" => "seq_toc"); $this->tpl = new ilTemplate("tpl.scorm2004.specialpages.html", false, false, "Modules/Scorm2004"); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setVariable('TXT_SPECIALPAGE', $lng->txt($specialpages[$this->page])); if ($this->page != "_TOC_" && $this->page != "_SEQABANDON_" && $this->page != "_SEQABANDONALL_") { $this->tpl->setVariable('CLOSE_WINDOW', $lng->txt('seq_close')); } else { $this->tpl->setVariable('CLOSE_WINDOW', ""); } $this->tpl->show("DEFAULT", false); }
/** * output explorer tree */ function explorer() { global $ilUser, $ilias, $ilCtrl; switch ($this->object->getType()) { case "lm": $gui_class = "ilobjlearningmodulegui"; break; case "dlb": $gui_class = "ilobjdlbookgui"; break; } $ilCtrl->setParameterByClass($gui_class, "active_node", $_GET["active_node"]); $this->tpl = new ilTemplate("tpl.main.html", true, true); // get learning module object //$this->lm_obj =& new ilObjLearningModule($this->ref_id, true); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); //$this->tpl = new ilTemplate("tpl.explorer.html", false, false); $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false)); require_once "./Modules/LearningModule/classes/class.ilLMEditorExplorer.php"; $exp = new ilLMEditorExplorer($this->ctrl->getLinkTarget($this, "view"), $this->object, $gui_class); $exp->setTargetGet("obj_id"); $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer")); if ($_GET["lmmovecopy"] == "1") { $this->proceedDragDrop(); } if ($_GET["lmexpand"] == "") { $mtree = new ilTree($this->object->getId()); $mtree->setTableNames('lm_tree', 'lm_data'); $mtree->setTreeTablePK("lm_id"); $expanded = $mtree->readRootId(); } else { $expanded = $_GET["lmexpand"]; } if ($_GET["active_node"] != "") { $path = $this->lm_tree->getPathId($_GET["active_node"]); $exp->setForceOpenPath($path); $exp->highlightNode($_GET["active_node"]); } $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); // asynchronous output if ($ilCtrl->isAsynch()) { echo $output; exit; } include_once "./Services/COPage/classes/class.ilPageEditorGUI.php"; /*if (ilPageEditorGUI::_doJSEditing()) { //$this->tpl->touchBlock("includejavascript"); $IDS = ""; for ($i=0;$i<count($exp->iconList);$i++) { if ($i>0) $IDS .= ","; $IDS .= "'".$exp->iconList[$i]."'"; } $this->tpl->setVariable("ICONIDS",$IDS); //$this->ctrl->setParameter($this, "lmovecopy", 1); $this->tpl->setVariable("TESTPFAD",$this->ctrl->getLinkTarget($this, "explorer")."&lmmovecopy=1"); //$this->tpl->setVariable("POPUPLINK",$this->ctrl->getLinkTarget($this, "popup")."&ptype=movecopytreenode"); $this->tpl->setVariable("POPUPLINK",$this->ctrl->getLinkTarget($this, "popup")."&ptype=movecopytreenode"); }*/ $this->tpl->setCurrentBlock("content"); $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_chap_and_pages")); $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh")); $this->tpl->setVariable("EXPLORER", $output); $this->ctrl->setParameter($this, "lmexpand", $_GET["lmexpand"]); $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "explorer")); $this->tpl->parseCurrentBlock(); $this->tpl->show(false); exit; }
/** * render list in fullscreen mode * * @return string */ public function getFullscreenHTML() { $tpl = new ilTemplate('tpl.main.html', true, true); $tpl->setBodyClass("ilBodyPrint"); // load style sheet depending on user's settings $location_stylesheet = ilUtil::getStyleSheetLocation(); $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet); $tpl->setVariable("BODY_ATTRIBUTES", 'onload="window.print()"'); $tpl->setVariable("CONTENT", $this->getHTML()); return $tpl->show(); }
/** * Handles all commmands of this class, centralizes permission checks * * @param string $cmd Given Command to Execute * * @return boolean true */ function performCommand($cmd) { global $ilTabs, $ilCtrl, $tpl, $ilNavigationHistory, $cmd, $rssPermission; $tpl->setDescription($this->object->getLongDescription()); $tpl->setAlertProperties($this->getAlertProperties()); $next_class = $ilCtrl->getNextClass($this); $this->pl_obj = new ilRoomSharingPlugin(); $this->pl_obj->includeClass("class.ilObjRoomSharing.php"); // Set pool id $this->pool_id = $this->object->getPoolID(); $cmd = $ilCtrl->getCmd(); $has_calendar = false; if ($cmd === 'edit' || $cmd === 'editSettings' || $cmd === 'updateSettings') { $ilTabs->setTabActive('settings'); // In case the edit button was clicked in the repository if ($cmd === 'edit') { $cmd = 'editSettings'; } $this->{$cmd}(); return true; } else { if ($cmd == 'showBooking' || $cmd == 'editBooking' || $cmd == 'saveEditBooking' || $cmd == 'cancelEdit') { $next_class = 'ilroomsharingshowandeditbookgui'; } else { if ($cmd === 'showSearch' || $cmd === 'showBookSearchResults' || $cmd === "showSearchResults") { $next_class = empty($next_class) ? 'ilroomsharingsearchgui' : $next_class; } else { if ($cmd === 'addRoom' || $cmd === 'editRoom') { $next_class = 'ilroomsharingroomgui'; } else { if ($cmd == 'showBookings') { $next_class = 'ilroomsharingappointmentsgui'; } } } } } // Extend list of last visited objects by this pool. $ilNavigationHistory->addItem($this->ref_id, "./goto.php?target=xrs_" . $this->ref_id, "xrs"); // Main switch for cmdClass. switch ($next_class) { // Attributes for rooms and bookings case ATTRC::ATTRS_GUI: $this->tabs_gui->setTabActive(ATTRC::ATTRS); $this->pl_obj->includeClass(ATTRC::ATTRS_GUI_PATH); $attributes_gui =& new ilRoomSharingAttributesGUI($this); $ret =& $this->ctrl->forwardCommand($attributes_gui); break; // Appointments // Appointments case 'ilroomsharingappointmentsgui': $this->tabs_gui->setTabActive('appointments'); $this->pl_obj->includeClass("appointments/class.ilRoomSharingAppointmentsGUI.php"); $object_gui =& new ilRoomSharingAppointmentsGUI($this); $ret =& $this->ctrl->forwardCommand($object_gui); $has_calendar = true; break; // Info // Info case 'ilinfoscreengui': $this->infoScreen(); break; // Search // Search case 'ilroomsharingsearchgui': $this->tabs_gui->setTabActive('search'); $this->pl_obj->includeClass("search/class.ilRoomSharingSearchGUI.php"); $object_gui =& new ilRoomSharingSearchGUI($this); $ret =& $this->ctrl->forwardCommand($object_gui); break; // Rooms, Called for a list of rooms // Rooms, Called for a list of rooms case 'ilroomsharingroomsgui': $this->tabs_gui->setTabActive('rooms'); $this->pl_obj->includeClass("rooms/class.ilRoomSharingRoomsGUI.php"); $object_gui =& new ilRoomSharingRoomsGUI($this); $ret =& $this->ctrl->forwardCommand($object_gui); $has_calendar = true; break; // Room, Called for display a single room // Room, Called for display a single room case 'ilroomsharingroomgui': $this->tabs_gui->setTabActive('rooms'); $room_id = (int) $_GET['room_id']; $this->pl_obj->includeClass("rooms/detail/class.ilRoomSharingRoomGUI.php"); $object_gui =& new ilRoomSharingRoomGUI($this, $room_id); $ret =& $this->ctrl->forwardCommand($object_gui); break; // CalendarWeek, Called for display a weekly view for a single room // CalendarWeek, Called for display a weekly view for a single room case 'ilroomsharingcalendarweekgui': $this->tabs_gui->setTabActive('rooms'); $room_id = (int) $_GET['room_id']; $this->pl_obj->includeClass("rooms/detail/calendar/class.ilRoomSharingCalendarWeekGUI.php"); $object_gui =& new ilRoomSharingCalendarWeekGUI($this->seed, $this->pool_id, $room_id); $ret =& $this->ctrl->forwardCommand($object_gui); break; // Book // Book case 'ilroomsharingbookgui': $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt($_SESSION['last_cmd'] != "showRoom" ? "rep_robj_xrs_search_back" : "rep_robj_xrs_room_back"), $this->ctrl->getLinkTarget($this, $_SESSION['last_cmd'])); $this->pl_obj->includeClass("booking/class.ilRoomSharingBookGUI.php"); $book_gui =& new ilRoomSharingBookGUI($this); $ret =& $this->ctrl->forwardCommand($book_gui); break; // Show and edit booking // Show and edit booking case 'ilroomsharingshowandeditbookgui': $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt("rep_robj_xrs_booking_back"), $ilCtrl->getLinkTarget($this, "showBookings")); $this->pl_obj->includeClass("booking/class.ilRoomSharingShowAndEditBookGUI.php"); $booking_id = (int) $_GET['booking_id']; $room_id = (int) $_GET['room_id']; if ($cmd == 'editBooking' || $cmd == 'saveEditBooking') { $mode = 'edit'; } else { $mode = 'show'; } $showAndEditBook_gui =& new ilRoomSharingShowAndEditBookGUI($this, $booking_id, $room_id, $mode); $ret =& $this->ctrl->forwardCommand($showAndEditBook_gui); $has_calendar = true; break; // Floorplans // Floorplans case 'ilroomsharingfloorplansgui': $this->tabs_gui->setTabActive('floor_plans'); $this->pl_obj->includeClass("floorplans/class.ilRoomSharingFloorPlansGUI.php"); $schedule_gui =& new ilRoomSharingFloorPlansGUI($this); $ret =& $this->ctrl->forwardCommand($schedule_gui); break; // daVinci import // daVinci import case 'ilroomsharingdavinciimportgui': if ($this->permission->checkPrivilege(PRIVC::ACCESS_IMPORT)) { $this->tabs_gui->setTabActive('daVinci_import'); $this->pl_obj->includeClass("import/class.ilRoomSharingDaVinciImportGUI.php"); $import_gui =& new ilRoomSharingDaVinciImportGUI($this); $ret =& $this->ctrl->forwardCommand($import_gui); break; } // Permissions // Permissions case 'ilpermissiongui': $this->tabs_gui->setTabActive('perm_settings'); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; // Privileges // Privileges case 'ilroomsharingprivilegesgui': if ($this->permission->checkPrivilege(PRIVC::ACCESS_PRIVILEGES)) { $this->tabs_gui->setTabActive('privileges'); $this->pl_obj->includeClass("privileges/class.ilRoomSharingPrivilegesGUI.php"); $privileges_gui =& new ilRoomSharingPrivilegesGUI($this); $ret =& $this->ctrl->forwardCommand($privileges_gui); } else { ilUtil::sendFailure($this->txt("no_permission")); } break; // Userprofile GUI // Userprofile GUI case 'ilpublicuserprofilegui': $ilTabs->clearTargets(); $profile = new ilPublicUserProfileGUI((int) $_GET["user_id"]); $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log')); $ret = $this->ctrl->forwardCommand($profile); $tpl->setContent($ret); break; // Standard dispatcher GUI // Standard dispatcher GUI case "ilcommonactiondispatchergui": $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; // Copy GUI. Not supported yet. // Copy GUI. Not supported yet. case "ilobjectcopygui": include_once "./Services/Object/classes/class.ilObjectCopyGUI.php"; $cp = new ilObjectCopyGUI($this); $cp->setType("roomsharing"); $this->ctrl->forwardCommand($cp); break; // Various CalendarGUIs // Various CalendarGUIs case "ilcalendardaygui": $this->setActiveTabRegardingPrivilege(); $day = new ilCalendarDayGUI(new ilDate($_GET["seed"], IL_CAL_DATE)); $this->ctrl->forwardCommand($day); break; case "ilcalendarmonthgui": $this->setActiveTabRegardingPrivilege(); $month = new ilCalendarMonthGUI(new ilDate($_GET["seed"], IL_CAL_DATE)); $this->ctrl->forwardCommand($month); break; case "ilcalendarweekgui": $this->setActiveTabRegardingPrivilege(); $week = new ilCalendarweekGUI(new ilDate($_GET["seed"], IL_CAL_DATE)); $this->ctrl->forwardCommand($week); break; case "ilcalendarblockgui": $this->setActiveTabRegardingPrivilege(); $this->ctrl->forwardCommand($this->cal); break; // Standard cmd handling if cmd is none of the above. In that case, the next page is // appointments. // Standard cmd handling if cmd is none of the above. In that case, the next page is // appointments. default: $cmd = $ilCtrl->getCmd('render'); $this->{$cmd}(); $has_calendar = true; break; } // Action menu (top right corner of the module) $this->addHeaderAction(); if (ilCalendarSettings::_getInstance()->isEnabled() && $has_calendar) { //adds Minicalendar to the right if active $tpl->setRightContent($this->cal->getHTML()); } $tpl->addCss(ilUtil::getStyleSheetLocation('filesystem', 'delos.css', 'Services/Calendar')); return true; }
/** * show media object */ function media($a_mode = "media") { $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage"); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); //$int_links = $page_object->getInternalLinks(); $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]); // later //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets()); $link_xlm = ""; require_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php"; $media_obj =& new ilObjMediaObject($_GET["mob_id"]); $xml = "<dummy>"; // todo: we get always the first alias now (problem if mob is used multiple // times in page) $xml .= $media_obj->getXML(IL_MODE_ALIAS); $xml .= $media_obj->getXML(IL_MODE_OUTPUT); $xml .= $link_xml; $xml .= "</dummy>"; $xsl = file_get_contents("./Services/COPage/xsl/page.xsl"); $args = array('/_xml' => $xml, '/_xsl' => $xsl); $xh = xslt_create(); if (!$this->offlineMode()) { $enlarge_path = ilUtil::getImagePath("enlarge.png", false, "output"); $wb_path = ilUtil::getWebspaceDir("output") . "/"; } else { $enlarge_path = "images/enlarge.png"; $wb_path = ""; } $mode = $a_mode; $this->ctrl->setParameter($this, "obj_type", "MediaObject"); $fullscreen_link = $this->getLink($_GET["ref_id"], "fullscreen"); $this->ctrl->clearParameters($this); $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path, 'link_params' => "ref_id=" . $_GET["ref_id"], 'fullscreen_link' => $fullscreen_link, 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path); $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params); echo xslt_error($xh); xslt_free($xh); // unmask user html $this->tpl->setVariable("MEDIA_CONTENT", $output); $this->tpl->parseCurrentBlock(); if ($this->offlineMode()) { $html = $this->tpl->get(); return $html; } }