ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 readonly \ilObjUser $user, private readonly Mode $profile_mode)
 
 getSteps ()
 
 anyVisibilitySettings ()
 
 getStatus (int $step)
 
 getStatusDetails (int $step)
 
 saveStepSucess (int $step)
 

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 readonly \ilObjUser  $user,
private readonly Mode  $profile_mode 
)

Definition at line 41 of file ChecklistStatus.php.

References ILIAS\Repository\lng().

46  {
47  $this->settings_chat = new \ilSetting('chatroom');
48  $this->settings_awareness = new \ilSetting('awrn');
49 
50  $this->lng->loadLanguageModule('chatroom');
51  }
+ 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.

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

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

68  : bool
69  {
70 
71  return $this->settings_awareness->get('awrn_enabled', '0') !== '0'
72  || \ilBuddySystem::getInstance()->isEnabled()
75  }
+ 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 187 of file ChecklistStatus.php.

References ILIAS\Repository\settings().

Referenced by ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings(), and ILIAS\User\Profile\ChecklistStatus\buildStatusArrayForVisibilityOnSuccess().

187  : bool
188  {
189  return $this->settings_chat->get('chat_enabled', '0')
190  && $this->settings->get('usr_settings_hide_chat_broadcast_typing', '0') === '0';
191  }
+ 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 180 of file ChecklistStatus.php.

References ILIAS\Repository\settings().

Referenced by ILIAS\User\Profile\ChecklistStatus\anyVisibilitySettings(), and ILIAS\User\Profile\ChecklistStatus\buildStatusArrayForVisibilityOnSuccess().

180  : bool
181  {
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';
185  }
+ 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 151 of file ChecklistStatus.php.

References ILIAS\User\Profile\ChecklistStatus\areChatTypingBroadcastOptionsVisible(), ILIAS\User\Profile\ChecklistStatus\areOnScreenChatOptionsVisible(), ilBuddySystem\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

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

151  : string
152  {
153  $status = [];
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';
158  $status[] = !$show
159  ? $this->lng->txt('hide_own_online_status')
160  : $this->lng->txt('show_own_online_status');
161  }
162  if (\ilBuddySystem::getInstance()->isEnabled()) {
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');
166  }
167  if ($this->areOnScreenChatOptionsVisible()) {
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');
171  }
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');
176  }
177  return implode(',<br>', $status);
178  }
+ 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.

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

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

77  : int
78  {
79  switch ($step) {
80  case self::STEP_PROFILE_DATA:
81  if ($this->user->getProfileIncomplete()) {
82  return self::STATUS_IN_PROGRESS;
83  }
84  if ($this->user->getPref('profile_personal_data_saved')) {
85  return self::STATUS_SUCCESSFUL;
86  }
87  break;
88 
89  case self::STEP_PUBLISH_OPTIONS:
90  if ($this->user->getPref('profile_publish_opt_saved')) {
91  return self::STATUS_SUCCESSFUL;
92  }
93  break;
94 
95  case self::STEP_VISIBILITY_OPTIONS:
96  if ($this->user->getPref('profile_visibility_opt_saved')
97  || !$this->anyVisibilitySettings()
98  && $this->user->getPref('profile_publish_opt_saved')) {
99  return self::STATUS_SUCCESSFUL;
100  }
101  break;
102  }
103 
104  return self::STATUS_NOT_STARTED;
105  }
+ 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.

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

Referenced by ilProfileChecklistGUI\render().

107  : string
108  {
109  $status = $this->getStatus($step);
110  switch ($step) {
111  case self::STEP_PROFILE_DATA:
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 
117  case self::STEP_PUBLISH_OPTIONS:
118  if ($status === self::STATUS_SUCCESSFUL) {
119  return $this->profile_mode->getModeInfo();
120  }
121  return $this->lng->txt('user_set_publishing_options');
122 
123  case self::STEP_VISIBILITY_OPTIONS:
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  }
+ 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.

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

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  }
+ Here is the call graph for this function:

◆ saveStepSucess()

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

Definition at line 135 of file ChecklistStatus.php.

References ILIAS\Repository\user().

135  : void
136  {
137  switch ($step) {
138  case self::STEP_PROFILE_DATA:
139  $this->user->setPref('profile_personal_data_saved', '1');
140  break;
141  case self::STEP_PUBLISH_OPTIONS:
142  $this->user->setPref('profile_publish_opt_saved', '1');
143  break;
144  case self::STEP_VISIBILITY_OPTIONS:
145  $this->user->setPref('profile_visibility_opt_saved', '1');
146  break;
147  }
148  $this->user->update();
149  }
+ 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

Definition at line 35 of file ChecklistStatus.php.

◆ STATUS_NOT_STARTED

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

Definition at line 34 of file ChecklistStatus.php.

◆ STATUS_SUCCESSFUL

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

Definition at line 36 of file ChecklistStatus.php.

◆ STEP_PROFILE_DATA

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

Definition at line 30 of file ChecklistStatus.php.

◆ STEP_PUBLISH_OPTIONS

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

Definition at line 31 of file ChecklistStatus.php.

◆ STEP_VISIBILITY_OPTIONS

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

Definition at line 32 of file ChecklistStatus.php.


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