ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Profile\Visibility Class Reference

Personal profile publishing mode of a user. More...

+ Collaboration diagram for ILIAS\User\Profile\Visibility:

Public Member Functions

 __construct (private readonly Language $lng, private readonly \ilSetting $settings, private readonly \ilObjUser $user)
 
 getMode ()
 
 isEnabled ()
 
 getModeInfo (?string $mode=null)
 

Data Fields

const PROFILE_DISABLED = 'n'
 
const PROFILE_ENABLED_LOGGED_IN_USERS = 'y'
 
const PROFILE_ENABLED_GLOBAL = 'g'
 

Detailed Description

Personal profile publishing mode of a user.

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

Definition at line 29 of file Visibility.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 35 of file Visibility.php.

39 {
40 }

Member Function Documentation

◆ getMode()

ILIAS\User\Profile\Visibility::getMode ( )

Definition at line 42 of file Visibility.php.

42 : string
43 {
44 $public_profile_pref = $this->user->getPref('public_profile');
45 if ($public_profile_pref === null
46 || !in_array(
47 $public_profile_pref,
48 [
49 self::PROFILE_ENABLED_LOGGED_IN_USERS,
50 self::PROFILE_ENABLED_GLOBAL
51 ]
52 )) {
54 }
55
56 if ($this->settings->get('enable_global_profiles')) {
57 return $public_profile_pref;
58 }
60 }

References ILIAS\User\Profile\Visibility\PROFILE_DISABLED, ILIAS\User\Profile\Visibility\PROFILE_ENABLED_LOGGED_IN_USERS, ILIAS\Repository\settings(), and ILIAS\Repository\user().

Referenced by ILIAS\User\Profile\Visibility\getModeInfo(), and ILIAS\User\Profile\Visibility\isEnabled().

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

◆ getModeInfo()

ILIAS\User\Profile\Visibility::getModeInfo ( ?string  $mode = null)

Definition at line 73 of file Visibility.php.

73 : string
74 {
75 switch ($this->getMode()) {
77 return $this->lng->txt('usr_public_profile_disabled');
79 return $this->lng->txt('usr_public_profile_logged_in');
81 return $this->lng->txt('usr_public_profile_global');
82 }
83 return '';
84 }

References ILIAS\User\Profile\Visibility\getMode(), ILIAS\Repository\lng(), ILIAS\User\Profile\Visibility\PROFILE_DISABLED, ILIAS\User\Profile\Visibility\PROFILE_ENABLED_GLOBAL, and ILIAS\User\Profile\Visibility\PROFILE_ENABLED_LOGGED_IN_USERS.

+ Here is the call graph for this function:

◆ isEnabled()

ILIAS\User\Profile\Visibility::isEnabled ( )

Definition at line 62 of file Visibility.php.

62 : bool
63 {
64 return in_array(
65 $this->getMode(),
66 [
67 self::PROFILE_ENABLED_LOGGED_IN_USERS,
68 self::PROFILE_ENABLED_GLOBAL
69 ]
70 );
71 }

References ILIAS\User\Profile\Visibility\getMode().

+ Here is the call graph for this function:

Field Documentation

◆ PROFILE_DISABLED

const ILIAS\User\Profile\Visibility::PROFILE_DISABLED = 'n'

◆ PROFILE_ENABLED_GLOBAL

const ILIAS\User\Profile\Visibility::PROFILE_ENABLED_GLOBAL = 'g'

Definition at line 33 of file Visibility.php.

Referenced by ILIAS\User\Profile\Visibility\getModeInfo().

◆ PROFILE_ENABLED_LOGGED_IN_USERS

const ILIAS\User\Profile\Visibility::PROFILE_ENABLED_LOGGED_IN_USERS = 'y'

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