ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMStShowUserGUI Class Reference

Class ilMStShowUserGUI. More...

+ Collaboration diagram for ilMStShowUserGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 getId ()
 
 cancel ()
 

Data Fields

const CMD_INDEX = 'index'
 
const CMD_SHOWUSER = 'showUser'
 
const CMD_RESET_FILTER = 'resetFilter'
 
const CMD_APPLY_FILTER = 'applyFilter'
 
const TAB_SHOW_COURSES = 'show_courses'
 
const TAB_SHOW_USER = 'show_user'
 

Protected Member Functions

 checkAccessOrFail ()
 
 index ()
 
 listUsers ()
 
 showUser ()
 
 applyFilter ()
 
 resetFilter ()
 
 addTabs ($active_tab_id)
 

Protected Attributes

 $usr_id
 
 $table
 
 $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 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:
global $DIC
Definition: saml.php:7

References $DIC, ilMyStaffAccess\getInstance(), 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 201 of file class.ilMStShowUserGUI.php.

202 {
203 global $DIC;
204
205 $DIC->tabs()->setBackTarget($DIC->language()->txt('mst_list_users'), $DIC->ctrl()->getLinkTargetByClass(array(
206 ilMyStaffGUI::class,
207 ilMStListUsersGUI::class,
208 )));
209 $DIC->tabs()->addTab(self::TAB_SHOW_COURSES, $DIC->language()->txt('mst_show_courses'), $DIC->ctrl()->getLinkTargetByClass(array(
210 ilMyStaffGUI::class,
211 self::class,
212 ), self::CMD_INDEX));
213
214 $user = new ilObjUser($this->usr_id);
215 if ($user->hasPublicProfile()) {
216 $DIC->ctrl()->setParameterByClass(self::class, 'usr_id', $this->usr_id);
217 $public_profile_url = $DIC->ctrl()->getLinkTargetByClass(self::class, self::CMD_SHOWUSER);
218 $DIC->tabs()->addTab(self::TAB_SHOW_USER, $DIC->language()->txt('public_profile'), $public_profile_url);
219 }
220
221 if ($active_tab_id) {
222 $DIC->tabs()->activateTab($active_tab_id);
223 }
224 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ applyFilter()

ilMStShowUserGUI::applyFilter ( )
protected

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

156 {
157 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_APPLY_FILTER);
158 $this->table->writeFilterToSession();
159 $this->table->resetOffset();
160 $this->index();
161 }
Class ilMStShowUserCoursesTableGUI.

References index().

+ Here is the call graph for this function:

◆ cancel()

ilMStShowUserGUI::cancel ( )

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

191 {
192 global $DIC;
193
194 $DIC->ctrl()->redirect($this);
195 }

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(ilPersonalDesktopGUI::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(ilPersonalDesktopGUI::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(ilFormPropertyDispatchGUI::class):
86 $DIC->ctrl()->setReturn($this, self::CMD_INDEX);
87 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
88 $this->table->executeCommand();
89 break;
90 default:
91 switch ($cmd) {
94 case self::CMD_INDEX:
95 $this->addTabs(self::TAB_SHOW_COURSES);
96 $this->$cmd();
97 break;
99 $this->addTabs(self::TAB_SHOW_USER);
100 $this->$cmd();
101 break;
102 default:
103 $this->addTabs(self::TAB_SHOW_COURSES);
104 $this->index();
105 break;
106 }
107 }
108 }

References $DIC, addTabs(), checkAccessOrFail(), CMD_APPLY_FILTER, CMD_INDEX, CMD_RESET_FILTER, CMD_SHOWUSER, and index().

+ Here is the call graph for this function:

◆ getId()

ilMStShowUserGUI::getId ( )
Returns
string

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

180 {
181 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
182
183 return $this->table->getId();
184 }

◆ index()

ilMStShowUserGUI::index ( )
protected

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

115 {
116 $this->listUsers();
117 }

References listUsers().

Referenced by applyFilter(), executeCommand(), and resetFilter().

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

◆ listUsers()

ilMStShowUserGUI::listUsers ( )
protected

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

124 {
125 global $DIC;
126
127 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
128 $this->table->setTitle(sprintf($DIC->language()->txt('mst_courses_of'), ilObjCourse::_lookupTitle($this->usr_id)));
129
130 $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
131 }
sprintf('%.4f', $callTime)
static _lookupTitle($a_id)
lookup object title

References $DIC, ilObject\_lookupTitle(), and sprintf.

Referenced by index().

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

◆ resetFilter()

ilMStShowUserGUI::resetFilter ( )
protected

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

168 {
169 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_RESET_FILTER);
170 $this->table->resetOffset();
171 $this->table->resetFilter();
172 $this->index();
173 }

References index().

+ Here is the call graph for this function:

◆ showUser()

ilMStShowUserGUI::showUser ( )
protected

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

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

References $DIC.

Field Documentation

◆ $access

ilMStShowUserGUI::$access
protected

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

◆ $table

ilMStShowUserGUI::$table
protected

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

◆ $usr_id

ilMStShowUserGUI::$usr_id
protected

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

◆ CMD_APPLY_FILTER

const ilMStShowUserGUI::CMD_APPLY_FILTER = 'applyFilter'

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

Referenced by executeCommand().

◆ CMD_INDEX

const ilMStShowUserGUI::CMD_INDEX = 'index'

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

Referenced by executeCommand().

◆ CMD_RESET_FILTER

const ilMStShowUserGUI::CMD_RESET_FILTER = 'resetFilter'

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

Referenced by executeCommand().

◆ CMD_SHOWUSER

const ilMStShowUserGUI::CMD_SHOWUSER = 'showUser'

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

Referenced by executeCommand().

◆ TAB_SHOW_COURSES

const ilMStShowUserGUI::TAB_SHOW_COURSES = 'show_courses'

Definition at line 17 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: