/**
  * 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();
 }
 /**
  * @return string
  */
 protected function render()
 {
     $tpl = new ilTemplate('./Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing/templates/default/utils/tpl.hours_input.html', false, false);
     //				echo '<pre>' . print_r($this->getHours(), 1) . '</pre>';
     //				echo '<pre>' . print_r($this->getMinutes(), 1) . '</pre>';
     $tpl->setVariable('POSTVAR', $this->getPostVar());
     for ($x = 0; $x < 24; $x++) {
         $tpl->setCurrentBlock('hour');
         if ($x == $this->getHours()) {
             $tpl->setVariable('SELECTED', "selected=selected");
         }
         $tpl->setVariable('VAL', $x);
         $tpl->setVariable('DISPLAY', str_pad($x, 2, '0', STR_PAD_LEFT));
         $tpl->parseCurrentBlock();
     }
     for ($x = 0; $x < 60; $x = $x + 5) {
         $tpl->setCurrentBlock('minute');
         if ($this->getMinutes() >= $x and $this->getMinutes() < $x + 5) {
             $tpl->setVariable('SELECTED', "selected=selected");
         }
         $tpl->setVariable('VAL', $x);
         $tpl->setVariable('DISPLAY', str_pad($x, 2, '0', STR_PAD_LEFT));
         $tpl->parseCurrentBlock();
     }
     return $tpl->get();
 }
