本文整理匯總了PHP中ilTemplate::blockExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate::blockExists方法的具體用法?PHP ilTemplate::blockExists怎麽用?PHP ilTemplate::blockExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilTemplate
的用法示例。
在下文中一共展示了ilTemplate::blockExists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addILIASFooter
/**
* add ILIAS footer
*/
function addILIASFooter()
{
global $ilAuth;
if (!$this->getAddFooter()) {
return;
}
global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
$ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
$ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
$link_items = array();
// imprint
include_once "Services/Imprint/classes/class.ilImprint.php";
if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
include_once "Services/Link/classes/class.ilLink.php";
$link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
}
$link_items["mailto:" . ilUtil::prepareFormOutput($ilSetting->get("feedback_recipient"))] = array($lng->txt("contact_sysadmin"), false);
if (DEVMODE && version_compare(PHP_VERSION, '5', '>=')) {
$link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
$link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
}
// output translation link (extended language maintenance)
if ($ilSetting->get("lang_ext_maintenance") == "1") {
include_once "Services/Language/classes/class.ilObjLanguageAccess.php";
if (ilObjLanguageAccess::_checkTranslate() and !ilObjLanguageAccess::_isPageTranslation()) {
ilObjLanguageAccess::_saveUsages();
$link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
}
}
$cnt = 0;
foreach ($link_items as $url => $caption) {
$cnt++;
if ($caption[1]) {
$ftpl->touchBlock("blank");
}
if ($cnt < sizeof($link_items)) {
$ftpl->touchBlock("item_separator");
}
$ftpl->setCurrentBlock("items");
$ftpl->setVariable("URL_ITEM", $url);
$ftpl->setVariable("TXT_ITEM", $caption[0]);
$ftpl->parseCurrentBlock();
}
if (DEVMODE) {
// execution time
$t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
$t2 = explode(" ", microtime());
$diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
$mem_usage = array();
if (function_exists("memory_get_usage")) {
$mem_usage[] = "Memory Usage: " . memory_get_usage() . " Bytes";
}
if (function_exists("xdebug_peak_memory_usage")) {
$mem_usage[] = "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
}
$mem_usage[] = round($diff, 4) . " Seconds";
if (sizeof($mem_usage)) {
$ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
}
if (is_object($ilAuth) && isset($_SESSION[$ilAuth->_sessionName]) && isset($_SESSION[$ilAuth->_sessionName]["timestamp"])) {
$ftpl->setVariable("SESS_INFO", "<br />maxlifetime: " . ini_get("session.gc_maxlifetime") . " (" . ini_get("session.gc_maxlifetime") / 60 . "), id: " . session_id() . "<br />" . "timestamp: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["timestamp"]) . ", idle: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"]) . "<br />expire: " . ($exp = $ilClientIniFile->readVariable("session", "expire")) . " (" . $exp / 60 . "), session ends at: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"] + $exp));
}
if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
require_once "Services/XHTMLValidator/classes/class.ilValidatorAdapter.php";
$template2 = clone $this;
//echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
$ftpl->setCurrentBlock("xhtml_validation");
$ftpl->setVariable("VALIDATION", ilValidatorAdapter::validate($template2->get("DEFAULT", false, false, false, true), $_GET["do_dev_validate"]));
$ftpl->parseCurrentBlock();
}
// controller history
if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") && $ftpl->blockExists("call_history")) {
$hist = $ilCtrl->getCallHistory();
foreach ($hist as $entry) {
$ftpl->setCurrentBlock("c_entry");
$ftpl->setVariable("C_ENTRY", $entry["class"]);
if (is_object($ilDB)) {
$file = $ilCtrl->lookupClassPath($entry["class"]);
$add = $entry["mode"] . " - " . $entry["cmd"];
if ($file != "") {
$add .= " - " . $file;
}
$ftpl->setVariable("C_FILE", $add);
}
$ftpl->parseCurrentBlock();
}
$ftpl->setCurrentBlock("call_history");
$ftpl->parseCurrentBlock();
// debug hack
$debug = $ilCtrl->getDebug();
foreach ($debug as $d) {
$ftpl->setCurrentBlock("c_entry");
$ftpl->setVariable("C_ENTRY", $d);
$ftpl->parseCurrentBlock();
}
$ftpl->setCurrentBlock("call_history");
$ftpl->parseCurrentBlock();
//.........這裏部分代碼省略.........