/** * 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; }
/** * @param array $row */ public function fillRow(array $row) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; if ($this->getParentObject()->isCRUDContext()) { $row['chb'] = ilUtil::formCheckbox(false, 'unit_ids[]', $row['unit_id']); $sequence = new ilNumberInputGUI('', 'sequence[' . $row['unit_id'] . ']'); $sequence->setValue($this->position++ * 10); $sequence->setMinValue(0); $sequence->setSize(3); $row['sequence'] = $sequence->render(); $action = new ilAdvancedSelectionListGUI(); $action->setId('asl_content_' . $row['unit_id']); $action->setAsynch(false); $action->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'unit_id', $row['unit_id']); $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitModificationForm')); $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteUnit')); $ilCtrl->setParameter($this->getParentObject(), 'unit_id', ''); $row['actions'] = $action->getHtml(); } if ($row['unit_id'] == $row['baseunit_id']) { $row['baseunit'] = ''; } parent::fillRow($row); }
/** * Fill row * @param array $a_set */ public function fillRow($a_set) { global $ilCtrl; // show title if available if ($a_set['term']) { $this->tpl->setVariable('VAL_TITLE', $a_set['term']); } else { $this->tpl->setVariable('VAL_TITLE', $a_set['title']); } $this->tpl->setVariable('TXT_STATUS', $this->lng->txt('status')); $this->tpl->setVariable('VAL_STATUS', ilECSMappingUtils::mappingStatusToString($a_set['status'])); // Actions include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setSelectionHeaderClass('small'); $list->setItemLinkClass('small'); $list->setId('actl_' . $a_set['id']); $list->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'tid', $a_set['id']); $this->tpl->setVariable('EDIT_TITLE', $this->ctrl->getLinkTarget($this->getParentObject(), 'dInitEditTree')); $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dInitEditTree')); include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php'; if ($a_set['status'] != ilECSMappingUtils::MAPPED_UNMAPPED && ilECSNodeMappingSettings::getInstance()->isDirectoryMappingEnabled()) { $list->addItem($this->lng->txt('ecs_cms_tree_synchronize'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dSynchronizeTree')); } $list->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dConfirmDeleteTree')); $this->tpl->setVariable('ACTIONS', $list->getHTML()); $ilCtrl->clearParameters($this->getParentObject()); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl, $rbacsystem; if ($a_set["id"] > 0) { $this->tpl->setCurrentBlock("cb"); $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("cb_act"); if ($a_set["active"]) { $this->tpl->setVariable("ACT_CHECKED", "checked='checked'"); } $this->tpl->setVariable("ID", $a_set["id"]); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("edit_link"); $ilCtrl->setParameterByClass("ilobjstylesheetgui", "obj_id", $a_set["id"]); $this->tpl->setVariable("EDIT_LINK", $ilCtrl->getLinkTargetByClass("ilobjstylesheetgui", "")); $ilCtrl->setParameterByClass("ilobjstylesheetgui", "obj_id", ""); $this->tpl->setVariable("EDIT_TITLE", $a_set["title"]); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setVariable("TITLE", $a_set["title"]); } $ilCtrl->setParameter($this->parent_obj, "id", $a_set["id"]); if ($a_set["id"] > 0 && $rbacsystem->checkAccess("write", $this->parent_obj->object->getRefId())) { $list = new ilAdvancedSelectionListGUI(); $list->setListTitle($lng->txt("actions")); $list->setId("sty_act_" . $a_set["id"]); // default style if ($this->default_style == $a_set["id"]) { $list->addItem($lng->txt("sty_remove_global_default_state"), "", $ilCtrl->getLinkTarget($this->parent_obj, "toggleGlobalDefault")); } else { if ($a_set["active"]) { $list->addItem($lng->txt("sty_make_global_default"), "", $ilCtrl->getLinkTarget($this->parent_obj, "toggleGlobalDefault")); } } // fixed style if ($this->fixed_style == $a_set["id"]) { $list->addItem($lng->txt("sty_remove_global_fixed_state"), "", $ilCtrl->getLinkTarget($this->parent_obj, "toggleGlobalFixed")); } else { if ($a_set["active"]) { $list->addItem($lng->txt("sty_make_global_fixed"), "", $ilCtrl->getLinkTarget($this->parent_obj, "toggleGlobalFixed")); } } $list->addItem($lng->txt("sty_set_scope"), "", $ilCtrl->getLinkTarget($this->parent_obj, "setScope")); $this->tpl->setVariable("ACTIONS", $list->getHTML()); if ($a_set["id"] == $this->fixed_style) { $this->tpl->setVariable("PURPOSE", $lng->txt("global_fixed")); } if ($a_set["id"] == $this->default_style) { $this->tpl->setVariable("PURPOSE", $lng->txt("global_default")); } } $ilCtrl->setParameter($this->parent_obj, "id", ""); $this->tpl->setVariable("NR_LM", $a_set["lm_nr"]); if ($a_set["category"] > 0) { $this->tpl->setVariable("SCOPE", ilObject::_lookupTitle(ilObject::_lookupObjId($a_set["category"]))); } }
public function fillRow($a_data) { global $lng, $ilCtrl, $ilUser; include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $current_selection_list = new ilAdvancedSelectionListGUI(); $current_selection_list->setListTitle($this->lng->txt("actions")); $current_selection_list->setId("act_" . $a_data['obj_id']); $this->tpl->setVariable("VAL_ID", $a_data["obj_id"]); // edit link $edit_link = ''; $delete_link = ''; $sendmail_link = ''; $export_link = ''; if ($a_data["type"] != "parent") { $hash = $ilUser->prefs["screen_reader_optimization"] ? "bookmark_top" : ""; $ilCtrl->setParameter($this->parent_obj, "bmf_id", $this->parent_obj->id); $ilCtrl->setParameter($this->parent_obj, "obj_id", $a_data["obj_id"]); $edit_link = $a_data["type"] == "bmf" ? $ilCtrl->getLinkTarget($this->parent_obj, "editFormBookmarkFolder", $hash) : $ilCtrl->getLinkTarget($this->parent_obj, "editFormBookmark", $hash); $ilCtrl->clearParameters($this->parent_obj); $ilCtrl->setParameter($this->parent_obj, "bm_id", $a_data['obj_id']); $delete_link = $ilCtrl->getLinkTarget($this->parent_obj, 'delete', $hash); $sendmail_link = $ilCtrl->getLinkTarget($this->parent_obj, 'sendmail', $hash); $export_link = $ilCtrl->getLinkTarget($this->parent_obj, 'export', $hash); } if ($edit_link) { $current_selection_list->addItem($this->lng->txt('edit'), '', $edit_link); } if ($delete_link) { $current_selection_list->addItem($this->lng->txt('delete'), '', $delete_link); } if ($export_link) { $current_selection_list->addItem($this->lng->txt('export'), '', $export_link); } if ($sendmail_link) { $current_selection_list->addItem($this->lng->txt('bkm_sendmail'), '', $sendmail_link); } $this->tpl->setVariable("COMMAND_SELECTION_LIST", $current_selection_list->getHTML()); // icon $img_type = $a_data["type"] == "bmf" || $a_data["type"] == "parent" ? "bmf" : $a_data["type"]; // #10556 $val = ilUtil::getImagePath("icon_" . $img_type . ".svg"); $this->tpl->setVariable("VAL_ICON", $val); $this->tpl->setVariable("VAL_ICON_ALT", $lng->txt("icon") . " " . $lng->txt($a_data["type"])); // folder links if ($a_data["type"] == "bmf" || $a_data["type"] == "parent") { $this->tpl->setVariable("VAL_BMF_TITLE", $a_data["title"]); $ilCtrl->setParameter($this->parent_obj, "bmf_id", $a_data["obj_id"]); $this->tpl->setVariable("VAL_BMF_TARGET", $ilCtrl->getLinkTarget($this->parent_obj)); //$this->tpl->setVariable("FRAME_TARGET_BMF", ilFrameTargetInfo::_getFrame("MainContent")); } else { $this->tpl->setVariable("VAL_BM_TITLE", $a_data["title"]); $this->tpl->setVariable("VAL_BM_TARGET", htmlentities($a_data["target"])); $this->tpl->setVariable("VAL_BM_DESCRIPTION", $a_data["description"]); $this->tpl->setVariable("FRAME_TARGET_BM", ilFrameTargetInfo::_getFrame("ExternalContent")); } $ilCtrl->clearParameters($this->parent_obj); }
/** * @param $delete_item * @param $delete_folder */ protected function addSelectionListItems($delete_item, $delete_folder) { global $lng; $this->addItemsBefore(); if ($delete_item && !$this->node->getIsDir() || $delete_folder && $this->node->getIsDir()) { $this->selection_list->addItem($lng->txt("delete"), "delete_item", "javascript:il.CloudFileList.deleteItem(\\'" . $this->node->getId() . "\\');"); } $this->addItemsAfter(); }
/** * Build action menu * * @param array $a_set * @return ilAdvancedSelectionListGUI */ protected function buildActionMenu(array $a_set) { $list = new ilAdvancedSelectionListGUI(); $list->setId($a_set['identifier']); $list->setListTitle($this->pl->txt('actions')); $this->ctrl->setParameterByClass('srcertificatetypegui', 'type_id', $this->type->getId()); $this->ctrl->setParameterByClass('srcertificatetypegui', 'placeholder_id', $a_set['id']); $list->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'editPlaceholder')); $list->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'confirmDeletePlaceholder')); return $list; }
/** * Fill row * @staticvar int $counter * @param array $set */ public function fillRow($set) { global $ilCtrl; $ilCtrl->setParameter($this->getParentObject(), 'server_id', $set['server_id']); $ilCtrl->setParameterByClass('ilecsmappingsettingsgui', 'server_id', $set['server_id']); if ($set['active']) { $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg')); $this->tpl->setVariable('TXT_OK', $this->lng->txt('ecs_activated')); } else { $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg')); $this->tpl->setVariable('TXT_OK', $this->lng->txt('ecs_inactivated')); } $this->tpl->setVariable('VAL_TITLE', ilECSSetting::getInstanceByServerId($set['server_id'])->getTitle()); $this->tpl->setVariable('LINK_EDIT', $ilCtrl->getLinkTarget($this->getParentObject(), 'edit')); $this->tpl->setVariable('TXT_SRV_ADDR', $this->lng->txt('ecs_server_addr')); if (ilECSSetting::getInstanceByServerId($set['server_id'])->getServer()) { $this->tpl->setVariable('VAL_DESC', ilECSSetting::getInstanceByServerId($set['server_id'])->getServer()); } else { $this->tpl->setVariable('VAL_DESC', $this->lng->txt('ecs_not_configured')); } $dt = ilECSSetting::getInstanceByServerId($set['server_id'])->fetchCertificateExpiration(); if ($dt != NULL) { $this->tpl->setVariable('TXT_CERT_VALID', $this->lng->txt('ecs_cert_valid_until')); $now = new ilDateTime(time(), IL_CAL_UNIX); $now->increment(IL_CAL_MONTH, 2); if (ilDateTime::_before($dt, $now)) { $this->tpl->setCurrentBlock('invalid'); $this->tpl->setVariable('VAL_ICERT', ilDatePresentation::formatDate($dt)); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('valid'); $this->tpl->setVariable('VAL_VCERT', ilDatePresentation::formatDate($dt)); $this->tpl->parseCurrentBlock(); } } // Actions include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setSelectionHeaderClass('small'); $list->setItemLinkClass('small'); $list->setId('actl_' . $set['server_id']); $list->setListTitle($this->lng->txt('actions')); if (ilECSSetting::getInstanceByServerId($set['server_id'])->isEnabled()) { $list->addItem($this->lng->txt('ecs_deactivate'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'deactivate')); } else { $list->addItem($this->lng->txt('ecs_activate'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'activate')); } $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'edit')); $list->addItem($this->lng->txt('copy'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'cp')); $list->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'delete')); $this->tpl->setVariable('ACTIONS', $list->getHTML()); $ilCtrl->clearParameters($this->getParentObject()); }
/** * @return bool */ protected function addItemsAfter() { if (!$this->node->getIsDir()) { $exoFile = exodItemCache::get($this->node->getId()); if (!$exoFile instanceof exodFile) { $exoFile = $this->getService()->getClient()->getFileObject($this->node->getPath()); } if ($exoFile->getMsURL()) { $this->selection_list->addItem(ilOneDrivePlugin::getInstance()->txt('asl_open_msoffice'), 'ms', $exoFile->getMsURL(), '', '', '_blank'); } } return true; }
/** * Fills table rows with content from $a_set. * * @global ilCtrl2 $ilCtrl * * @param array $a_set */ public function fillRow($a_set) { global $ilCtrl; $this->tpl->setVariable('VAL_LIBRARY_NAME', $a_set['name']); $this->tpl->setVariable('VAL_LIBRARY_URL', $a_set['url']); $this->tpl->setVariable('VAL_LIBRARY_IMG', $a_set['img']); $current_selection_list = new ilAdvancedSelectionListGUI(); $current_selection_list->setListTitle($this->lng->txt("actions")); $current_selection_list->setId($a_set['id']); $current_selection_list->addItem($this->lng->txt("edit"), "", $ilCtrl->getLinkTarget($this->gui, 'edit') . "&lib_id=" . $a_set['id']); $current_selection_list->addItem($this->lng->txt("delete"), "", $ilCtrl->getLinkTarget($this->gui, 'delete') . "&lib_id=" . $a_set['id']); $this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML()); }
/** * Pass data to row template * * @param array $set */ public function fillRow($set) { $this->tpl->setVariable('TITLE', $set['title']); $this->tpl->setVariable('DESCRIPTION', $set['description']); $this->tpl->setVariable('DEFAULT_LANG', $set['default_language']); $this->tpl->setVariable('ICON', $set['icon']); $this->ctrl->setParameterByClass("ilorgunittypegui", "type_id", $set['id']); $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($this->lng->txt('Actions')); $selection->setId('action_orgu_type' . $set['id']); $selection->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'edit')); $selection->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'delete')); $this->tpl->setVariable('ACTIONS', $selection->getHTML()); }
/** * Build action menu * * @param array $a_set * @return ilAdvancedSelectionListGUI */ protected function buildActionMenu(array $a_set) { $alist = new ilAdvancedSelectionListGUI(); $alist->setId($a_set['id']); $alist->setListTitle($this->pl->txt('actions')); $this->ctrl->setParameterByClass('srcertificatetypegui', 'type_id', $a_set['id']); $alist->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'editType')); return $alist; }
/** * Fill row * @param type $a_set */ public function fillRow($a_set) { global $ilCtrl; $this->tpl->setVariable('TITLE', $a_set['title']); $this->tpl->setVariable('MAX_BOOKINGS', $a_set['max_books']); $this->tpl->setVariable('ASSIGNED', $a_set['assigned']); include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setId('act_chgrp_' . $this->user_id . '_' . $a_set['id']); $list->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'grp_id', $a_set['id']); $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'editGroup')); // add members if ($a_set['assigned']) { $list->addItem($this->lng->txt('cal_ch_assign_participants'), '', $ilCtrl->getLinkTargetByClass('ilRepositorySearchGUI', '')); } $list->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteGroup')); $this->tpl->setVariable('ACTIONS', $list->getHTML()); }
/** * Build action menu for a record asynchronous * */ protected function buildActions() { // Download is only possible if certificate is processed $alist = new ilAdvancedSelectionListGUI(); $alist->setId((int) $_GET['cert_id']); $alist->setListTitle($this->pl->txt('actions')); $this->ctrl->setParameter($this, 'cert_id', (int) $_GET['cert_id']); $alist->addItem($this->pl->txt('download'), 'download', $this->ctrl->getLinkTarget($this, 'downloadCertificate')); echo $alist->getHTML(true); exit; }
/** * Fill row * @param type $a_set */ public function fillRow($row) { global $ilCtrl; $this->tpl->setVariable('START', $row['start_str']); $this->tpl->setVariable('NAME', $row['name']); $this->tpl->setVariable('COMMENT', $row['comment']); $this->tpl->setVariable('TITLE', $row['title']); $this->tpl->setVariable('VAL_ID', $row['id']); include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setId('act_chboo_' . $row['id']); $list->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'bookuser', $row['id']); $start = new ilDateTime($row['start'], IL_CAL_UNIX); if (ilDateTime::_after($start, $this->today, IL_CAL_DAY)) { $list->addItem($this->lng->txt('cal_ch_reject_booking'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmRejectBooking')); } $list->addItem($this->lng->txt('cal_ch_delete_booking'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteBooking')); $this->tpl->setVariable('ACTIONS', $list->getHTML()); }
/** * @param string $type * @param string $filename */ protected function formatActionsList($type, $filename) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; $list = new ilAdvancedSelectionListGUI(); $list->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'file', $filename); $list->addItem($this->lng->txt('download'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'download')); $ilCtrl->setParameter($this->getParentObject(), 'file', ''); return $list->getHTML(); }
/** * Fill table row * @param array $a_set */ protected function fillRow($a_set) { global $lng, $ilAccess, $ilCtrl; $this->tpl->setVariable("TXT_TITLE", $a_set["title"]); if ($a_set["is_used"]) { $this->tpl->setVariable("TXT_IS_USED", $lng->txt("yes")); } else { $this->tpl->setVariable("TXT_IS_USED", $lng->txt("no")); } $ilCtrl->setParameter($this->parent_obj, 'schedule_id', $a_set['booking_schedule_id']); include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId($a_set['booking_schedule_id']); $alist->setListTitle($lng->txt("actions")); if ($ilAccess->checkAccess('write', '', $this->ref_id)) { if (!$a_set["is_used"]) { $alist->addItem($lng->txt('delete'), 'delete', $ilCtrl->getLinkTarget($this->parent_obj, 'confirmDelete')); } $alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTarget($this->parent_obj, 'edit')); } $this->tpl->setVariable("LAYER", $alist->getHTML()); }
/** * @param array $row */ public function fillRow(array $row) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; $row['chb'] = ilUtil::formCheckbox(false, 'category_ids[]', $row['category_id']); $action = new ilAdvancedSelectionListGUI(); $action->setId('asl_content_' . $row['category_id']); $action->setAsynch(false); $action->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'category_id', $row['category_id']); $action->addItem($this->lng->txt('un_show_units'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory')); if ($this->getParentObject()->isCRUDContext()) { $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitCategoryModificationForm')); $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteCategory')); } else { $action->addItem($this->lng->txt('import'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmImportGlobalCategory')); } $row['title_href'] = $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory'); $ilCtrl->setParameter($this->getParentObject(), 'category_id', ''); $row['actions'] = $action->getHtml(); parent::fillRow($row); }
/** * @param $title * @param $show_action_menu * @return string */ public function getLinkHTML($title, $show_action_menu = false) { global $lng; $link = ilLink::_getStaticLink($this->getValue()); if ($show_action_menu) { $list = new ilAdvancedSelectionListGUI(); $list->setId('adv_list_copy_link_' . $this->field->getId() . $this->record->getId()); $list->setListTitle($title); if ($this->properties[ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK]) { $list->addItem($lng->txt('view'), 'view', $link); } $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy')); $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link')); return $list->getHTML(); } else { return "<a href=\"{$link}\">{$title}</a>"; } }
/** * Show user's courses */ public function showMyGroups() { global $lng, $ilUser, $ilObjDataCache, $tree; include_once 'Modules/Group/classes/class.ilGroupParticipants.php'; $this->tpl->setTitle($this->lng->txt('mail_addressbook')); $searchTpl = new ilTemplate('tpl.mail_search_template.html', true, true, 'Services/Contact'); $_GET['view'] = 'mygroups'; $lng->loadLanguageModule('crs'); $this->ctrl->setParameter($this, 'view', 'mygroups'); include_once 'Services/Contact/classes/class.ilMailSearchCoursesTableGUI.php'; $table = new ilMailSearchCoursesTableGUI($this, 'grp', $_GET["ref"]); $table->setId('search_grps_tbl'); $grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), 'grp'); $counter = 0; $tableData = array(); if (is_array($grp_ids) && count($grp_ids) > 0) { include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; foreach ($grp_ids as $grp_id) { if (ilObject::_hasUntrashedReference($grp_id)) { $oGroupParticipants = ilGroupParticipants::_getInstanceByObjId($grp_id); $grp_members = $oGroupParticipants->getParticipants(); foreach ($grp_members as $key => $member) { $tmp_usr = new ilObjUser($member); if ($tmp_usr->checkTimeLimit() == false || $tmp_usr->getActive() == false) { unset($grp_members[$key]); } } unset($tmp_usr); $ref_ids = ilObject::_getAllReferences($grp_id); $ref_id = current($ref_ids); $path_arr = $tree->getPathFull($ref_id, $tree->getRootId()); $path_counter = 0; $path = ''; foreach ($path_arr as $data) { if ($path_counter++) { $path .= " -> "; } $path .= $data['title']; } $path = $this->lng->txt('path') . ': ' . $path; $current_selection_list = new ilAdvancedSelectionListGUI(); $current_selection_list->setListTitle($this->lng->txt("actions")); $current_selection_list->setId("act_" . $counter); $this->ctrl->setParameter($this, 'search_grp', $grp_id); $this->ctrl->setParameter($this, 'view', 'mygroups'); if ($_GET["ref"] == "mail") { if ($this->mailing_allowed) { $current_selection_list->addItem($this->lng->txt("mail_members"), '', $this->ctrl->getLinkTarget($this, "mail")); } } else { if ($_GET["ref"] == "wsp") { $current_selection_list->addItem($this->lng->txt("wsp_share_with_members"), '', $this->ctrl->getLinkTarget($this, "share")); } } $current_selection_list->addItem($this->lng->txt("mail_list_members"), '', $this->ctrl->getLinkTarget($this, "showMembers")); $this->ctrl->clearParameters($this); $rowData = array('CRS_ID' => $grp_id, 'CRS_NAME' => $ilObjDataCache->lookupTitle($grp_id), 'CRS_NO_MEMBERS' => count($grp_members), 'CRS_PATH' => $path, 'COMMAND_SELECTION_LIST' => $current_selection_list->getHTML()); $counter++; $tableData[] = $rowData; } } } $table->setData($tableData); if ($counter > 0) { $this->tpl->setVariable('TXT_MARKED_ENTRIES', $lng->txt('marked_entries')); } $searchTpl->setVariable('TABLE', $table->getHtml()); $this->tpl->setContent($searchTpl->get()); if ($_GET["ref"] != "wsp") { $this->tpl->show(); } }
private function getActionsHTML($sourcePoolDefinitionId) { require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $selectionList = new ilAdvancedSelectionListGUI(); $selectionList->setId('sourcePoolDefinitionActions_' . $sourcePoolDefinitionId); $selectionList->setListTitle($this->lng->txt("actions")); $selectionList->addItem($this->lng->txt('edit'), '', $this->getEditHref($sourcePoolDefinitionId)); $selectionList->addItem($this->lng->txt('delete'), '', $this->getDeleteHref($sourcePoolDefinitionId)); return $selectionList->getHTML(); }
/** * Fill footer row */ function fillFooter() { global $lng, $ilCtrl, $ilUser; $footer = false; // select all checkbox if (strlen($this->getFormName()) && strlen($this->getSelectAllCheckbox()) && $this->dataExists()) { $this->tpl->setCurrentBlock("select_all_checkbox"); $this->tpl->setVariable("SELECT_ALL_TXT_SELECT_ALL", $lng->txt("select_all")); $this->tpl->setVariable("SELECT_ALL_CHECKBOX_NAME", $this->getSelectAllCheckbox()); $this->tpl->setVariable("SELECT_ALL_FORM_NAME", $this->getFormName()); $this->tpl->setVariable("CHECKBOXNAME", "chb_select_all_" . $this->unique_id); $this->tpl->parseCurrentBlock(); } // table footer numinfo if ($this->enabled["numinfo"] && $this->enabled["footer"]) { $start = $this->offset + 1; // compute num info if (!$this->dataExists()) { $start = 0; } $end = $this->offset + $this->limit; if ($end > $this->max_count or $this->limit == 0) { $end = $this->max_count; } if ($this->max_count > 0) { if ($this->lang_support) { $numinfo = "(" . $start . " - " . $end . " " . strtolower($this->lng->txt("of")) . " " . $this->max_count . ")"; } else { $numinfo = "(" . $start . " - " . $end . " of " . $this->max_count . ")"; } } if ($this->max_count > 0) { if ($this->getEnableNumInfo()) { $this->tpl->setCurrentBlock("tbl_footer_numinfo"); $this->tpl->setVariable("NUMINFO", $numinfo); $this->tpl->parseCurrentBlock(); } } $footer = true; } // table footer linkbar if ($this->enabled["linkbar"] && $this->enabled["footer"] && $this->limit != 0 && $this->max_count > 0) { $layout = array("link" => $this->footer_style, "prev" => $this->footer_previous, "next" => $this->footer_next); //if (!$this->getDisplayAsBlock()) //{ $linkbar = $this->getLinkbar("1"); $this->tpl->setCurrentBlock("tbl_footer_linkbar"); $this->tpl->setVariable("LINKBAR", $linkbar); $this->tpl->parseCurrentBlock(); $linkbar = true; //} $footer = true; } // column selector if (count($this->getSelectableColumns()) > 0) { $items = array(); foreach ($this->getSelectableColumns() as $k => $c) { $items[$k] = array("txt" => $c["txt"], "selected" => $this->isColumnSelected($k)); } include_once "./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php"; $cb_over = new ilCheckboxListOverlayGUI("tbl_" . $this->getId()); $cb_over->setLinkTitle($lng->txt("columns")); $cb_over->setItems($items); //$cb_over->setUrl("./ilias.php?baseClass=ilTablePropertiesStorage&table_id=". // $this->getId()."&cmd=saveSelectedFields&user_id=".$ilUser->getId()); $cb_over->setFormCmd($this->getParentCmd()); $cb_over->setFieldVar("tblfs" . $this->getId()); $cb_over->setHiddenVar("tblfsh" . $this->getId()); $cb_over->setSelectionHeaderClass("ilTableMenuItem"); $column_selector = $cb_over->getHTML(); $footer = true; } if ($this->getShowTemplates() && is_object($ilUser)) { // template handling if (isset($_REQUEST["tbltplcrt"]) && $_REQUEST["tbltplcrt"]) { if ($this->saveTemplate($_REQUEST["tbltplcrt"])) { ilUtil::sendSuccess($lng->txt("tbl_template_created")); } } else { if (isset($_REQUEST["tbltpldel"]) && $_REQUEST["tbltpldel"]) { if ($this->deleteTemplate($_REQUEST["tbltpldel"])) { ilUtil::sendSuccess($lng->txt("tbl_template_deleted")); } } } $create_id = "template_create_overlay_" . $this->getId(); $delete_id = "template_delete_overlay_" . $this->getId(); $list_id = "template_stg_" . $this->getId(); include_once "./Services/Table/classes/class.ilTableTemplatesStorage.php"; $storage = new ilTableTemplatesStorage(); $templates = $storage->getNames($this->getContext(), $ilUser->getId()); include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php"; // form to delete template if (count($templates)) { $overlay = new ilOverlayGUI($delete_id); $overlay->setTrigger($list_id . "_delete"); $overlay->setAnchor("ilAdvSelListAnchorElement_" . $list_id); $overlay->setAutoHide(false); $overlay->add(); $lng->loadLanguageModule("form"); $this->tpl->setCurrentBlock("template_editor_delete_item"); $this->tpl->setVariable("TEMPLATE_DELETE_OPTION_VALUE", ""); $this->tpl->setVariable("TEMPLATE_DELETE_OPTION", "- " . $lng->txt("form_please_select") . " -"); $this->tpl->parseCurrentBlock(); foreach ($templates as $name) { $this->tpl->setVariable("TEMPLATE_DELETE_OPTION_VALUE", $name); $this->tpl->setVariable("TEMPLATE_DELETE_OPTION", $name); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("template_editor_delete"); $this->tpl->setVariable("TEMPLATE_DELETE_ID", $delete_id); $this->tpl->setVariable("TXT_TEMPLATE_DELETE", $lng->txt("tbl_template_delete")); $this->tpl->setVariable("TXT_TEMPLATE_DELETE_SUBMIT", $lng->txt("delete")); $this->tpl->setVariable("TEMPLATE_DELETE_CMD", $this->parent_cmd); $this->tpl->parseCurrentBlock(); } // form to save new template $overlay = new ilOverlayGUI($create_id); $overlay->setTrigger($list_id . "_create"); $overlay->setAnchor("ilAdvSelListAnchorElement_" . $list_id); $overlay->setAutoHide(false); $overlay->add(); $this->tpl->setCurrentBlock("template_editor"); $this->tpl->setVariable("TEMPLATE_CREATE_ID", $create_id); $this->tpl->setVariable("TXT_TEMPLATE_CREATE", $lng->txt("tbl_template_create")); $this->tpl->setVariable("TXT_TEMPLATE_CREATE_SUBMIT", $lng->txt("save")); $this->tpl->setVariable("TEMPLATE_CREATE_CMD", $this->parent_cmd); $this->tpl->parseCurrentBlock(); // load saved template include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId($list_id); $alist->addItem($lng->txt("tbl_template_create"), "create", "#"); if (count($templates)) { $alist->addItem($lng->txt("tbl_template_delete"), "delete", "#"); foreach ($templates as $name) { $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_tpl", urlencode($name)); $alist->addItem($name, $name, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)); $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_tpl", ""); } } $alist->setListTitle($lng->txt("tbl_templates")); $this->tpl->setVariable("TEMPLATE_SELECTOR", " " . $alist->getHTML()); } if ($footer) { $this->tpl->setCurrentBlock("tbl_footer"); $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount()); if ($this->getDisplayAsBlock()) { $this->tpl->setVariable("BLK_CLASS", "Block"); } $this->tpl->parseCurrentBlock(); // top navigation, if number info or linkbar given if ($numinfo != "" || $linkbar != "" || $column_selector != "" || count($this->filters) > 0 || count($this->optional_filters) > 0) { if (is_object($ilUser) && (count($this->filters) || count($this->optional_filters))) { $this->tpl->setCurrentBlock("filter_activation"); $this->tpl->setVariable("TXT_ACTIVATE_FILTER", $lng->txt("show_filter")); $this->tpl->setVariable("FILA_ID", $this->getId()); if ($this->getId() != "") { $this->tpl->setVariable("SAVE_URLA", "./ilias.php?baseClass=ilTablePropertiesStorage&table_id=" . $this->getId() . "&cmd=showFilter&user_id=" . $ilUser->getId()); } $this->tpl->parseCurrentBlock(); if (!$this->getDisableFilterHiding()) { $this->tpl->setCurrentBlock("filter_deactivation"); $this->tpl->setVariable("TXT_HIDE", $lng->txt("hide_filter")); if ($this->getId() != "") { $this->tpl->setVariable("SAVE_URL", "./ilias.php?baseClass=ilTablePropertiesStorage&table_id=" . $this->getId() . "&cmd=hideFilter&user_id=" . $ilUser->getId()); $this->tpl->setVariable("FILD_ID", $this->getId()); } $this->tpl->parseCurrentBlock(); } } if ($numinfo != "" && $this->getEnableNumInfo()) { $this->tpl->setCurrentBlock("top_numinfo"); $this->tpl->setVariable("NUMINFO", $numinfo); $this->tpl->parseCurrentBlock(); } if ($linkbar != "" && !$this->getDisplayAsBlock()) { $linkbar = $this->getLinkbar("2"); $this->tpl->setCurrentBlock("top_linkbar"); $this->tpl->setVariable("LINKBAR", $linkbar); $this->tpl->parseCurrentBlock(); } // column selector $this->tpl->setVariable("COLUMN_SELECTOR", $column_selector); // row selector if ($this->getShowRowsSelector() && is_object($ilUser)) { include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId("sellst_rows_" . $this->getId()); $hpp = $ilUser->getPref("hits_per_page") != 9999 ? $ilUser->getPref("hits_per_page") : $lng->txt("unlimited"); $options = array(0 => $lng->txt("default") . " (" . $hpp . ")", 5 => 5, 10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40, 50 => 50, 100 => 100, 200 => 200, 400 => 400, 800 => 800); foreach ($options as $k => $v) { $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_trows", $k); $alist->addItem($v, $k, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)); $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_trows", ""); } $alist->setListTitle($this->getRowSelectorLabel() ? $this->getRowSelectorLabel() : $lng->txt("rows")); $this->tpl->setVariable("ROW_SELECTOR", $alist->getHTML()); } // export if (count($this->export_formats) && $this->dataExists()) { include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId("sellst_xpt"); foreach ($this->export_formats as $format => $caption_lng_id) { $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_xpt", $format); $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd); $ilCtrl->setParameter($this->parent_obj, $this->prefix . "_xpt", ""); $caption = $lng->txt($caption_lng_id); //this part is necessary, because the labels for xls- and csv-Export are fetched from the ilias-lang-files, while the label for pdf-export is fetched from the lang-file of the plugin. If the ilias-lang-file does not contain a translation for the caption_lng_id, it will set it into '-'es. In that case the caption comes from the plugin and we just use the string that is there. if (strpos($caption, '-') === 0 && strpos($caption, '-', strlen($caption) - 1) === strlen($caption) - 1) { $alist->addItem($caption_lng_id, $format, $url); } else { $alist->addItem($lng->txt($caption_lng_id), $format, $url); } } $alist->setListTitle($lng->txt("export")); $this->tpl->setVariable("EXPORT_SELECTOR", " " . $alist->getHTML()); } $this->tpl->setCurrentBlock("top_navigation"); $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount()); if ($this->getDisplayAsBlock()) { $this->tpl->setVariable("BLK_CLASS", "Block"); } $this->tpl->parseCurrentBlock(); } } }
/** * Build posting month list * * @param array $items * @param string $a_month * @param string $a_cmd * @param bool $a_link_template * @param bool $a_show_inactive * @return string */ function renderList(array $items, $a_month, $a_cmd = "preview", $a_link_template = null, $a_show_inactive = false) { global $lng, $ilCtrl; include_once "Services/Calendar/classes/class.ilCalendarUtil.php"; $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog"); // title according to current "filter"/navigation if ($this->keyword) { $title = $lng->txt("blog_keyword") . ": " . $this->keyword; } else { if ($this->author) { include_once "Services/User/classes/class.ilUserUtil.php"; $title = $lng->txt("blog_author") . ": " . ilUserUtil::getNamePresentation($this->author); } else { include_once "Services/Calendar/classes/class.ilCalendarUtil.php"; $title = ilCalendarUtil::_numericMonthToString((int) substr($a_month, 5)) . " " . substr($a_month, 0, 4); } } $wtpl->setVariable("TXT_CURRENT_MONTH", $title); $can_approve = $this->object->hasApproval() && $this->checkPermissionBool("write"); $can_deactivate = $this->checkPermissionBool("write"); include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php"; foreach ($items as $item) { // only published items $is_active = ilBlogPosting::_lookupActive($item["id"], "blp"); if (!$is_active && !$a_show_inactive) { continue; } if (!$a_link_template) { $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month); $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]); $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd); } else { $preview = $this->buildExportLink($a_link_template, "posting", $item["id"]); } // actions $item_contribute = $this->mayContribute($item["id"], $item["author"]); if (($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd == "preview") { include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId($item["id"]); $alist->setListTitle($lng->txt("actions")); if ($is_active && $this->object->hasApproval() && !$item["approved"]) { if ($can_approve) { $ilCtrl->setParameter($this, "apid", $item["id"]); $alist->addItem($lng->txt("blog_approve"), "approve", $ilCtrl->getLinkTarget($this, "approve")); $ilCtrl->setParameter($this, "apid", ""); } $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval")); } if ($item_contribute) { $alist->addItem($lng->txt("edit_content"), "edit", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit")); // #11858 if ($is_active) { $alist->addItem($lng->txt("blog_toggle_draft"), "deactivate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList")); } else { $alist->addItem($lng->txt("blog_toggle_final"), "activate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList")); } $alist->addItem($lng->txt("rename"), "rename", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle")); $alist->addItem($lng->txt("blog_edit_keywords"), "keywords", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords")); $alist->addItem($lng->txt("blog_edit_date"), "editdate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate")); $alist->addItem($lng->txt("delete"), "delete", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")); } else { if ($can_deactivate) { // #10513 if ($is_active) { $ilCtrl->setParameter($this, "apid", $item["id"]); $alist->addItem($lng->txt("blog_toggle_draft_admin"), "deactivate", $ilCtrl->getLinkTarget($this, "deactivateAdmin")); $ilCtrl->setParameter($this, "apid", ""); } $alist->addItem($lng->txt("delete"), "delete", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")); } } $wtpl->setCurrentBlock("actions"); $wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML()); $wtpl->parseCurrentBlock(); } // comments if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) { // count (public) notes include_once "Services/Notes/classes/class.ilNote.php"; $count = sizeof(ilNote::_getNotesOfObject($this->obj_id, $item["id"], "blp", IL_NOTE_PUBLIC)); if ($a_cmd != "preview") { $wtpl->setCurrentBlock("comments"); $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments")); $wtpl->setVariable("URL_COMMENTS", $preview); $wtpl->setVariable("COUNT_COMMENTS", $count); $wtpl->parseCurrentBlock(); } /* we disabled comments in edit mode (should always be done via pagegui) else { $hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE, $this->node_id, "blog", $this->obj_id, "blp", $item["id"]); $notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash); } */ } // permanent link if ($a_cmd != "preview" && $a_cmd != "previewEmbedded") { if ($this->id_type == self::WORKSPACE_NODE_ID) { $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_" . $item["id"]); } else { include_once "Services/Link/classes/class.ilLink.php"; $goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_" . $item["id"]); } $wtpl->setCurrentBlock("permalink"); $wtpl->setVariable("URL_PERMALINK", $goto); $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link")); $wtpl->parseCurrentBlock(); } $snippet = ilBlogPostingGUI::getSnippet($item["id"]); if ($snippet) { $wtpl->setCurrentBlock("more"); $wtpl->setVariable("URL_MORE", $preview); $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more")); $wtpl->parseCurrentBlock(); } $wtpl->setCurrentBlock("posting"); if (!$is_active) { $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft"); } $author = ""; if ($this->id_type == self::REPOSITORY_NODE_ID) { $author_id = $item["author"]; if ($author_id) { include_once "Services/User/classes/class.ilUserUtil.php"; $author = ilUserUtil::getNamePresentation($author_id) . " - "; } } // title $wtpl->setVariable("URL_TITLE", $preview); $wtpl->setVariable("TITLE", $item["title"]); $wtpl->setVariable("DATETIME", $author . ilDatePresentation::formatDate($item["created"], IL_CAL_DATE)); // content $wtpl->setVariable("CONTENT", $snippet); $wtpl->parseCurrentBlock(); } // notes /* if($a_cmd == "previewFullscreen" && $this->object->getNotesStatus()) { $wtpl->setVariable("NOTES", $this->getNotesHTML()); } */ // permalink if ($a_cmd == "previewFullscreen") { $wtpl->setVariable("PERMALINK", $this->getPermanentLinkWidget(null, true)); } return $wtpl->get(); }
/** * fill row * * @access public * @param $a_set */ public function fillRow(ilDataCollectionField $a_set) { global $lng, $ilCtrl; $this->tpl->setVariable('NAME', "order[" . $a_set->getId() . "]"); $this->tpl->setVariable('VALUE', $this->order); $this->tpl->setVariable("CHECKBOX_VISIBLE", "visible[" . $a_set->getId() . "]"); if ($a_set->isVisible()) { $this->tpl->setVariable("CHECKBOX_VISIBLE_CHECKED", "checked"); } $this->tpl->setVariable("CHECKBOX_FILTERABLE", "filterable[" . $a_set->getId() . "]"); if ($a_set->isFilterable()) { $this->tpl->setVariable("CHECKBOX_FILTERABLE_CHECKED", "checked"); } if (!$a_set->isStandardField()) { $this->tpl->setVariable("CHECKBOX_NAME_LOCKED", "locked[" . $a_set->getId() . "]"); if ($a_set->getLocked()) { $this->tpl->setVariable("CHECKBOX_CHECKED_LOCKED", "checked"); } } else { $this->tpl->setVariable("NOT_LOCKED", "-"); } $this->order = $this->order + 10; $this->tpl->setVariable("ORDER_NAME", "order[" . $a_set->getId() . "]"); $this->tpl->setVariable("ORDER_VALUE", $this->order); $this->tpl->setVariable('TITLE', $a_set->getTitle()); $this->tpl->setVariable('DESCRIPTION', $a_set->getDescription()); $this->tpl->setVariable('DATATYPE', $a_set->getDatatypeTitle()); if (!$a_set->isStandardField()) { switch ($a_set->getRequired()) { case 0: $required = ilUtil::getImagePath('icon_not_ok.png'); break; case 1: $required = ilUtil::getImagePath('icon_ok.png'); break; } switch ($a_set->isUnique()) { case 0: $uniq = ilUtil::getImagePath('icon_not_ok.png'); break; case 1: $uniq = ilUtil::getImagePath('icon_ok.png'); break; } $this->tpl->setVariable('REQUIRED', $required); $this->tpl->setVariable('UNIQUE', $uniq); } else { $this->tpl->setVariable('NO_REQUIRED', "-"); $this->tpl->setVariable('NO_UNIQUE', "-"); } $ilCtrl->setParameterByClass("ildatacollectionfieldeditgui", "field_id", $a_set->getId()); if (!$a_set->isStandardField()) { include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $alist = new ilAdvancedSelectionListGUI(); $alist->setId($a_set->getId()); $alist->setListTitle($lng->txt("actions")); if ($this->table->hasPermissionToFields($this->parent_obj->parent_obj->ref_id)) { $alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTargetByClass("ildatacollectionfieldeditgui", 'edit')); $alist->addItem($lng->txt('delete'), 'delete', $ilCtrl->getLinkTargetByClass("ildatacollectionfieldeditgui", 'confirmDelete')); } $this->tpl->setVariable("ACTIONS", $alist->getHTML()); } }
/** * * @see ilLinkCheckerGUIRowHandling::formatInvalidLinkArray() * @param array Unformatted array * @return array Formatted array * @access public * */ public function formatInvalidLinkArray(array $row) { $row['title'] = ilLMPageObject::_getPresentationTitle($row['page_id'], $this->object->getPageHeader()); require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $actions = new ilAdvancedSelectionListGUI(); $actions->setSelectionHeaderClass('small'); $actions->setItemLinkClass('xsmall'); $actions->setListTitle($this->lng->txt('actions')); $actions->setId($row['page_id']); $this->ctrl->setParameterByClass('ilLMPageObjectGUI', 'obj_id', $row['page_id']); $actions->addItem($this->lng->txt('edit'), '', $this->ctrl->getLinkTargetByClass('ilLMPageObjectGUI', 'edit')); $this->ctrl->clearParametersByClass('ilLMPageObjectGUI'); $row['action_html'] = $actions->getHTML(); return $row; }
public function showMailingLists() { global $rbacsystem; $this->tpl->setTitle($this->lng->txt('mail_addressbook')); $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_list.html', 'Services/Contact'); // check if current user may send mails include_once "Services/Mail/classes/class.ilMail.php"; $mail = new ilMail($_SESSION["AccountId"]); $mailing_allowed = $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()); $tbl = new ilTable2GUI($this); $tbl->setId('show_mlng_lists_tbl'); $tbl->setFormAction($this->ctrl->getFormAction($this), 'showForm'); $tbl->setTitle($this->lng->txt('mail_mailing_lists')); $tbl->setRowTemplate('tpl.mail_mailing_lists_listrow.html', 'Services/Contact'); $tbl->setDefaultOrderField('title'); $result = array(); $tbl->addColumn('', 'check', '10%', true); $tbl->addColumn($this->lng->txt('title'), 'title', '30%'); $tbl->addColumn($this->lng->txt('description'), 'description', '30%'); $tbl->addColumn($this->lng->txt('members'), 'members', '20%'); $tbl->addColumn($this->lng->txt('actions'), '', '10%'); $entries = $this->mlists->getAll(); if (count($entries)) { $tbl->enable('select_all'); $tbl->setSelectAllCheckbox('ml_id'); $counter = 0; include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; foreach ($entries as $entry) { if ($entry->getMode() == ilMailingList::MODE_TEMPORARY) { continue; } $result[$counter]['check'] = ilUtil::formCheckbox(0, 'ml_id[]', $entry->getId()); $result[$counter]['title'] = $entry->getTitle() . " [#il_ml_" . $entry->getId() . "]"; $result[$counter]['description'] = $entry->getDescription(); $result[$counter]['members'] = count($entry->getAssignedEntries()); $this->ctrl->setParameter($this, 'ml_id', $entry->getId()); //$result[$counter]['edit_text'] = $this->lng->txt("edit"); //$result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, "showForm"); //$result[$counter]['members_text'] = $this->lng->txt("members"); //$result[$counter]['members_url'] = $this->ctrl->getLinkTarget($this, "showMembersList"); $current_selection_list = new ilAdvancedSelectionListGUI(); $current_selection_list->setListTitle($this->lng->txt("actions")); $current_selection_list->setId("act_" . $counter); $current_selection_list->addItem($this->lng->txt("edit"), '', $this->ctrl->getLinkTarget($this, "showForm")); $current_selection_list->addItem($this->lng->txt("members"), '', $this->ctrl->getLinkTarget($this, "showMembersList")); if ($mailing_allowed) { $current_selection_list->addItem($this->lng->txt("send_mail_to"), '', $this->ctrl->getLinkTarget($this, "mailToList")); } $current_selection_list->addItem($this->lng->txt("delete"), '', $this->ctrl->getLinkTarget($this, "confirmDelete")); $result[$counter]['COMMAND_SELECTION_LIST'] = $current_selection_list->getHTML(); ++$counter; } if ($mailing_allowed) { $tbl->addMultiCommand('mailToList', $this->lng->txt('send_mail_to')); } $tbl->addMultiCommand('confirmDelete', $this->lng->txt('delete')); } else { $tbl->disable('header'); $tbl->disable('footer'); $tbl->setNoEntriesText($this->lng->txt('mail_search_no')); } $tbl->setData($result); $tbl->addCommandButton('showForm', $this->lng->txt('add')); if (isset($_GET['ref']) && $_GET['ref'] == 'mail') { $tbl->addCommandButton('cancel', $this->lng->txt('cancel')); } $this->tpl->setVariable('MAILING_LISTS', $tbl->getHTML()); $this->tpl->show(); return true; }
/** * Fill table row */ protected function fillRow($term) { global $lng, $ilCtrl; include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $defs = ilGlossaryDefinition::getDefinitionList($term["id"]); $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $term["id"]); $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]); $ilCtrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]); // actions drop down if ($this->glossary->getId() == $term["glo_id"]) { $list = new ilAdvancedSelectionListGUI(); $list->addItem($lng->txt("cont_edit_term"), "", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "editTerm")); if (count($defs) > 1) { $list->addItem($lng->txt("cont_edit_definitions"), "", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listDefinitions")); } else { if (count($defs) == 1) { $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", $defs[0]["id"]); $list->addItem($lng->txt("cont_edit_definition"), "", $ilCtrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit")); } } $list->addItem($lng->txt("cont_add_definition"), "", $ilCtrl->getLinkTargetByClass("ilobjglossarygui", "addDefinition")); $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", ""); $list->setId("act_term_" . $term["id"]); $list->setListTitle($lng->txt("actions")); $this->tpl->setVariable("ACTIONS", $list->getHTML()); } for ($j = 0; $j < count($defs); $j++) { $def = $defs[$j]; /*if ($this->glossary->getId() == $term["glo_id"]) { // up if ($j > 0) { $this->tpl->setCurrentBlock("move_up"); $this->tpl->setVariable("TXT_UP", $lng->txt("up")); $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]); $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]); $this->tpl->setVariable("LINK_UP", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionUp")); $this->tpl->parseCurrentBlock(); } // down if ($j+1 < count($defs)) { $this->tpl->setCurrentBlock("move_down"); $this->tpl->setVariable("TXT_DOWN", $lng->txt("down")); $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]); $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]); $this->tpl->setVariable("LINK_DOWN", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionDown")); $this->tpl->parseCurrentBlock(); } // delete $this->tpl->setCurrentBlock("delete"); $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]); $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]); $this->tpl->setVariable("LINK_DELETE", $ilCtrl->getLinkTarget($this->parent_obj, "confirmDefinitionDeletion")); $this->tpl->setVariable("TXT_DELETE", $lng->txt("delete")); $this->tpl->parseCurrentBlock(); // edit $this->tpl->setCurrentBlock("edit"); $ilCtrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]); $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", $def["id"]); $this->tpl->setVariable("LINK_EDIT", $ilCtrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit")); $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $this->tpl->parseCurrentBlock(); }*/ // text $this->tpl->setCurrentBlock("definition"); $short_str = $def["short_text"]; // replace tex // if a tex end tag is missing a tex end tag $ltexs = strrpos($short_str, "[tex]"); $ltexe = strrpos($short_str, "[/tex]"); if ($ltexs > $ltexe) { $page = new ilGlossaryDefPage($def["id"]); $page->buildDom(); $short_str = $page->getFirstParagraphText(); $short_str = strip_tags($short_str, "<br>"); $ltexe = strpos($short_str, "[/tex]", $ltexs); $short_str = ilUtil::shortenText($short_str, $ltexe + 6, true); } $short_str = ilUtil::insertLatexImages($short_str); $short_str = ilPCParagraph::xml2output($short_str); $this->tpl->setVariable("DEF_SHORT", $short_str); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("definition_row"); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("check_col"); $this->tpl->setVariable("CHECKBOX_ID", $term["id"]); $this->tpl->parseCurrentBlock(); $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]); // usage if (in_array("usage", $this->getSelectedColumns())) { $nr_usage = ilGlossaryTerm::getNumberOfUsages($term["id"]); if ($nr_usage > 0 && $this->glossary->getId() == $term["glo_id"]) { $this->tpl->setCurrentBlock("link_usage"); $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]); $this->tpl->setVariable("LUSAGE", ilGlossaryTerm::getNumberOfUsages($term["id"])); $this->tpl->setVariable("LINK_USAGE", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages")); $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", ""); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock("usage"); $this->tpl->setVariable("USAGE", ilGlossaryTerm::getNumberOfUsages($term["id"])); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("td_usage"); $this->tpl->parseCurrentBlock(); } // glossary title if (in_array($this->glossary->getVirtualMode(), array("level", "subtree"))) { $this->tpl->setCurrentBlock("glossary"); $this->tpl->setVariable("GLO_TITLE", ilObject::_lookupTitle($term["glo_id"])); $this->tpl->parseCurrentBlock(); } // output language if (in_array("language", $this->getSelectedColumns())) { $this->tpl->setCurrentBlock("td_lang"); $this->tpl->setVariable("TEXT_LANGUAGE", $lng->txt("meta_l_" . $term["language"])); $this->tpl->parseCurrentBlock(); } foreach ($this->adv_cols_order as $c) { if ($c["id"] == 0) { $this->tpl->setCurrentBlock("td"); $this->tpl->setVariable("TD_VAL", $term["term"]); $this->tpl->parseCurrentBlock(); } else { if (in_array("md_" . $c["id"], $this->selected_cols)) { $id = (int) $c["id"]; $val = " "; if (isset($term["md_" . $id . "_presentation"])) { $pb = $term["md_" . $id . "_presentation"]->getHTML(); if ($pb) { $val = $pb; } } $this->tpl->setCurrentBlock("td"); $this->tpl->setVariable("TD_VAL", $val); $this->tpl->parseCurrentBlock(); } } } }
/** * renders a table row by filling wor data to table row template * * @access public * @global ilCtrl $ilCtrl * @global ilLanguage $lng * @param array $rowData */ public function fillRow($rowData) { global $ilCtrl, $lng; if ($this->tableMode == self::TBL_MODE_ADMINISTRATION) { $editHref = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintGUI', ilAssQuestionHintGUI::CMD_SHOW_FORM); $editHref = ilUtil::appendUrlParameterString($editHref, "hint_id={$rowData['hint_id']}", true); $deleteHref = $ilCtrl->getLinkTarget($this->parent_obj, ilAssQuestionHintsGUI::CMD_CONFIRM_DELETE); $deleteHref = ilUtil::appendUrlParameterString($deleteHref, "hint_id={$rowData['hint_id']}", true); $list = new ilAdvancedSelectionListGUI(); $list->setListTitle($lng->txt('actions')); $list->setId("advsl_hint_{$rowData['hint_id']}_actions"); $list->addItem($lng->txt('tst_question_hints_table_link_edit_hint'), '', $editHref); $list->addItem($lng->txt('tst_question_hints_table_link_delete_hint'), '', $deleteHref); $this->tpl->setVariable('ACTIONS', $list->getHTML()); $this->tpl->setVariable('HINT_ID', $rowData['hint_id']); $hintIndex = $rowData['hint_index'] * self::INDEX_TO_POSITION_FACTOR; } else { $showHref = $ilCtrl->getLinkTarget($this->parent_obj, ilAssQuestionHintRequestGUI::CMD_SHOW_HINT); $showHref = ilUtil::appendUrlParameterString($showHref, "hintId={$rowData['hint_id']}", true); $this->tpl->setVariable('HINT_HREF', $showHref); $hintIndex = sprintf($lng->txt('tst_question_hints_index_column_label'), $rowData['hint_index']); } $this->tpl->setVariable('HINT_INDEX', $hintIndex); $this->tpl->setVariable('HINT_TEXT', $rowData['hint_text']); $this->tpl->setVariable('HINT_POINTS', $rowData['hint_points']); }
/** * Get HTML. */ function getHTML() { global $ilCtrl, $lng, $ilAccess, $ilUser; if ($this->isRepositoryObject()) { if (!$ilAccess->checkAccess("read", "", $this->getRefId())) { return ""; } } $this->tpl = new ilTemplate("tpl.block.html", true, true, "Services/Block"); // $this->handleConfigStatus(); $this->fillDataSection(); if ($this->getRepositoryMode() && $this->isRepositoryObject()) { // #10993 if ($this->getAdminCommands()) { $this->tpl->setCurrentBlock("block_check"); $this->tpl->setVariable("BL_REF_ID", $this->getRefId()); $this->tpl->parseCurrentBlock(); } if ($ilAccess->checkAccess("delete", "", $this->getRefId())) { $this->addBlockCommand("ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=delete" . "&item_ref_id=" . $this->getRefId(), $lng->txt("delete")); } } // footer info if ($this->getFooterInfo() != "") { $this->tpl->setCurrentBlock("footer_information"); $this->tpl->setVariable("FOOTER_INFO", $this->getFooterInfo()); $this->tpl->setVariable("FICOLSPAN", $this->getColSpan()); $this->tpl->parseCurrentBlock(); } $this->dropdown = array(); // commands if (count($this->getBlockCommands()) > 0) { $has_block_command = false; foreach ($this->getBlockCommands() as $command) { if (!$command["img"]) { $this->dropdown[] = $command; continue; } $has_block_command = true; if ($command["target"] != "") { $this->tpl->setCurrentBlock("bc_target"); $this->tpl->setVariable("CMD_TARGET", $command["target"]); $this->tpl->parseCurrentBlock(); } if ($command["img"] != "") { $this->tpl->setCurrentBlock("bc_image"); $this->tpl->setVariable("SRC_BC", $command["img"]); $this->tpl->setVariable("ALT_BC", $command["text"]); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("block_command"); } else { $this->tpl->setCurrentBlock("block_command"); $this->tpl->setVariable("CMD_TEXT", $command["text"]); $this->tpl->setVariable("BC_CLASS", 'class="il_ContainerItemCommand"'); } $this->tpl->setVariable("CMD_HREF", $command["href"]); $this->tpl->parseCurrentBlock(); } if ($has_block_command) { $this->tpl->setCurrentBlock("block_commands"); $this->tpl->setVariable("CCOLSPAN", $this->getColSpan()); $this->tpl->parseCurrentBlock(); } } // fill previous next $this->fillPreviousNext(); // fill footer $this->fillFooter(); // fill row for setting details $this->fillDetailRow(); // header links if (count($this->getHeaderLinks())) { $counter = 0; foreach ($this->getHeaderLinks() as $command) { if ($counter > 0) { $this->tpl->setCurrentBlock('head_delim'); $this->tpl->touchBlock('head_delim'); $this->tpl->parseCurrentBlock(); } if ($command['status'] == true) { $this->tpl->setCurrentBlock('head_link'); $this->tpl->setVariable('HHREF', $command['href']); $this->tpl->setVariable('HLINK', $command['text']); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('head_text'); $this->tpl->setVariable('HTEXT', $command['text']); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('head_item'); $this->tpl->parseCurrentBlock(); ++$counter; } $this->tpl->setCurrentBlock('header_links'); $this->tpl->parseCurrentBlock(); } // for screen readers we first output the title and the commands // (e.g. close icon afterwards), otherwise we first output the // header commands, since we want to have the close icon top right // and not floated after the title if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization")) { $this->fillHeaderTitleBlock(); $this->fillHeaderCommands(); } else { $this->fillHeaderCommands(); $this->fillHeaderTitleBlock(); } // adv selection gui include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $dropdown = new ilAdvancedSelectionListGUI(); $dropdown->setUseImages(true); $dropdown->setHeaderIcon(ilUtil::getImagePath("icon_sett_s.png")); $dropdown->setId("block_dd_" . $this->getBlockType() . "_" . $this->block_id); foreach ($this->dropdown as $item) { if ($item["href"] || $item["onclick"]) { if ($item["checked"]) { $item["image"] = ilUtil::getImagePath("icon_checked_s.png"); } $dropdown->addItem($item["text"], "", $item["href"], $item["image"], $item["text"], "", "", false, $item["onclick"]); } } $dropdown = $dropdown->getHTML(); $this->tpl->setVariable("ADV_DROPDOWN", $dropdown); $this->tpl->setVariable("COLSPAN", $this->getColSpan()); if ($this->getBigMode()) { $this->tpl->touchBlock("hclassb"); } else { $this->tpl->touchBlock("hclass"); } if ($ilCtrl->isAsynch()) { // return without div wrapper echo $this->tpl->getAsynch(); } else { // return incl. wrapping div with id return '<div id="' . "block_" . $this->getBlockType() . "_" . $this->block_id . '">' . $this->tpl->get() . '</div>'; } }
/** * Fill row * * @access public * @param array row data * */ public function fillRow($a_set) { global $ilCtrl; $this->tpl->setVariable('S_ID', $this->getServer()->getServerId()); $this->tpl->setVariable('M_ID', $a_set['mid']); $this->tpl->setVariable('VAL_ID', $this->getServer()->getServerId() . '_' . $a_set['mid']); $this->tpl->setVariable('VAL_ORG', (string) $a_set['org']); $this->tpl->setVariable('VAL_CHECKED', $a_set['checked'] ? 'checked="checked"' : ''); $this->tpl->setVariable('VAL_TITLE', $a_set['participants']); $this->tpl->setVariable('VAL_DESC', $a_set['description']); $this->tpl->setVariable('VAL_EMAIL', $a_set['email']); $this->tpl->setVariable('VAL_DNS', $a_set['dns']); $this->tpl->setVariable('VAL_ABR', $a_set['abr']); $this->tpl->setVariable('TXT_EMAIL', $this->lng->txt('ecs_email')); $this->tpl->setVariable('TXT_DNS', $this->lng->txt('ecs_dns')); $this->tpl->setVariable('TXT_ABR', $this->lng->txt('ecs_abr')); $this->tpl->setVariable('TXT_ID', $this->lng->txt('ecs_unique_id')); $this->tpl->setVariable('TXT_ORG', $this->lng->txt('organization')); include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php'; $part = new ilECSParticipantSetting($this->getServer()->getServerId(), $a_set['mid']); if ($part->isExportEnabled()) { foreach ($part->getExportTypes() as $obj_type) { $this->tpl->setCurrentBlock('obj_erow'); $this->tpl->setVariable('TXT_OBJ_EINFO', $this->lng->txt('objs_' . $obj_type)); $this->tpl->parseCurrentBlock(); } } else { $this->lng->loadLanguageModule('administration'); $this->tpl->setVariable('TXT_OBJ_EINFO', $this->lng->txt('disabled')); } if ($part->isImportEnabled()) { foreach ($part->getImportTypes() as $obj_type) { $this->tpl->setCurrentBlock('obj_irow'); $this->tpl->setVariable('TXT_OBJ_IINFO', $this->lng->txt('objs_' . $obj_type)); $this->tpl->parseCurrentBlock(); } } else { $this->lng->loadLanguageModule('administration'); $this->tpl->setVariable('TXT_OBJ_IINFO', $this->lng->txt('disabled')); } // :TODO: what types are to be supported? $sel = ilUtil::formSelect($part->getImportType(), 'import_type[' . $this->getServer()->getServerId() . '][' . $a_set['mid'] . ']', array(ilECSParticipantSetting::IMPORT_RCRS => $this->lng->txt('obj_rcrs'), ilECSParticipantSetting::IMPORT_CRS => $this->lng->txt('obj_crs'), ilECSParticipantSetting::IMPORT_CMS => $this->lng->txt('ecs_import_cms')), false, true); $this->tpl->setVariable('IMPORT_SEL', $sel); include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setItemLinkClass('small'); $list->setSelectionHeaderClass('small'); $list->setId('actl_' . $a_set['server_id'] . '_' . $a_set['mid']); $list->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId()); $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']); $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTargetByClass('ilecsparticipantsettingsgui', 'settings')); switch ($part->getImportType()) { case ilECSParticipantSetting::IMPORT_RCRS: // Do nothing break; case ilECSParticipantSetting::IMPORT_CRS: // Possible action => Edit course allocation $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId()); $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']); $list->addItem($this->lng->txt('ecs_crs_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'cStart')); break; case ilECSParticipantSetting::IMPORT_CMS: $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId()); $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']); // Possible action => Edit course allocation, edit node mapping $list->addItem($this->lng->txt('ecs_dir_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'dStart')); $list->addItem($this->lng->txt('ecs_crs_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'cStart')); break; } $this->tpl->setVariable('ACTIONS', $list->getHTML()); }