ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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:22
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilMStShowUserCoursesGUI::applyFilter ( )
protected

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

References index().

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.
+ Here is the call graph for this function:

◆ cancel()

ilMStShowUserCoursesGUI::cancel ( )
final

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

References $DIC.

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

◆ checkAccessOrFail()

ilMStShowUserCoursesGUI::checkAccessOrFail ( )
protected

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

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

Referenced by executeCommand().

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  }
global $DIC
Definition: shib_login.php:22
+ 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.

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

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) {
86  case self::CMD_RESET_FILTER:
87  case self::CMD_APPLY_FILTER:
88  case self::CMD_INDEX:
89  case self::CMD_GET_ACTIONS:
90  $this->$cmd();
91  break;
92  default:
93  $this->index();
94  break;
95  }
96  }
97  }
global $DIC
Definition: shib_login.php:22
Class ilMStShowUserCoursesTableGUI.
+ 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  }
Class ilMStShowUserCoursesTableGUI.

◆ index()

ilMStShowUserCoursesGUI::index ( )
protected

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

References listUsers().

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

99  : void
100  {
101  $this->listUsers();
102  }
+ 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.

References $DIC, and ilObject\_lookupTitle().

Referenced by index().

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)
global $DIC
Definition: shib_login.php:22
Class ilMStShowUserCoursesTableGUI.
+ 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.

References index().

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  }
Class ilMStShowUserCoursesTableGUI.
+ 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.

◆ CMD_GET_ACTIONS

const string ilMStShowUserCoursesGUI::CMD_GET_ACTIONS = "getActions"

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

◆ 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.


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