protected function prepareOutput() { $this->tpl->getStandardTemplate(); $this->tpl->setTitleIcon(ilObject::_getIcon('', '', 'pays'), $this->lng->txt("shop")); $this->tpl->setTitle($this->lng->txt("shop")); ilUtil::infoPanel(); }
/** * Get HTML for navigation history */ function getHTML() { global $ilNavigationHistory, $lng; include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $selection = new ilAdvancedSelectionListGUI(); $selection->setFormSelectMode("url_ref_id", "ilNavHistorySelect", true, "goto.php?target=navi_request", "ilNavHistory", "ilNavHistoryForm", "_top", $lng->txt("go"), "ilNavHistorySubmit"); $selection->setListTitle($lng->txt("last_visited")); $selection->setId("lastvisited"); $selection->setSelectionHeaderClass("MMInactive"); $selection->setHeaderIcon(ilAdvancedSelectionListGUI::NO_ICON); $selection->setItemLinkClass("small"); $selection->setUseImages(true); include_once "./Services/Accessibility/classes/class.ilAccessKey.php"; $selection->setAccessKey(ilAccessKey::LAST_VISITED); $items = $ilNavigationHistory->getItems(); //$sel_arr = array(0 => "-- ".$lng->txt("last_visited")." --"); reset($items); $cnt = 0; foreach ($items as $k => $item) { if ($cnt++ > 20) { break; } if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) || $item["ref_id"] != $_GET["ref_id"] || $k > 0) { $obj_id = ilObject::_lookupObjId($item["ref_id"]); $selection->addItem($item["title"], $item["ref_id"], $item["link"], ilObject::_getIcon($obj_id, "tiny", $item["type"]), $lng->txt("obj_" . $item["type"]), "_top"); } } $html = $selection->getHTML(); if ($html == "") { $selection->addItem($lng->txt("no_items"), "", "#", "", "", "_top"); $selection->setUseImages(false); $html = $selection->getHTML(); } return $html; }
function getSelectableColumns() { global $ilObjDataCache; $columns = array(); if ($this->obj_ids === NULL) { $this->obj_ids = $this->getItems(); } if ($this->obj_ids) { $tmp_cols = array(); foreach ($this->obj_ids as $obj_id) { if ($obj_id == $this->obj_id) { $parent = array("txt" => $this->lng->txt("status"), "default" => true); } else { $title = $ilObjDataCache->lookupTitle($obj_id); $type = $ilObjDataCache->lookupType($obj_id); $icon = ilObject::_getIcon("", "tiny", $type); if ($type == "sess") { include_once "Modules/Session/classes/class.ilObjSession.php"; $sess = new ilObjSession($obj_id, false); $title = $sess->getPresentationTitle(); } $tmp_cols[strtolower($title) . "#~#obj_" . $obj_id] = array("txt" => $title, "icon" => $icon, "type" => $type, "default" => true); } } if (sizeof($this->objective_ids)) { foreach ($this->objective_ids as $obj_id => $title) { $tmp_cols[strtolower($title) . "#~#objtv_" . $obj_id] = array("txt" => $title, "default" => true); } } if (sizeof($this->sco_ids)) { foreach ($this->sco_ids as $obj_id => $title) { $icon = ilUtil::getTypeIconPath("sco", $obj_id, "tiny"); $tmp_cols[strtolower($title) . "#~#objsco_" . $obj_id] = array("txt" => $title, "icon" => $icon, "default" => true); } } // alex, 5 Nov 2011: Do not sort SCORM items if (!sizeof($this->sco_ids)) { ksort($tmp_cols); } foreach ($tmp_cols as $id => $def) { $id = explode('#~#', $id); $columns[$id[1]] = $def; } unset($tmp_cols); if ($parent) { $columns["obj_" . $this->obj_id] = $parent; } } $columns["status_changed"] = array("txt" => $this->lng->txt("trac_status_changed"), "id" => "status_changed", "default" => false); include_once 'Services/Tracking/classes/class.ilObjUserTracking.php'; $tracking = new ilObjUserTracking(); if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) { $columns["last_access"] = array("txt" => $this->lng->txt("last_access"), "id" => "last_access", "default" => false); } if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) { $columns["spent_seconds"] = array("txt" => $this->lng->txt("trac_spent_seconds"), "id" => "spent_seconds", "default" => false); } return $columns; }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; //var_dump($a_set); $this->tpl->setVariable("ICON", ilUtil::img(ilObject::_getIcon($a_set["obj_id"], "tiny"), $a_set["type_txt"])); $this->tpl->setVariable("TITLE", $a_set["title"]); $this->tpl->setVariable("CMD", $a_set["cmd"]); }
function prepareOutput() { global $ilLocator, $lng; $this->tpl->getStandardTemplate(); // $ilLocator->addItem($this->lng->txt('search'),$this->ctrl->getLinkTarget($this)); // $this->tpl->setLocator(); //$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_src_b.gif"), // $lng->txt("search")); $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", "src"), ""); $this->tpl->setTitle($lng->txt("search")); ilUtil::infoPanel(); }
/** * Get node icon * Return custom icon of OrgUnit type if existing * * @param array $a_node * * @return string */ public function getNodeIcon($a_node) { global $ilias; if ($ilias->getSetting('custom_icons')) { $icons_cache = ilObjOrgUnit::getIconsCache(); $obj_id = ilObject::_lookupObjId($a_node["child"]); if (isset($icons_cache[$obj_id])) { return $icons_cache[$obj_id]; } } return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $objDefinition; $img = ilObject::_getIcon($obj_id, "small", $a_set["type"]); if (is_file($img)) { $alt = $objDefinition->isPlugin($a_set["type"]) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $a_set["type"], "obj_" . $a_set["type"]) : $lng->txt("icon") . " " . $lng->txt("obj_" . $a_set["type"]); $this->tpl->setVariable("IMG_TYPE", ilUtil::img($img, $alt)); } $this->tpl->setVariable("ID", $a_set["ref_id"]); $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); $this->tpl->setVariable("VAL_LAST_CHANGE", $a_set["last_update"]); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("ITEM_REF_ID", $a_set["child"]); $this->tpl->setVariable("TITLE", $a_set["title"]); $this->tpl->setVariable("IMG", ilUtil::img(ilObject::_getIcon($a_set["obj_id"], "tiny"))); if (in_array($a_set["child"], $this->items)) { $this->tpl->setVariable("IMG_ASSIGNED", ilUtil::img(ilUtil::getImagePath("icon_ok.png"))); $this->tpl->setVariable("CHECKED", "checked='checked'"); } else { $this->tpl->setVariable("IMG_ASSIGNED", ilUtil::img(ilUtil::getImagePath("icon_not_ok.png"))); } }
/** * Render html */ function render($a_mode = "") { global $lng, $tpl, $ilUser; $quota_exceeded = $quota_legend = false; if (self::$check_wsp_quota) { include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php"; if (!ilDiskQuotaHandler::isUploadPossible()) { $lng->loadLanguageModule("file"); return $lng->txt("personal_workspace_quota_exceeded_warning"); } else { $quota_legend = ilDiskQuotaHandler::getStatusLegend(); } } // make sure jQuery is loaded iljQueryUtil::initjQuery(); // add file upload scripts include_once "./Services/FileUpload/classes/class.ilFileUploadGUI.php"; ilFileUploadGUI::initFileUpload(); // load template $this->tpl = new ilTemplate("tpl.prop_dndfiles.html", true, true, "Services/Form"); // general variables $this->tpl->setVariable("UPLOAD_ID", $this->uniqueId); // input $this->tpl->setVariable("FILE_SELECT_ICON", ilObject::_getIcon("", "", "fold")); $this->tpl->setVariable("TXT_SHOW_ALL_DETAILS", $lng->txt('show_all_details')); $this->tpl->setVariable("TXT_HIDE_ALL_DETAILS", $lng->txt('hide_all_details')); $this->tpl->setVariable("TXT_SELECTED_FILES", $lng->txt('selected_files')); $this->tpl->setVariable("TXT_DRAG_FILES_HERE", $lng->txt('drag_files_here')); $this->tpl->setVariable("TXT_NUM_OF_SELECTED_FILES", $lng->txt('num_of_selected_files')); $this->tpl->setVariable("TXT_SELECT_FILES_FROM_COMPUTER", $lng->txt('select_files_from_computer')); $this->tpl->setVariable("TXT_OR", $lng->txt('logic_or')); $this->tpl->setVariable("INPUT_ACCEPT_SUFFIXES", $this->getInputAcceptSuffixes($this->getSuffixes())); // info $this->tpl->setCurrentBlock("max_size"); $this->tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString()); $this->tpl->parseCurrentBlock(); if ($quota_legend) { $this->tpl->setVariable("TXT_MAX_SIZE", $quota_legend); $this->tpl->parseCurrentBlock(); } $this->outputSuffixes($this->tpl); // create file upload object $upload = new ilFileUploadGUI("ilFileUploadDropZone_" . $this->uniqueId, $this->uniqueId, false); $upload->enableFormSubmit("ilFileUploadInput_" . $this->uniqueId, $this->submit_button_name, $this->cancel_button_name); $upload->setDropAreaId("ilFileUploadDropArea_" . $this->uniqueId); $upload->setFileListId("ilFileUploadList_" . $this->uniqueId); $upload->setFileSelectButtonId("ilFileUploadFileSelect_" . $this->uniqueId); $this->tpl->setVariable("FILE_UPLOAD", $upload->getHTML()); return $this->tpl->get(); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $tree; $ref_id = $a_set["rep_ref_id"]; $obj_id = ilObject::_lookupObjId($ref_id); $this->tpl->setVariable("TITLE", ilObject::_lookupTitle($obj_id)); $this->tpl->setVariable("IMG", ilUtil::img(ilObject::_getIcon($obj_id, "tiny"))); $this->tpl->setVariable("ID", $ref_id); $path = $tree->getPathFull($ref_id); $path_items = array(); foreach ($path as $p) { if ($p["type"] != "root" && $p["child"] != $ref_id) { $path_items[] = $p["title"]; } } $this->tpl->setVariable("PATH", implode($path_items, " > ")); }
protected function getStartObjects() { $data = array(); $counter = 0; foreach ($this->start_obj->getStartObjects() as $start_id => $item) { $tmp_obj = ilObjectFactory::getInstanceByRefId($item['item_ref_id']); $data[$item['item_ref_id']]['id'] = $start_id; $data[$item['item_ref_id']]['title'] = $tmp_obj->getTitle(); $data[$item['item_ref_id']]['type'] = $this->lng->txt('obj_' . $tmp_obj->getType()); $data[$item['item_ref_id']]['icon'] = ilObject::_getIcon($tmp_obj->getId(), 'tiny'); $counter += 10; $data[$item['item_ref_id']]['pos'] = $counter; if (strlen($tmp_obj->getDescription())) { $data[$item['item_ref_id']]['description'] = $tmp_obj->getDescription(); } } return $data; }
/** * Set and parse conditions * @param array $a_conditions */ public function setConditions($a_conditions) { foreach ((array) $a_conditions as $condition) { if ($condition['trigger_type'] == 'crsg') { continue; } $row['id'] = $condition['condition_id']; $row['ref_id'] = $condition['trigger_ref_id']; $row['type'] = $condition['trigger_type']; $row['title'] = ilObject::_lookupTitle($condition['trigger_obj_id']); $row['description'] = ilObject::_lookupDescription($condition['trigger_obj_id']); $row['icon'] = ilObject::_getIcon($condition['trigger_obj_id']); $row['icon_alt'] = $this->lng->txt('obj_' . $condition['trigger_type']); $row['condition'] = $this->lng->txt('condition_' . $condition['operator']); $row['obligatory'] = $condition['obligatory']; $rows[] = $row; } $this->setData($rows); }
/** * Show delete confirmation table */ function showDeleteConfirmation($a_ids, $a_supress_message = false) { global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition; if (!is_array($a_ids) || count($a_ids) == 0) { ilUtil::sendFailure($lng->txt("no_checkbox"), true); return false; } // Remove duplicate entries $a_ids = array_unique((array) $a_ids); include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); if (!$a_supress_message) { $msg = $lng->txt("info_delete_sure"); if (!$ilSetting->get('enable_trash')) { $msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash"); } $cgui->setHeaderText($msg); } $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui)); $cgui->setCancel($lng->txt("cancel"), "cancelDelete"); $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete"); $form_name = "cgui_" . md5(uniqid()); $cgui->setFormName($form_name); $deps = array(); foreach ($a_ids as $ref_id) { $obj_id = ilObject::_lookupObjId($ref_id); $type = ilObject::_lookupType($obj_id); $title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id); $alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type); $title .= $this->handleMultiReferences($obj_id, $ref_id, $form_name); $cgui->addItem("id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt); ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type); } $deps_html = ""; if (is_array($deps) && count($deps) > 0) { include_once "./Services/Repository/classes/class.ilRepDependenciesTableGUI.php"; $tab = new ilRepDependenciesTableGUI($deps); $deps_html = "<br/><br/>" . $tab->getHTML(); } $tpl->setContent($cgui->getHTML() . $deps_html); return true; }
public function fillRow($row) { global $lng, $objDefinition; // #11050 if (!$objDefinition->isPlugin($row["type"])) { $txt_type = $lng->txt("obj_" . $row["type"]); } else { include_once "./Services/Component/classes/class.ilPlugin.php"; $txt_type = ilPlugin::lookupTxt("rep_robj", $row["type"], "obj_" . $row["type"]); } $this->tpl->setVariable("TITLE", $row["title"]); $this->tpl->setVariable("ALT_ICON", $txt_type); $this->tpl->setVariable("SRC_ICON", ilObject::_getIcon("", "tiny", $row["type"])); $this->tpl->setVariable("PATH", $row["path"]); if ($row["readable"]) { $this->tpl->setCurrentBlock("actions"); $this->tpl->setVariable("ACTIONS", $this->buildActions($row["ref_id"], $row["type"])); $this->tpl->parseCurrentBlock(); } }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl; $now = new ilDateTime(time(), IL_CAL_UNIX); $this->tpl->setVariable("IMG_ALT", $lng->txt("obj_" . $a_set["type"])); $this->tpl->setVariable("IMG_SRC", ilObject::_getIcon($a_set["obj_id"], "small", $a_set["type"])); $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); $this->tpl->setVariable("ID", $a_set["ref_id"]); $this->tpl->setVariable("TXT_LAST_EXPORT_FILE", $lng->txt("export_last_file")); $this->tpl->setVariable("TXT_OMIT", $lng->txt("export_omit")); $this->tpl->setVariable("TXT_CREATE_NEW_EXPORT_FILE", $lng->txt("export_create")); $preset = "CREATE"; if ($a_set["timestamp"] > 0) { $last_export = new ilDateTime($a_set["timestamp"], IL_CAL_UNIX); $this->tpl->setVariable("VAL_LAST_EXPORT", ilDatePresentation::formatDate($last_export)); if (ilDateTime::_equals($last_export, $now, IL_CAL_DAY)) { $preset = "LAST_FILE"; } } $this->tpl->setVariable("SEL_" . $preset, ' checked="checked" '); }
/** * Fill a single data row. */ protected function fillRow($a_set) { $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon('', 'tiny', $a_set['type'])); $this->tpl->setVariable('IMG_ALT', $this->lng->txt('obj_' . $a_set['type'])); $this->tpl->setVariable("VAL_POSTNAME", "items"); $this->tpl->setVariable("VAL_ID", $a_set['ref_id']); if (in_array($a_set['ref_id'], $this->getMaterialItems())) { $this->tpl->setVariable("VAL_CHECKED", "checked"); } $this->tpl->setVariable("COLL_TITLE", $a_set['title']); if (strlen($a_set['description'])) { $this->tpl->setVariable("COLL_DESC", $a_set['description']); } $this->tpl->setVariable("ASSIGNED_IMG_OK", in_array($a_set['ref_id'], $this->getMaterialItems()) ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg')); $this->tpl->setVariable("ASSIGNED_STATUS", $this->lng->txt('event_material_assigned')); include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->enableDisplayCut(true); $path->enableTextOnly(false); $this->tpl->setVariable("PATH", $this->lng->txt('path')); $this->tpl->setVariable("COLL_PATH", $path->getPath($this->getContainerRefId(), $a_set['ref_id'])); }
protected function getStartObjects($a_obj_course, $crs_start) { $starters = $crs_start->getStartObjects(); /* if(!count($starters)) { ilUtil::sendInfo($this->lng->txt('crs_no_starter_created')); } */ $data = array(); foreach ($starters as $start_id => $item) { $tmp_obj = ilObjectFactory::getInstanceByRefId($item['item_ref_id']); $data[$item['item_ref_id']]['id'] = $start_id; $data[$item['item_ref_id']]['title'] = $tmp_obj->getTitle(); $data[$item['item_ref_id']]['type'] = $this->lng->txt('obj_' . $tmp_obj->getType()); $data[$item['item_ref_id']]['icon'] = ilObject::_getIcon($tmp_obj->getId(), 'tiny'); if (strlen($tmp_obj->getDescription())) { $data[$item['item_ref_id']]['description'] = $tmp_obj->getDescription(); } } return $data; }
/** * 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(); }
public function confirmRemoveObject() { global $ilCtrl; if (!sizeof($_POST["id"])) { ilUtil::sendFailure($this->lng->txt("select_one"), true); $ilCtrl->redirect($this, "manage"); } if ($this->view == self::VIEW_MY_OFFERS) { $question = $this->lng->txt("pd_info_delete_sure_remove"); $cmd = "confirmedRemove"; } else { $question = $this->lng->txt("pd_info_delete_sure_unsubscribe"); $cmd = "confirmedUnsubscribe"; } include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setHeaderText($question); $cgui->setFormAction($ilCtrl->getFormAction($this)); $cgui->setCancel($this->lng->txt("cancel"), "manage"); $cgui->setConfirm($this->lng->txt("confirm"), $cmd); foreach ($_POST["id"] as $ref_id) { $obj_id = ilObject::_lookupObjectId($ref_id); $title = ilObject::_lookupTitle($obj_id); $type = ilObject::_lookupType($obj_id); $cgui->addItem("ref_id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $type)); } return $cgui->getHTML(); }
/** * Insert resources * * @param * @return */ static function insertResourcesIntoPageContent($a_content) { global $objDefinition, $tree, $lng; $ref_id = (int) $_GET["ref_id"]; $obj_id = (int) ilObject::_lookupObjId($ref_id); $obj_type = ilObject::_lookupType($obj_id); // determine type -> group $type_to_grp = array(); $type_grps = $objDefinition->getGroupedRepositoryObjectTypes($obj_type); foreach ($type_grps as $grp => $def) { foreach ($def["objs"] as $t) { $type_to_grp[$t] = $grp; } } $childs = $tree->getChilds($ref_id); $childs_by_type = array(); $item_groups = array(); foreach ($childs as $child) { $childs_by_type[$type_to_grp[$child["type"]]][] = $child; if ($child["type"] == "itgr") { $item_groups[(int) $child["ref_id"]] = $child["title"]; } } // handle "by type" lists foreach ($type_grps as $type => $v) { if (is_int(strpos($a_content, "[list-" . $type . "]"))) { // render block $tpl = new ilTemplate("tpl.resource_block.html", true, true, "Services/COPage"); $cnt = 0; if (is_array($childs_by_type[$type]) && count($childs_by_type[$type]) > 0) { foreach ($childs_by_type[$type] as $child) { $tpl->setCurrentBlock("row"); $tpl->setVariable("IMG", ilUtil::img(ilObject::_getIcon($child["obj_id"], "small"))); $tpl->setVariable("TITLE", $child["title"]); $tpl->parseCurrentBlock(); $cnt++; } $tpl->setVariable("HEADER", $lng->txt("objs_" . $type)); $a_content = str_replace("[list-" . $type . "]", $tpl->get(), $a_content); } else { $tpl->setCurrentBlock("row"); $tpl->setVariable("TITLE", $lng->txt("no_items")); $tpl->parseCurrentBlock(); $tpl->setVariable("HEADER", $lng->txt("objs_" . $type)); $a_content = str_replace("[list-" . $type . "]", $tpl->get(), $a_content); } } } // handle item groups while (eregi("\\[(item-group-([0-9]*))\\]", $a_content, $found)) { $itgr_ref_id = (int) $found[2]; // check whether this item group is child -> insert editing html if (isset($item_groups[$itgr_ref_id])) { include_once "./Modules/ItemGroup/classes/class.ilItemGroupItems.php"; $itgr_items = new ilItemGroupItems($itgr_ref_id); $items = $itgr_items->getValidItems(); // render block $tpl = new ilTemplate("tpl.resource_block.html", true, true, "Services/COPage"); foreach ($items as $it_ref_id) { $it_obj_id = ilObject::_lookupObjId($it_ref_id); $it_title = ilObject::_lookupTitle($it_obj_id); $tpl->setCurrentBlock("row"); $tpl->setVariable("IMG", ilUtil::img(ilObject::_getIcon($it_obj_id, "small"))); $tpl->setVariable("TITLE", $it_title); $tpl->parseCurrentBlock(); } $tpl->setVariable("HEADER", $item_groups[$itgr_ref_id]); $html = $tpl->get(); } else { $html = "<i>" . $lng->txt("cont_element_refers_removed_itgr") . "</i>"; } $a_content = eregi_replace("\\[" . $found[1] . "\\]", $html, $a_content); } return $a_content; }
/** * called by prepare output */ protected function setTitleAndDescription() { if (!is_object($this->object)) { if ((int) $_REQUEST["crtptrefid"] > 0) { $cr_obj_id = ilObject::_lookupObjId((int) $_REQUEST["crtcb"]); $this->tpl->setTitle(ilObject::_lookupTitle($cr_obj_id)); $this->tpl->setTitleIcon(ilObject::_getIcon($cr_obj_id)); } return; } $this->tpl->setTitle($this->object->getPresentationTitle()); $this->tpl->setDescription($this->object->getLongDescription()); if (strtolower($_GET["baseClass"]) == "iladministrationgui") { // alt text would be same as heading -> empty alt text $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType())); } else { $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType()), $this->lng->txt("obj_" . $this->object->getType())); } include_once './Services/Object/classes/class.ilObjectListGUIFactory.php'; $lgui = ilObjectListGUIFactory::_getListGUIByType($this->object->getType()); $lgui->initItem($this->object->getRefId(), $this->object->getId()); $this->tpl->setAlertProperties($lgui->getAlertProperties()); }
private function renderItems($oContainerTpl, $results, $topic) { // main shop_content global $ilUser; $items_counter = 0; $cur_obj_type = ''; $tpl = $this->newBlockTemplate(); foreach ($this->type_ordering as $act_type) { $item_html = array(); if (count($results[(int) $topic['id']][$act_type])) { foreach ($results[$topic['id']][$act_type] as $key => $item) { // price presentation $oPaymentObject = new ilPaymentObject($ilUser, ilPaymentObject::_lookupPobjectId($item['ref_id'])); $oPrice = new ilPaymentPrices((int) $oPaymentObject->getPobjectId()); $lowest_price = $oPrice->getLowestPrice(); $special_icon = ' '; if ($oPaymentObject->getSpecial() == '1') { $special_icon = ilShopUtils::_getSpecialObjectSymbol(); } $results[$topic['id']][$act_type][$key]['title'] = $item['title'] . ' ' . ($results[$topic['id']][$act_type][$key]['special_icon'] = $special_icon); $results[$topic['id']][$act_type][$key]['price'] = $lowest_price['price']; $paymethod_icon = ilShopUtils::_getPaymethodSymbol($oPaymentObject->getPayMethod()); $shoppingcart_icon = ilShopUtils::_addToShoppingCartSymbol($item['ref_id']); $results[$topic['id']][$act_type][$key]['price_string'] = ($oPrice->getNumberOfPrices() > 1 ? $this->lng->txt('price_from') . ' ' : '') . ilPaymentPrices::_formatPriceToString($lowest_price['price']) . ' ' . ($results[$topic['id']][$act_type][$key]['shoppingcart_icon'] = $shoppingcart_icon . ' ' . ($results[$topic['id']][$act_type][$key]['paymethod_icon'] = $paymethod_icon)); // authors include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($item['obj_id'], 0, $item['type']); if (is_object($md_section = $md_obj->getLifecycle())) { $sep = $ent_str = ""; foreach ($ids = $md_section->getContributeIds() as $con_id) { $md_con = $md_section->getContribute($con_id); if ($md_con->getRole() == "Author") { foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) { $md_ent = $md_con->getEntity($ent_id); $ent_str = $ent_str . $sep . $md_ent->getEntity(); $sep = ", "; } } } $results[$topic['id']][$act_type][$key]['author'] = $ent_str; } } $results[$topic['id']][$act_type] = $this->sortResult($results[$topic['id']][$act_type]); foreach ($results[$topic['id']][$act_type] as $key => $item) { // get list gui class for each object type list($item, $html) = $this->getObjectListItem($cur_obj_type, $item); if ($html) { $item_html[$item['ref_id']] = $html; } } // output block for resource type if (count($item_html) > 0) { // add a header for each resource type $tpl->setCurrentBlock("container_header_row_image"); $tpl->setVariable("HEADER_IMG", ilObject::_getIcon('', '', $act_type)); $tpl->setVariable("HEADER_ALT", $this->lng->txt("objs_" . $act_type)); $tpl->setVariable("BLOCK_HEADER_CONTENT", $this->lng->txt("objs_" . $act_type)); $this->resetRowType(); // content row foreach ($item_html as $ref_id => $html) { $this->addStandardRow($tpl, $html); } ++$items_counter; } } } if ($items_counter > 0) { $oContainerTpl->setCurrentBlock('loop_item'); $oContainerTpl->setCurrentBlock('topic_title'); $oContainerTpl->setVariable('TOPIC_TITLE', $topic['title']); $oContainerTpl->parseCurrentBlock('topic_title'); $oContainerTpl->setVariable('CONTAINER_LIST_BLOCK', $html); $oContainerTpl->parseCurrentBlock('loop_item'); $tpl->setContent($oContainerTpl->get()); $container_html = $tpl->get(); return $container_html; } }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $objDefinition; $obj_id = $a_set["obj_id"]; $ref_id = $a_set["ref_id"]; $type = $a_set['type']; $title = $a_set['title']; $description = $a_set['description']; $relevance = $a_set['relevance']; if (!$type) { return false; } include_once './Services/Search/classes/Lucene/class.ilLuceneSearchObjectListGUIFactory.php'; $item_list_gui = ilLuceneSearchObjectListGUIFactory::factory($type); $item_list_gui->initItem($ref_id, $obj_id, $title, $description); $item_list_gui->setContainerObject($this->parent_obj); $item_list_gui->setSearchFragment($this->presenter->lookupContent($obj_id, 0)); $item_list_gui->setSeparateCommands(true); ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_set); $this->presenter->appendAdditionalInformation($item_list_gui, $ref_id, $obj_id, $type); $this->tpl->setVariable("ACTION_HTML", $item_list_gui->getCommandsHTML()); if ($html = $item_list_gui->getListItemHTML($ref_id, $obj_id, $title, $description)) { $item_html[$ref_id]['html'] = $html; $item_html[$ref_id]['type'] = $type; } $this->tpl->setVariable("HREF_IMG", $item_list_gui->default_command["link"]); global $lng; if ($this->enabledRelevance()) { $width1 = (int) ((int) $relevance / 2); $width2 = (int) (50 - $width1); $this->tpl->setCurrentBlock('relev'); $this->tpl->setVariable('VAL_REL', sprintf("%d %%", $relevance)); $this->tpl->setVariable('WIDTH_A', $width1); $this->tpl->setVariable('WIDTH_B', $width2); $this->tpl->setVariable('IMG_A', ilUtil::getImagePath("relevance_blue.png")); $this->tpl->setVariable('IMG_B', ilUtil::getImagePath("relevance_dark.png")); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("ITEM_HTML", $html); if (!$objDefinition->isPlugin($type)) { $type_txt = $lng->txt('icon') . ' ' . $lng->txt('obj_' . $type); $icon = ilUtil::getImagePath('icon_' . $type . '.png'); } else { include_once "./Services/Component/classes/class.ilPlugin.php"; $type_txt = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type); $icon = ilObject::_getIcon($obj_id, 'small', $type); } $this->tpl->setVariable("TYPE_IMG", ilUtil::img($icon, $type_txt)); }
/** * Fill table row */ protected function fillRow($a_set) { global $ilCtrl; $type = ilObject::_lookupType($a_set["obj_id"]); $this->tpl->setVariable("OBJ_ID", $a_set["obj_id"]); $this->tpl->setVariable("ICON_SRC", ilObject::_getIcon("", "tiny", $type)); $this->tpl->setVariable("ICON_ALT", $this->lng->txt($type)); $this->tpl->setVariable("TITLE_TEXT", $a_set["title"]); if ($this->preselected && in_array($a_set["obj_id"], $this->preselected)) { $this->tpl->setVariable("CHECKBOX_STATE", " checked=\"checked\""); } $this->tpl->setCurrentBlock("hour"); for ($loop = 0; $loop < 24; $loop += 2) { $value = (int) $a_set["hour" . $loop]; if ($this->filter["measure"] != "spent_seconds") { $value = $this->anonymizeValue($value); } else { $value = $this->formatSeconds($value, true); } $this->tpl->setVariable("HOUR_VALUE", $value); $this->tpl->parseCurrentBlock(); } if ($this->filter["measure"] == "spent_seconds") { $sum = $this->formatSeconds((int) $a_set["sum"], true); } else { $sum = $this->anonymizeValue((int) $a_set["sum"]); } $this->tpl->setVariable("TOTAL", $sum); }
/** * Get locator HTML */ function getHTML() { global $lng, $ilSetting; if ($this->getTextOnly()) { $loc_tpl = new ilTemplate("tpl.locator_text_only.html", true, true, "Services/Locator"); } else { $loc_tpl = new ilTemplate("tpl.locator.html", true, true, "Services/Locator"); } $items = $this->getItems(); $first = true; if (is_array($items)) { foreach ($items as $item) { if (!$first) { $loc_tpl->touchBlock("locator_separator_prefix"); } if ($item["ref_id"] > 0) { $obj_id = ilObject::_lookupObjId($item["ref_id"]); $type = ilObject::_lookupType($obj_id); if (!$this->getTextOnly()) { $icon_path = ilObject::_getIcon($obj_id, "tiny", $type, $this->getOffline()); } $loc_tpl->setCurrentBlock("locator_img"); $loc_tpl->setVariable("IMG_SRC", $icon_path); $loc_tpl->setVariable("IMG_ALT", $lng->txt("obj_" . $type)); $loc_tpl->parseCurrentBlock(); } $loc_tpl->setCurrentBlock("locator_item"); if ($item["link"] != "") { $loc_tpl->setVariable("LINK_ITEM", $item["link"]); if ($item["frame"] != "") { $loc_tpl->setVariable("LINK_TARGET", ' target="' . $item["frame"] . '" '); } $loc_tpl->setVariable("ITEM", $item["title"]); } else { $loc_tpl->setVariable("PREFIX", $item["title"]); } $loc_tpl->parseCurrentBlock(); $first = false; } } else { $loc_tpl->setVariable("NOITEM", " "); $loc_tpl->touchBlock("locator"); } $loc_tpl->setVariable("TXT_BREADCRUMBS", $lng->txt("breadcrumb_navigation")); return trim($loc_tpl->get()); }
/** * Render workspace toolbar (folder navigation, add subobject) */ protected function renderToolbar() { global $lng, $ilCtrl, $objDefinition, $tpl, $ilSetting; $settings_map = array("blog" => "blogs", "file" => "files", "tstv" => "certificates", "excv" => "certificates", "webr" => "links"); $root = $this->tree->getNodeData($this->node_id); $subtypes = $objDefinition->getCreatableSubObjects($root["type"], ilObjectDefinition::MODE_WORKSPACE); if ($subtypes) { // :TODO: permission checks? $subobj = array(); foreach (array_keys($subtypes) as $type) { if (isset($settings_map[$type]) && $ilSetting->get("disable_wsp_" . $settings_map[$type])) { continue; } $class = $objDefinition->getClassName($type); $subobj[] = array("value" => $type, "title" => $lng->txt("wsp_type_" . $type), "img" => ilObject::_getIcon("", "tiny", $type), "alt" => $lng->txt("wsp_type_" . $type)); } $subobj = ilUtil::sortArray($subobj, "title", 1); $lng->loadLanguageModule("cntr"); $tpl->setCreationSelector($ilCtrl->getFormAction($this), $subobj, "create", $lng->txt("add")); } }
/** * Fill table row */ protected function fillRow($a_set) { global $ilCtrl; if (!$this->is_details) { $type = ilObject::_lookupType($a_set["obj_id"]); // ajax details layer link if (strpos($this->filter["yearmonth"], "-") === false) { $ilCtrl->setParameter($this->parent_obj, "item_id", $a_set["obj_id"]); $url = $ilCtrl->getLinkTarget($this->parent_obj, "showLearningProgressDetails"); $a_set["title"] .= " (<a href=\"#\" onclick=\"ilObjStat.showLPDetails(event, '" . $url . "');\">Details</a>)"; $ilCtrl->setParameter($this->parent_obj, "item_id", ""); } $this->tpl->setCurrentBlock("checkbox"); $this->tpl->setVariable("OBJ_ID", $a_set["obj_id"]); $this->tpl->setVariable("ICON_SRC", ilObject::_getIcon("", "tiny", $type)); $this->tpl->setVariable("ICON_ALT", $this->lng->txt($type)); $this->tpl->setVariable("TITLE_TEXT", $a_set["title"]); if ($this->preselected && in_array($a_set["obj_id"], $this->preselected)) { $this->tpl->setVariable("CHECKBOX_STATE", " checked=\"checked\""); } $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock("details"); $this->tpl->setVariable("TXT_FIGURE", $a_set["figure"]); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("item"); if (strpos($this->filter["yearmonth"], "-") === false) { foreach (array_keys($this->getMonthsYear($this->filter["yearmonth"])) as $num) { $value = $this->anonymizeValue((int) $a_set["month_" . $num]); $this->tpl->setVariable("ITEM_VALUE", $value); $this->tpl->parseCurrentBlock(); } } else { foreach ($this->types as $type) { $this->tpl->setVariable("ITEM_VALUE", $this->anonymizeValue((int) $a_set["mem_cnt_" . $type])); $this->tpl->parseCurrentBlock(); } foreach ($this->status as $status) { foreach ($this->types as $type) { $this->tpl->setVariable("ITEM_VALUE", $this->anonymizeValue((int) $a_set[$status . "_" . $type])); $this->tpl->parseCurrentBlock(); } } } }
/** * Render main menu entry * * @param * @return */ function renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target = "_top") { global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem, $ilCtrl; $id = strtolower($a_id); $id_up = strtoupper($a_id); $a_tpl->setCurrentBlock("entry_" . $id); include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php"; // repository if ($a_id == "repository") { $gl = new ilGroupedListGUI(); $gl->setAsDropDown(true); include_once "./Services/Link/classes/class.ilLink.php"; $icon = ilUtil::img(ilObject::_getIcon(ilObject::_lookupObjId(1), "tiny")); $gl->addEntry($icon . " " . $a_txt . " - " . $lng->txt("rep_main_page"), ilLink::_getStaticLink(1, 'root', true), "_top"); $items = $ilNavigationHistory->getItems(); reset($items); $cnt = 0; $first = true; foreach ($items as $k => $item) { if ($cnt >= 10) { break; } if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) || ($item["ref_id"] != $_GET["ref_id"] || !$first)) { if ($cnt == 0) { $gl->addGroupHeader($lng->txt("last_visited"), "ilLVNavEnt"); } $obj_id = ilObject::_lookupObjId($item["ref_id"]); $cnt++; $icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny")); $ititle = ilUtil::shortenText(strip_tags($item["title"]), 50, true); // #11023 $gl->addEntry($icon . " " . $ititle, $item["link"], "_top", "", "ilLVNavEnt"); } $first = false; } if ($cnt > 0) { $gl->addEntry("» " . $lng->txt("remove_entries"), "#", "", "return il.MainMenu.removeLastVisitedItems('" . $ilCtrl->getLinkTargetByClass("ilnavigationhistorygui", "removeEntries", "", true) . "');", "ilLVNavEnt"); } $a_tpl->setVariable("REP_EN_OV", $gl->getHTML()); } // desktop if ($a_id == "desktop") { $gl = new ilGroupedListGUI(); $gl->setAsDropDown(true); // overview $gl->addEntry($lng->txt("overview"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems", "_top", "", "", "mm_pd_sel_items", ilHelp::getMainMenuTooltip("mm_pd_sel_items"), "left center", "right center", false); // my groups and courses, if both is available if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) { $gl->addEntry($lng->txt("my_courses_groups"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships", "_top", "", "", "mm_pd_crs_grp", ilHelp::getMainMenuTooltip("mm_pd_crs_grp"), "left center", "right center", false); } // bookmarks if (!$this->ilias->getSetting("disable_bookmarks")) { $gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks", "_top", "", "", "mm_pd_bookm", ilHelp::getMainMenuTooltip("mm_pd_bookm"), "left center", "right center", false); } // private notes if (!$this->ilias->getSetting("disable_notes")) { $gl->addEntry($lng->txt("notes_and_comments"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNotes", "_top", "", "", "mm_pd_notes", ilHelp::getMainMenuTooltip("mm_pd_notes"), "left center", "right center", false); } // news if ($ilSetting->get("block_activated_news")) { $gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews", "_top", "", "", "mm_pd_news", ilHelp::getMainMenuTooltip("mm_pd_news"), "left center", "right center", false); } // overview is always active $gl->addSeparator(); $separator = false; if (!$ilSetting->get("disable_personal_workspace")) { // workspace $gl->addEntry($lng->txt("personal_workspace"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace", "_top", "", "", "mm_pd_wsp", ilHelp::getMainMenuTooltip("mm_pd_wsp"), "left center", "right center", false); $separator = true; } // portfolio if ($ilSetting->get('user_portfolios')) { $gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio", "_top", "", "", "mm_pd_port", ilHelp::getMainMenuTooltip("mm_pd_port"), "left center", "right center", false); $separator = true; } // skills $skmg_set = new ilSetting("skmg"); if ($skmg_set->get("enable_skmg")) { $gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills", "_top", "", "", "mm_pd_skill", ilHelp::getMainMenuTooltip("mm_pd_skill"), "left center", "right center", false); $separator = true; } // Learning Progress include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (ilObjUserTracking::_enabledLearningProgress() && (ilObjUserTracking::_hasLearningProgressOtherUsers() || ilObjUserTracking::_hasLearningProgressLearner())) { //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI")); $gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP", "_top", "", "", "mm_pd_lp", ilHelp::getMainMenuTooltip("mm_pd_lp"), "left center", "right center", false); $separator = true; } if ($separator) { $gl->addSeparator(); } $separator = false; // calendar include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; $settings = ilCalendarSettings::_getInstance(); if ($settings->isEnabled()) { $gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar", "_top", "", "", "mm_pd_cal", ilHelp::getMainMenuTooltip("mm_pd_cal"), "left center", "right center", false); $separator = true; } // mail if ($this->mail) { $gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top', "", "", "mm_pd_mail", ilHelp::getMainMenuTooltip("mm_pd_mail"), "left center", "right center", false); $separator = true; } // contacts if (!$this->ilias->getSetting('disable_contacts') && ($this->ilias->getSetting('disable_contacts_require_mail') || $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))) { $gl->addEntry($lng->txt('mail_addressbook'), 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts', '_top', "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_contacts"), "left center", "right center", false); $separator = true; } if ($separator) { $gl->addSeparator(); } // profile $gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile", "_top", "", "", "mm_pd_profile", ilHelp::getMainMenuTooltip("mm_pd_profile"), "left center", "right center", false); // settings $gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings", "_top", "", "", "mm_pd_sett", ilHelp::getMainMenuTooltip("mm_pd_sett"), "left center", "right center", false); $a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML()); } if (IS_PAYMENT_ENABLED) { // shop if ($a_id == "shop") { $gl = new ilGroupedListGUI(); $gl->setAsDropDown(true); // shop_content $gl->addEntry($lng->txt("content"), "ilias.php?baseClass=ilShopController&cmd=firstpage", "_top"); // shoppingcart include_once 'Services/Payment/classes/class.ilPaymentShoppingCart.php'; global $ilUser; $objShoppingCart = new ilPaymentShoppingCart($ilUser); $items = $objShoppingCart->getEntries(); if (count($items) > 0) { $gl->addEntry($lng->txt("shoppingcart") . ' (' . count($items) . ')', "ilias.php?baseClass=ilShopController&cmdClass=ilshopshoppingcartgui", "_top"); } $a_tpl->setVariable("SHOP_CONT_OV", $gl->getHTML()); } } $a_tpl->setVariable("TXT_" . $id_up, $a_txt); $a_tpl->setVariable("SCRIPT_" . $id_up, $a_script); $a_tpl->setVariable("TARGET_" . $id_up, $a_target); if ($this->active == $a_id || $this->active == "" && $a_id == "repository") { //$a_tpl->setVariable("MM_CLASS", "MMActive"); $a_tpl->setVariable("SEL", '<span class="ilAccHidden">(' . $lng->txt("stat_selected") . ')</span>'); } else { //$a_tpl->setVariable("MM_CLASS", "MMInactive"); } if ($a_id == "repository") { include_once "./Services/Accessibility/classes/class.ilAccessKey.php"; if (ilAccessKey::getKey(ilAccessKey::LAST_VISITED) != "") { $a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="' . ilAccessKey::getKey(ilAccessKey::LAST_VISITED) . '"'); } } if ($a_id == "desktop") { include_once "./Services/Accessibility/classes/class.ilAccessKey.php"; if (ilAccessKey::getKey(ilAccessKey::PERSONAL_DESKTOP) != "") { $a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="' . ilAccessKey::getKey(ilAccessKey::PERSONAL_DESKTOP) . '"'); } } $a_tpl->parseCurrentBlock(); }
function formatHeader(&$tpl, $a_obj_id, $a_option) { global $lng, $ilias, $tree; // custom icons $path = ilObject::_getIcon($a_obj_id, "tiny", "root"); $tpl->setCurrentBlock("icon"); $nd = $tree->getNodeData(ROOT_FOLDER_ID); $title = $nd["title"]; if ($title == "ILIAS") { $title = $lng->txt("repository"); } $tpl->setVariable("ICON_IMAGE", $path); $tpl->setVariable("TXT_ALT_IMG", $title); $tpl->parseCurrentBlock(); if (strlen($formItem = $this->buildFormItem($a_obj_id, $a_option['type']))) { $tpl->setCurrentBlock('check'); $tpl->setVariable('OBJ_CHECK', $formItem); $tpl->parseCurrentBlock(); } if ($this->isMapped(ROOT_FOLDER_ID)) { $tpl->setVariable('OBJ_TITLE', '<font style="font-weight: bold">' . $title . '</font>'); } else { $tpl->setVariable('OBJ_TITLE', $title); } }
private function showCouponInput($payment_type = '') { include_once './Services/Payment/classes/class.ilPaymentSettings.php'; $genSet = ilPaymentSettings::_getInstance(); $tpl = new ilTemplate('tpl.pay_shopping_cart_coupons.html', true, true, 'Services/Payment'); $tpl->setVariable('COUPON_FORMACTION', $this->ctrl->getFormAction($this)); $tpl->setVariable('TITLE', $this->lng->txt('paya_coupons_coupons')); $tpl->setVariable('TYPE_IMG', ilObject::_getIcon('', '', 'pays')); $tpl->setVariable('ALT_IMG', $this->lng->txt('obj_usr')); $tpl->setVariable('TXT_CODE', $this->lng->txt('paya_coupons_code')); $tpl->setVariable('CMD_VALUE', $this->lng->txt('send')); $tpl->setVariable('CMD', 'setCoupon'); $tpl->setVariable('PAYMENT_TYPE', $payment_type); $coupon_session = $payment_type; if (!empty($_SESSION['coupons'][$coupon_session])) { $i = 0; foreach ($_SESSION['coupons'][$coupon_session] as $coupon) { $tpl->setCurrentBlock('loop'); $tpl->setVariable('LOOP_ROW', ilUtil::switchColor($i++, '1', '2')); $tpl->setVariable('LOOP_TXT_COUPON', $this->lng->txt('paya_coupons_coupon')); $tpl->setVariable('LOOP_CODE', $coupon['pcc_code']); $this->ctrl->setParameter($this, 'coupon_id', $coupon['pc_pk']); $this->ctrl->setParameter($this, 'payment_type', $_SESSION['bmf']['payment_type']); $tpl->setVariable('LOOP_TITLE', $coupon['pc_title']); if ($coupon['pc_description'] != '') { $tpl->setVariable('LOOP_DESCRIPTION', nl2br($coupon['pc_description'])); } $tpl->setVariable("LOOP_TYPE", sprintf($this->lng->txt('paya_coupons_' . ($coupon['pc_type'] == "fix" ? 'fix' : 'percentaged') . '_' . (count($coupon['objects']) == 0 ? 'all' : 'selected') . '_objects'), (double) $coupon['pc_value'] / round($coupon['pc_value'], 2) == 1 && $coupon['pc_type'] == "percent" ? round($coupon['pc_value'], 2) : number_format($coupon['pc_value'], 2, ',', '.'), $coupon['pc_type'] == "percent" ? "%" : $genSet->get('currency_unit'))); $tpl->setVariable("LOOP_REMOVE", "<div class=\"il_ContainerItemCommands\" style=\"float: right;\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, 'removeCoupon') . "\">" . $this->lng->txt('remove') . "</a></div>"); $tpl->parseCurrentBlock(); } } return $tpl->get(); }