/** * 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); }
/** * 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(); }
/** * Show page * * @param * @return */ function showPage() { global $tpl; $tpl = new ilTemplate("tpl.main.html", true, true); include_once "./Services/Container/classes/class.ilContainerPage.php"; include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $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"); include_once "./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php"; $page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; //$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId( // $this->object->getStyleSheetId(), $this->object->getType())); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $ret = $page_gui->showPage(true); $tpl->setBodyClass("ilMediaPoolPagePreviewBody"); $tpl->setVariable("CONTENT", $ret); //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>"; //$ret =& $page_gui->executeCommand(); $tpl->show(); exit; }