ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilStudyProgrammeAutoMembershipsTableGUI.php
Go to the documentation of this file.
1<?php
2
3 declare(strict_types=1);
4
11{
12 public function __construct(
13 $a_parent_obj,
14 $a_parent_cmd = "",
15 $a_template_context = ""
16 ) {
17 $this->setId("sp_ac_list");
18 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
19 $this->setTitle($this->lng->txt('auto_membership_title'));
20 $this->setDescription($this->lng->txt('auto_membership_description'));
21 $this->setEnableTitle(true);
22 $this->setTopCommands(false);
23 $this->setEnableHeader(true);
24 $this->setExternalSorting(false);
25 $this->setExternalSegmentation(true);
26 $this->setRowTemplate("tpl.automembers_table_row.html", "Modules/StudyProgramme");
27 $this->setShowRowsSelector(false);
28 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, "view"));
29 $this->disable('sort');
30 $this->addColumn("", "", "1", true);
31 $this->addColumn($this->lng->txt('auto_membership_src_type'), 'type');
32 $this->addColumn($this->lng->txt('title'), 'title');
33 $this->addColumn($this->lng->txt('last_edited_by'), 'editor');
34 $this->addColumn($this->lng->txt('last_edited'), 'last');
35 $this->addColumn($this->lng->txt('status'), 'status');
36 $this->addColumn($this->lng->txt('actions'), 'actions');
38 $this->setEnableAllCommand(true);
39 $this->addMultiCommand('deleteConfirmation', $this->lng->txt('delete'));
40 }
41
42 protected function fillRow($set)
43 {
44 list($ams, $title, $usr, $actions) = $set;
45
46 $username = ilObjUser::_lookupName($ams->getLastEditorId());
47 $editor = implode(' ', [
48 $username['firstname'],
49 $username['lastname'],
50 '(' . $username['login'] . ')'
51 ]);
52
53 $id = $ams->getSourceType() . '-' . $ams->getSourceId();
54 $status = $ams->isEnabled() ? $this->lng->txt('active') : $this->lng->txt('inactive');
55 $date = $this->getDatePresentation($ams->getLastEdited()->getTimestamp());
56
57 $this->tpl->setVariable("ID", $id);
58 $this->tpl->setVariable("TYPE", $this->lng->txt($ams->getSourceType()));
59 $this->tpl->setVariable("TITLE", $title);
60 $this->tpl->setVariable("EDITOR", $usr);
61 $this->tpl->setVariable("LAST_EDITED", $date);
62 $this->tpl->setVariable("STATUS", $status);
63 $this->tpl->setVariable("ACTIONS", $actions);
64 }
65
66 protected function getDatePresentation(int $timestamp) : string
67 {
68 $date = new ilDateTime($timestamp, IL_CAL_UNIX);
70 }
71}
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _lookupName($a_user_id)
lookup user name
__construct( $a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI constructor.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setDescription($a_val)
Set description.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc