ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMStShowUserCoursesGUI Class Reference
+ Collaboration diagram for ilMStShowUserCoursesGUI:

Public Member Functions

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

Data Fields

const string CMD_INDEX = 'index'
 
const string CMD_RESET_FILTER = 'resetFilter'
 
const string CMD_APPLY_FILTER = 'applyFilter'
 
const string CMD_GET_ACTIONS = "getActions"
 

Protected Member Functions

 checkAccessOrFail ()
 
 index ()
 
 listUsers ()
 
 applyFilter ()
 
 resetFilter ()
 

Protected Attributes

int $usr_id
 
ilTable2GUI $table
 
ilMyStaffAccess $access
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCoursesGUI::__construct ( )

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

40 {
41 global $DIC;
42 $this->main_tpl = $DIC->ui()->mainTemplate();
43
44 $this->access = ilMyStaffAccess::getInstance();
45
46 $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
47 $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
48 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilMStShowUserCoursesGUI::applyFilter ( )
protected

Definition at line 116 of file class.ilMStShowUserCoursesGUI.php.

116 : void
117 {
118 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_APPLY_FILTER);
119 $this->table->writeFilterToSession();
120 $this->table->resetOffset();
121 $this->index();
122 }
Class ilMStShowUserCoursesTableGUI.

References index().

+ Here is the call graph for this function:

◆ cancel()

ilMStShowUserCoursesGUI::cancel ( )
final

Definition at line 139 of file class.ilMStShowUserCoursesGUI.php.

139 : void
140 {
141 global $DIC;
142 $DIC->ctrl()->redirect($this);
143 }

References $DIC.

◆ checkAccessOrFail()

ilMStShowUserCoursesGUI::checkAccessOrFail ( )
protected

Definition at line 50 of file class.ilMStShowUserCoursesGUI.php.

51 {
52 global $DIC;
53
54 if (!$this->usr_id) {
55 $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt("permission_denied"), true);
56 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
57 }
58
59 if ($this->access->hasCurrentUserAccessToUser($this->usr_id)
60 && $this->access->hasCurrentUserAccessToCourseMemberships()
61 ) {
62 return;
63 } else {
64 $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt("permission_denied"), true);
65 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
66 }
67 }

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()

ilMStShowUserCoursesGUI::executeCommand ( )
final

Definition at line 69 of file class.ilMStShowUserCoursesGUI.php.

70 {
71 global $DIC;
72
73 $this->checkAccessOrFail();
74
75 $cmd = $DIC->ctrl()->getCmd();
76 $next_class = $DIC->ctrl()->getNextClass();
77
78 switch ($next_class) {
79 case strtolower(ilMStShowUserCoursesTableGUI::class):
80 $DIC->ctrl()->setReturn($this, self::CMD_INDEX);
81 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
82 $DIC->ctrl()->forwardCommand($this->table);
83 break;
84 default:
85 switch ($cmd) {
88 case self::CMD_INDEX:
90 $this->$cmd();
91 break;
92 default:
93 $this->index();
94 break;
95 }
96 }
97 }

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

+ Here is the call graph for this function:

◆ getId()

ilMStShowUserCoursesGUI::getId ( )
final

Definition at line 132 of file class.ilMStShowUserCoursesGUI.php.

132 : string
133 {
134 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
135
136 return $this->table->getId();
137 }

◆ index()

ilMStShowUserCoursesGUI::index ( )
protected

Definition at line 99 of file class.ilMStShowUserCoursesGUI.php.

99 : void
100 {
101 $this->listUsers();
102 }

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()

ilMStShowUserCoursesGUI::listUsers ( )
protected

Definition at line 104 of file class.ilMStShowUserCoursesGUI.php.

105 {
106 global $DIC;
107
108 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
109 $this->table->setTitle(
110 sprintf($DIC->language()->txt('mst_courses_of'), ilObjCourse::_lookupTitle($this->usr_id))
111 );
112
113 $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
114 }
static _lookupTitle(int $obj_id)

References $DIC, and ilObject\_lookupTitle().

Referenced by index().

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

◆ resetFilter()

ilMStShowUserCoursesGUI::resetFilter ( )
protected

Definition at line 124 of file class.ilMStShowUserCoursesGUI.php.

124 : void
125 {
126 $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_RESET_FILTER);
127 $this->table->resetOffset();
128 $this->table->resetFilter();
129 $this->index();
130 }

References index().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilMStShowUserCoursesGUI::$access
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilMStShowUserCoursesGUI::$main_tpl
private

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

◆ $table

ilTable2GUI ilMStShowUserCoursesGUI::$table
protected

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

◆ $usr_id

int ilMStShowUserCoursesGUI::$usr_id
protected

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

◆ CMD_APPLY_FILTER

const string ilMStShowUserCoursesGUI::CMD_APPLY_FILTER = 'applyFilter'

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

Referenced by executeCommand().

◆ CMD_GET_ACTIONS

const string ilMStShowUserCoursesGUI::CMD_GET_ACTIONS = "getActions"

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

Referenced by executeCommand().

◆ CMD_INDEX

const string ilMStShowUserCoursesGUI::CMD_INDEX = 'index'

◆ CMD_RESET_FILTER

const string ilMStShowUserCoursesGUI::CMD_RESET_FILTER = 'resetFilter'

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

Referenced by executeCommand().


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