ILIAS  release_8 Revision v8.24
ilProfileChecklistStatus Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilProfileChecklistStatus:

Public Member Functions

 __construct (?ilLanguage $lng=null, ?ilObjUser $user=null)
 
 getSteps ()
 
 anyVisibilitySettings ()
 Any visibility settings? More...
 
 getStatus (int $step)
 Get status of step. More...
 
 getStatusDetails (int $step)
 Get status details. More...
 
 saveStepSucess (int $step)
 Save step success. More...
 

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
 

Protected Attributes

ilPersonalProfileMode $profile_mode
 
ilObjUser $user
 
ilLanguage $lng
 
ilSetting $settings
 

Private Member Functions

 areOnScreenChatOptionsVisible ()
 
 areChatTypingBroadcastOptionsVisible ()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Definition at line 22 of file ilProfileChecklistStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilProfileChecklistStatus::__construct ( ?ilLanguage  $lng = null,
?ilObjUser  $user = null 
)

Definition at line 37 of file ilProfileChecklistStatus.php.

40 {
41 global $DIC;
42
43 $this->lng = is_null($lng)
44 ? $DIC->language()
45 : $lng;
46
47 $this->lng->loadLanguageModule('chatroom');
48 $this->user = is_null($user)
49 ? $DIC->user()
50 : $user;
51
52 $this->settings = $DIC->settings();
53
54 $this->profile_mode = new ilPersonalProfileMode($this->user, $DIC->settings());
55 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, $lng, $user, ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ anyVisibilitySettings()

ilProfileChecklistStatus::anyVisibilitySettings ( )

Any visibility settings?

Definition at line 99 of file ilProfileChecklistStatus.php.

99 : bool
100 {
101 $awrn_set = new ilSetting("awrn");
102 if (
103 $awrn_set->get("awrn_enabled", '0') ||
104 ilBuddySystem::getInstance()->isEnabled() ||
105 $this->areOnScreenChatOptionsVisible() ||
106 $this->areChatTypingBroadcastOptionsVisible()
107 ) {
108 return true;
109 }
110
111 return false;
112 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilBuddySystem\getInstance().

Referenced by getStatusDetails(), and getSteps().

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

◆ areChatTypingBroadcastOptionsVisible()

ilProfileChecklistStatus::areChatTypingBroadcastOptionsVisible ( )
private

Definition at line 68 of file ilProfileChecklistStatus.php.

68 : bool
69 {
70 $chatSettings = new ilSetting('chatroom');
71
72 return (
73 $chatSettings->get('chat_enabled', '0') &&
74 !(bool) $this->settings->get('usr_settings_hide_chat_broadcast_typing', '0')
75 );
76 }

Referenced by getStatusDetails().

+ Here is the caller graph for this function:

◆ areOnScreenChatOptionsVisible()

ilProfileChecklistStatus::areOnScreenChatOptionsVisible ( )
private

Definition at line 57 of file ilProfileChecklistStatus.php.

57 : bool
58 {
59 $chatSettings = new ilSetting('chatroom');
60
61 return (
62 $chatSettings->get('chat_enabled', '0') &&
63 $chatSettings->get('enable_osc', '0') &&
64 !(bool) $this->settings->get('usr_settings_hide_chat_osc_accept_msg', '0')
65 );
66 }

Referenced by getStatusDetails().

+ Here is the caller graph for this function:

◆ getStatus()

ilProfileChecklistStatus::getStatus ( int  $step)

Get status of step.

Definition at line 117 of file ilProfileChecklistStatus.php.

117 : int
118 {
119 $status = self::STATUS_NOT_STARTED;
121
122 switch ($step) {
124 if ($user->getPref("profile_personal_data_saved")) {
125 $status = self::STATUS_SUCCESSFUL;
126 }
127
129 $status = self::STATUS_IN_PROGRESS;
130 }
131 break;
132
134 if ($user->getPref("profile_publish_opt_saved")) {
135 $status = self::STATUS_SUCCESSFUL;
136 }
137 break;
138
140 if ($user->getPref("profile_visibility_opt_saved") ||
141 (!$this->anyVisibilitySettings() && $user->getPref("profile_publish_opt_saved"))) {
142 $status = self::STATUS_SUCCESSFUL;
143 }
144 break;
145 }
146
147 return $status;
148 }
getPref(string $a_keyword)

References $user, ilObjUser\getPref(), ilObjUser\getProfileIncomplete(), STATUS_IN_PROGRESS, STATUS_NOT_STARTED, STATUS_SUCCESSFUL, STEP_PROFILE_DATA, STEP_PUBLISH_OPTIONS, and STEP_VISIBILITY_OPTIONS.

Referenced by getStatusDetails(), and ilProfileChecklistGUI\render().

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

◆ getStatusDetails()

ilProfileChecklistStatus::getStatusDetails ( int  $step)

Get status details.

Definition at line 153 of file ilProfileChecklistStatus.php.

153 : string
154 {
157 $status = $this->getStatus($step);
158 $details = "";
159 switch ($step) {
161 if ($status == self::STATUS_SUCCESSFUL) {
162 $details = $lng->txt("user_profile_data_checked");
163 } else {
164 $details = $lng->txt("user_check_profile_data");
165 }
166 break;
167
169 if ($status == self::STATUS_SUCCESSFUL) {
170 $details = $this->profile_mode->getModeInfo();
171 } else {
172 $details = $lng->txt("user_set_publishing_options");
173 }
174 break;
175
177 if ($status == self::STATUS_SUCCESSFUL) {
178 $awrn_set = new ilSetting("awrn");
179 $status = [];
180 if ($awrn_set->get("awrn_enabled", '0')) {
181 $show = ($user->getPref("hide_own_online_status") === "n" ||
182 ($user->getPref("hide_own_online_status") == "" && $this->settings->get("hide_own_online_status") === "n"));
183 $status[] = (!$show)
184 ? $lng->txt("hide_own_online_status")
185 : $lng->txt("show_own_online_status");
186 }
187 if (ilBuddySystem::getInstance()->isEnabled()) {
188 $status[] = ($user->getPref("bs_allow_to_contact_me") !== "y")
189 ? $lng->txt("buddy_allow_to_contact_me_no")
190 : $lng->txt("buddy_allow_to_contact_me_yes");
191 }
192 if ($this->areOnScreenChatOptionsVisible()) {
193 $status[] = ilUtil::yn2tf((string) $this->user->getPref('chat_osc_accept_msg'))
194 ? $lng->txt("chat_use_osc")
195 : $lng->txt("chat_not_use_osc");
196 }
198 $status[] = ilUtil::yn2tf((string) $this->user->getPref('chat_broadcast_typing'))
199 ? $lng->txt("chat_use_typing_broadcast")
200 : $lng->txt("chat_no_use_typing_broadcast");
201 }
202 $details = implode(",<br>", $status);
203 } else {
204 if ($this->anyVisibilitySettings()) {
205 $details = $lng->txt("user_set_visibilty_options");
206 }
207 }
208 break;
209 }
210 return $details;
211 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
anyVisibilitySettings()
Any visibility settings?
getStatus(int $step)
Get status of step.
static yn2tf(string $a_yn)
array $details
Details for error message relating to last request processed.
Definition: System.php:109

References ILIAS\LTI\ToolProvider\$details, $lng, $user, anyVisibilitySettings(), areChatTypingBroadcastOptionsVisible(), areOnScreenChatOptionsVisible(), ilBuddySystem\getInstance(), ilObjUser\getPref(), getStatus(), ILIAS\Repository\settings(), STEP_PROFILE_DATA, STEP_PUBLISH_OPTIONS, STEP_VISIBILITY_OPTIONS, ilLanguage\txt(), ILIAS\Repository\user(), and ilUtil\yn2tf().

Referenced by ilProfileChecklistGUI\render().

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

◆ getSteps()

ilProfileChecklistStatus::getSteps ( )
Returns
array<int,string>

Definition at line 81 of file ilProfileChecklistStatus.php.

81 : array
82 {
84
85 $txt_visibility = $this->anyVisibilitySettings()
86 ? $lng->txt("user_visibility_settings")
87 : $lng->txt("preview");
88
89 return [
90 self::STEP_PROFILE_DATA => $lng->txt("user_profile_data"),
91 self::STEP_PUBLISH_OPTIONS => $lng->txt("user_publish_options"),
92 self::STEP_VISIBILITY_OPTIONS => $txt_visibility
93 ];
94 }

References $lng, anyVisibilitySettings(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveStepSucess()

ilProfileChecklistStatus::saveStepSucess ( int  $step)

Save step success.

Definition at line 217 of file ilProfileChecklistStatus.php.

217 : void
218 {
220 switch ($step) {
222 $user->setPref("profile_personal_data_saved", "1");
223 break;
225 $user->setPref("profile_publish_opt_saved", "1");
226 break;
228 $user->setPref("profile_visibility_opt_saved", "1");
229 break;
230 }
231 $user->update();
232 }
setPref(string $a_keyword, ?string $a_value)

References $user, ilObjUser\setPref(), STEP_PROFILE_DATA, STEP_PUBLISH_OPTIONS, STEP_VISIBILITY_OPTIONS, and ilObjUser\update().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilProfileChecklistStatus::$lng
protected

Definition at line 34 of file ilProfileChecklistStatus.php.

Referenced by __construct(), getStatusDetails(), and getSteps().

◆ $profile_mode

ilPersonalProfileMode ilProfileChecklistStatus::$profile_mode
protected

Definition at line 31 of file ilProfileChecklistStatus.php.

◆ $settings

ilSetting ilProfileChecklistStatus::$settings
protected

Definition at line 35 of file ilProfileChecklistStatus.php.

◆ $user

ilObjUser ilProfileChecklistStatus::$user
protected

◆ STATUS_IN_PROGRESS

const ilProfileChecklistStatus::STATUS_IN_PROGRESS = 1

◆ STATUS_NOT_STARTED

const ilProfileChecklistStatus::STATUS_NOT_STARTED = 0

◆ STATUS_SUCCESSFUL

const ilProfileChecklistStatus::STATUS_SUCCESSFUL = 2

◆ STEP_PROFILE_DATA

const ilProfileChecklistStatus::STEP_PROFILE_DATA = 0

◆ STEP_PUBLISH_OPTIONS

const ilProfileChecklistStatus::STEP_PUBLISH_OPTIONS = 1

◆ STEP_VISIBILITY_OPTIONS

const ilProfileChecklistStatus::STEP_VISIBILITY_OPTIONS = 2

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