ILIAS  release_7 Revision v7.30-3-g800a261c036
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'
 

Protected Member Functions

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

Protected Attributes

 $usr_id
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserGUI::__construct ( )

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

37 {
38 global $DIC;
39
40 $this->access = ilMyStaffAccess::getInstance();
41
42 $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
43 $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
44
45 $this->setTitleAndIcon();
46 }
global $DIC
Definition: goto.php:24

References $DIC, and setTitleAndIcon().

+ Here is the call graph for this function:

Member Function Documentation

◆ addTabs()

ilMStShowUserGUI::addTabs (   $active_tab_id)
protected
Parameters
string$active_tab_id

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

170 {
171 global $DIC;
172
173 $DIC->tabs()->setBackTarget($DIC->language()->txt('mst_list_users'), $DIC->ctrl()->getLinkTargetByClass(array(
174 ilMyStaffGUI::class,
175 self::class,
176 ilMStListUsersGUI::class,
177 )));
178
179 if ($this->access->hasCurrentUserAccessToCourseMemberships()) {
180 $DIC->tabs()->addTab(self::TAB_SHOW_COURSES, $DIC->language()->txt('mst_list_courses'), $DIC->ctrl()->getLinkTargetByClass(array(
181 ilMyStaffGUI::class,
182 self::class,
183 ilMStShowUserCoursesGUI::class,
184 )));
185 }
186
187 if ($this->access->hasCurrentUserAccessToCertificates()) {
188 $DIC->tabs()->addTab(self::TAB_SHOW_CERTIFICATES, $DIC->language()->txt('mst_list_certificates'), $DIC->ctrl()->getLinkTargetByClass(array(
189 ilMyStaffGUI::class,
190 self::class,
191 ilUserCertificateGUI::class,
192 )));
193 }
194
195 if ($this->access->hasCurrentUserAccessToCompetences()) {
196 $DIC->tabs()->addTab(self::TAB_SHOW_COMPETENCES, $DIC->language()->txt('mst_list_competences'), $DIC->ctrl()->getLinkTargetByClass(array(
197 ilMyStaffGUI::class,
198 self::class,
199 ilMStShowUserCompetencesGUI::class,
200 )));
201 }
202
203
204 $user = new ilObjUser($this->usr_id);
205 if ($user->hasPublicProfile()) {
206 $DIC->ctrl()->setParameterByClass(self::class, 'usr_id', $this->usr_id);
207 $public_profile_url = $DIC->ctrl()->getLinkTargetByClass(self::class, self::CMD_SHOW_USER);
208 $DIC->tabs()->addTab(self::TAB_SHOW_USER, $DIC->language()->txt('public_profile'), $public_profile_url);
209 }
210
211 if ($active_tab_id) {
212 $DIC->tabs()->activateTab($active_tab_id);
213 }
214 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ cancel()

ilMStShowUserGUI::cancel ( )

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

159 {
160 global $DIC;
161
162 $DIC->ctrl()->redirect($this);
163 }

References $DIC.

◆ checkAccessOrFail()

ilMStShowUserGUI::checkAccessOrFail ( )
protected

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

61 {
62 global $DIC;
63
64 if (!$this->usr_id) {
65 ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
66 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
67 }
68
69 if ($this->access->hasCurrentUserAccessToUser($this->usr_id)) {
70 return;
71 } else {
72 ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
73 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
74 }
75 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, and ilUtil\sendFailure().

Referenced by executeCommand().

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

◆ executeCommand()

ilMStShowUserGUI::executeCommand ( )

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

82 {
83 global $DIC;
84
85 $this->checkAccessOrFail();
86
87 $cmd = $DIC->ctrl()->getCmd();
88 $next_class = $DIC->ctrl()->getNextClass();
89
90 switch ($next_class) {
91 case strtolower(ilMStShowUserCoursesGUI::class):
92 $this->addTabs(self::TAB_SHOW_COURSES);
93 $gui = new ilMStShowUserCoursesGUI();
94 $DIC->ctrl()->forwardCommand($gui);
95 break;
96 case strtolower(ilUserCertificateGUI::class):
97 $this->addTabs(self::TAB_SHOW_CERTIFICATES);
98 $gui = new ilUserCertificateGUI(
99 null,
100 null,
101 null,
102 new ilObjUser($this->usr_id)
103 );
104 $DIC->ctrl()->forwardCommand($gui);
105 $this->setTitleAndIcon();
106 break;
107 case strtolower(ilMStShowUserCompetencesGUI::class):
108 $this->addTabs(self::TAB_SHOW_COMPETENCES);
110 $DIC->ctrl()->forwardCommand($gui);
111 break;
112 default:
113
114 switch ($cmd) {
116 $this->addTabs(self::TAB_SHOW_USER);
117 $this->$cmd();
118 break;
119 default:
120 $this->index();
121 break;
122 }
123 }
124 }
Class ilMStShowUserCompetencesGUI.

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

+ Here is the call graph for this function:

◆ index()

ilMStShowUserGUI::index ( )
protected

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

131 {
132 global $DIC;
133 $DIC->ctrl()->redirectByClass(ilMStShowUserCoursesGUI::class);
134 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setTitleAndIcon()

ilMStShowUserGUI::setTitleAndIcon ( )
protected

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

48 : void
49 {
50 global $DIC;
51
52 $DIC->ui()->mainTemplate()->setTitle(ilUserUtil::getNamePresentation($this->usr_id));
53 $DIC->ui()->mainTemplate()->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->usr_id, "xxsmall"));
54 }
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false, $html_export=false)
Get path to personal picture.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:

References $DIC, 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 140 of file class.ilMStShowUserGUI.php.

141 {
142 global $DIC;
143
144 //Redirect if Profile is not public
145 $user = new ilObjUser($this->usr_id);
146 if (!$user->hasPublicProfile()) {
147 $DIC->ctrl()->redirectByClass(self::class, self::CMD_INDEX);
148 }
149
150 $pub_profile = new ilPublicUserProfileGUI($this->usr_id);
151 $DIC->ui()->mainTemplate()->setContent($pub_profile->getEmbeddable());
152 }
GUI class for public user profile presentation.

References $DIC.

Field Documentation

◆ $access

ilMStShowUserGUI::$access
protected

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

◆ $usr_id

ilMStShowUserGUI::$usr_id
protected

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

◆ CMD_INDEX

const ilMStShowUserGUI::CMD_INDEX = 'index'

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

◆ CMD_SHOW_USER

const ilMStShowUserGUI::CMD_SHOW_USER = 'showUser'

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

Referenced by executeCommand().

◆ TAB_SHOW_CERTIFICATES

const ilMStShowUserGUI::TAB_SHOW_CERTIFICATES = 'show_certificates'

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

◆ TAB_SHOW_COMPETENCES

const ilMStShowUserGUI::TAB_SHOW_COMPETENCES = 'show_competences'

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

◆ TAB_SHOW_COURSES

const ilMStShowUserGUI::TAB_SHOW_COURSES = 'show_courses'

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

◆ TAB_SHOW_USER

const ilMStShowUserGUI::TAB_SHOW_USER = 'show_user'

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


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