/** * Render COPage * * @see ilContainerGUI * @return string */ protected function getPageHTML() { global $tpl, $ilSetting, $ilUser; if (!$ilSetting->get("enable_cat_page_edit")) { return; } $page_id = $this->start_object->getObjId(); // if page does not exist, return nothing include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) { return; } include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); include_once "./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $page_gui = new ilContainerStartObjectsPageGUI($page_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); return $page_gui->showPage(); }
/** * Checks whether page exists and is not empty (may return true on some empty pages) * * @param string $a_parent_type parent type * @param int $a_id page id * @param string $a_lang language code ("-" for unknown / not set) */ static function _existsAndNotEmpty($a_parent_type, $a_id, $a_lang = "-") { global $ilDB; include_once "./Services/COPage/classes/class.ilPageUtil.php"; return ilPageUtil::_existsAndNotEmpty($a_parent_type, $a_id, $a_lang); }
/** * render objective * * @access protected * @param int objective id * @param bool co page status * @param ilAccordionGUI $a_accordion * @param array $a_lo_result * @return string html */ protected function renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion = null, array $a_lo_result = null) { global $ilUser, $lng; include_once './Modules/Course/classes/class.ilCourseObjective.php'; $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id); include_once './Services/Container/classes/class.ilContainerSorting.php'; include_once './Services/Object/classes/class.ilObjectActivation.php'; $items = ilObjectActivation::getItemsByObjective($a_objective_id); // sorting is handled by ilCourseObjectiveMaterials // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items); include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php'; $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id); // #13381 - map material assignment to position $sort_map = array(); foreach ($objectives_lm_obj->getMaterials() as $item) { $sort_map[$item["lm_ass_id"]] = $item["position"]; } $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel(); $is_order = $this->getContainerGUI()->isActiveOrdering(); $sort_content = array(); foreach ($items as $item) { if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) { continue; } $item_list_gui2 = $this->getItemGUI($item); $item_list_gui2->enableIcon(true); if ($is_order || $a_accordion) { $item_list_gui2->enableCommands(true, true); $item_list_gui2->enableProperties(false); } $chapters = $objectives_lm_obj->getChapters(); if (count($chapters)) { $has_sections = false; foreach ($chapters as $chapter) { if ($chapter['ref_id'] != $item['child']) { continue; } $has_sections = true; include_once './Modules/LearningModule/classes/class.ilLMObject.php'; $title = $item['title'] . " › " . ilLMObject::_lookupTitle($chapter['obj_id']) . " (" . $lng->txt('obj_' . $chapter['type']) . ")"; $item_list_gui2->setDefaultCommandParameters(array("obj_id" => $chapter['obj_id'], "focus_id" => $chapter['obj_id'], "focus_return" => $this->container_obj->getRefId())); if ($is_order) { $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]", sprintf('%d', $chapter['position'] * 10)); } $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $title, $item['description']); // #13381 - use materials order $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT) . "_" . strtolower($title) . "_" . $chapter['lm_ass_id']; $sort_content[$sort_key] = $sub_item_html; } } $this->rendered_items[$item['child']] = true; if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) { if ($is_order) { $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]", sprintf('%d', $sort_map[$lm_ass_id] * 10)); } $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']); // #13381 - use materials order $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . "_" . strtolower($item['title']) . "_" . $lm_ass_id; $sort_content[$sort_key] = $sub_item_html; } } if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) { $this->objective_list_gui->enableCommands(false); } else { $this->objective_list_gui->enableCommands(true); } if ($is_order) { $this->objective_list_gui->setPositionInputField("[lobj][" . $a_objective_id . "][0]", $objective->__getPosition() * 10); } ksort($sort_content); if (!$a_accordion) { foreach ($sort_content as $sub_item_html) { $this->objective_list_gui->addSubItemHTML($sub_item_html); } return $this->objective_list_gui->getListItemHTML(0, $a_objective_id, $objective->getTitle(), $objective->getDescription(), $is_manage || $is_order); } else { $acc_content = $sort_content; $initial_shown = false; if ($this->getSettings()->hasSeparateInitialTests() and !$a_lo_result['initial_status']) { $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL), $a_objective_id, true, false, $a_lo_result); $initial_shown = TRUE; } elseif ($this->getSettings()->hasSeparateQualifiedTests()) { $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED), $a_objective_id, false, false, $a_lo_result); } /* if($this->loc_settings->getInitialTest() && $this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL && !$a_lo_result["initial_status"]) { $acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result); $initial_shown = true; } if(!$initial_shown && $this->loc_settings->getQualifiedTest() && $this->loc_settings->isQualifiedTestPerObjectiveVisible()) { $acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result); } */ $co_page = null; include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) { $a_has_lo_page = true; include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php'; $page_gui = new ilLOPageGUI($objective->getObjectiveId()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>"; } // patch optes start $a_accordion->addItem($this->buildAccordionTitle($objective, $a_lo_result), $co_page . $this->buildAccordionContent($acc_content), isset($_GET["oobj"]) && (int) $_GET["oobj"] == $objective->getObjectiveId()); // patch optes end } }
/** * Get HTML of ILIAS login page editor * @return string html */ protected function getLoginPageEditorHTML() { global $lng, $tpl; include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php'; $lpe = ilAuthLoginPageEditorSettings::getInstance(); $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey()); if (!$active_lang) { return ''; } // if page does not exist, return nothing include_once './Services/COPage/classes/class.ilPageUtil.php'; if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) { return ''; } include_once './Services/Authentication/classes/class.ilLoginPage.php'; include_once './Services/Authentication/classes/class.ilLoginPageGUI.php'; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); // get page object $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang)); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(0, 'auth'); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $ret = $page_gui->showPage(); return $ret; }
/** * Get container page HTML */ function getContainerPageHTML() { global $ilSetting, $ilUser; if (!$ilSetting->get("enable_cat_page_edit")) { return; } // old page editor content $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { include_once "Services/XHTMLPage/classes/class.ilXHTMLPage.php"; $xpage = new ilXHTMLPage($xpage_id); return $xpage->getContent(); } // page object // if page does not exist, return nothing include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("cont", $this->object->getId())) { return ""; } include_once "./Services/Container/classes/class.ilContainerPage.php"; include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())); $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); // get page object include_once "./Services/Object/classes/class.ilObjectTranslation.php"; $ot = ilObjectTranslation::getInstance($this->object->getId()); $lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont"); $page_gui = new ilContainerPageGUI($this->object->getId(), 0, $lang); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), $this->object->getType())); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $ret = $page_gui->showPage(); //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>"; //$ret =& $page_gui->executeCommand(); return $ret; }
/** * Show page * * @param * @return */ function showPage() { global $lng; $page_id = (int) $_GET["help_page"]; $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help"); include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $h_tpl->setCurrentBlock("backlink"); $h_tpl->setVariable("TXT_BACK", $lng->txt("back")); $h_tpl->setVariable("ONCLICK_BACK", "return il.Help.listHelp(event, true);"); $h_tpl->parseCurrentBlock(); $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " . ilLMObject::_lookupTitle($page_id)); include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) { exit; } include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; // get page object include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php"; $page_gui =& new ilPageObjectGUI("lm", $page_id); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $page_gui->setEnabledFileLists(false); $page_gui->setEnabledPCTabs(false); $page_gui->setFileDownloadLink("."); $page_gui->setFullscreenLink("."); $page_gui->setSourcecodeDownloadScript("."); $page_gui->setRawPageContent(true); $page_gui->setEnabledMaps(false); $ret = $page_gui->showPage(); $h_tpl->setVariable("CONTENT", $ret); $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png"))); ilSession::set("help_pg", $page_id); $page = $h_tpl->get(); // replace style classes //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page); echo $page; exit; }
/** * Get HTML of ILIAS login page editor * @return string html */ protected function getLoginPageEditorHTML() { global $lng, $tpl; include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php'; $lpe = ilAuthLoginPageEditorSettings::getInstance(); $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey()); if (!$active_lang) { return ''; } // if page does not exist, return nothing include_once './Services/COPage/classes/class.ilPageUtil.php'; if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) { return ''; } include_once './Services/COPage/classes/class.ilPageObject.php'; include_once './Services/COPage/classes/class.ilPageObjectGUI.php'; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); // get page object $page_gui = new ilPageObjectGUI('auth', ilLanguage::lookupId($active_lang)); /* include_once("./Services/Style/classes/class.ilObjStyleSheet.php"); $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId( $this->object->getStyleSheetId(), $this->object->getType())); */ include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(0, 'auth'); $page_gui->setIntLinkHelpDefault("RepositoryItem", $active_lang); //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen")); //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo // $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, "")); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $page_gui->setEnabledRepositoryObjects(true); $page_gui->setEnabledLoginPage(true); $page_gui->setEnabledFileLists(false); $page_gui->setEnabledPCTabs(false); $page_gui->setEnabledMaps(true); $ret = $page_gui->showPage(); return $ret; }
/** * Show page * * @param * @return */ function showPage() { global $lng; $page_id = (int) $_GET["help_page"]; $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help"); include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $h_tpl->setCurrentBlock("backlink"); $h_tpl->setVariable("TXT_BACK", $lng->txt("back")); $h_tpl->setVariable("ONCLICK_BACK", "return il.Help.listHelp(event, true);"); $h_tpl->parseCurrentBlock(); $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " . ilLMObject::_lookupTitle($page_id)); include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) { exit; } include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; // get page object include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php"; include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php"; $page_gui = new ilLMPageGUI($page_id); $cfg = $page_gui->getPageConfig(); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $page_gui->setRawPageContent(true); $cfg->setEnablePCType("Map", false); $cfg->setEnablePCType("Tabs", false); $cfg->setEnablePCType("FileList", false); $page_gui->getPageObject()->buildDom(); $int_links = $page_gui->getPageObject()->getInternalLinks(); $link_xml = $this->getLinkXML($int_links); $link_xml .= $this->getLinkTargetsXML(); //echo htmlentities($link_xml); $page_gui->setLinkXML($link_xml); $ret = $page_gui->showPage(); $h_tpl->setVariable("CONTENT", $ret); $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png"))); ilSession::set("help_pg", $page_id); $page = $h_tpl->get(); // replace style classes //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page); echo $page; exit; }