/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]); $exp_id = ilLMPageObject::getExportId($this->parent_obj->object->getId(), $a_set["obj_id"], $a_set["type"]); if ($this->validation) { if (!preg_match("/^[a-zA-Z_]*\$/", trim($_POST["exportid"][$a_set["obj_id"]]))) { // @todo: move to style $this->tpl->setVariable("STYLE", " style='background-color: #FCEAEA;' "); $this->tpl->setVariable("ALERT_IMG", ilUtil::img(ilUtil::getImagePath("icon_alert.svg"), $lng->txt("alert"))); } $this->tpl->setVariable("EXPORT_ID", ilUtil::prepareFormOutput(ilUtil::stripSlashes($_POST["exportid"][$a_set["obj_id"]]))); } else { $this->tpl->setVariable("EXPORT_ID", ilUtil::prepareFormOutput($exp_id)); } if ($this->cnt_exp_ids[$exp_id] > 1) { $this->tpl->setVariable("ITEM_ADD_TXT", $lng->txt("cont_exp_id_used_multiple")); $this->tpl->setVariable("ALERT_IMG", ilUtil::img(ilUtil::getImagePath("icon_alert.svg"), $lng->txt("alert"))); if (!$this->dup_info_given) { ilUtil::sendInfo($lng->txt("content_some_export_ids_multiple_times")); $this->dup_info_given = true; } } }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { if (strlen($data['description'])) { $this->tpl->setCurrentBlock('description'); $this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description'])); $this->tpl->parseCurrentBlock(); } if ($data["worked_through"]) { $this->tpl->setVariable("SRC_WORKED_THROUGH", ilUtil::getImagePath("icon_ok.png")); $this->tpl->setVariable("ALT_WORKED_THROUGH", $this->lng->txt("worked_through")); } else { $this->tpl->setVariable("SRC_WORKED_THROUGH", ilUtil::getImagePath("icon_not_ok.png")); $this->tpl->setVariable("ALT_WORKED_THROUGH", $this->lng->txt("not_worked_through")); } $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title'])); $this->tpl->setVariable("POSTPONED", $data["postponed"] ? $this->lng->txt("postponed") : ''); if ($this->show_marker) { if ($data['marked']) { $this->tpl->setCurrentBlock('marked_img'); $this->tpl->setVariable("ALT_MARKED", $this->lng->txt("tst_question_marked")); $this->tpl->setVariable("HREF_MARKED", ilUtil::getImagePath("marked.png")); $this->tpl->parseCurrentBlock(); } else { $this->tpl->touchBlock('marker'); } } }
/** * parse * * @access public * */ public function fillTemplate() { include_once 'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php'; $desc = ilMDRights::_lookupDescription($this->rbac_id, $this->obj_id); if (!$this->settings->isCopyrightSelectionActive() or !count($entries = ilMDCopyrightSelectionEntry::_getEntries())) { $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright')); $this->tpl->setVariable('COPYRIGHT_VAL', ilUtil::prepareFormOutput($desc)); return true; } $default_id = ilMDCopyrightSelectionEntry::_extractEntryId($desc); include_once 'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php'; $found = false; foreach ($entries as $entry) { $this->tpl->setCurrentBlock('copyright_selection'); if ($entry->getEntryId() == $default_id) { $found = true; $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"'); } $this->tpl->setVariable('COPYRIGHT_ID', $entry->getEntryId()); $this->tpl->setVariable('COPYRIGHT_TITLE', $entry->getTitle()); $this->tpl->setVariable('COPYRIGHT_DESCRIPTION', $entry->getDescription()); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('copyright_selection'); if (!$found) { $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"'); } $this->tpl->setVariable('COPYRIGHT_ID', 0); $this->tpl->setVariable('COPYRIGHT_TITLE', $this->lng->txt('meta_cp_own')); $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright')); if (!$found) { $this->tpl->setVariable('COPYRIGHT_VAL', $desc); } }
/** * Returns an array containing all variables and values which can be exchanged in the certificate * The values should be calculated from real data. The $params parameter array should contain all * necessary information to calculate the values. * * @param array $params An array of parameters to calculate the certificate parameter values * @return array The certificate variables */ public function getCertificateVariablesForPresentation($params = array()) { global $lng; $lng->loadLanguageModule('certificate'); $user_data = $params["user_data"]; $vars = $this->getBaseVariablesForPresentation($user_data, $params["last_access"], null); $vars["SKILL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTitleForCertificate()); $vars["SKILL_LEVEL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getLevelTitleForCertificate($this->skill_level_id)); $vars["SKILL_TRIGGER_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTriggerTitleForCertificate($this->skill_level_id)); // custom completion date $achievement_date = ilBasicSkill::lookupLevelAchievementDate($user_data["usr_id"], $this->skill_level_id); if ($achievement_date !== false) { $old = ilDatePresentation::useRelativeDates(); ilDatePresentation::setUseRelativeDates(false); $vars["DATE_COMPLETED"] = ilDatePresentation::formatDate(new ilDate($achievement_date, IL_CAL_DATETIME)); $vars["DATETIME_COMPLETED"] = ilDatePresentation::formatDate(new ilDateTime($achievement_date, IL_CAL_DATETIME)); ilDatePresentation::setUseRelativeDates($old); } else { $vars["DATE_COMPLETED"] = ""; $vars["DATETIME_COMPLETED"] = ""; } foreach ($vars as $id => $caption) { $insert_tags["[" . $id . "]"] = $caption; } return $insert_tags; }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { if (strlen($data['description'])) { $this->tpl->setCurrentBlock('description'); $this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description'])); $this->tpl->parseCurrentBlock(); } if ($this->show_marker) { if ($data['marked']) { $this->tpl->setCurrentBlock('marked_img'); $this->tpl->setVariable("ALT_MARKED", $this->lng->txt("tst_question_marked")); $this->tpl->setVariable("HREF_MARKED", ilUtil::getImagePath("marked.png")); $this->tpl->parseCurrentBlock(); } else { $this->tpl->touchBlock('marker'); } } // obligatory icon if ($data["obligatory"]) { $OBLIGATORY = "<img src=\"" . ilUtil::getImagePath("obligatory.gif", "Modules/Test") . "\" alt=\"" . $this->lng->txt("question_obligatory") . "\" title=\"" . $this->lng->txt("question_obligatory") . "\" />"; } else { $OBLIGATORY = ''; } $this->tpl->setVariable("QUESTION_OBLIGATORY", $OBLIGATORY); $this->tpl->setVariable("ORDER", $data['order']); $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title'])); $this->tpl->setVariable("HREF", $data['href']); $this->tpl->setVariable("POSTPONED", $data['postponed']); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $lng, $ilCtrl; switch ($a_set["type"]) { case ilPortfolioPage::TYPE_PAGE: $this->tpl->setCurrentBlock("title_field"); $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("action"); $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit_page")); $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $a_set["id"]); $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilportfoliopagegui", "edit")); $this->tpl->parseCurrentBlock(); break; case ilPortfolioPage::TYPE_BLOG: $this->tpl->setCurrentBlock("title_static"); $this->tpl->setVariable("VAL_TITLE", $lng->txt("obj_blog") . ": " . ilObjBlog::_lookupTitle($a_set["title"])); $this->tpl->parseCurrentBlock(); $obj_id = (int) $a_set["title"]; if (isset($this->blogs[$obj_id])) { $node_id = $this->blogs[$obj_id]; $link = ilWorkspaceAccessHandler::getGotoLink($node_id, $obj_id); $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $a_set["id"]); $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "edit"); $this->tpl->setCurrentBlock("action"); $this->tpl->setVariable("TXT_EDIT", $lng->txt("blog_edit")); $this->tpl->setVariable("CMD_EDIT", $link); $this->tpl->parseCurrentBlock(); } break; } $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->setVariable("VAL_ORDER_NR", $a_set["order_nr"]); }
/** * Fill a single data row. */ protected function fillRow($data) { global $lng, $ilCtrl; if ($this->params['langmode']) { $this->tpl->setCurrentBlock('comment'); $this->tpl->setVariable("COM_ID", ilUtil::prepareFormOutput($data["name"] . $lng->separator . "comment")); $this->tpl->setVariable("COM_NAME", ilUtil::prepareFormOutput($data["name"] . $lng->separator . "comment")); $this->tpl->setVariable("COM_VALUE", ilUtil::prepareFormOutput($data["comment"])); $this->tpl->setVariable("COM_SIZE", $this->commentsize); $this->tpl->setVariable("COM_MAX", 250); $this->tpl->setVariable("TXT_COMMENT", $lng->txt('comment')); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('hidden_comment'); $this->tpl->setVariable("COM_NAME", ilUtil::prepareFormOutput($data["name"] . $lng->separator . "comment")); $this->tpl->setVariable("COM_VALUE", ilUtil::prepareFormOutput($data["comment"])); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("T_ROWS", ceil(strlen($data["translation"]) / $this->inputsize)); $this->tpl->setVariable("T_SIZE", $this->inputsize); $this->tpl->setVariable("T_NAME", ilUtil::prepareFormOutput($data["name"])); $this->tpl->setVariable("T_USER_VALUE", ilUtil::prepareFormOutput($data["translation"])); $this->tpl->setVariable("MODULE", ilUtil::prepareFormOutput($data["module"])); $this->tpl->setVariable("TOPIC", ilUtil::prepareFormOutput($data["topic"])); $this->tpl->setVariable("DEFAULT_VALUE", ilUtil::prepareFormOutput($data["default"])); $this->tpl->setVariable("COMMENT", ilUtil::prepareFormOutput($data["default_comment"])); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->setVariable("TEXT", ilUtil::prepareFormOutput($a_set["text"])); $this->tpl->setVariable("TT_ID", ilUtil::prepareFormOutput($a_set["tt_id"])); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]); $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]); $this->tpl->setVariable("SCREEN_IDS", ilUtil::prepareFormOutput(implode($screen_ids, "\n"))); }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl; $this->pos += 10; $this->tpl->setVariable("POS", ilUtil::prepareFormOutput($this->pos)); $this->tpl->setVariable("TID", $a_set["hier_id"] . ":" . $a_set["pc_id"]); $this->tpl->setVariable("VAL_CAPTION", ilUtil::prepareFormOutput($a_set["caption"])); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("VAL_COMPONENT", ilAccessKey::getComponentNames($a_set["func_id"])); $this->tpl->setVariable("VAL_FUNCTION", ilAccessKey::getFunctionName($a_set["func_id"])); $this->tpl->setVariable("FUNC_ID", $a_set["func_id"]); $this->tpl->setVariable("VAL_ACC_KEY", ilUtil::prepareFormOutput($a_set["access_key"])); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl; // owner if (!$this->shared) { $this->tpl->setCurrentBlock("title_form"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); $this->tpl->parseCurrentBlock(); if (in_array($a_set["id"], $this->shared_objects)) { $this->tpl->setCurrentBlock("shared"); $this->tpl->setVariable("TXT_SHARED", $lng->txt("wsp_status_shared")); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("chck"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("edit"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->setVariable("STATUS_ONLINE", $a_set["is_online"] ? " checked=\"checked\"" : ""); $this->tpl->setVariable("VAL_DEFAULT", $a_set["is_default"] ? $lng->txt("yes") : ""); $this->tpl->parseCurrentBlock(); $ilCtrl->setParameter($this->parent_obj, "prt_id", $a_set["id"]); $this->tpl->setCurrentBlock("action"); $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "preview")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("user_profile_preview")); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "pages")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_edit_portfolio")); $this->tpl->parseCurrentBlock(); if ($a_set["is_online"]) { if (!$a_set["is_default"]) { $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "setDefaultConfirmation")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_set_as_default")); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "unsetDefault")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_unset_as_default")); $this->tpl->parseCurrentBlock(); } } $ilCtrl->setParameter($this->parent_obj, "prt_id", ""); } else { $this->tpl->setCurrentBlock("title_static"); $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); $this->tpl->parseCurrentBlock(); if ($a_set["password"]) { $this->tpl->setCurrentBlock("shared"); $this->tpl->setVariable("TXT_SHARED", $lng->txt("wsp_password_protected_resource")); $this->tpl->parseCurrentBlock(); } $link = ilLink::_getStaticLink($a_set["id"], "prtf", true); $this->tpl->setCurrentBlock("action"); $this->tpl->setVariable("URL_ACTION", $link); $this->tpl->setVariable("TXT_ACTION", $lng->txt("view")); $this->tpl->parseCurrentBlock(); } }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $lng, $ilCtrl; $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $ilCtrl->setParameterByClass("ilextpublicprofilepagegui", "user_page", $a_set["id"]); $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilextpublicprofilepagegui", "edit")); $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->setVariable("VAL_ORDER_NR", $a_set["order_nr"]); }
/** * fill row * * @access public * @param * @return */ public function fillRow($a_set) { global $ilUser, $ilAccess; $this->tpl->setVariable('VAL_ID', $a_set['solution_id']); if (strlen($a_set['webpath'])) { $this->tpl->setVariable('VAL_FILE', '<a href="' . $a_set['webpath'] . $a_set['value1'] . '" target=\\"_blank\\">' . ilUtil::prepareFormOutput($a_set['value2']) . '</a>'); } else { $this->tpl->setVariable('VAL_FILE', ilUtil::prepareFormOutput($a_set['value2'])); } ilDatePresentation::setUseRelativeDates(false); $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX))); }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { global $ilUser, $ilAccess; $username = $this->tstObject->userLookupFullName($data["user_fi"], TRUE); $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"], IL_CAL_UNIX))); $this->tpl->setVariable("USER", $username); $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"]))); $location = ''; if (strlen($data["ref_id"]) && strlen($data["href"])) { $location = '<a href="' . $data['href'] . '">' . $this->lng->txt("perma_link") . '</a>'; } $this->tpl->setVariable("LOCATION", $location); }
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(); }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDate($data['tstamp'], IL_CAL_UNIX))); $user = ilObjUser::_lookupName($data["user_fi"]); $this->tpl->setVariable("USER", ilUtil::prepareFormOutput(trim($user["title"] . " " . $user["firstname"] . " " . $user["lastname"]))); $title = ""; if ($data["question_fi"] || $data["original_fi"]) { include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $title = assQuestion::_getQuestionTitle($data["question_fi"]); if (strlen($title) == 0) { $title = assQuestion::_getQuestionTitle($data["original_fi"]); } $title = $this->lng->txt("assessment_log_question") . ": " . $title; } $this->tpl->setVariable("MESSAGE", ilUtil::prepareFormOutput($data['logtext']) . (strlen($title) ? " (" . $title . ")" : '')); }
/** * 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(); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl; $ilCtrl->setParameter($this->parent_obj, "tax_node", $a_set["child"]); $ret = $ilCtrl->getLinkTargetByClass("ilobjtaxonomygui", "listItems"); $ilCtrl->setParameter($this->parent_obj, "tax_node", $_GET["tax_node"]); if ($this->tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) { $this->tpl->setCurrentBlock("order"); $this->tpl->setVariable("ORDER_NR", $a_set["order_nr"]); $this->tpl->setVariable("ONODE_ID", $a_set["child"]); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("HREF_TITLE", $ret); $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($a_set["title"])); $this->tpl->setVariable("NODE_ID", $a_set["child"]); }
/** * 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(); }
/** * fill row * @global type $ilObjDataCache * @global ilRbacReview $rbacreview * @param array $a_set */ function fillRow($a_set) { global $ilObjDataCache, $rbacreview; $title = $ilObjDataCache->lookupTitle($rbacreview->getObjectOfRole($a_set["role"])); $this->tpl->setVariable("VAL_ID", $a_set['mapping_id']); $this->tpl->setVariable("VAL_TITLE", ilUtil::shortenText($title, 30, true)); $this->tpl->setVariable("VAL_ROLE", $a_set["role_name"]); $this->tpl->setVariable("VAL_GROUP", $a_set["dn"]); $this->tpl->setVariable("VAL_URL", $a_set["url"]); $this->tpl->setVariable("VAL_MEMBER", $a_set["member_attribute"]); $this->tpl->setVariable("VAL_INFO", ilUtil::prepareFormOutput($a_set['info'])); $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']); $this->tpl->setVariable("EDIT_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'addRoleMapping')); $this->tpl->setVariable("EDIT_TXT", $this->lng->txt('copy')); $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']); $this->tpl->setVariable("COPY_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'editRoleMapping')); $this->tpl->setVariable("COPY_TXT", $this->lng->txt('edit')); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl, $ilAccess, $rbacsystem; for ($i = -80; $i <= 80; $i += 20) { $this->tpl->setCurrentBlock("flavor"); $this->tpl->setVariable("FLAVOR_NAME", "(" . $i . ")"); $this->tpl->setVariable("FLAVOR_CODE", ilObjStyleSheet::_getColorFlavor($a_set["code"], $i)); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("COLOR_NAME_ENC", ilUtil::prepareFormOutput($a_set["name"])); $this->tpl->setVariable("COLOR_NAME", $a_set["name"]); $this->tpl->setVariable("COLOR_CODE", $a_set["code"]); if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])) { $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $ilCtrl->setParameter($this->parent_obj, "c_name", rawurlencode($a_set["name"])); $this->tpl->setVariable("LINK_EDIT_COLOR", $ilCtrl->getLinkTarget($this->parent_obj, "editColor")); } }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl; $this->tpl->setCurrentBlock("title_form"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); $this->tpl->parseCurrentBlock(); if (in_array($a_set["id"], $this->shared_objects)) { $this->tpl->setCurrentBlock("shared"); $this->tpl->setVariable("TXT_SHARED", $lng->txt("wsp_status_shared")); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("chck"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("edit"); $this->tpl->setVariable("VAL_ID", $a_set["id"]); $this->tpl->setVariable("STATUS_ONLINE", $a_set["is_online"] ? " checked=\"checked\"" : ""); $this->tpl->setVariable("VAL_DEFAULT", $a_set["is_default"] ? $lng->txt("yes") : ""); $this->tpl->parseCurrentBlock(); $prtf_path = array(get_class($this->parent_obj), "ilobjportfoliogui"); $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $a_set["id"]); $this->tpl->setCurrentBlock("action"); $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTargetByClass($prtf_path, "preview")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("user_profile_preview")); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTargetByClass($prtf_path, "view")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_edit_portfolio")); $this->tpl->parseCurrentBlock(); $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", ""); if ($a_set["is_online"]) { if (!$a_set["is_default"]) { $ilCtrl->setParameter($this->parent_obj, "prt_id", $a_set["id"]); $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "setDefaultConfirmation")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_set_as_default")); $this->tpl->parseCurrentBlock(); $ilCtrl->setParameter($this->parent_obj, "prt_id", ""); } else { $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, "unsetDefault")); $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_unset_as_default")); $this->tpl->parseCurrentBlock(); } } }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->nr++; if ($this->incl_desc) { $this->tpl->setCurrentBlock("desc_row"); $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"])); $this->tpl->setVariable("DNR", $this->nr); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("NR", $this->nr); // lang selection include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $languages = ilMDLanguageItem::_getLanguages(); $this->tpl->setVariable("LANG_SELECT", ilUtil::formSelect($a_set["lang"], "lang[" . $this->nr . "]", $languages, false, true)); if ($a_set["default"]) { $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\""); } $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); }
/** * 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() ? "< " : "") . $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(); }
/** * 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"); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl; $this->tpl->setVariable("TID", $a_set["hier_id"] . ":" . $a_set["pc_id"]); $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($a_set["title"])); }
/** * 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(); }
/** * Returns a JSON representation of the question */ public function toJSON() { include_once "./Services/RTE/classes/class.ilRTE.php"; $result = array(); $result['id'] = (int) $this->getId(); $result['type'] = (string) $this->getQuestionType(); $result['title'] = (string) $this->getTitle(); $result['question'] = $this->formatSAQuestion($this->getQuestion()); $result['text'] = (string) ilRTE::_replaceMediaObjectImageSrc($this->getErrorText(), 0); $result['nr_of_tries'] = (int) $this->getNrOfTries(); $result['shuffle'] = (bool) $this->getShuffle(); $result['feedback'] = array('onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)), 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))); $answers = array(); foreach ($this->getErrorData() as $idx => $answer_obj) { array_push($answers, array("answertext_wrong" => (string) $answer_obj->text_wrong, "answertext_correct" => (string) $answer_obj->text_correct, "points" => (double) $answer_obj->points, "order" => (int) $idx + 1)); } $result['correct_answers'] = $answers; $answers = array(); $textarray = preg_split("/[\n\r]+/", $this->getErrorText()); foreach ($textarray as $textidx => $text) { $items = preg_split("/\\s+/", trim($text)); foreach ($items as $idx => $item) { if (substr($item, 0, 1) == "#") { $item = substr($item, 1); // #14115 - add position to correct answer foreach ($result["correct_answers"] as $aidx => $answer) { if ($answer["answertext_wrong"] == $item && !$answer["pos"]) { $result["correct_answers"][$aidx]["pos"] = $this->getId() . "_" . $textidx . "_" . ($idx + 1); break; } } } array_push($answers, array("answertext" => (string) ilUtil::prepareFormOutput($item), "order" => $this->getId() . "_" . $textidx . "_" . ($idx + 1))); } if ($textidx != sizeof($textarray) - 1) { array_push($answers, array("answertext" => "###", "order" => $this->getId() . "_" . $textidx . "_" . ($idx + 2))); } } $result['answers'] = $answers; $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId()); $result['mobs'] = $mobs; return json_encode($result); }