ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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

 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 $DIC->ui()->mainTemplate()->setTitle(ilUserUtil::getNamePresentation($this->usr_id));
46 $DIC->ui()->mainTemplate()->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->usr_id, "xxsmall"));
47 }
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=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:
$DIC
Definition: xapitoken.php:46

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

+ 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 162 of file class.ilMStShowUserGUI.php.

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

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ cancel()

ilMStShowUserGUI::cancel ( )

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

152 {
153 global $DIC;
154
155 $DIC->ctrl()->redirect($this);
156 }

References $DIC.

◆ checkAccessOrFail()

ilMStShowUserGUI::checkAccessOrFail ( )
protected

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

54 {
55 global $DIC;
56
57 if (!$this->usr_id) {
58 ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
59 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
60 }
61
62 if ($this->access->hasCurrentUserAccessToMyStaff()
63 && $this->access->hasCurrentUserAccessToUser($this->usr_id)) {
64 return;
65 } else {
66 ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
67 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
68 }
69 }
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 75 of file class.ilMStShowUserGUI.php.

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

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

+ Here is the call graph for this function:

◆ index()

ilMStShowUserGUI::index ( )
protected

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

124 {
125 global $DIC;
126 $DIC->ctrl()->redirectByClass(ilMStShowUserCoursesGUI::class);
127 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ showUser()

ilMStShowUserGUI::showUser ( )
protected

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

134 {
135 global $DIC;
136
137 //Redirect if Profile is not public
138 $user = new ilObjUser($this->usr_id);
139 if (!$user->hasPublicProfile()) {
140 $DIC->ctrl()->redirectByClass(self::class, self::CMD_INDEX);
141 }
142
143 $pub_profile = new ilPublicUserProfileGUI($this->usr_id);
144 $DIC->ui()->mainTemplate()->setContent($pub_profile->getEmbeddable());
145 }
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: