19declare(strict_types=1);
32use Psr\Http\Message\ServerRequestInterface;
38 private readonly \
ilCtrl $ctrl,
40 private readonly ServerRequestInterface $request,
44 private readonly UIFactory $ui_factory,
45 private readonly UIRenderer $ui_renderer,
47 private readonly ProfileVisibility $profile_mode,
49 private readonly \
ilSetting $chat_settings,
50 private readonly \
ilSetting $notification_settings
56 $cmd = $this->
ctrl->getCmd(
'show') .
'Cmd';
58 $this->tpl->printToStdout();
62 ?StandardForm $form =
null
64 $this->tpl->setContent(
73 $form = $this->initForm()->withRequest($this->request);
75 'privacy' => $form->getData()
78 $updated_user = $this->user_settings->saveForm(
80 [AvailablePages::PrivacySettings],
85 $this->checklist_status->setStepSucessOnUser(
90 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
91 $this->
ctrl->redirectByClass(self::class,
'');
98 $form = $this->initForm();
100 return $this->ui_renderer->render($form);
105 if ($this->profile_mode->isEnabled()) {
106 $pub_profile_legacy = $this->ui_factory->legacy()->content(
111 return $this->ui_renderer->render($this->ui_factory->panel()->standard(
112 $this->lng->txt(
'user_profile_preview'),
117 if (!$this->checklist_status->anyVisibilitySettings()) {
118 return $this->ui_renderer->render(
119 $this->ui_factory->messageBox()->info(
120 $this->lng->txt(
'usr_public_profile_disabled')
136 if (!$this->shouldShowOnScreenChatOptions()
137 || $this->chat_settings->
get(
'enable_browser_notifications',
'0') !==
'1') {
140 $global_template->addJavaScript(
'assets/js/BrowserNotifications.min.js');
141 $this->
lng->toJSMap([
142 'osc_browser_noti_no_permission_error' => $this->
lng->txt(
'osc_browser_noti_no_permission_error'),
143 'osc_browser_noti_no_support_error' => $this->lng->txt(
'osc_browser_noti_no_support_error'),
144 'osc_browser_noti_req_permission_error' => $this->lng->txt(
'osc_browser_noti_req_permission_error'),
145 ], $global_template);
147 $tpl = new \ilTemplate(
'tpl.personal_chat_settings_form.html',
true,
true,
'components/ILIAS/Chatroom');
149 $tpl->setVariable(
'BROWSER_NOTIFICATION_TOGGLE_LABEL', $this->
lng->txt(
'osc_enable_browser_notifications_label'));
155 return $this->ui_factory->input()->container()->form()->standard(
156 $this->
ctrl->getLinkTarget($this,
'save'),
157 $this->user_settings->buildFormInputs(
158 [AvailablePages::PrivacySettings],
167 return $this->chat_settings->get(
'enable_osc',
'0') &&
168 $this->
settings->get(
'usr_settings_hide_chat_osc_accept_msg',
'0') !== 1;
173 return $this->
settings->get(
'usr_settings_hide_chat_broadcast_typing',
'0') !==
'1';
178 return (
bool) $this->chat_settings->get(
'chat_enabled',
'0');
183 return (
bool) $this->notification_settings->get(
'osd_play_sound',
'0');
188 return (
bool) $this->notification_settings->get(
'enable_osd',
'0');
Builds a Color from either hex- or rgb values.
buildChatJsTemplate(\ilGlobalTemplateInterface $global_template)
showCmd(?StandardForm $form=null)
shouldShowChatTypingBroadcastOption()
shouldDisplayChatSection()
shouldDisplayNotificationSection()
__construct(private readonly \ilLanguage $lng, private readonly \ilCtrl $ctrl, private readonly \ilAppEventHandler $event, private readonly ServerRequestInterface $request, private readonly \ilObjUser $user, private readonly \ilSetting $settings, private readonly \ilGlobalTemplateInterface $tpl, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly SettingsImplementation $user_settings, private readonly ProfileVisibility $profile_mode, private readonly ChecklistStatus $checklist_status, private readonly \ilSetting $chat_settings, private readonly \ilSetting $notification_settings)
buildPrivacySettingsForm(?StandardForm $form)
shouldShowNotificationOptions()
shouldShowOnScreenChatOptions()
buildPublicProfilePresentation()
const STEP_VISIBILITY_OPTIONS
GUI class for public user profile presentation.
Personal profile publishing mode of a user.
Class ilCtrl provides processing control methods.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
An entity that renders components to a string output.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))