ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\User\Profile\Mode Class Reference

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

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

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 Mode.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 35 of file Mode.php.

39  {
40  }

Member Function Documentation

◆ getMode()

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

Definition at line 42 of file Mode.php.

References null, ILIAS\Repository\settings(), and ILIAS\Repository\user().

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

42  : string
43  {
44  $public_profile_pref = $this->user->prefs['public_profile'] ?? null;
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  )) {
53  return self::PROFILE_DISABLED;
54  }
55 
56  if ($this->settings->get('enable_global_profiles')) {
57  return $public_profile_pref;
58  }
59  return self::PROFILE_ENABLED_LOGGED_IN_USERS;
60  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModeInfo()

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

Definition at line 73 of file Mode.php.

References ILIAS\User\Profile\Mode\getMode(), and ILIAS\Repository\lng().

73  : string
74  {
75  switch ($this->getMode()) {
76  case self::PROFILE_DISABLED:
77  return $this->lng->txt('usr_public_profile_disabled');
78  case self::PROFILE_ENABLED_LOGGED_IN_USERS:
79  return $this->lng->txt('usr_public_profile_logged_in');
80  case self::PROFILE_ENABLED_GLOBAL:
81  return $this->lng->txt('usr_public_profile_global');
82  }
83  return '';
84  }
+ Here is the call graph for this function:

◆ isEnabled()

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

Definition at line 62 of file Mode.php.

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

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

Field Documentation

◆ PROFILE_DISABLED

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

Definition at line 31 of file Mode.php.

◆ PROFILE_ENABLED_GLOBAL

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

Definition at line 33 of file Mode.php.

◆ PROFILE_ENABLED_LOGGED_IN_USERS

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

Definition at line 32 of file Mode.php.


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