ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilStudyProgrammeAutoMembershipsTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public function __construct(
30 string $parent_cmd = "",
31 string $template_context = ""
32 ) {
33 $this->setId("sp_ac_list");
34 parent::__construct($parent_obj, $parent_cmd, $template_context);
35 $this->setTitle($this->lng->txt('auto_membership_title'));
36 $this->setDescription($this->lng->txt('auto_membership_description'));
37 $this->setEnableTitle(true);
38 $this->setTopCommands(false);
39 $this->setEnableHeader(true);
40 $this->setExternalSorting(false);
41 $this->setExternalSegmentation(true);
42 $this->setRowTemplate("tpl.automembers_table_row.html", "components/ILIAS/StudyProgramme");
43 $this->setShowRowsSelector(false);
44 $this->setFormAction($this->ctrl->getFormAction($parent_obj, "view"));
45 $this->disable('sort');
46 $this->addColumn("", "", "1", true);
47 $this->addColumn($this->lng->txt('auto_membership_src_type'), 'type');
48 $this->addColumn($this->lng->txt('title'), 'title');
49 $this->addColumn($this->lng->txt('last_edited_by'), 'editor');
50 $this->addColumn($this->lng->txt('last_edited'), 'last');
51 $this->addColumn($this->lng->txt('status'), 'status');
52 $this->addColumn($this->lng->txt('search_for_orgu_members_recursive'), 'search_recursive');
53 $this->addColumn($this->lng->txt('actions'), 'actions');
55 $this->setEnableAllCommand(true);
56 $this->addMultiCommand('deleteConfirmation', $this->lng->txt('delete'));
57 }
58
59 protected function fillRow(array $a_set): void
60 {
62 list($ams, $title, $usr, $actions) = $a_set;
63
64 $username = ilObjUser::_lookupName($ams->getLastEditorId());
65 $editor = implode(' ', [
66 $username['firstname'],
67 $username['lastname'],
68 '(' . $username['login'] . ')'
69 ]);
70
71 $id = $ams->getSourceType() . '-' . $ams->getSourceId();
72 $status = $ams->isEnabled() ? $this->lng->txt('active') : $this->lng->txt('inactive');
73 $date = $this->getDatePresentation($ams->getLastEdited()->getTimestamp());
74
75 $search_recursive = $this->lng->txt("no");
76 if ($ams->isSearchRecursive()) {
77 $search_recursive = $this->lng->txt("yes");
78 }
79
80 $this->tpl->setVariable("ID", $id);
81 $this->tpl->setVariable("TYPE", $this->lng->txt($ams->getSourceType()));
82 $this->tpl->setVariable("TITLE", $title);
83 $this->tpl->setVariable("EDITOR", $usr);
84 $this->tpl->setVariable("LAST_EDITED", $date);
85 $this->tpl->setVariable("STATUS", $status);
86 $this->tpl->setVariable("SEARCH_RECURSIVE", $search_recursive);
87 $this->tpl->setVariable("ACTIONS", $actions);
88 }
89
90 protected function getDatePresentation(int $timestamp): string
91 {
92 $date = new ilDateTime($timestamp, IL_CAL_UNIX);
93 return ilDatePresentation::formatDate($date) ?? "";
94 }
95}
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _lookupName(int $a_user_id)
__construct(ilObjStudyProgrammeAutoMembershipsGUI $parent_obj, string $parent_cmd="", string $template_context="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setEnableAllCommand(bool $a_value)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setExternalSegmentation(bool $a_val)
setEnableTitle(bool $a_enabletitle)
setDescription(string $a_val)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
fillRow(array $a_set)
Standard Version of Fill Row.
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setTopCommands(bool $a_val)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
disable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc