ILIAS  release_8 Revision v8.24
ilMStShowUserGUI Class Reference

Class ilMStShowUserGUI. More...

+ Collaboration diagram for ilMStShowUserGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 cancel ()
 

Data Fields

const CMD_INDEX = 'index'
 
const CMD_SHOW_USER = 'showUser'
 
const TAB_SHOW_USER = 'show_user'
 
const TAB_SHOW_COURSES = 'show_courses'
 
const TAB_SHOW_CERTIFICATES = 'show_certificates'
 
const TAB_SHOW_COMPETENCES = 'show_competences'
 
const TAB_SHOW_TALKS = 'show_talks'
 

Protected Member Functions

 setTitleAndIcon ()
 
 checkAccessOrFail ()
 
 index ()
 
 showUser ()
 
 addTabs (string $active_tab_id)
 

Protected Attributes

int $usr_id
 
ilMyStaffAccess $access
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserGUI::__construct ( )

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

44 {
45 global $DIC;
46 $this->main_tpl = $DIC->ui()->mainTemplate();
47
48 $this->access = ilMyStaffAccess::getInstance();
49
50 $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
51 $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
52
53 $this->setTitleAndIcon();
54 }
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\access(), and setTitleAndIcon().

+ Here is the call graph for this function:

Member Function Documentation

◆ addTabs()

ilMStShowUserGUI::addTabs ( string  $active_tab_id)
protected

Definition at line 167 of file class.ilMStShowUserGUI.php.

167 : void
168 {
169 global $DIC;
170
171 $DIC->tabs()->setBackTarget($DIC->language()->txt('mst_list_users'), $DIC->ctrl()->getLinkTargetByClass(array(
172 ilMyStaffGUI::class,
173 ilMStListUsersGUI::class,
174 )));
175
176 if ($this->access->hasCurrentUserAccessToCourseMemberships()) {
177 $DIC->tabs()->addTab(
178 self::TAB_SHOW_COURSES,
179 $DIC->language()->txt('mst_list_courses'),
180 $DIC->ctrl()->getLinkTargetByClass(array(
181 ilMyStaffGUI::class,
182 self::class,
183 ilMStShowUserCoursesGUI::class,
184 ))
185 );
186 }
187
188 if ($this->access->hasCurrentUserAccessToCertificates()) {
189 $DIC->tabs()->addTab(
190 self::TAB_SHOW_CERTIFICATES,
191 $DIC->language()->txt('mst_list_certificates'),
192 $DIC->ctrl()->getLinkTargetByClass(array(
193 ilMyStaffGUI::class,
194 self::class,
195 ilUserCertificateGUI::class,
196 ))
197 );
198 }
199
200 if ($this->access->hasCurrentUserAccessToCompetences()) {
201 $DIC->tabs()->addTab(
202 self::TAB_SHOW_COMPETENCES,
203 $DIC->language()->txt('mst_list_competences'),
204 $DIC->ctrl()->getLinkTargetByClass(array(
205 ilMyStaffGUI::class,
206 self::class,
207 ilMStShowUserCompetencesGUI::class,
208 ))
209 );
210 }
211
212 $user = new ilObjUser($this->usr_id);
213 if ($user->hasPublicProfile()) {
214 $DIC->ctrl()->setParameterByClass(self::class, 'usr_id', $this->usr_id);
215 $public_profile_url = $DIC->ctrl()->getLinkTargetByClass(self::class, self::CMD_SHOW_USER);
216 $DIC->tabs()->addTab(self::TAB_SHOW_USER, $DIC->language()->txt('public_profile'), $public_profile_url);
217 }
218
219 if ($this->access->hasCurrentUserAccessToTalks()) {
220 $DIC->ctrl()->setParameterByClass(strtolower(self::class), 'usr_id', $this->usr_id);
221 $DIC->tabs()->addTab(self::TAB_SHOW_TALKS, $DIC->language()->txt('etal_talks'), $DIC->ctrl()->getLinkTargetByClass([
222 strtolower(ilMyStaffGUI::class),
223 strtolower(self::class),
224 strtolower(ilEmployeeTalkMyStaffUserGUI::class)
225 ], ControlFlowCommand::INDEX));
226 }
227
228 if ($active_tab_id) {
229 $DIC->tabs()->activateTab($active_tab_id);
230 }
231 }
User class.

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

Referenced by executeCommand().

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

◆ cancel()

ilMStShowUserGUI::cancel ( )

Definition at line 160 of file class.ilMStShowUserGUI.php.

160 : void
161 {
162 global $DIC;
163
164 $DIC->ctrl()->redirect($this);
165 }

References $DIC.

◆ checkAccessOrFail()

ilMStShowUserGUI::checkAccessOrFail ( )
protected

Definition at line 62 of file class.ilMStShowUserGUI.php.

62 : void
63 {
64 global $DIC;
65
66 if (!$this->usr_id) {
67 $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt("permission_denied"), true);
68 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
69 }
70
71 if ($this->access->hasCurrentUserAccessToUser($this->usr_id)) {
72 return;
73 } else {
74 $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt("permission_denied"), true);
75 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
76 }
77 }

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

Referenced by executeCommand().

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

◆ executeCommand()

ilMStShowUserGUI::executeCommand ( )
final

Definition at line 79 of file class.ilMStShowUserGUI.php.

79 : void
80 {
81 global $DIC;
82
83 $this->checkAccessOrFail();
84
85 $cmd = $DIC->ctrl()->getCmd();
86 $next_class = $DIC->ctrl()->getNextClass();
87
88 switch ($next_class) {
89 case strtolower(ilMStShowUserCoursesGUI::class):
90 $this->addTabs(self::TAB_SHOW_COURSES);
91 $gui = new ilMStShowUserCoursesGUI();
92 $DIC->ctrl()->forwardCommand($gui);
93 break;
94 case strtolower(ilUserCertificateGUI::class):
95 $this->addTabs(self::TAB_SHOW_CERTIFICATES);
96 $gui = new ilUserCertificateGUI(
97 null,
98 null,
99 null,
100 new ilObjUser($this->usr_id)
101 );
102 $DIC->ctrl()->forwardCommand($gui);
103 $this->setTitleAndIcon();
104 break;
105 case strtolower(ilMStShowUserCompetencesGUI::class):
106 $this->addTabs(self::TAB_SHOW_COMPETENCES);
108 $DIC->ctrl()->forwardCommand($gui);
109 break;
110 case strtolower(ilEmployeeTalkMyStaffUserGUI::class):
111 $this->addTabs(self::TAB_SHOW_TALKS);
113 ilMyStaffAccess::getInstance(),
114 $DIC->ctrl(),
115 $DIC->language(),
116 $DIC->http()->request(),
117 $DIC->ui()->mainTemplate(),
118 $DIC->tabs(),
119 new IliasDBEmployeeTalkRepository($DIC->database()),
120 $DIC->ui(),
122 $DIC->user()
123 );
124 $DIC->ctrl()->forwardCommand($gui);
125 break;
126 default:
127
128 switch ($cmd) {
130 $this->addTabs(self::TAB_SHOW_USER);
131 $this->$cmd();
132 break;
133 default:
134 $this->index();
135 break;
136 }
137 }
138 }
Class ilEmployeeTalkMyStaffUserGUI.
Class ilMStShowUserCompetencesGUI.
addTabs(string $active_tab_id)

References $DIC, addTabs(), checkAccessOrFail(), CMD_SHOW_USER, ilObjEmployeeTalkAccess\getInstance(), index(), and setTitleAndIcon().

+ Here is the call graph for this function:

◆ index()

ilMStShowUserGUI::index ( )
protected

Definition at line 140 of file class.ilMStShowUserGUI.php.

140 : void
141 {
142 global $DIC;
143 $DIC->ctrl()->redirectByClass(ilMStShowUserCoursesGUI::class);
144 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setTitleAndIcon()

ilMStShowUserGUI::setTitleAndIcon ( )
protected

Definition at line 56 of file class.ilMStShowUserGUI.php.

56 : void
57 {
58 $this->main_tpl->setTitle(ilUserUtil::getNamePresentation($this->usr_id));
59 $this->main_tpl->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->usr_id, "xxsmall"));
60 }
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:

References ilObjUser\_getPersonalPicturePath(), and ilUserUtil\getNamePresentation().

Referenced by __construct(), and executeCommand().

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

◆ showUser()

ilMStShowUserGUI::showUser ( )
protected

Definition at line 146 of file class.ilMStShowUserGUI.php.

146 : void
147 {
148 global $DIC;
149
150 //Redirect if Profile is not public
151 $user = new ilObjUser($this->usr_id);
152 if (!$user->hasPublicProfile()) {
153 $DIC->ctrl()->redirectByClass(self::class, self::CMD_INDEX);
154 }
155
156 $pub_profile = new ilPublicUserProfileGUI($this->usr_id);
157 $DIC->ui()->mainTemplate()->setContent($pub_profile->getEmbeddable());
158 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $DIC.

Field Documentation

◆ $access

ilMyStaffAccess ilMStShowUserGUI::$access
protected

Definition at line 40 of file class.ilMStShowUserGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilMStShowUserGUI::$main_tpl
private

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

◆ $usr_id

int ilMStShowUserGUI::$usr_id
protected

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

◆ CMD_INDEX

const ilMStShowUserGUI::CMD_INDEX = 'index'

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

◆ CMD_SHOW_USER

const ilMStShowUserGUI::CMD_SHOW_USER = 'showUser'

Definition at line 32 of file class.ilMStShowUserGUI.php.

Referenced by executeCommand().

◆ TAB_SHOW_CERTIFICATES

const ilMStShowUserGUI::TAB_SHOW_CERTIFICATES = 'show_certificates'

Definition at line 35 of file class.ilMStShowUserGUI.php.

◆ TAB_SHOW_COMPETENCES

const ilMStShowUserGUI::TAB_SHOW_COMPETENCES = 'show_competences'

Definition at line 36 of file class.ilMStShowUserGUI.php.

◆ TAB_SHOW_COURSES

const ilMStShowUserGUI::TAB_SHOW_COURSES = 'show_courses'

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

◆ TAB_SHOW_TALKS

const ilMStShowUserGUI::TAB_SHOW_TALKS = 'show_talks'

Definition at line 37 of file class.ilMStShowUserGUI.php.

◆ TAB_SHOW_USER

const ilMStShowUserGUI::TAB_SHOW_USER = 'show_user'

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


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