19 declare(strict_types=1);
37 $this->ui_factory = $DIC->ui()->factory();
38 $this->ui_renderer = $DIC->ui()->renderer();
40 $this->
lng = $DIC->language();
41 $this->
ctrl = $DIC->ctrl();
44 $this->
setId(
'frmev_' . $settings_gui->
getRefId() . substr($type, 0, 3));
48 $this->
setTitle($this->
lng->txt(strtolower($type)));
49 $this->
setRowTemplate(
'tpl.forums_members_row.html',
'Modules/Forum');
54 $this->
addColumn($this->
lng->txt(
'firstname'),
'',
'20%');
55 $this->
addColumn($this->
lng->txt(
'lastname'),
'',
'20%');
56 $this->
addColumn($this->
lng->txt(
'allow_user_toggle_noti'),
'',
'20%');
60 $this->
addMultiCommand(
'enableHideUserToggleNoti', $this->
lng->txt(
'enable_hide_user_toggle'));
61 $this->
addMultiCommand(
'disableHideUserToggleNoti', $this->
lng->txt(
'disable_hide_user_toggle'));
64 private function getIcon(
int $user_toggle_noti): string
66 $icon_ok = $this->ui_factory->symbol()->icon()->custom(
68 $this->
lng->txt(
'enabled')
70 $icon_not_ok = $this->ui_factory->symbol()->icon()->custom(
72 $this->
lng->txt(
'disabled')
74 $icon = $user_toggle_noti === 0 ? $icon_ok : $icon_not_ok;
76 return $this->ui_renderer->render(
$icon);
79 protected function fillRow(array $a_set): void
81 $this->tpl->setVariable(
'VAL_USER_ID', $a_set[
'user_id']);
82 $this->tpl->setVariable(
'VAL_LOGIN', $a_set[
'login']);
83 $this->tpl->setVariable(
'VAL_FIRSTNAME', $a_set[
'firstname']);
84 $this->tpl->setVariable(
'VAL_LASTNAME', $a_set[
'lastname']);
86 $icon_ok = $this->
getIcon((
int) $a_set[
'user_toggle_noti']);
87 $this->tpl->setVariable(
'VAL_USER_TOGGLE_NOTI', $icon_ok);
94 $interested_events = $row[
'interested_events'];
97 $this->
ctrl->getFormAction($this->parent_obj,
'saveEventsForUser'),
99 'hidden_value' => json_encode([
100 'usr_id' => $row[
'usr_id_events']
101 ], JSON_THROW_ON_ERROR),
115 $notificationsModal = $this->ui_factory->modal()->roundtrip(
116 $this->
lng->txt(
'notification_settings'),
118 )->withActionButtons([
119 $this->ui_factory->button()
120 ->primary($this->
lng->txt(
'save'),
'#')
123 $('#$id').closest('.modal').find('form').addClass('ilForumNotificationSettingsForm'); 124 $('#$id').closest('.modal').find('form .il-standard-form-header, .il-standard-form-footer').remove(); 125 $('#$id').click(function() { $(this).closest('.modal').find('form').submit(); return false; }); 130 $showNotificationSettingsBtn = $this->ui_factory->button()
131 ->shy($this->
lng->txt(
'notification_settings'),
'#')
133 $notificationsModal->getShowSignal()
136 $this->notification_modals[] = $notificationsModal;
138 $this->tpl->setVariable(
'VAL_NOTIFICATION', $this->ui_renderer->render($showNotificationSettingsBtn));
143 return parent::render() . $this->ui_renderer->render($this->notification_modals);
setFormAction(string $a_form_action, bool $a_multipart=false)
__construct(ilForumSettingsGUI $settings_gui, string $cmd, string $type)
getIcon(int $user_toggle_noti)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ILIAS UI Factory $ui_factory
Class ilForumSettingsGUI.
ILIAS UI Renderer $ui_renderer
ilGlobalTemplateInterface $mainTemplate
populateWithModal(array $row)
withOnLoadCode(Closure $binder)
eventsFormBuilder(array $row)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
Class ilForumNotificationTableGUI.
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)
addMultiCommand(string $a_cmd, string $a_text)
array $notification_modals