ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Privacy\SettingsGUI Class Reference
+ Collaboration diagram for ILIAS\User\Privacy\SettingsGUI:

Public Member Functions

 __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)
 
 executeCommand ()
 
 showCmd (?StandardForm $form=null)
 
 saveCmd ()
 
 shouldDisplayChatSection ()
 
 shouldDisplayNotificationSection ()
 

Private Member Functions

 buildPrivacySettingsForm (?StandardForm $form)
 
 buildPublicProfilePresentation ()
 
 buildChatJsTemplate (\ilGlobalTemplateInterface $global_template)
 
 initForm ()
 
 shouldShowOnScreenChatOptions ()
 
 shouldShowChatTypingBroadcastOption ()
 
 shouldShowNotificationOptions ()
 

Detailed Description

Definition at line 34 of file class.SettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Privacy\SettingsGUI::__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 
)

Definition at line 36 of file class.SettingsGUI.php.

51 {
52 }

Member Function Documentation

◆ buildChatJsTemplate()

ILIAS\User\Privacy\SettingsGUI::buildChatJsTemplate ( \ilGlobalTemplateInterface  $global_template)
private
Todo:
sk 2025-08-20: This is actually in the completely wrong place, but we will leave it here for the time being until a good solution to initialize the javascript without the need for a template is found.

Definition at line 133 of file class.SettingsGUI.php.

135 : string {
137 || $this->chat_settings->get('enable_browser_notifications', '0') !== '1') {
138 return '';
139 }
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);
146
147 $tpl = new \ilTemplate('tpl.personal_chat_settings_form.html', true, true, 'components/ILIAS/Chatroom');
148 $tpl->setVariable('ALERT_IMAGE_SRC', \ilUtil::getImagePath('standard/icon_alert.svg'));
149 $tpl->setVariable('BROWSER_NOTIFICATION_TOGGLE_LABEL', $this->lng->txt('osc_enable_browser_notifications_label'));
150 return $tpl->get();
151 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

◆ buildPrivacySettingsForm()

ILIAS\User\Privacy\SettingsGUI::buildPrivacySettingsForm ( ?StandardForm  $form)
private

Definition at line 94 of file class.SettingsGUI.php.

96 : string {
97 if ($form === null) {
98 $form = $this->initForm();
99 }
100 return $this->ui_renderer->render($form);
101 }

◆ buildPublicProfilePresentation()

ILIAS\User\Privacy\SettingsGUI::buildPublicProfilePresentation ( )
private

Definition at line 103 of file class.SettingsGUI.php.

103 : string
104 {
105 if ($this->profile_mode->isEnabled()) {
106 $pub_profile_legacy = $this->ui_factory->legacy()->content(
107 (new PublicProfileGUI(
108 $this->user->getId()
109 ))->getEmbeddable()
110 );
111 return $this->ui_renderer->render($this->ui_factory->panel()->standard(
112 $this->lng->txt('user_profile_preview'),
113 $pub_profile_legacy
114 ));
115 }
116
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')
121 )
122 );
123 }
124
125 return '';
126 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\User\Privacy\SettingsGUI::executeCommand ( )

Definition at line 54 of file class.SettingsGUI.php.

54 : void
55 {
56 $cmd = $this->ctrl->getCmd('show') . 'Cmd';
57 $this->$cmd();
58 $this->tpl->printToStdout();
59 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initForm()

ILIAS\User\Privacy\SettingsGUI::initForm ( )
private

Definition at line 153 of file class.SettingsGUI.php.

154 {
155 return $this->ui_factory->input()->container()->form()->standard(
156 $this->ctrl->getLinkTarget($this, 'save'),
157 $this->user_settings->buildFormInputs(
158 [AvailablePages::PrivacySettings],
159 Context::User,
160 $this->user
161 )
162 );
163 }
This describes a standard form.
Definition: Standard.php:29

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveCmd()

ILIAS\User\Privacy\SettingsGUI::saveCmd ( )

Definition at line 71 of file class.SettingsGUI.php.

71 : void
72 {
73 $form = $this->initForm()->withRequest($this->request);
74 $form_data = [
75 'privacy' => $form->getData()
76 ];
77
78 $updated_user = $this->user_settings->saveForm(
79 $form_data,
80 [AvailablePages::PrivacySettings],
81 Context::User,
82 $this->user
83 );
84
85 $this->checklist_status->setStepSucessOnUser(
87 $updated_user
88 )->update();
89
90 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
91 $this->ctrl->redirectByClass(self::class, '');
92 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\User\Profile\ChecklistStatus\STEP_VISIBILITY_OPTIONS, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ shouldDisplayChatSection()

ILIAS\User\Privacy\SettingsGUI::shouldDisplayChatSection ( )

Definition at line 176 of file class.SettingsGUI.php.

176 : bool
177 {
178 return (bool) $this->chat_settings->get('chat_enabled', '0');
179 }

◆ shouldDisplayNotificationSection()

ILIAS\User\Privacy\SettingsGUI::shouldDisplayNotificationSection ( )

Definition at line 186 of file class.SettingsGUI.php.

186 : bool
187 {
188 return (bool) $this->notification_settings->get('enable_osd', '0');
189 }

◆ shouldShowChatTypingBroadcastOption()

ILIAS\User\Privacy\SettingsGUI::shouldShowChatTypingBroadcastOption ( )
private

Definition at line 171 of file class.SettingsGUI.php.

171 : bool
172 {
173 return $this->settings->get('usr_settings_hide_chat_broadcast_typing', '0') !== '1';
174 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ shouldShowNotificationOptions()

ILIAS\User\Privacy\SettingsGUI::shouldShowNotificationOptions ( )
private

Definition at line 181 of file class.SettingsGUI.php.

181 : bool
182 {
183 return (bool) $this->notification_settings->get('osd_play_sound', '0');
184 }

◆ shouldShowOnScreenChatOptions()

ILIAS\User\Privacy\SettingsGUI::shouldShowOnScreenChatOptions ( )
private

Definition at line 165 of file class.SettingsGUI.php.

165 : bool
166 {
167 return $this->chat_settings->get('enable_osc', '0') &&
168 $this->settings->get('usr_settings_hide_chat_osc_accept_msg', '0') !== 1;
169 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ showCmd()

ILIAS\User\Privacy\SettingsGUI::showCmd ( ?StandardForm  $form = null)

Definition at line 61 of file class.SettingsGUI.php.

63 : void {
64 $this->tpl->setContent(
65 $this->buildPrivacySettingsForm($form)
67 . $this->buildChatJsTemplate($this->tpl)
68 );
69 }
buildChatJsTemplate(\ilGlobalTemplateInterface $global_template)
buildPrivacySettingsForm(?StandardForm $form)

The documentation for this class was generated from the following file: