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

Public Member Functions

 __construct (private readonly Language $lng, private readonly \ilSetting $settings, private \ilObjUser $user, private readonly Visibility $profile_mode)
 
 getSteps ()
 
 anyVisibilitySettings ()
 
 getStatus (int $step)
 
 getStatusDetails (int $step)
 
 setStepSucessOnUser (int $step, \ilObjUser $user)
 

Data Fields

const STEP_PROFILE_DATA = 0
 
const STEP_PUBLISH_OPTIONS = 1
 
const STEP_VISIBILITY_OPTIONS = 2
 
const STATUS_NOT_STARTED = 0
 
const STATUS_IN_PROGRESS = 1
 
const STATUS_SUCCESSFUL = 2
 

Private Member Functions

 buildStatusArrayForVisibilityOnSuccess ()
 
 areOnScreenChatOptionsVisible ()
 
 areChatTypingBroadcastOptionsVisible ()
 

Private Attributes

ilSetting $settings_chat
 
ilSetting $settings_awareness
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file ChecklistStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\ChecklistStatus::__construct ( private readonly Language  $lng,
private readonly \ilSetting  $settings,
private \ilObjUser  $user,
private readonly Visibility  $profile_mode 
)

Definition at line 41 of file ChecklistStatus.php.

46 {
47 $this->settings_chat = new \ilSetting('chatroom');
48 $this->settings_awareness = new \ilSetting('awrn');
49
50 $this->lng->loadLanguageModule('chatroom');
51 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ anyVisibilitySettings()

ILIAS\User\Profile\ChecklistStatus::anyVisibilitySettings ( )

Definition at line 68 of file ChecklistStatus.php.

68 : bool
69 {
70
71 return $this->settings_awareness->get('awrn_enabled', '0') !== '0'
72 || \ilBuddySystem::getInstance()->isEnabled()
75 }

References ILIAS\User\Profile\ChecklistStatus\areChatTypingBroadcastOptionsVisible(), ILIAS\User\Profile\ChecklistStatus\areOnScreenChatOptionsVisible(), and ilBuddySystem\getInstance().

Referenced by ILIAS\User\Profile\ChecklistStatus\getStatusDetails(), and ILIAS\User\Profile\ChecklistStatus\getSteps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ areChatTypingBroadcastOptionsVisible()

ILIAS\User\Profile\ChecklistStatus::areChatTypingBroadcastOptionsVisible ( )
private

Definition at line 190 of file ChecklistStatus.php.

190 : bool
191 {
192 return $this->settings_chat->get('chat_enabled', '0')
193 && $this->settings->get('usr_settings_hide_chat_broadcast_typing', '0') === '0';
194 }

References ILIAS\Repository\settings().

Referenced by ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ areOnScreenChatOptionsVisible()

ILIAS\User\Profile\ChecklistStatus::areOnScreenChatOptionsVisible ( )
private

Definition at line 183 of file ChecklistStatus.php.

183 : bool
184 {
185 return $this->settings_chat->get('chat_enabled', '0') !== '0'
186 && $this->settings_chat->get('enable_osc', '0') !== '0'
187 && $this->settings->get('usr_settings_hide_chat_osc_accept_msg', '0') === '0';
188 }

References ILIAS\Repository\settings().

Referenced by ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildStatusArrayForVisibilityOnSuccess()

ILIAS\User\Profile\ChecklistStatus::buildStatusArrayForVisibilityOnSuccess ( )
private

Definition at line 154 of file ChecklistStatus.php.

154 : string
155 {
156 $status = [];
157 if ($this->settings_awareness->get('awrn_enabled', '0') !== '0') {
158 $show = $this->user->getPref('hide_own_online_status') === 'n'
159 || $this->user->getPref('hide_own_online_status') ?? '' === ''
160 && $this->settings->get('hide_own_online_status') === 'n';
161 $status[] = !$show
162 ? $this->lng->txt('hide_own_online_status')
163 : $this->lng->txt('show_own_online_status');
164 }
165 if (\ilBuddySystem::getInstance()->isEnabled()) {
166 $status[] = $this->user->getPref('bs_allow_to_contact_me') !== 'y'
167 ? $this->lng->txt('buddy_allow_to_contact_me_no')
168 : $this->lng->txt('buddy_allow_to_contact_me_yes');
169 }
170 if ($this->areOnScreenChatOptionsVisible()) {
171 $status[] = $this->user->getPref('chat_osc_accept_msg') === 'y'
172 ? $this->lng->txt('chat_use_osc')
173 : $this->lng->txt('chat_not_use_osc');
174 }
176 $status[] = $this->user->getPref('chat_broadcast_typing') === 'y'
177 ? $this->lng->txt('chat_use_typing_broadcast')
178 : $this->lng->txt('chat_no_use_typing_broadcast');
179 }
180 return implode(',<br>', $status);
181 }

References ilBuddySystem\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

Referenced by ILIAS\User\Profile\ChecklistStatus\getStatusDetails().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStatus()

ILIAS\User\Profile\ChecklistStatus::getStatus ( int  $step)

