本文整理汇总了PHP中ilAdvancedSelectionListGUI::addItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilAdvancedSelectionListGUI::addItem方法的具体用法?PHP ilAdvancedSelectionListGUI::addItem怎么用?PHP ilAdvancedSelectionListGUI::addItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilAdvancedSelectionListGUI
的用法示例。
在下文中一共展示了ilAdvancedSelectionListGUI::addItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTML
/**
* 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;
}
示例2: fillRow
/**
* @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);
}
示例3: fillRow
/**
* 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());
}
示例4: fillRow
/**
* 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"])));
}
}
示例5: fillRow
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);
}
示例6: addSelectionListItems
/**
* @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();
}
示例7: buildActionMenu
/**
* 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;
}
示例8: fillRow
/**
* 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());
}
示例9: addItemsAfter
/**
* @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;
}
示例10: fillRow
/**
* 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());
}
示例11: fillRow
/**
* 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());
}
示例12: buildActionMenu
/**
* 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;
}
示例13: fillRow
/**
* 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());
}
示例14: buildActions
/**
* 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;
}
示例15: fillRow
/**
* 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());
}