示例#3
0
 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;
 }
 /**
  * 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();
 }
 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();
 }
 /**
  * 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();
 }
 /**
  * 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();
 }
 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();
 }
 /**
  * @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;
 }
 /**
  * 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());
 }
示例#11
0
 function getHTML()
 {
     global $ilObjDataCache;
     $tpl = new ilTemplate('tpl.search_user_filter.html', true, true, 'Services/Search');
     $tpl->setVariable("FILTER_ACTION", $this->ctrl->getFormAction($this));
     $tpl->setVariable("TBL_TITLE", $this->lng->txt('trac_lp_filter'));
     $tpl->setVariable("TXT_LOGIN", $this->lng->txt('login'));
     $tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt('firstname'));
     $tpl->setVariable("TXT_LASTNAME", $this->lng->txt('lastname'));
     $tpl->setVariable("BTN_REFRESH", $this->lng->txt('trac_refresh'));
     $tpl->setVariable("QUERY", ilUtil::prepareFormOutput($this->filter->getQueryString('login')));
     $tpl->setVariable("FIRSTNAME", ilUtil::prepareFormOutput($this->filter->getQueryString('firstname')));
     $tpl->setVariable("LASTNAME", ilUtil::prepareFormOutput($this->filter->getQueryString('lastname')));
     return $tpl->get();
 }
 /**
  * Render output
  */
 function render()
 {
     global $lng;
     $tpl = new ilTemplate("tpl.prop_captchainput.html", true, true, "Services/Captcha");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_text_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     include_once "./Services/Captcha/classes/class.ilSecurImageUtil.php";
     $tpl->setVariable("IMAGE_SCRIPT", ilSecurImageUtil::getImageScript());
     $tpl->setVariable("POST_VAR", $this->getPostVar());
     $tpl->setVariable("TXT_CONSTR_PROP", $lng->txt("cont_constrain_proportions"));
     //		$GLOBALS["tpl"]->addJavascript("./Services/MediaObjects/js/ServiceMediaObjectPropWidthHeight.js");
     return $tpl->get();
 }
 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();
 }
 /**
  * Render item
  * (modified class name in links and respect disabled status)
  */
 function render($a_mode = "property_form")
 {
     global $lng, $ilCtrl, $ilObjDataCache, $tree;
     // modification:
     $tpl = new ilTemplate("tpl.prop_glos_select.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/Flashcards");
     // modification.
     $tpl->setVariable("POST_VAR", $this->getPostVar());
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
     // modification:
     if (!$this->getDisabled()) {
         switch ($a_mode) {
             case "property_form":
                 $parent_gui = "ilpropertyformgui";
                 break;
             case "table_filter":
                 $parent_gui = get_class($this->getParent());
                 break;
         }
         $ilCtrl->setParameterByClass("ilglossaryselectorinputgui", "postvar", $this->getPostVar());
         $tpl->setVariable("TXT_SELECT", $this->getSelectText());
         $tpl->setVariable("HREF_SELECT", $ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilglossaryselectorinputgui"), "showRepositorySelection"));
         if ($this->getValue() > 0) {
             $tpl->setVariable("TXT_RESET", $lng->txt("reset"));
             $tpl->setVariable("HREF_RESET", $ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilglossaryselectorinputgui"), "reset"));
         }
     }
     // modification.
     if ($this->getValue() > 0 && $this->getValue() != ROOT_FOLDER_ID) {
         // modification:
         require_once "Services/Locator/classes/class.ilLocatorGUI.php";
         $loc_gui = new ilLocatorGUI();
         $loc_gui->addContextItems($this->getValue());
         $tpl->setVariable("TXT_ITEM", $loc_gui->getHTML());
         // modification.
     } else {
         $nd = $tree->getNodeData(ROOT_FOLDER_ID);
         $title = $nd["title"];
         if ($title == "ILIAS") {
             $title = $lng->txt("repository");
         }
         if (in_array($nd["type"], $this->getClickableTypes())) {
             $tpl->setVariable("TXT_ITEM", $title);
         }
     }
     return $tpl->get();
 }
 public function insert($a_tpl)
 {
     global $lng;
     $subtpl = new ilTemplate("tpl.invoice_number_placeholders.html", false, false, "Services/Payment");
     $subtpl->setVariable('TXT_USE_PLACEHOLDERS', $lng->txt('placeholders'));
     $subtpl->setVariable('TXT_PLACEHOLDERS_ADVICE', $lng->txt('inv_number_placeholder_advice'));
     $subtpl->setVariable('TXT_CURRENT_TIMESTAMP', $lng->txt('current_timestamp'));
     $subtpl->setVariable('TXT_INSTALLATION_ID', $lng->txt('installation_id'));
     $subtpl->setVariable('TXT_USER_ID', $lng->txt('user_id'));
     $subtpl->setVariable('TXT_DAY', $lng->txt('day'));
     $subtpl->setVariable('TXT_MONTH', $lng->txt('month'));
     $subtpl->setVariable('TXT_YEAR', $lng->txt('year'));
     $subtpl->setVariable('TXT_INCREMENTAL_NUMBER', $lng->txt('incremental_number'));
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $subtpl->get());
     $a_tpl->parseCurrentBlock();
 }
 /**
  * List skill changes
  */
 function listSkillChanges()
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl;
     include_once "./Modules/Survey/classes/class.ilSurveySkillChangesTableGUI.php";
     //		$ilToolbar->addButton($lng->txt("survey_write_skills"),
     //			$ilCtrl->getLinkTarget($this, "writeSkills"));
     $apps = $this->survey->getAppraiseesData();
     $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
     foreach ($apps as $app) {
         $changes_table = new ilSurveySkillChangesTableGUI($this, "listSkillChanges", $this->survey, $app);
         $ctpl->setCurrentBlock("appraisee");
         $ctpl->setVariable("LASTNAME", $app["lastname"]);
         $ctpl->setVariable("FIRSTNAME", $app["firstname"]);
         $ctpl->setVariable("CHANGES_TABLE", $changes_table->getHTML());
         $ctpl->parseCurrentBlock();
     }
     $tpl->setContent($ctpl->get());
 }