Definition at line 77 of file ChecklistStatus.php.

77 : int
78 {
79 switch ($step) {
81 if ($this->user->getProfileIncomplete()) {
83 }
84 if ($this->user->getPref('profile_personal_data_saved')) {
86 }
87 break;
88
90 if ($this->user->getPref('profile_publish_opt_saved')) {
92 }
93 break;
94
96 if ($this->user->getPref('profile_visibility_opt_saved')
97 || !$this->anyVisibilitySettings()
98 && $this->user->getPref('profile_publish_opt_saved')) {
100 }
101 break;
102 }
103
105 }

References ILIAS\User\Profile\ChecklistStatus\STATUS_IN_PROGRESS, ILIAS\User\Profile\ChecklistStatus\STATUS_NOT_STARTED, ILIAS\User\Profile\ChecklistStatus\STATUS_SUCCESSFUL, ILIAS\User\Profile\ChecklistStatus\STEP_PROFILE_DATA, ILIAS\User\Profile\ChecklistStatus\STEP_PUBLISH_OPTIONS, ILIAS\User\Profile\ChecklistStatus\STEP_VISIBILITY_OPTIONS, and ILIAS\Repository\user().

Referenced by ILIAS\User\Profile\ChecklistStatus\getStatusDetails(), and ILIAS\User\Profile\ChecklistGUI\render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStatusDetails()

ILIAS\User\Profile\ChecklistStatus::getStatusDetails ( int  $step)

Definition at line 107 of file ChecklistStatus.php.

107 : string
108 {
109 $status = $this->getStatus($step);
110 switch ($step) {
112 if ($status === self::STATUS_SUCCESSFUL) {
113 return $this->lng->txt('user_profile_data_checked');
114 }
115 return $this->lng->txt('user_check_profile_data');
116
118 if ($status === self::STATUS_SUCCESSFUL) {
119 return $this->profile_mode->getModeInfo();
120 }
121 return $this->lng->txt('user_set_publishing_options');
122
124 if ($status === self::STATUS_SUCCESSFUL) {
126 }
127 if ($this->anyVisibilitySettings()) {
128 return $this->lng->txt('user_set_visibilty_options');
129 }
130 break;
131 }
132 return '';
133 }

References ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings(), ILIAS\User\Profile\ChecklistStatus\buildStatusArrayForVisibilityOnSuccess(), ILIAS\User\Profile\ChecklistStatus\getStatus(), ILIAS\Repository\lng(), ILIAS\User\Profile\ChecklistStatus\STEP_PROFILE_DATA, ILIAS\User\Profile\ChecklistStatus\STEP_PUBLISH_OPTIONS, and ILIAS\User\Profile\ChecklistStatus\STEP_VISIBILITY_OPTIONS.

Referenced by ILIAS\User\Profile\ChecklistGUI\render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSteps()

ILIAS\User\Profile\ChecklistStatus::getSteps ( )
Returns
array<int,string>

Definition at line 55 of file ChecklistStatus.php.

55 : array
56 {
57 $txt_visibility = $this->anyVisibilitySettings()
58 ? $this->lng->txt('user_visibility_settings')
59 : $this->lng->txt('preview');
60
61 return [
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
65 ];
66 }

References ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setStepSucessOnUser()

ILIAS\User\Profile\ChecklistStatus::setStepSucessOnUser ( int  $step,
\ilObjUser  $user 
)

Definition at line 135 of file ChecklistStatus.php.

138 : \ilObjUser {
139 switch ($step) {
141 $user->setPref('profile_personal_data_saved', '1');
142 break;
144 $user->setPref('profile_publish_opt_saved', '1');
145 break;
147 $user->setPref('profile_visibility_opt_saved', '1');
148 break;
149 }
150 $this->user = $user;
151 return $user;
152 }
User class.

References ilObjUser\setPref(), ILIAS\User\Profile\ChecklistStatus\STEP_PROFILE_DATA, ILIAS\User\Profile\ChecklistStatus\STEP_PUBLISH_OPTIONS, and ILIAS\User\Profile\ChecklistStatus\STEP_VISIBILITY_OPTIONS.

+ Here is the call graph for this function:

Field Documentation

◆ $settings_awareness

ilSetting ILIAS\User\Profile\ChecklistStatus::$settings_awareness
private

Definition at line 39 of file ChecklistStatus.php.

◆ $settings_chat

ilSetting ILIAS\User\Profile\ChecklistStatus::$settings_chat
private

Definition at line 38 of file ChecklistStatus.php.

◆ STATUS_IN_PROGRESS

const ILIAS\User\Profile\ChecklistStatus::STATUS_IN_PROGRESS = 1

◆ STATUS_NOT_STARTED

const ILIAS\User\Profile\ChecklistStatus::STATUS_NOT_STARTED = 0

◆ STATUS_SUCCESSFUL

const ILIAS\User\Profile\ChecklistStatus::STATUS_SUCCESSFUL = 2

◆ STEP_PROFILE_DATA

◆ STEP_PUBLISH_OPTIONS

◆ STEP_VISIBILITY_OPTIONS


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