本文整理匯總了PHP中ilTemplate::addBlockFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate::addBlockFile方法的具體用法?PHP ilTemplate::addBlockFile怎麽用?PHP ilTemplate::addBlockFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilTemplate
的用法示例。
在下文中一共展示了ilTemplate::addBlockFile方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: outputAdjustQuestionForm
/**
* @param $form
*/
protected function outputAdjustQuestionForm($form)
{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_questions.html", "Modules/Test");
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable('QUESTIONBROWSER', $form->getHTML());
$this->tpl->parseCurrentBlock();
}
示例2: updateRoleAssignmentRule
protected function updateRoleAssignmentRule()
{
global $ilAccess, $ilErr;
if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->roleAssignment();
return false;
}
$this->initFormRoleAssignment();
if (!$this->form->checkInput() or $err = $this->checkInput((int) $_REQUEST['rule_id'])) {
if ($err) {
ilUtil::sendFailure($this->lng->txt($err));
}
$this->tabs_gui->setSubTabActive('shib_role_assignment');
$this->form->setValuesByPost();
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shib_role_assignment.html', 'Services/AuthShibboleth');
$this->tpl->setVariable('NEW_RULE_TABLE', $this->form->getHTML());
return true;
}
$this->showLocalRoleSelection('update');
$this->rule->update();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->roleAssignment();
return true;
}
示例3: exportHTMLMOB
/**
* Export media object to html
*/
function exportHTMLMOB($a_mob_id, &$a_linked_mobs)
{
global $tpl;
$source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
if (@is_dir($source_dir)) {
ilUtil::makeDir($this->mobs_dir . "/mm_" . $a_mob_id);
ilUtil::rCopy($source_dir, $this->mobs_dir . "/mm_" . $a_mob_id);
}
// fullscreen
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
$mob_obj = new ilObjMediaObject($a_mob_id);
if ($mob_obj->hasFullscreenItem()) {
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$file = $this->exp_dir . "/fullscreen_" . $a_mob_id . ".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);
}
$linked_mobs = $mob_obj->getLinkedMediaObjects();
$a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
}
示例4: getOutput
/**
* 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;
}
示例5: exportPageHTML
/**
* export page html
*/
function exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame = "", $a_exp_id_map = array())
{
global $tpl, $ilBench;
//echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
// template workaround: reset of template
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_id"] = $a_lm_page_id;
$_GET["frame"] = $a_frame;
if ($a_frame == "") {
//if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id])) {
$file = $a_target_dir . "/lm_pg_" . $a_exp_id_map[$a_lm_page_id] . ".html";
} else {
$file = $a_target_dir . "/lm_pg_" . $a_lm_page_id . ".html";
}
} else {
if ($a_frame != "toc") {
$file = $a_target_dir . "/frame_" . $a_lm_page_id . "_" . $a_frame . ".html";
} else {
$file = $a_target_dir . "/frame_" . $a_frame . ".html";
}
}
// return if file is already existing
if (@is_file($file)) {
return;
}
$ilBench->start("ExportHTML", "layout");
$ilBench->start("ExportHTML", "layout_" . $a_frame);
$content =& $a_lm_gui->layout("main.xml", false);
$ilBench->stop("ExportHTML", "layout_" . $a_frame);
$ilBench->stop("ExportHTML", "layout");
// 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 />");
}
// set file permissions
chmod($file, 0770);
// write xml data into the file
fwrite($fp, $content);
// close file
fclose($fp);
if ($this->first_page_id == $a_lm_page_id && $a_frame == "") {
copy($file, $a_target_dir . "/index.html");
}
// write frames of frameset
$ilBench->start("ExportHTML", "getCurrentFrameSet");
$frameset = $a_lm_gui->getCurrentFrameSet();
$ilBench->stop("ExportHTML", "getCurrentFrameSet");
foreach ($frameset as $frame) {
$this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
}
}
示例6: exportHTMLMOB
/**
* export media object to html
*/
function exportHTMLMOB($a_target_dir, &$a_glo_gui, $a_mob_id)
{
global $tpl;
$mob_dir = $a_target_dir . "/mobs";
$source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
if (@is_dir($source_dir)) {
ilUtil::makeDir($mob_dir . "/mm_" . $a_mob_id);
ilUtil::rCopy($source_dir, $mob_dir . "/mm_" . $a_mob_id);
}
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_type"] = "MediaObject";
$_GET["mob_id"] = $a_mob_id;
$_GET["cmd"] = "";
$content =& $a_glo_gui->media();
$file = $a_target_dir . "/media_" . $a_mob_id . ".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);
// fullscreen
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
$mob_obj = new ilObjMediaObject($a_mob_id);
if ($mob_obj->hasFullscreenItem()) {
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["mob_id"] = $a_mob_id;
$_GET["cmd"] = "fullscreen";
$content = $a_glo_gui->fullscreen();
$file = $a_target_dir . "/fullscreen_" . $a_mob_id . ".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);
}
}
示例7: showClientList
/**
* show client list
*/
function showClientList()
{
global $tpl, $ilIliasIniFile, $ilCtrl;
//echo "1";
if (!$ilIliasIniFile->readVariable("clients", "list")) {
$this->processIndexPHP();
return;
}
//echo "2";
$tpl = new ilTemplate("tpl.main.html", true, true);
// to do: get standard style
$tpl->setVariable("PAGETITLE", "Client List");
$tpl->setVariable("LOCATION_STYLESHEET", "./templates/default/delos.css");
// load client list template
$tpl->addBlockfile("CONTENT", "content", "tpl.startup_screen.html", "Services/Init");
$tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
$tpl->addBlockFile("STARTUP_CONTENT", "startup_content", "tpl.client_list.html", "Services/Init");
// load template for table
$tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
// load template for table content data
$tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
// load table content data
require_once "setup/classes/class.ilClientList.php";
require_once "setup/classes/class.ilClient.php";
require_once "setup/classes/class.ilDBConnections.php";
require_once "./Services/Table/classes/class.ilTableGUI.php";
$this->db_connections = new ilDBConnections();
$clientlist = new ilClientList($this->db_connections);
$list = $clientlist->getClients();
if (count($list) == 0) {
header("Location: ./setup/setup.php");
exit;
}
$hasPublicSection = false;
foreach ($list as $key => $client) {
$client->setDSN();
if ($client->checkDatabaseExists(true) and $client->ini->readVariable("client", "access") and $client->getSetting("setup_ok")) {
$this->ctrl->setParameter($this, "client_id", $key);
$tmp = array();
$tmp[] = $client->getName();
$tmp[] = "<a href=\"" . "login.php?cmd=force_login&client_id=" . urlencode($key) . "\">Login page</a>";
if ($client->getSetting('pub_section')) {
$hasPublicSection = true;
$tmp[] = "<a href=\"" . "ilias.php?baseClass=ilRepositoryGUI&client_id=" . urlencode($key) . "\">Start page</a>";
} else {
$tmp[] = '';
}
$data[] = $tmp;
}
}
// create table
$tbl = new ilTableGUI();
// title & header columns
if ($hasPublicSection) {
$tbl->setTitle("Available Clients");
$tbl->setHeaderNames(array("Installation Name", "Login", "Public Access"));
$tbl->setHeaderVars(array("name", "index", "login"));
$tbl->setColumnWidth(array("50%", "25%", "25%"));
} else {
$tbl->setTitle("Available Clients");
$tbl->setHeaderNames(array("Installation Name", "Login", ''));
$tbl->setHeaderVars(array("name", "login", ''));
$tbl->setColumnWidth(array("70%", "25%", '1px'));
}
// control
$tbl->setOrderColumn($_GET["sort_by"], "name");
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
// content
$tbl->setData($data);
// footer
$tbl->setFooter("tblfooter");
// styles
$tbl->setStyle("table", "std");
$tbl->disable("icon");
$tbl->disable("numinfo");
$tbl->disable("sort");
// render table
$tbl->render();
$tpl->show("DEFAULT", true, true);
}