示例#17
0
 protected function renderFullscreen()
 {
     global $tpl, $lng, $ilMainMenu;
     if (!ilImprint::isActive()) {
         ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
     }
     $tpl->getStandardTemplate();
     $this->setRawPageContent(true);
     $html = $this->showPage();
     $itpl = new ilTemplate("tpl.imprint.html", true, true, "Services/Imprint");
     $itpl->setVariable("PAGE_TITLE", $lng->txt("imprint"));
     $itpl->setVariable("IMPRINT", $html);
     unset($html);
     $tpl->setContent($itpl->get());
     $ilMainMenu->showLogoOnly(true);
     echo $tpl->show("DEFAULT", true, false);
     exit;
 }
 private function showVirtualPassCmd()
 {
     $testSession = $this->testSessionFactory->getSession();
     if (!$this->object->getShowPassDetails()) {
         $executable = $this->object->isExecutable($testSession, $testSession->getUserId());
         if ($executable["executable"]) {
             $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
         }
     }
     $this->tabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants'));
     $toolbar = $this->buildUserTestResultsToolbarGUI();
     $this->ctrl->setParameter($this, 'pdf', '1');
     $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'showVirtualPass'));
     $this->ctrl->setParameter($this, 'pdf', '');
     $toolbar->build();
     $virtualSequence = $this->service->buildVirtualSequence($testSession);
     $userResults = $this->service->getVirtualSequenceUserResults($virtualSequence);
     require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
     $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
     $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $virtualSequence);
     $objectivesList->loadObjectivesTitles();
     require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
     $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $this->objCache);
     $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
     $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
     $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
     $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
     $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
     $tpl = new ilTemplate('tpl.il_as_tst_virtual_pass_details.html', false, false, 'Modules/Test');
     $tpl->setVariable("TEXT_HEADING", $testResultHeaderLabelBuilder->getVirtualPassDetailsHeaderLabel($objectivesList->getUniqueObjectivesString()));
     $command_solution_details = "";
     if ($this->object->getShowSolutionDetails()) {
         $command_solution_details = "outCorrectSolution";
     }
     $questionAnchorNav = false;
     if ($this->object->canShowSolutionPrintview()) {
         $questionAnchorNav = true;
         $list_of_answers = $this->getPassListOfAnswers($userResults, $testSession->getActiveId(), null, $this->object->getShowSolutionListComparison(), false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder);
         $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
     }
     $overview = $this->getPassDetailsOverview($userResults, $testSession->getActiveId(), null, $this, "showVirtualPass", $command_solution_details, $questionAnchorNav, $objectivesList);
     $tpl->setVariable("PASS_DETAILS", $overview);
     $this->populateContent($this->ctrl->getHTML($toolbar) . $tpl->get());
 }
 /**
  * Get content HTML for main column.
  */
 function getMainContent()
 {
     global $ilBench, $ilAccess;
     $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);
     }
     return $tpl->get();
 }
 /**
  * @param ilTemplate $tpl
  */
 public function insert(ilTemplate $tpl)
 {
     /**
      * @var $lng ilLanguage
      */
     global $lng;
     $local_tpl = new ilTemplate('tpl.prop_tos_signed_document.html', true, true, 'Services/TermsOfService');
     require_once 'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
     $modal = ilModalGUI::getInstance();
     $modal->setHeading($lng->txt('tos_agreement_document'));
     $modal->setId('accepted_tos_' . $this->entity->getUserId());
     $modal->setBody($this->entity->getText());
     require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
     $local_tpl->setVariable('MODAL_TRIGGER_HTML', ilGlyphGUI::get(ilGlyphGUI::SEARCH));
     $local_tpl->setVariable('MODAL', $modal->getHTML());
     $local_tpl->setVariable('MODAL_ID', 'accepted_tos_' . $this->entity->getUserId());
     $tpl->setCurrentBlock('prop_generic');
     $tpl->setVariable('PROP_GENERIC', $local_tpl->get());
     $tpl->parseCurrentBlock();
 }
 public function render(array &$a_html, $a_parent_gui)
 {
     global $lng;
     $all_tags = $this->getSubTreeTags();
     if ($all_tags) {
         // see ilPDTaggingBlockGUI::getTagCloud();
         $map = array("personal" => $lng->txt("tagging_my_tags"), "other" => $lng->txt("tagging_other_users"));
         foreach ($map as $type => $title) {
             $tags = $all_tags[$type];
             if ($tags) {
                 $max = 1;
                 foreach ($tags as $tag => $counter) {
                     $max = max($counter, $max);
                 }
                 reset($tags);
                 $tpl = new ilTemplate("tpl.tag_cloud_block.html", true, true, "Services/Tagging");
                 $tpl->setCurrentBlock("tag_bl");
                 foreach ($tags as $tag => $counter) {
                     $tpl->setVariable("TAG_TYPE", $type);
                     $tpl->setVariable("TAG_TITLE", $tag);
                     $tpl->setVariable("TAG_CODE", md5($tag));
                     $tpl->setVariable("REL_CLASS", ilTagging::getRelevanceClass($counter, $max));
                     if (is_array($this->selection[$type]) && in_array($tag, $this->selection[$type])) {
                         $tpl->setVariable("HIGHL_CLASS", ' ilHighlighted');
                     }
                     $tpl->parseCurrentBlock();
                 }
                 $a_html[] = array("title" => $title, "html" => $tpl->get());
             }
         }
         /*
         if($this->selection)
         {
         	$a_html[] = array(
         			"title" => "Related Tags",
         			"html" => ":TODO:"
         		);
         }			 
         */
     }
 }
 /**
  * @return string
  */
 public function getRoomSelect()
 {
     /**
      * @var $lng    ilLanguage
      * @var $ilUser ilObjUser
      */
     global $lng, $ilUser;
     $readable = $this->getReadableAreas();
     $tpl = new ilTemplate('tpl.chatroom_block_room_select.html', true, true, 'Modules/Chatroom');
     $tpl->setVariable('TXT_SELECT_ROOM', $lng->txt('chat_select_room'));
     foreach ($readable as $room) {
         $tpl->setCurrentBlock('select_room_row');
         $tpl->setVariable('ROW_VALUE', $room['ref_id']);
         $tpl->setVariable('ROW_CAPTION', $room['title']);
         if ($ilUser->getPref('chatviewer_last_selected_room') == $room['ref_id']) {
             $tpl->setVariable('ROW_SELECTED', 'selected="selected"');
         }
         $tpl->parseCurrentBlock();
     }
     return $tpl->get();
 }
 /**
  * render
  */
 function render()
 {
     global $lng;
     $tpl = new ilTemplate("tpl.adv_col_sort_input.html", true, true, "Modules/Glossary");
     if (is_array($this->getValue())) {
         foreach ($this->getValue() as $k => $v) {
             $tpl->setCurrentBlock("item");
             $tpl->setVariable("TEXT", $v["text"]);
             $tpl->setVariable("ID", $this->getFieldId() . "~" . $k);
             $tpl->setVariable("SRC_DOWN", ilUtil::getImagePath('icon_down_s.png'));
             $tpl->setVariable("TXT_DOWN", $lng->txt("down"));
             $tpl->setVariable("SRC_UP", ilUtil::getImagePath('icon_up_s.png'));
             $tpl->setVariable("TXT_UP", $lng->txt("up"));
             $tpl->setVariable('NAME', $this->getPostVar() . "[" . $k . "][id]");
             $tpl->setVariable('TNAME', $this->getPostVar() . "[" . $k . "][text]");
             $tpl->setVariable('VAL', ilUtil::prepareFormOutput($v["id"]));
             $tpl->setVariable('TVAL', ilUtil::prepareFormOutput($v["text"]));
             $tpl->parseCurrentBlock();
         }
     }
     return $tpl->get();
 }
 /**
  * Overwritten method from ilNumberInputGUI. This method is primarily used
  * to make use of a different template.
  *
  * @global type $lng
  * @return type
  */
 public function render()
 {
     global $lng;
     // own template (the number is aligned left)
     $tpl = new ilTemplate("tpl.room_prop_number.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_number_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     $tpl->setCurrentBlock("prop_number");
     $tpl->setVariable("POST_VAR", $this->getPostVar());
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("SIZE", $this->getSize());
     $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
     if (strlen($this->getSuffix())) {
         $tpl->setVariable("INPUT_SUFFIX", $this->getSuffix());
     }
     if ($this->getDisabled()) {
         $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
     }
     // constraints
     if ($this->areDecimalsAllowed() && $this->getDecimals() > 0) {
         $constraints = $lng->txt("form_format") . ": ###." . str_repeat("#", $this->getDecimals());
         $delim = ", ";
     }
     if ($this->getMaxValue() !== false) {
         $constraints .= $delim . $lng->txt("rep_robj_xrs_at_most") . ": " . ($this->maxvalueShouldBeLess() ? "&lt; " : "") . $this->getMaxValue();
         $delim = ", ";
     }
     // append the constraint-text at the end of the input, if given
     if ($constraints !== "") {
         $tpl->setVariable("TXT_NUMBER_CONSTRAINTS", $constraints);
     }
     $tpl->parseCurrentBlock();
     return $tpl->get();
 }
 /**
  * @return string
  */
 public function getHtml()
 {
     /**
      * @var $lng    ilLanguage
      * @var $tpl ilTemplate
      */
     global $lng, $tpl;
     if ($this->getSessionReminder()->isActive()) {
         require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
         iljQueryUtil::initjQuery();
         require_once 'Services/YUI/classes/class.ilYuiUtil.php';
         ilYuiUtil::initCookie();
         $tpl->addJavaScript('./Services/Authentication/js/session_reminder.js');
         $reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication');
         $reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0);
         $reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID);
         $reminder_tpl->setVariable('SESSION_NAME', session_name());
         $reminder_tpl->setVariable('FREQUENCY', 60);
         $reminder_tpl->setVariable('SESSION_ID', session_id());
         $reminder_tpl->setVariable('URL', './sessioncheck.php?client_id=' . CLIENT_ID . '&lang=' . $lng->getLangKey());
         return $reminder_tpl->get();
     }
     return '';
 }
