ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPersonalProfileMode 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 ilPersonalProfileMode:

Public Member Functions

 __construct (ilObjUser $user, ilSetting $settings)
 
 getMode ()
 
 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

ilObjUser $user
 
ilSetting $settings
 
ilLanguage $lng
 

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 Personal profile publishing mode of a user

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

34  {
35  global $DIC;
36 
37  $this->lng = $DIC->language();
38  $this->user = $user;
39  $this->settings = $settings;
40  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getMode()

ilPersonalProfileMode::getMode ( )

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

References $settings, $user, and ilSetting\get().

Referenced by getModeInfo(), and isEnabled().

42  : string
43  {
46 
47  $pub_prof = isset($user->prefs["public_profile"]) && in_array($user->prefs["public_profile"], [
48  self::PROFILE_DISABLED,
49  self::PROFILE_ENABLED_LOGGED_IN_USERS,
50  self::PROFILE_ENABLED_GLOBAL
51  ])
52  ? $user->prefs["public_profile"]
53  : self::PROFILE_DISABLED;
54  if (!$settings->get('enable_global_profiles') && $pub_prof == self::PROFILE_ENABLED_GLOBAL) {
55  $pub_prof = self::PROFILE_ENABLED_LOGGED_IN_USERS;
56  }
57  return $pub_prof;
58  }
get(string $a_keyword, ?string $a_default_value=null)
get setting
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModeInfo()

ilPersonalProfileMode::getModeInfo ( string  $mode = null)

Get mode info.

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

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

73  : string
74  {
75  $lng = $this->lng;
76 
77  if (is_null($mode)) {
78  $mode = $this->getMode();
79  }
80  switch ($mode) {
81  case self::PROFILE_DISABLED:
82  return $lng->txt("usr_public_profile_disabled");
83  case self::PROFILE_ENABLED_LOGGED_IN_USERS:
84  return $lng->txt("usr_public_profile_logged_in");
85  case self::PROFILE_ENABLED_GLOBAL:
86  return $lng->txt("usr_public_profile_global");
87  }
88  return "";
89  }
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...
+ Here is the call graph for this function:

◆ isEnabled()

ilPersonalProfileMode::isEnabled ( )

Is profile enabled.

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

References getMode().

63  : bool
64  {
65  return in_array($this->getMode(), [self::PROFILE_ENABLED_LOGGED_IN_USERS,
66  self::PROFILE_ENABLED_GLOBAL
67  ]);
68  }
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilPersonalProfileMode::$lng
protected

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

Referenced by getModeInfo().

◆ $settings

ilSetting ilPersonalProfileMode::$settings
protected

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

Referenced by __construct(), and getMode().

◆ $user

ilObjUser ilPersonalProfileMode::$user
protected

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

Referenced by __construct(), and getMode().

◆ PROFILE_DISABLED

const ilPersonalProfileMode::PROFILE_DISABLED = "n"

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

◆ PROFILE_ENABLED_GLOBAL

const ilPersonalProfileMode::PROFILE_ENABLED_GLOBAL = "g"

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

Referenced by ilForum\getUserStatistics().

◆ PROFILE_ENABLED_LOGGED_IN_USERS

const ilPersonalProfileMode::PROFILE_ENABLED_LOGGED_IN_USERS = "y"

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

Referenced by ilForum\getUserStatistics().


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