ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilSystemSupportContactsGUI Class Reference

System support contacts. More...

+ Inheritance diagram for ilSystemSupportContactsGUI:
+ Collaboration diagram for ilSystemSupportContactsGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 showContacts ()
 Show contacts. More...
 

Static Public Member Functions

static getFooterLink ()
 Get a contact link to be shown in the footer. More...
 
static getFooterText ()
 Get the text for a contact link to be shown in the footer. More...
 
static isProfileVisible (int $user_id)
 Check if the profile of a user can be shown. More...
 

Protected Attributes

ILIAS DI UIServices $ui
 
 $tpl
 
 $lng
 
 $ctrl
 

Static Private Member Functions

static isAnonymous ()
 Check if the current user is anonymous. More...
 
static globalProfilesEnabled ()
 Check if user profiles can be shown to anonymous users. More...
 

Detailed Description

System support contacts.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e @ilCtrl_Calls ilSystemSupportContactsGUI: ILIAS\User\Profile\PublicProfileGUI

Definition at line 28 of file class.ilSystemSupportContactsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSystemSupportContactsGUI::__construct ( )

Constructor.

Definition at line 46 of file class.ilSystemSupportContactsGUI.php.

47 {
48 global $DIC;
49
50 $ilCtrl = $DIC->ctrl();
51 $tpl = $DIC["tpl"];
52 $lng = $DIC->language();
53
54 $this->ctrl = $ilCtrl;
55 $this->tpl = $tpl;
56 $this->lng = $lng;
57 $this->ui = $DIC->ui();
58 }
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilSystemSupportContactsGUI::executeCommand ( )

Execute command.

Definition at line 64 of file class.ilSystemSupportContactsGUI.php.

65 {
66 $next_class = $this->ctrl->getNextClass($this);
67
68 switch ($next_class) {
69 case strtolower(PublicProfileGUI::class):
70 $gui = new PublicProfileGUI();
71 $this->ctrl->setReturn($this, 'showContacts');
72 $this->ctrl->forwardCommand($gui);
73 break;
74
75 default:
76 $cmd = $this->ctrl->getCmd("showContacts");
77 if (in_array($cmd, array("showContacts"))) {
78 $this->$cmd();
79 }
80 }
81 }
GUI class for public user profile presentation.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getFooterLink()

static ilSystemSupportContactsGUI::getFooterLink ( )
static

Get a contact link to be shown in the footer.

Definition at line 125 of file class.ilSystemSupportContactsGUI.php.

125 : ?string
126 {
127 global $DIC;
129 return $DIC->ctrl()->getLinkTargetByClass(self::class);
130 }
131 return null;
132 }
static getValidSupportContactIds()
Get valid support contacts.

References $DIC, and ilSystemSupportContacts\getValidSupportContactIds().

Referenced by ilFooterStandardGroupsProvider\getEntries().

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

◆ getFooterText()

static ilSystemSupportContactsGUI::getFooterText ( )
static

Get the text for a contact link to be shown in the footer.

Definition at line 137 of file class.ilSystemSupportContactsGUI.php.

137 : string
138 {
139 global $DIC;
140 return $DIC->language()->txt("contact_sysadmin");
141 }

References $DIC.

Referenced by ilFooterStandardGroupsProvider\getEntries().

+ Here is the caller graph for this function:

◆ globalProfilesEnabled()

static ilSystemSupportContactsGUI::globalProfilesEnabled ( )
staticprivate

Check if user profiles can be shown to anonymous users.

Definition at line 173 of file class.ilSystemSupportContactsGUI.php.

173 : bool
174 {
175 global $DIC;
176 return $DIC->settings()->get('enable_global_profiles') ?? false;
177 }

References $DIC.

Referenced by isProfileVisible().

+ Here is the caller graph for this function:

◆ isAnonymous()

static ilSystemSupportContactsGUI::isAnonymous ( )
staticprivate

Check if the current user is anonymous.

Definition at line 163 of file class.ilSystemSupportContactsGUI.php.

163 : bool
164 {
165 global $DIC;
166 $current_user_id = $DIC->user()->getId();
167 return $current_user_id === 0 || $current_user_id === ANONYMOUS_USER_ID;
168 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References $DIC, and ANONYMOUS_USER_ID.

◆ isProfileVisible()

static ilSystemSupportContactsGUI::isProfileVisible ( int  $user_id)
static

Check if the profile of a user can be shown.

  • if it is published for www
  • OR if it is published for users and the current user is logged in

Definition at line 148 of file class.ilSystemSupportContactsGUI.php.

148 : bool
149 {
150 $user = new ilObjUser($user_id);
151 $public = $user->getPref('public_profile');
152
153 if (self::isAnonymous()) {
154 return $public === 'g' && self::globalProfilesEnabled();
155 } else {
156 return $public === 'g' || $public === 'y';
157 }
158 }
User class.
static globalProfilesEnabled()
Check if user profiles can be shown to anonymous users.

References $user_id, and globalProfilesEnabled().

+ Here is the call graph for this function:

◆ showContacts()

ilSystemSupportContactsGUI::showContacts ( )

Show contacts.

Definition at line 86 of file class.ilSystemSupportContactsGUI.php.

87 {
88 $this->lng->loadLanguageModule("adm");
89 $this->tpl->loadStandardTemplate();
90 $this->tpl->setTitle($this->lng->txt("adm_support_contacts"));
91
92 $content = [];
93 if (self::isAnonymous() && !self::globalProfilesEnabled()) {
94 $mails = [];
97 if ($mail) {
98 $mails[] = $mail;
99 }
100 }
101 $content[] = $this->ui->factory()->listing()->unordered(array_unique($mails));
102 } else {
104 if (self::isProfileVisible($user_id)) {
105 $pgui = new PublicProfileGUI($user_id);
106 $pgui->setEmbedded(true);
107 $content[] = $this->ui->factory()->legacy()->content($pgui->getHTML());
108 }
109 }
110 }
111
112 $panel = $this->ui->factory()->panel()->standard(
113 $this->lng->txt("adm_support_contacts"),
114 $content
115 );
116
117 $this->tpl->setContent($this->ui->renderer()->render($panel));
118 $this->tpl->printToStdout();
119 }
static _lookupEmail(int $a_user_id)

References $user_id, ilObjUser\_lookupEmail(), ilSystemSupportContacts\getValidSupportContactIds(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSystemSupportContactsGUI::$ctrl
protected

Definition at line 41 of file class.ilSystemSupportContactsGUI.php.

◆ $lng

ilSystemSupportContactsGUI::$lng
protected

Definition at line 39 of file class.ilSystemSupportContactsGUI.php.

Referenced by __construct().

◆ $tpl

ilSystemSupportContactsGUI::$tpl
protected

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

Referenced by __construct().

◆ $ui

ILIAS DI UIServices ilSystemSupportContactsGUI::$ui
protected

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


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