ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilUserSettingsConfig Class Reference

User settings configuration (what preferences can be visible/changed/...) More...

+ Collaboration diagram for ilUserSettingsConfig:

Public Member Functions

 __construct (ilSetting $settings=null)
 Constructor. More...
 
 isVisibleAndChangeable ($field)
 Is field visible and changeable by user? More...
 
 isVisible (string $field)
 Is setting visible to user? More...
 
 isChangeable (string $field)
 Is setting changeable by user? More...
 
 setVisible (string $field, bool $visible)
 Set a profile field being visible. More...
 
 setChangeable (string $field, bool $changeable)
 Set a profile field being changeable. More...
 

Data Fields

const HIDE_PREFIX = "usr_settings_hide_"
 
const DISABLED_PREFIX = "usr_settings_disable_"
 

Detailed Description

User settings configuration (what preferences can be visible/changed/...)

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

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

Constructor & Destructor Documentation

◆ __construct()

ilUserSettingsConfig::__construct ( ilSetting  $settings = null)

Constructor.

Definition at line 18 of file class.ilUserSettingsConfig.php.

19 {
20 global $DIC;
21
22 $this->settings = (is_null($settings))
23 ? $DIC->settings()
24 : $settings;
25 $this->setting = $this->settings->getAll();
26 }
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $DIC, and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ isChangeable()

ilUserSettingsConfig::isChangeable ( string  $field)

Is setting changeable by user?

Parameters
string$field
Returns
bool

Definition at line 54 of file class.ilUserSettingsConfig.php.

54 : bool
55 {
56 return (!(isset($this->setting[self::DISABLED_PREFIX . $field]) &&
57 $this->setting[self::DISABLED_PREFIX . $field] == 1));
58 }

Referenced by isVisibleAndChangeable().

+ Here is the caller graph for this function:

◆ isVisible()

ilUserSettingsConfig::isVisible ( string  $field)

Is setting visible to user?

Parameters
string$field
Returns
bool

Definition at line 43 of file class.ilUserSettingsConfig.php.

43 : bool
44 {
45 return (!(isset($this->setting[self::HIDE_PREFIX . $field]) &&
46 $this->setting[self::HIDE_PREFIX . $field] == 1));
47 }

Referenced by isVisibleAndChangeable().

+ Here is the caller graph for this function:

◆ isVisibleAndChangeable()

ilUserSettingsConfig::isVisibleAndChangeable (   $field)

Is field visible and changeable by user?

Parameters
$field
Returns
bool

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

33 : bool
34 {
35 return $this->isVisible($field) && $this->isChangeable($field);
36 }
isChangeable(string $field)
Is setting changeable by user?
isVisible(string $field)
Is setting visible to user?

References isChangeable(), and isVisible().

+ Here is the call graph for this function:

◆ setChangeable()

ilUserSettingsConfig::setChangeable ( string  $field,
bool  $changeable 
)

Set a profile field being changeable.

Parameters
string$field
bool$changeable

Definition at line 81 of file class.ilUserSettingsConfig.php.

82 {
83 if (!$changeable) {
84 $this->settings->set(self::DISABLED_PREFIX . $field, "1");
85 $this->setting[self::DISABLED_PREFIX . $field] = 1;
86 } else {
87 $this->settings->delete(self::DISABLED_PREFIX . $field);
88 unset($this->setting[self::DISABLED_PREFIX . $field]);
89 }
90 }

References settings().

+ Here is the call graph for this function:

◆ setVisible()

ilUserSettingsConfig::setVisible ( string  $field,
bool  $visible 
)

Set a profile field being visible.

Parameters
string$field
bool$visible

Definition at line 65 of file class.ilUserSettingsConfig.php.

66 {
67 if (!$visible) {
68 $this->settings->set(self::HIDE_PREFIX . $field, "1");
69 $this->setting[self::HIDE_PREFIX . $field] = 1;
70 } else {
71 $this->settings->delete(self::HIDE_PREFIX . $field);
72 unset($this->setting[self::HIDE_PREFIX . $field]);
73 }
74 }

References settings().

+ Here is the call graph for this function:

Field Documentation

◆ DISABLED_PREFIX

const ilUserSettingsConfig::DISABLED_PREFIX = "usr_settings_disable_"

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

◆ HIDE_PREFIX

const ilUserSettingsConfig::HIDE_PREFIX = "usr_settings_hide_"

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


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