ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPersonalProfileMode Class Reference

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

+ Collaboration diagram for ilPersonalProfileMode:

Public Member Functions

 __construct (ilObjUser $user, ilSetting $settings)
 Constructor. More...
 
 getMode ()
 Get mode. More...
 
 isEnabled ()
 Is profile enabled. More...
 
 getModeInfo (string $mode=null)
 Get mode info. More...
 

Data Fields

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

Protected Attributes

 $user
 
 $settings
 
 $lng
 

Detailed Description

Personal profile publishing mode of a iser.

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

Definition at line 10 of file class.ilPersonalProfileMode.php.

Constructor & Destructor Documentation

◆ __construct()

ilPersonalProfileMode::__construct ( ilObjUser  $user,
ilSetting  $settings 
)

Constructor.

Definition at line 34 of file class.ilPersonalProfileMode.php.

35 {
36 global $DIC;
37
38 $this->lng = $DIC->language();
39 $this->user = $user;
40 $this->settings = $settings;
41 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
settings()
Definition: settings.php:2

References $DIC, $settings, $user, settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getMode()

ilPersonalProfileMode::getMode ( )

Get mode.

Returns
string

Definition at line 48 of file class.ilPersonalProfileMode.php.

48 : string
49 {
52
53 $pub_prof = in_array($user->prefs["public_profile"], [
54 self::PROFILE_DISABLED,
55 self::PROFILE_ENABLED_LOGGED_IN_USERS,
56 self::PROFILE_ENABLED_GLOBAL
57 ])
58 ? $user->prefs["public_profile"]
60 if (!$settings->get('enable_global_profiles') && $pub_prof == self::PROFILE_ENABLED_GLOBAL) {
62 }
63 return $pub_prof;
64 }

References $settings, $user, PROFILE_DISABLED, and PROFILE_ENABLED_LOGGED_IN_USERS.

Referenced by getModeInfo(), and isEnabled().

+ Here is the caller graph for this function:

◆ getModeInfo()

ilPersonalProfileMode::getModeInfo ( string  $mode = null)

Get mode info.

Parameters
string | null$mode
Returns
string

Definition at line 84 of file class.ilPersonalProfileMode.php.

84 : string
85 {
87
88 if (is_null($mode)) {
89 $mode = $this->getMode();
90 }
91 switch ($mode) {
93 return $lng->txt("usr_public_profile_disabled");
94 break;
96 return $lng->txt("usr_public_profile_logged_in");
97 break;
99 return $lng->txt("usr_public_profile_global");
100 break;
101 }
102 }

References $lng, getMode(), PROFILE_DISABLED, PROFILE_ENABLED_GLOBAL, and PROFILE_ENABLED_LOGGED_IN_USERS.

+ Here is the call graph for this function:

◆ isEnabled()

ilPersonalProfileMode::isEnabled ( )

Is profile enabled.

Returns
bool

Definition at line 71 of file class.ilPersonalProfileMode.php.

71 : bool
72 {
73 return in_array($this->getMode(), [self::PROFILE_ENABLED_LOGGED_IN_USERS,
74 self::PROFILE_ENABLED_GLOBAL
75 ]);
76 }

References getMode().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilPersonalProfileMode::$lng
protected

Definition at line 29 of file class.ilPersonalProfileMode.php.

Referenced by getModeInfo().

◆ $settings

ilPersonalProfileMode::$settings
protected

Definition at line 24 of file class.ilPersonalProfileMode.php.

Referenced by __construct(), and getMode().

◆ $user

ilPersonalProfileMode::$user
protected

Definition at line 19 of file class.ilPersonalProfileMode.php.

Referenced by __construct(), and getMode().

◆ PROFILE_DISABLED

const ilPersonalProfileMode::PROFILE_DISABLED = "n"

Definition at line 12 of file class.ilPersonalProfileMode.php.

Referenced by getMode(), and getModeInfo().

◆ PROFILE_ENABLED_GLOBAL

const ilPersonalProfileMode::PROFILE_ENABLED_GLOBAL = "g"

Definition at line 14 of file class.ilPersonalProfileMode.php.

Referenced by getModeInfo().

◆ PROFILE_ENABLED_LOGGED_IN_USERS

const ilPersonalProfileMode::PROFILE_ENABLED_LOGGED_IN_USERS = "y"

Definition at line 13 of file class.ilPersonalProfileMode.php.

Referenced by getMode(), and getModeInfo().


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