当前位置: 首页>>代码示例>>PHP>>正文


PHP ilTemplate::setVariable方法代码示例

本文整理汇总了PHP中ilTemplate::setVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTemplate::setVariable方法的具体用法?PHP ilTemplate::setVariable怎么用?PHP ilTemplate::setVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilTemplate的用法示例。


在下文中一共展示了ilTemplate::setVariable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insert

 /**
  * Insert property html
  *
  * @return	int	Size
  */
 function insert(&$a_tpl)
 {
     global $lng;
     $tpl = new ilTemplate("tpl.prop_randomtestroinput.html", true, true, "Modules/Test");
     $i = 0;
     foreach ($this->values as $value) {
         if ($value['num_of_q'] > 0) {
             $tpl->setCurrentBlock("num_of_q");
             $tpl->setVariable("NUM_OF_Q", $value['num_of_q']);
             $tpl->setVariable("TEXT_FROM", $lng->txt('questions_from'));
             $tpl->parseCurrentBlock();
         }
         $tpl->setCurrentBlock("row");
         $class = $i % 2 == 0 ? "even" : "odd";
         if ($i == 0) {
             $class .= " first";
         }
         if ($i == count($this->values) - 1) {
             $class .= " last";
         }
         $tpl->setVariable("ROW_CLASS", $class);
         $tpl->setVariable("QPL_VALUE", ilUtil::prepareFormOutput($value['title']));
         $tpl->setVariable("COUNT_VALUE", "(" . $value['count'] . " " . $lng->txt('assQuestions') . ")");
         $tpl->parseCurrentBlock();
         $i++;
     }
     $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
     $a_tpl->parseCurrentBlock();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:36,代码来源:class.ilRandomTestROInputGUI.php

示例2: 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;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:30,代码来源:class.ilContainerByTypeContentGUI.php

示例3: 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();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilChatroomSmiliesCurrentSmileyFormElement.php

示例4: 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();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:9,代码来源:class.ilDataCollectionTreePickInputGUI.php

示例5: perminfo

 /**
  * cmd function
  */
 function perminfo()
 {
     $tpl = new ilTemplate("tpl.info_layout.html", false, false, "Services/AccessControl");
     $tpl->setVariable("INFO_SUMMARY", $this->accessStatusInfo());
     $tpl->setVariable("INFO_PERMISSIONS", $this->accessPermissionsTable());
     $tpl->setVariable("INFO_ROLES", $this->availableRolesTable());
     $tpl->setVariable("INFO_REMARK_INTERRUPTED", $this->lng->txt('info_remark_interrupted'));
     $this->tpl->setVariable("ADM_CONTENT", $tpl->get());
     $this->addToolbar();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:13,代码来源:class.ilObjectPermissionStatusGUI.php

示例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();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:13,代码来源:class.ilMiniCalendarGUI.php

示例7: generateDBUpdateForInstallation

 public function generateDBUpdateForInstallation()
 {
     $tpl = new ilTemplate(dirname(__FILE__) . '/templates/dbupdate.txt', true, true);
     $ar = $this->getAr();
     $tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
     $tpl->setVariable('STEP', $this->getStep());
     $tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
     foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
         $tpl->touchBlock('field');
         $tpl->setVariable('FIELD_NAME', $field->getName());
         foreach ($field->getAttributesForConnector() as $name => $value) {
             $tpl->setCurrentBlock('attribute');
             $tpl->setVariable('NAME', arFieldList::mapKey($name));
             $tpl->setVariable('VALUE', $value);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() == arField::FIELD_TYPE_INTEGER) {
         $tpl->setCurrentBlock('attribute');
         $tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
         $tpl->parseCurrentBlock();
     }
     header('Content-type: application/x-httpd-php');
     header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
     echo $tpl->get();
     exit;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:29,代码来源:class.arBuilder.php

示例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();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:15,代码来源:class.ilMiniCalendarGUI.php

示例9: insert

 public function insert($a_tpl)
 {
     $tpl = new ilTemplate('tpl.mail_new_attachments.html', true, true, 'Services/Mail');
     foreach ($this->items as $item) {
         $tpl->setCurrentBlock('attachment_list_item');
         $tpl->setVariable('ATTACHMENT_LABEL', $item);
         $tpl->parseCurrentBlock();
     }
     $tpl->setVariable('ATTACHMENT_BUTTON_LABEL', $this->buttonLabel);
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
     $a_tpl->parseCurrentBlock();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:13,代码来源:class.ilMailFormAttachmentFormPropertyGUI.php

示例10: 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilDataCollectionTreePickInputGUI.php

示例11: configure

 /**
  * Configure screen
  */
 public function configure()
 {
     $form = new ilCertificateConfigFormGUI($this);
     $form->fillForm();
     $ftpl = new ilTemplate('tpl.config_form.html', true, true, $this->pl->getDirectory());
     $ftpl->setVariable("FORM", $form->getHTML());
     $ftpl->setVariable("TXT_USE_PLACEHOLDERS", $this->pl->txt('txt_use_placeholders'));
     foreach (srCertificateStandardPlaceholders::getStandardPlaceholders() as $placeholder => $text) {
         $ftpl->setCurrentBlock("placeholder");
         $ftpl->setVariable("PLACEHOLDER", $placeholder);
         $ftpl->setVariable("TXT_PLACEHOLDER", $text);
         $ftpl->parseCurrentBlock();
     }
     $this->tpl->setContent($ftpl->get());
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:18,代码来源:class.ilCertificateConfigGUI.php

示例12: show

 public function show()
 {
     require_once 'class.ilTestEvaluationGUI.php';
     require_once './Services/PDFGeneration/classes/class.ilPDFGeneration.php';
     global $ilUser;
     $template = new ilTemplate("tpl.il_as_tst_submission_review.html", TRUE, TRUE, "Modules/Test");
     $this->ilCtrl->setParameter($this, "skipfinalstatement", 1);
     $template->setVariable("FORMACTION", $this->ilCtrl->getFormAction($this->testOutputGUI, 'redirectBack') . '&reviewed=1');
     $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
     $template->setVariable("BUTTON_BACK", $this->lng->txt("btn_previous"));
     if ($this->test->getListOfQuestionsEnd()) {
         $template->setVariable("CANCEL_CMD", 'outQuestionSummary');
     } else {
         $template->setVariable("CANCEL_CMD", 'backFromSummary');
     }
     $active = $this->test->getActiveIdOfUser($ilUser->getId());
     $testevaluationgui = new ilTestEvaluationGUI($this->test);
     $results = $this->test->getTestResult($active, $this->testSession->getPass());
     $results_output = $testevaluationgui->getPassListOfAnswers($results, $active, $this->testSession->getPass(), false, false, false, false);
     if ($this->test->getShowExamviewPdf()) {
         $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
         global $ilSetting;
         $inst_id = $ilSetting->get('inst_id', null);
         $path = ilUtil::getWebspaceDir() . '/assessment/' . $this->testOutputGUI->object->getId() . '/exam_pdf';
         if (!is_dir($path)) {
             ilUtil::makeDirParents($path);
         }
         $filename = $path . '/exam_N' . $inst_id . '-' . $this->testOutputGUI->object->getId() . '-' . $active . '-' . $this->testSession->getPass() . '.pdf';
         require_once 'class.ilTestPDFGenerator.php';
         ilTestPDFGenerator::generatePDF($results_output, ilTestPDFGenerator::PDF_OUTPUT_FILE, $filename);
         $template->setVariable("PDF_FILE_LOCATION", $filename);
     } else {
         $template->setCurrentBlock('prevent_double_form_subm');
         $template->touchBlock('prevent_double_form_subm');
         $template->parseCurrentBlock();
     }
     if ($this->test->getShowExamviewHtml()) {
         if ($this->test->getListOfQuestionsEnd()) {
             $template->setVariable("CANCEL_CMD_BOTTOM", 'outQuestionSummary');
         } else {
             $template->setVariable("CANCEL_CMD_BOTTOM", 'backFromSummary');
         }
         $template->setVariable("BUTTON_CONTINUE_BOTTOM", $this->lng->txt("btn_next"));
         $template->setVariable("BUTTON_BACK_BOTTOM", $this->lng->txt("btn_previous"));
         $template->setVariable('HTML_REVIEW', $results_output);
     }
     $this->tpl->setVariable($this->getContentBlockName(), $template->get());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:48,代码来源:class.ilTestSubmissionReviewGUI.php

示例13: 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;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:51,代码来源:class.ilChartBubble.php

示例14: array

 function __showRolesTable($a_result_set, $a_from = "")
 {
     if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this, "");
     }
     $tbl =& $this->parent_gui->__initTableGUI();
     $tpl =& $tbl->getTemplateObject();
     // SET FORMAACTION
     $tpl->setCurrentBlock("tbl_form_header");
     $this->ctrl->setParameter($this, 'obj_id', $_GET['obj_id']);
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     // SET FOOTER BUTTONS
     $tpl->setVariable("COLUMN_COUNTS", 4);
     $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
     $tpl->setCurrentBlock("tbl_action_button");
     $tpl->setVariable("BTN_NAME", "assignSave");
     $tpl->setVariable("BTN_VALUE", $this->lng->txt("change_assignment"));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_row");
     $tpl->setVariable("TPLPATH", $this->tpl->tplPath);
     $tpl->parseCurrentBlock();
     $tmp_obj =& ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
     $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
     $tbl->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
     $tbl->setHeaderNames(array('', $this->lng->txt("title"), $this->lng->txt('description'), $this->lng->txt("type")));
     $tbl->setHeaderVars(array("", "title", "description", "type"), array("ref_id" => $this->object->getRefId(), "cmd" => "assignRoles", "obj_id" => $_GET['obj_id'], "cmdClass" => "ilobjcategorygui", "cmdNode" => $_GET["cmdNode"]));
     $tbl->setColumnWidth(array("4%", "35%", "45%", "16%"));
     $this->set_unlimited = true;
     $this->parent_gui->__setTableGUIBasicData($tbl, $a_result_set, $a_from, true);
     $tbl->render();
     $this->tpl->setVariable("ROLES_TABLE", $tbl->tpl->get());
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:35,代码来源:class.ilLocalUserGUI.php

示例15: 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:25,代码来源:class.ilAuthShibbolethSettingsGUI.php


注:本文中的ilTemplate::setVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。