本文整理匯總了PHP中ilTemplate類的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate類的具體用法?PHP ilTemplate怎麽用?PHP ilTemplate使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ilTemplate類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getMainContent
/**
* Get content HTML for main column.
*/
function getMainContent()
{
global $ilBench, $tree, $ilTabs, $ilAccess;
// see bug #7452
// $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
$tpl = new ilTemplate("tpl.container_page.html", true, true, "Services/Container");
// get all sub items
$ilBench->start("ilContainerGUI", "0100_getSubItems");
$this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
$ilBench->stop("ilContainerGUI", "0100_getSubItems");
// Show introduction, if repository is empty
// @todo: maybe we move this
if (count($this->items) == 0 && $this->getContainerObject()->getRefId() == ROOT_FOLDER_ID && $ilAccess->checkAccess("write", "", $this->getContainerObject()->getRefId())) {
$html = $this->getIntroduction();
$tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
} else {
$html = $this->renderItemList();
$tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
}
// @todo: Move this completely to GUI class?
/* $this->getContainerGUI()->adminCommands = $this->adminCommands;
$this->getContainerGUI()->showAdministrationPanel($tpl);
$this->getContainerGUI()->showPossibleSubObjects();
$this->getContainerGUI()->showPermanentLink($tpl);*/
$this->html = $tpl->get();
return $this->html;
}
示例2: getReport
/**
* Get assignment header for overview
*/
function getReport($a_data)
{
global $lng, $ilCrtl, $ilUser;
$tpl = new ilTemplate("tpl.eph_report_results.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus");
$tpl->setVariable("CONTENT", $a_data);
return $tpl->get();
}
示例3: show
function show()
{
global $lng, $tree;
$tpl = new ilTemplate("tpl.container_link_help.html", true, true, "Services/Container");
$type_ordering = array("cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres", "glo", "webr", "file", "exc", "tst", "svy", "mep", "qpl", "spl");
$childs = $tree->getChilds($_GET["ref_id"]);
foreach ($childs as $child) {
if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm"))) {
$cnt["lres"]++;
} else {
$cnt[$child["type"]]++;
}
}
$tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
foreach ($type_ordering as $type) {
$tpl->setCurrentBlock("row");
$tpl->setVariable("ROWCOL", "tblrow" . ($i++ % 2 + 1));
if ($type != "lres") {
$tpl->setVariable("TYPE", $lng->txt("objs_" . $type) . " (" . (int) $cnt[$type] . ")");
} else {
$tpl->setVariable("TYPE", $lng->txt("learning_resources") . " (" . (int) $cnt["lres"] . ")");
}
$tpl->setVariable("TXT_LINK", "[list-" . $type . "]");
$tpl->parseCurrentBlock();
}
$tpl->show();
exit;
}
示例4: getHtml
/**
* Returns template HTML.
*
* @global ilLanguage $lng
* @return string
*/
public function getHtml()
{
global $lng;
$tpl = new ilTemplate("tpl.chatroom_current_smiley_image.html", true, true, "Modules/Chatroom");
$tpl->setVariable("IMAGE_ALT", $lng->txt("chatroom_current_smiley_image"));
$tpl->setVariable("IMAGE_PATH", $this->value);
return $tpl->get();
}
示例5: getHtml
public function getHtml()
{
global $ilCtrl;
$tpl = new ilTemplate("tpl.dcl_tree.html", true, true, "Modules/DataCollection");
$tpl->setVariable("FIELD_ID", $this->getPostVar());
$tpl->setVariable("AJAX_LINK", $ilCtrl->getLinkTargetByClass("ildatacollectionrecordeditgui", "searchObjects"));
$tpl->setVariable("LOADER_PATH", ilUtil::getImagePath("loader.gif"));
return $this->title_input->getToolbarHTML() . "<br /><br />" . $this->search_input->getTableFilterHTML() . $this->hidden_input->getToolbarHTML() . " <a href='#' id='search_button_" . $this->getPostVar() . "'>Search</a>" . $tpl->get();
}
示例6: getHTML
/**
* Get HTML for calendar
*/
function getHTML()
{
global $lng;
$ftpl = new ilTemplate("tpl.calendar_block_frame.html", true, true, "Services/Calendar");
$tpl = new ilTemplate("tpl.calendar_block.html", true, true, "Services/Calendar");
$this->addMiniMonth($tpl);
$ftpl->setVariable("BLOCK_TITLE", $lng->txt("calendar"));
$ftpl->setVariable("CONTENT", $tpl->get());
return $ftpl->get();
}
示例7: formatHeader
/**
* overwritten method from base class
* @access public
* @param integer obj_id
* @param integer array options
* @return string
*/
function formatHeader($a_obj_id, $a_option)
{
global $lng, $ilias;
$tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
$tpl->setCurrentBlock("text");
$tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
$tpl->parseCurrentBlock();
//$tpl->setCurrentBlock("row");
//$tpl->parseCurrentBlock();
$this->output[] = $tpl->get();
}
示例8: getHTML
/**
* Get HTML for calendar
*/
function getHTML()
{
global $lng;
$ftpl = new ilTemplate("tpl.calendar_block_frame.html", true, true, "Services/Calendar");
$tpl = new ilTemplate("tpl.calendar_block.html", true, true, "Services/Calendar");
$this->addMiniMonth($tpl);
$ftpl->setVariable("IMG_BLOCK", ilUtil::getImagePath("icon_cals_s.png"));
$ftpl->setVariable("BLOCK_TITLE", $lng->txt("calendar"));
$ftpl->setVariable("CONTENT", $tpl->get());
$ftpl->setVariable("ALT_BLOCK", $lng->txt("icon") . " " . $lng->txt("calendar"));
return $ftpl->get();
}
示例9: getHtml
/**
* @return string
*/
public function getHtml()
{
global $ilCtrl;
$tpl = new ilTemplate("tpl.dcl_tree.html", true, true, "Modules/DataCollection");
$tpl->setVariable("FIELD_ID", $this->getPostVar());
$tpl->setVariable("AJAX_LINK", $ilCtrl->getLinkTargetByClass("ildatacollectionrecordeditgui", "searchObjects"));
$tpl->setVariable("LOADER_PATH", ilUtil::getImagePath("loader.svg"));
$out = $this->title_input->getToolbarHTML();
$out .= "<a href='#' style='display:inline-block;' id='remove_{$this->getPostVar()}'>" . ilGlyphGUI::get(ilGlyphGUI::REMOVE) . "</a>";
$out .= $this->search_input->getTableFilterHTML();
$out .= $this->hidden_input->getToolbarHTML();
$out .= "<a href='#' id='search_button_" . $this->getPostVar() . "'>" . $this->lng->txt('search') . "</a>";
$out .= $tpl->get();
return $out;
}
示例10: getHTML
/**
* Render
*/
public function getHTML()
{
global $tpl;
if (!$this->isValid()) {
return;
}
$this->initJS();
$chart = new ilTemplate("tpl.grid2.html", true, true, "Services/Chart");
$chart->setVariable("ID", $this->id);
$chart->setVariable("WIDTH", $this->width);
$chart->setVariable("HEIGHT", $this->height);
$data = array();
foreach ($this->data as $idx => $series) {
$data[] = $series->getData();
}
include_once "./Services/JSON/classes/class.ilJsonUtil.php";
$cfg = array();
$cfg["series"] = array("bubbles" => array("active" => true, "show" => true, "bubblelabel" => array("show" => true), "linewidth" => 2));
$cfg["grid"] = array("hoverable" => true, "clickable" => true, "editable" => true);
if ($ticks = $this->getTicks()) {
foreach ($ticks as $axis => $def) {
if (is_array($def)) {
foreach ($def as $k => $v) {
$cfg[$axis . "axis"]["ticks"][] = array($k, $v);
}
}
}
}
if ($this->x_min !== false) {
$cfg["xaxis"]["min"] = $this->x_min;
}
if ($this->x_max !== false) {
$cfg["xaxis"]["max"] = $this->x_max;
}
if ($this->y_min !== false) {
$cfg["yaxis"]["min"] = $this->y_min;
}
if ($this->y_max !== false) {
$cfg["yaxis"]["max"] = $this->y_max;
}
//ticks: [[1, "m"], [2, "n"], [3, "o"], [4, "p"], [5, "q"], [6, "r"], [7, "s"]]
//echo ilJsonUtil::encode($cfg);
$chart->setVariable("CFG", ilJsonUtil::encode($cfg));
$chart->setVariable("DATA", ilJsonUtil::encode($data));
$ret = $chart->get();
//echo htmlentities($ret);
return $ret;
}
示例11: render
function render()
{
global $ilUser;
$tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
$tpl->setCurrentBlock("prop_time");
if ($this->getMode() == self::MODE_SELECT) {
if (is_a($this->getDate(), 'ilDate')) {
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', 'UTC');
} elseif (is_a($this->getDate(), 'ilDateTime')) {
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
} else {
$this->setDate(new ilDateTime(time(), IL_CAL_UNIX));
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
}
// display invalid input again
if (is_array($this->invalid_input)) {
$date_info['year'] = $this->invalid_input['y'];
$date_info['mon'] = $this->invalid_input['m'];
$date_info['mday'] = $this->invalid_input['d'];
}
}
if ($this->getMode() == self::MODE_SELECT) {
$tpl->setVariable("TIME_SELECT", ilUtil::makeTimeSelect($this->getPostVar() . "[time]", !$this->getShowSeconds(), $date_info['hours'], $date_info['minutes'], $date_info['seconds'], true, array('minute_steps' => $this->getMinuteStepSize(), 'disabled' => $this->getDisabled())));
}
$tpl->parseCurrentBlock();
return $tpl->get();
}
示例12: insert
public function insert($a_tpl)
{
global $lng;
$subtpl = new ilTemplate("tpl.mail_new_placeholders.html", false, false, "Services/Mail");
$subtpl->setVariable('TXT_USE_PLACEHOLDERS', $lng->txt('mail_nacc_use_placeholder'));
$subtpl->setVariable('TXT_PLACEHOLDERS_ADVISE', sprintf($lng->txt('placeholders_advise'), '<br />'));
$subtpl->setVariable('TXT_MAIL_SALUTATION', $lng->txt('mail_nacc_salutation'));
$subtpl->setVariable('TXT_FIRST_NAME', $lng->txt('firstname'));
$subtpl->setVariable('TXT_LAST_NAME', $lng->txt('lastname'));
$subtpl->setVariable('TXT_LOGIN', $lng->txt('mail_nacc_login'));
$subtpl->setVariable('TXT_ILIAS_URL', $lng->txt('mail_nacc_ilias_url'));
$subtpl->setVariable('TXT_CLIENT_NAME', $lng->txt('mail_nacc_client_name'));
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $subtpl->get());
$a_tpl->parseCurrentBlock();
}
示例13: showCmd
private function showCmd()
{
$selectedSkillProfile = ilTestSkillEvaluationToolbarGUI::fetchSkillProfileParam($_POST);
$testSession = $this->testSessionFactory->getSession();
$this->skillEvaluation->init()->evaluate($testSession->getActiveId(), $testSession->getLastFinishedPass(), $testSession->getUserId());
$evaluationToolbarGUI = $this->buildEvaluationToolbarGUI($testSession->getUserId(), $selectedSkillProfile);
$personalSkillsGUI = $this->buildPersonalSkillsGUI($testSession->getUserId(), $selectedSkillProfile);
$this->tpl->setContent($this->ctrl->getHTML($evaluationToolbarGUI) . $this->ctrl->getHTML($personalSkillsGUI));
}
示例14: save
/**
* Save config
*/
public function save()
{
$form = new ilCertificateConfigFormGUI($this);
if ($form->saveObject()) {
ilUtil::sendSuccess($this->pl->txt('msg_save_config'), true);
$this->ctrl->redirect($this, 'configure');
} else {
$form->setValuesByPost();
$this->tpl->setContent($form->getHTML());
}
}
示例15: showSkillThresholdsCmd
private function showSkillThresholdsCmd()
{
$table = $this->buildTableGUI();
$skillLevelThresholdList = $this->buildSkillLevelThresholdList();
$skillLevelThresholdList->loadFromDb();
$table->setSkillLevelThresholdList($skillLevelThresholdList);
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
$table->setData($assignmentList->getUniqueAssignedSkills());
$this->tpl->setContent($this->ctrl->getHTML($table));
}