ILIAS  release_8 Revision v8.24
class.ilStudyProgrammeAutoMembershipsTableGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
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", "Modules/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('actions'), 'actions');
54 $this->setEnableAllCommand(true);
55 $this->addMultiCommand('deleteConfirmation', $this->lng->txt('delete'));
56 }
57
58 protected function fillRow(array $a_set): void
59 {
60 [$ams, $title, $usr, $actions] = $a_set;
61
62 $id = $ams->getSourceType() . '-' . $ams->getSourceId();
63 $status = $ams->isEnabled() ? $this->lng->txt('active') : $this->lng->txt('inactive');
64 $date = $this->getDatePresentation($ams->getLastEdited()->getTimestamp());
65
66 $this->tpl->setVariable("ID", $id);
67 $this->tpl->setVariable("TYPE", $this->lng->txt($ams->getSourceType()));
68 $this->tpl->setVariable("TITLE", $title);
69 $this->tpl->setVariable("EDITOR", $usr);
70 $this->tpl->setVariable("LAST_EDITED", $date);
71 $this->tpl->setVariable("STATUS", $status);
72 $this->tpl->setVariable("ACTIONS", $actions);
73 }
74
75 protected function getDatePresentation(int $timestamp): string
76 {
77 $date = new ilDateTime($timestamp, IL_CAL_UNIX);
78 return ilDatePresentation::formatDate($date) ?? "";
79 }
80}
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)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__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)
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