示例#26
0
 /**
  * Get icon html
  *
  * @param string $a_type icons type ICON_RSS | ICON_ICAL
  * @param string $a_href href
  * @return string icon html
  */
 static function get($a_type, $a_href = "")
 {
     $tpl = new ilTemplate("tpl.rss_icon.html", true, true, "Services/News");
     if ($a_href != "") {
         $tpl->setCurrentBlock("a_start");
         $tpl->setVariable("HREF", $a_href);
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("a_end");
     }
     $text = "";
     switch ($a_type) {
         case self::ICON_RSS:
             $text = "RSS";
             break;
         case self::ICON_RSS_AUDIO:
             $text = "RSS Audio";
             break;
         case self::ICON_RSS_VIDEO:
             $text = "RSS Video";
             break;
         case self::ICON_ICAL:
             $text = "iCal";
             break;
         case self::ICON_ITUNES:
             $text = "iTunes";
             break;
         case self::ICON_ITUNES_AUDIO:
             $text = "iTunes Audio";
             break;
         case self::ICON_ITUNES_VIDEO:
             $text = "iTunes Video";
             break;
     }
     $tpl->setVariable("TEXT", $text);
     return $tpl->get();
 }
 /**
  * Insert property html
  *
  * @return	int	Size
  */
 function insert(&$a_tpl)
 {
     global $lng;
     $tpl = new ilTemplate("tpl.prop_answerwizardinput.html", true, true, "Modules/TestQuestionPool");
     $i = 0;
     foreach ($this->values as $value) {
         if ($this->getSingleline()) {
             if (is_object($value)) {
                 $tpl->setCurrentBlock("prop_text_propval");
                 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
                 $tpl->parseCurrentBlock();
                 $tpl->setCurrentBlock("prop_points_propval");
                 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
                 $tpl->parseCurrentBlock();
             }
             $tpl->setCurrentBlock('singleline');
             $tpl->setVariable("SIZE", $this->getSize());
             $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][{$i}]");
             $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
             $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
             $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
             if ($this->getDisabled()) {
                 $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
             }
             $tpl->parseCurrentBlock();
         } else {
             if (!$this->getSingleline()) {
                 if (is_object($value)) {
                     $tpl->setCurrentBlock("prop_points_propval");
                     $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
                     $tpl->parseCurrentBlock();
                 }
                 $tpl->setCurrentBlock('multiline');
                 $tpl->setVariable("PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext()));
                 $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][{$i}]");
                 $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
                 $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
                 if ($this->getDisabled()) {
                     $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
                 }
                 $tpl->parseCurrentBlock();
             }
         }
         if ($this->getAllowMove()) {
             $tpl->setCurrentBlock("move");
             $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][{$i}]");
             $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][{$i}]");
             $tpl->setVariable("ID", $this->getPostVar() . "[{$i}]");
             $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png'));
             $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png'));
             $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("POST_VAR", $this->getPostVar());
         $tpl->setVariable("ROW_NUMBER", $i);
         $tpl->setVariable("ID", $this->getPostVar() . "[answer][{$i}]");
         $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][{$i}]");
         $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]");
         $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]");
         if ($this->getDisabled()) {
             $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
         }
         $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png'));
         $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png'));
         $tpl->parseCurrentBlock();
         $i++;
     }
     $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
     $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
     $tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
     $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
     $a_tpl->parseCurrentBlock();
     global $tpl;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDomEvent();
     $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/answerwizard.js");
 }
 /**
  * Insert property html
  */
 function insert(&$a_tpl)
 {
     $tpl = new ilTemplate("tpl.prop_background_image.html", true, true, "Services/Style");
     $tpl->setVariable("POSTVAR", $this->getPostVar());
     $int_options = array_merge(array("" => ""), $this->getImages());
     $value = trim($this->getValue());
     if (is_int(strpos($value, "/"))) {
         $current_type = "ext";
         $tpl->setVariable("EXTERNAL_SELECTED", 'checked="checked"');
         $tpl->setVariable("VAL_EXT", ilUtil::prepareFormOutput($value));
     } else {
         $current_type = "int";
         $tpl->setVariable("INTERNAL_SELECTED", 'checked="checked"');
     }
     foreach ($int_options as $option) {
         $tpl->setCurrentBlock("int_option");
         $tpl->setVariable("VAL_INT", $option);
         $tpl->setVariable("TXT_INT", $option);
         if ($current_type == "int" && $value == $option) {
             $tpl->setVariable("INT_SELECTED", 'selected="selected"');
         }
         $tpl->parseCurrentBlock();
     }
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
     $a_tpl->parseCurrentBlock();
 }
示例#29
0
 /**
  * @param integer		$active_id
  * @param integer|null	$pass
  * @param bool			$is_postponed
  * @param bool			$use_post_solutions
  *
  * @return string
  */
 public function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
 {
     $solutions = NULL;
     // get the solution of the user for the active pass or from the last pass if allowed
     if ($active_id) {
         require_once './Modules/Test/classes/class.ilObjTest.php';
         if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
             if (is_null($pass)) {
                 $pass = ilObjTest::_getPass($active_id);
             }
         }
         $solutions =& $this->object->getSolutionValues($active_id, $pass);
     }
     // generate the question output
     require_once './Services/UICore/classes/class.ilTemplate.php';
     $template = new ilTemplate("tpl.il_as_qpl_numeric_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
     if (is_array($solutions)) {
         foreach ($solutions as $solution) {
             $template->setVariable("NUMERIC_VALUE", " value=\"" . $solution["value1"] . "\"");
         }
     }
     $template->setVariable("NUMERIC_SIZE", $this->object->getMaxChars());
     $questiontext = $this->object->getQuestion();
     $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
     $questionoutput = $template->get();
     $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
     return $pageoutput;
 }
 /**
  * Get introduction.
  */
 function getIntroduction()
 {
     global $ilUser, $lng, $ilCtrl;
     $lng->loadLanguageModule("rep");
     $tpl = new ilTemplate("tpl.rep_intro.html", true, true, "Services/Repository");
     $tpl->setVariable("IMG_REP_LARGE", ilObject::_getIcon("", "big", "root"));
     $tpl->setVariable("TXT_WELCOME", $lng->txt("rep_intro"));
     $tpl->setVariable("TXT_INTRO_1", $lng->txt("rep_intro1"));
     $tpl->setVariable("TXT_INTRO_2", $lng->txt("rep_intro2"));
     $tpl->setVariable("TXT_INTRO_3", sprintf($lng->txt("rep_intro3"), $lng->txt("add")));
     $tpl->setVariable("TXT_INTRO_4", sprintf($lng->txt("rep_intro4"), $lng->txt("cat_add")));
     $tpl->setVariable("TXT_INTRO_5", $lng->txt("rep_intro5"));
     $tpl->setVariable("TXT_INTRO_6", $lng->txt("rep_intro6"));
     return $tpl->get();
 }