ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Help\UserSettings\Help Class Reference
+ Inheritance diagram for ILIAS\Help\UserSettings\Help:
+ Collaboration diagram for ILIAS\Help\UserSettings\Help:

Public Member Functions

 __construct ()
 
 getIdentifier ()
 
 isAvailable ()
 If this function returns false the setting will not be shown, even if it's PropertyAttributes would allow it to be. More...
 
 getLabel (Language $lng)
 
 getSettingsPage ()
 
 getSection ()
 
 getInput (FieldFactory $field_factory, Language $lng, Refinery $refinery, \ilSetting $settings, ?\ilObjUser $user=null)
 
 getLegacyInput (Language $lng, \ilSetting $settings, ?\ilObjUser $user=null)
 
 getDefaultValueForDisplay (Language $lng, \ilSetting $settings)
 
 hasUserPersonalizedSetting (\ilSetting $settings, \ilObjUser $user)
 
 persistUserInput (\ilObjUser $user, mixed $input)
 
 retrieveValueFromUser (\ilObjUser $user)
 
- Public Member Functions inherited from ILIAS\User\Settings\SettingDefinition
 isAvailable ()
 If this function returns false the setting will not be shown, even if it's PropertyAttributes would allow it to be. More...
 
 getSettingsPage ()
 
 getDefaultValueForDisplay (Language $lng, \ilSetting $settings)
 
 hasUserPersonalizedSetting (\ilSetting $settings, \ilObjUser $user)
 
 getInput (FieldFactory $field_factory, Language $lng, Refinery $refinery, \ilSetting $settings, ?\ilObjUser $user=null)
 
 getLegacyInput (Language $lng, \ilSetting $settings, ?\ilObjUser $user=null)
 You don't need to add a post_var to the input as the User will handle this for you, thus you can also not rely on the post_var anywhere else, as it will be changed. More...
 
 persistUserInput (\ilObjUser $user, mixed $input)
 
- Public Member Functions inherited from ILIAS\User\Property
 getIdentifier ()
 
 getLabel (Language $lng)
 
 getSection ()
 
 retrieveValueFromUser (\ilObjUser $user)
 

Private Attributes

readonly ilHelpGUI $help
 

Detailed Description

Definition at line 31 of file Help.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Help\UserSettings\Help::__construct ( )

Definition at line 35 of file Help.php.

36 {
37 global $DIC;
38 $this->help = $DIC['ilHelp'] ?? null;
39 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\help().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultValueForDisplay()

ILIAS\Help\UserSettings\Help::getDefaultValueForDisplay ( Language  $lng,
\ilSetting  $settings 
)

Definition at line 100 of file Help.php.

103 : string {
104 return $lng->txt('active');
105 }
global $lng
Definition: privfeed.php:31

◆ getIdentifier()

ILIAS\Help\UserSettings\Help::getIdentifier ( )

Implements ILIAS\User\Property.

Definition at line 41 of file Help.php.

41 : string
42 {
43 return 'help';
44 }

Referenced by ILIAS\Help\UserSettings\Help\getLabel().

+ Here is the caller graph for this function:

◆ getInput()

ILIAS\Help\UserSettings\Help::getInput ( FieldFactory  $field_factory,
Language  $lng,
Refinery  $refinery,
\ilSetting  $settings,
?\ilObjUser  $user = null 
)

Definition at line 66 of file Help.php.

72 : Input {
73 $lng->loadLanguageModule('help');
74 return $field_factory->checkbox(
75 $lng->txt('help_toggle_tooltips'),
76 $lng->txt('help_toggle_tooltips_info')
77 )->withValue(
78 $user !== null
79 ? $this->retrieveValueFromUser($user)
80 : false
81 );
82 }
retrieveValueFromUser(\ilObjUser $user)
Definition: Help.php:124

◆ getLabel()

ILIAS\Help\UserSettings\Help::getLabel ( Language  $lng)

Definition at line 51 of file Help.php.

51 : string
52 {
53 return $lng->txt($this->getIdentifier());
54 }

References $lng, and ILIAS\Help\UserSettings\Help\getIdentifier().

+ Here is the call graph for this function:

◆ getLegacyInput()

ILIAS\Help\UserSettings\Help::getLegacyInput ( Language  $lng,
\ilSetting  $settings,
?\ilObjUser  $user = null 
)

Definition at line 84 of file Help.php.

89 $lng->loadLanguageModule('help');
90 $input = new \ilCheckboxInputGUI($lng->txt('help_toggle_tooltips'));
91 $input->setInfo($lng->txt('help_toggle_tooltips_info'));
92 $input->setChecked(
93 $user !== null
94 ? $this->retrieveValueFromUser($user)
95 : false
96 );
97 return $input;
98 }
This class represents a property in a property form.

◆ getSection()

ILIAS\Help\UserSettings\Help::getSection ( )

◆ getSettingsPage()

ILIAS\Help\UserSettings\Help::getSettingsPage ( )

Implements ILIAS\User\Settings\SettingDefinition.

Definition at line 56 of file Help.php.

57 {
58 return AvailablePages::MainSettings;
59 }

◆ hasUserPersonalizedSetting()

ILIAS\Help\UserSettings\Help::hasUserPersonalizedSetting ( \ilSetting  $settings,
\ilObjUser  $user 
)

Implements ILIAS\User\Settings\SettingDefinition.

Definition at line 107 of file Help.php.

110 : bool {
111 return $this->retrieveValueFromUser($user) === true;
112 }

◆ isAvailable()

ILIAS\Help\UserSettings\Help::isAvailable ( )

If this function returns false the setting will not be shown, even if it's PropertyAttributes would allow it to be.

This is meant e.g. to check if the chat server is configured or the badges enabled. Settings that are not available will also not be available on the table to define their PropertyAttributes

Implements ILIAS\User\Settings\SettingDefinition.

Definition at line 46 of file Help.php.

46 : bool
47 {
48 return $this->help->areTooltipsActive();
49 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ persistUserInput()

ILIAS\Help\UserSettings\Help::persistUserInput ( \ilObjUser  $user,
mixed  $input 
)
Parameters
mixed$inputNull will be handed in, if the user wants to use the system default. If you are able to set the preference on the user without saving it, you can rely on the User-object being saved after the call to this function. If your input has different structures depending on its provenience (KS-Input, Legacy-Input, ...), the function needs to be able to handle them all.

Implements ILIAS\User\Settings\SettingDefinition.

Definition at line 114 of file Help.php.

117 : \ilObjUser {
118 if ($this->help->areTooltipsActive()) {
119 $user->setPref('hide_help_tt', (string) (int) $input);
120 }
121 return $user;
122 }
User class.
setPref(string $a_keyword, ?string $a_value)

References ilObjUser\setPref().

+ Here is the call graph for this function:

◆ retrieveValueFromUser()

ILIAS\Help\UserSettings\Help::retrieveValueFromUser ( \ilObjUser  $user)

Implements ILIAS\User\Property.

Definition at line 124 of file Help.php.

124 : bool
125 {
126 return $user->getPref('hide_help_tt') !== '1';
127 }

References ilObjUser\getPref().

+ Here is the call graph for this function:

Field Documentation

◆ $help

readonly ilHelpGUI ILIAS\Help\UserSettings\Help::$help
private

Definition at line 33 of file Help.php.


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