19 declare(strict_types=1);
45 private readonly
Mode $profile_mode
47 $this->settings_chat = new \ilSetting(
'chatroom');
48 $this->settings_awareness = new \ilSetting(
'awrn');
50 $this->
lng->loadLanguageModule(
'chatroom');
58 ? $this->
lng->txt(
'user_visibility_settings')
59 : $this->
lng->txt(
'preview');
62 self::STEP_PROFILE_DATA => $this->
lng->txt(
'user_profile_data'),
63 self::STEP_PUBLISH_OPTIONS => $this->
lng->txt(
'user_publish_options'),
64 self::STEP_VISIBILITY_OPTIONS => $txt_visibility
71 return $this->settings_awareness->get(
'awrn_enabled',
'0') !==
'0' 80 case self::STEP_PROFILE_DATA:
81 if ($this->
user->getProfileIncomplete()) {
82 return self::STATUS_IN_PROGRESS;
84 if ($this->
user->getPref(
'profile_personal_data_saved')) {
85 return self::STATUS_SUCCESSFUL;
89 case self::STEP_PUBLISH_OPTIONS:
90 if ($this->
user->getPref(
'profile_publish_opt_saved')) {
91 return self::STATUS_SUCCESSFUL;
95 case self::STEP_VISIBILITY_OPTIONS:
96 if ($this->
user->getPref(
'profile_visibility_opt_saved')
98 && $this->
user->getPref(
'profile_publish_opt_saved')) {
99 return self::STATUS_SUCCESSFUL;
104 return self::STATUS_NOT_STARTED;
111 case self::STEP_PROFILE_DATA:
112 if ($status === self::STATUS_SUCCESSFUL) {
113 return $this->
lng->txt(
'user_profile_data_checked');
115 return $this->
lng->txt(
'user_check_profile_data');
117 case self::STEP_PUBLISH_OPTIONS:
118 if ($status === self::STATUS_SUCCESSFUL) {
119 return $this->profile_mode->getModeInfo();
121 return $this->
lng->txt(
'user_set_publishing_options');
123 case self::STEP_VISIBILITY_OPTIONS:
124 if ($status === self::STATUS_SUCCESSFUL) {
128 return $this->
lng->txt(
'user_set_visibilty_options');
138 case self::STEP_PROFILE_DATA:
139 $this->
user->setPref(
'profile_personal_data_saved',
'1');
141 case self::STEP_PUBLISH_OPTIONS:
142 $this->
user->setPref(
'profile_publish_opt_saved',
'1');
144 case self::STEP_VISIBILITY_OPTIONS:
145 $this->
user->setPref(
'profile_visibility_opt_saved',
'1');
148 $this->
user->update();
154 if ($this->settings_awareness->get(
'awrn_enabled',
'0') !==
'0') {
155 $show = $this->
user->getPref(
'hide_own_online_status') ===
'n' 156 || $this->
user->getPref(
'hide_own_online_status') ??
'' ===
'' 157 && $this->
settings->get(
'hide_own_online_status') ===
'n';
159 ? $this->
lng->txt(
'hide_own_online_status')
160 : $this->
lng->txt(
'show_own_online_status');
163 $status[] = $this->
user->getPref(
'bs_allow_to_contact_me') !==
'y' 164 ? $this->
lng->txt(
'buddy_allow_to_contact_me_no')
165 : $this->
lng->txt(
'buddy_allow_to_contact_me_yes');
168 $status[] = $this->
user->getPref(
'chat_osc_accept_msg') ===
'y' 169 ? $this->
lng->txt(
'chat_use_osc')
170 : $this->
lng->txt(
'chat_not_use_osc');
173 $status[] = $this->
user->getPref(
'chat_broadcast_typing') ===
'y' 174 ? $this->
lng->txt(
'chat_use_typing_broadcast')
175 : $this->
lng->txt(
'chat_no_use_typing_broadcast');
177 return implode(
',<br>', $status);
182 return $this->settings_chat->get(
'chat_enabled',
'0') !==
'0' 183 && $this->settings_chat->get(
'enable_osc',
'0') !==
'0' 184 && $this->
settings->get(
'usr_settings_hide_chat_osc_accept_msg',
'0') ===
'0';
189 return $this->settings_chat->get(
'chat_enabled',
'0')
190 && $this->
settings->get(
'usr_settings_hide_chat_broadcast_typing',
'0') ===
'0';
buildStatusArrayForVisibilityOnSuccess()
Personal profile publishing mode of a user.
areOnScreenChatOptionsVisible()
getStatusDetails(int $step)
__construct(private readonly Language $lng, private readonly \ilSetting $settings, private readonly \ilObjUser $user, private readonly Mode $profile_mode)
areChatTypingBroadcastOptionsVisible()
const STEP_PUBLISH_OPTIONS
ilSetting $settings_awareness
saveStepSucess(int $step)
const STEP_VISIBILITY_OPTIONS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...