ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Presentation\SettingsTabs Class Reference
+ Collaboration diagram for ILIAS\User\Presentation\SettingsTabs:

Public Member Functions

 __construct (private readonly \ilTabsGUI $tabs_gui, private readonly Language $lng, private readonly \ilCtrl $ctrl, private readonly \ilSetting $settings, private readonly \ilObjUser $current_user)
 
 initializeTabs ()
 

Private Member Functions

 addSettingsTab ()
 
 addChangePasswordTab ()
 
 addDeleteAccountTab ()
 
 activateTab ()
 
 changePasswordAvailable ()
 
 deleteAccountAvailable ()
 

Private Attributes

const TAB_ID_SETTINGS = 'settings'
 
const TAB_ID_CHANGE_PASSWORD = 'change_password'
 
const TAB_ID_DELETE_ACCOUNT = 'delete_account'
 

Detailed Description

Definition at line 28 of file SettingsTabs.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Presentation\SettingsTabs::__construct ( private readonly \ilTabsGUI  $tabs_gui,
private readonly Language  $lng,
private readonly \ilCtrl  $ctrl,
private readonly \ilSetting  $settings,
private readonly \ilObjUser  $current_user 
)

Definition at line 34 of file SettingsTabs.php.

40 {
41 }

Member Function Documentation

◆ activateTab()

ILIAS\User\Presentation\SettingsTabs::activateTab ( )
private

Definition at line 98 of file SettingsTabs.php.

98 : void
99 {
100 $next_class = $this->ctrl->getNextClass();
101 if ($next_class === strtolower(DeleteAccountGUI::class)) {
102 $this->tabs_gui->activateTab(self::TAB_ID_DELETE_ACCOUNT);
103 return;
104 }
105
106 if ($next_class === strtolower(\ilLocalUserPasswordSettingsGUI::class)) {
107 $this->tabs_gui->activateTab(self::TAB_ID_CHANGE_PASSWORD);
108 return;
109 }
110
111 $this->tabs_gui->activateTab(self::TAB_ID_SETTINGS);
112 }

References ILIAS\Repository\ctrl().

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addChangePasswordTab()

ILIAS\User\Presentation\SettingsTabs::addChangePasswordTab ( )
private

Definition at line 70 of file SettingsTabs.php.

70 : void
71 {
72 $this->tabs_gui->addTab(
73 self::TAB_ID_CHANGE_PASSWORD,
74 $this->lng->txt('chg_password'),
75 $this->ctrl->getLinkTargetByClass(
76 [
77 \ilDashboardGUI::class,
78 PersonalSettingsGUI::class,
79 \ilLocalUserPasswordSettingsGUI::class
80 ],
82 )
83 );
84 }

References ilLocalUserPasswordSettingsGUI\CMD_SHOW_PASSWORD, and ILIAS\Repository\lng().

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addDeleteAccountTab()

ILIAS\User\Presentation\SettingsTabs::addDeleteAccountTab ( )
private

Definition at line 86 of file SettingsTabs.php.

86 : void
87 {
88 $this->tabs_gui->addTab(
89 self::TAB_ID_DELETE_ACCOUNT,
90 $this->lng->txt('user_delete_own_account'),
91 $this->ctrl->getLinkTargetByClass(
92 [\ilDashboardGUI::class, PersonalSettingsGUI::class, DeleteAccountGUI::class],
93 'deleteOwnAccountStep1'
94 )
95 );
96 }

References ILIAS\Repository\lng().

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSettingsTab()

ILIAS\User\Presentation\SettingsTabs::addSettingsTab ( )
private

Definition at line 58 of file SettingsTabs.php.

58 : void
59 {
60 $this->tabs_gui->addTab(
61 self::TAB_ID_SETTINGS,
62 $this->lng->txt('settings'),
63 $this->ctrl->getLinkTargetByClass(
64 [\ilDashboardGUI::class, PersonalSettingsGUI::class],
65 'show'
66 ),
67 );
68 }

References ILIAS\Repository\lng().

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changePasswordAvailable()

ILIAS\User\Presentation\SettingsTabs::changePasswordAvailable ( )
private

Definition at line 114 of file SettingsTabs.php.

114 : bool
115 {
116 return LocalUserPasswordManager::getInstance()->allowPasswordChange($this->current_user);
117 }
static getInstance()
Singleton method to reduce footprint (included files, created instances)

References ILIAS\Authentication\Password\LocalUserPasswordManager\getInstance().

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAccountAvailable()

ILIAS\User\Presentation\SettingsTabs::deleteAccountAvailable ( )
private

Definition at line 119 of file SettingsTabs.php.

119 : bool
120 {
121 return $this->settings->get('user_delete_own_account') === '1'
122 && $this->current_user->getId() !== SYSTEM_USER_ID;
123 }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26

References ILIAS\Repository\settings(), and SYSTEM_USER_ID.

Referenced by ILIAS\User\Presentation\SettingsTabs\initializeTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initializeTabs()

Field Documentation

◆ TAB_ID_CHANGE_PASSWORD

const ILIAS\User\Presentation\SettingsTabs::TAB_ID_CHANGE_PASSWORD = 'change_password'
private

Definition at line 31 of file SettingsTabs.php.

◆ TAB_ID_DELETE_ACCOUNT

const ILIAS\User\Presentation\SettingsTabs::TAB_ID_DELETE_ACCOUNT = 'delete_account'
private

Definition at line 32 of file SettingsTabs.php.

◆ TAB_ID_SETTINGS

const ILIAS\User\Presentation\SettingsTabs::TAB_ID_SETTINGS = 'settings'
private

Definition at line 30 of file SettingsTabs.php.


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