本文整理匯總了PHP中ilTemplate::setBodyClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate::setBodyClass方法的具體用法?PHP ilTemplate::setBodyClass怎麽用?PHP ilTemplate::setBodyClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilTemplate
的用法示例。
在下文中一共展示了ilTemplate::setBodyClass方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ilTemplate
/**
* 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);
}
示例2: getFullscreenHTML
/**
* 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();
}
示例3: showPage
/**
* 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;
}