33 protected \ILIAS\DI\UIServices
$ui;
34 protected \ilObjAdministrativeNotificationAccess
$access;
50 $this->
ctrl = $DIC->ctrl();
51 $this->
lng = $DIC->language();
52 $this->data_factory =
new Factory();
53 $this->
ui = $DIC->ui();
56 $this->
setId(
'msg_msg_table');
57 $this->
setRowTemplate(
'Services/AdministrativeNotification/templates/default/tpl.row.html');
65 $this->
addColumn($this->
lng->txt(
'msg_type_during_event'));
66 $this->
addColumn($this->
lng->txt(
'msg_event_date_start'));
68 $this->
addColumn($this->
lng->txt(
'msg_display_date_start'));
69 $this->
addColumn($this->
lng->txt(
'msg_display_date_end'));
85 protected function fillRow(array $a_set):
void 90 $notification = ilADNNotification::find($a_set[
'id']);
91 $this->tpl->setVariable(
'TITLE', $notification->getTitle());
92 $this->tpl->setVariable(
'TYPE', $this->
lng->txt(
'msg_type_' . $notification->getType()));
95 if (!$notification->isPermanent()) {
96 $this->tpl->setVariable(
98 $this->
lng->txt(
'msg_type_' . $notification->getTypeDuringEvent())
100 $this->tpl->setVariable(
'EVENT_START', $this->
formatDate($notification->getEventStart()));
101 $this->tpl->setVariable(
'EVENT_END', $this->
formatDate($notification->getEventEnd()));
102 $this->tpl->setVariable(
'DISPLAY_START', $this->
formatDate($notification->getDisplayStart()));
103 $this->tpl->setVariable(
'DISPLAY_END', $this->
formatDate($notification->getDisplayEnd()));
106 if ($this->
access->hasUserPermissionTo(
'write')) {
110 $items[] = $this->
ui->factory()->button()->shy(
116 $ditem = $this->
ui->factory()->modal()->interruptiveItem()->standard((
string) $notification->getId(), $notification->getTitle());
119 ->withOnClick($delete_modal->getShowSignal());
120 $this->modals[] = $delete_modal;
124 ->withOnClick($reset_modal->getShowSignal());
125 $this->modals[] = $reset_modal;
127 $items[] = $this->
ui->factory()->button()->shy(
132 $actions = $this->
ui->renderer()->render([$this->
ui->factory()->dropdown()->standard($items)->withLabel($this->
lng->txt(
'actions'))]);
134 $this->tpl->setVariable(
'ACTIONS', $actions);
136 $this->tpl->setVariable(
'ACTIONS',
"");
142 $action = $this->
ctrl->getLinkTargetByClass(ilADNNotificationGUI::class, $cmd);
144 return $this->
ui->factory()->modal()
146 $this->
lng->txt(
'btn_' . $cmd),
147 $this->
lng->txt(
'btn_' . $cmd .
'_confirm'),
150 ->withAffectedItems([$i])
151 ->withActionButtonLabel($this->
lng->txt($cmd));
156 return parent::getHTML() . $this->
ui->renderer()->render($this->modals);
164 $languages_text = $this->
lng->txt(
"all");
165 if ($has_language_limitation) {
167 $languages_text = $this->
lng->txt(
"none");
168 if (!empty($limited_to_languages)) {
169 $this->
lng->loadLanguageModule(
"meta");
172 $languages_text = implode(
175 function (
string $lng_code):
string {
176 return $this->
lng->txt(
"meta_l_" . $lng_code);
178 $limited_to_languages
184 return $languages_text;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getArray(?string $key=null, $values=null)
setFormAction(string $a_form_action, bool $a_multipart=false)
Interface InterruptiveItem.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
modal(InterruptiveItem $i, string $cmd)
formatDate(DateTimeImmutable $timestamp)
fillRow(array $a_set)
Standard Version of Fill Row.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
foreach($mandatory_scripts as $file) $timestamp
ilObjAdministrativeNotificationAccess $access
Class ilADNNotificationTableGUI.
getLanguagesTextForNotification(ilADNNotification $notification)
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)
ILIAS Data Factory $data_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")