ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMStShowUserCoursesGUI Class Reference
+ Collaboration diagram for ilMStShowUserCoursesGUI:

Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

 $usr_id
 
 $table
 
 $access
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCoursesGUI::__construct ( )

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

References $DIC.

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

Member Function Documentation

◆ applyFilter()

ilMStShowUserCoursesGUI::applyFilter ( )
protected

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

References index().

133  {
134  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_APPLY_FILTER);
135  $this->table->writeFilterToSession();
136  $this->table->resetOffset();
137  $this->index();
138  }
+ Here is the call graph for this function:

◆ cancel()

ilMStShowUserCoursesGUI::cancel ( )

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

References $DIC.

168  {
169  global $DIC;
170 
171  $DIC->ctrl()->redirect($this);
172  }
global $DIC
Definition: goto.php:24

◆ checkAccessOrFail()

ilMStShowUserCoursesGUI::checkAccessOrFail ( )
protected

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

References $DIC, and ilUtil\sendFailure().

Referenced by executeCommand().

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->hasCurrentUserAccessToUser($this->usr_id)
63  && $this->access->hasCurrentUserAccessToCourseMemberships()
64  ) {
65  return;
66  } else {
67  ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
68  $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
69  }
70  }
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStShowUserCoursesGUI::executeCommand ( )

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

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

77  {
78  global $DIC;
79 
80  $this->checkAccessOrFail();
81 
82  $cmd = $DIC->ctrl()->getCmd();
83  $next_class = $DIC->ctrl()->getNextClass();
84 
85  switch ($next_class) {
86  case strtolower(ilFormPropertyDispatchGUI::class):
87  $DIC->ctrl()->setReturn($this, self::CMD_INDEX);
88  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
89  $this->table->executeCommand();
90  break;
91  default:
92  switch ($cmd) {
93  case self::CMD_RESET_FILTER:
94  case self::CMD_APPLY_FILTER:
95  case self::CMD_INDEX:
96  case self::CMD_GET_ACTIONS:
97  $this->$cmd();
98  break;
99  default:
100  $this->index();
101  break;
102  }
103  }
104  }
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ getId()

ilMStShowUserCoursesGUI::getId ( )
Returns
string

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

157  {
158  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
159 
160  return $this->table->getId();
161  }

◆ index()

ilMStShowUserCoursesGUI::index ( )
protected

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

References listUsers().

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

111  {
112  $this->listUsers();
113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsers()

ilMStShowUserCoursesGUI::listUsers ( )
protected

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

References $DIC, and ilObject\_lookupTitle().

Referenced by index().

120  {
121  global $DIC;
122 
123  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
124  $this->table->setTitle(sprintf($DIC->language()->txt('mst_courses_of'), ilObjCourse::_lookupTitle($this->usr_id)));
125 
126  $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
127  }
static _lookupTitle($a_id)
lookup object title
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilMStShowUserCoursesGUI::resetFilter ( )
protected

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

References index().

145  {
146  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_RESET_FILTER);
147  $this->table->resetOffset();
148  $this->table->resetFilter();
149  $this->index();
150  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMStShowUserCoursesGUI::$access
protected

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

◆ $table

ilMStShowUserCoursesGUI::$table
protected

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

◆ $usr_id

ilMStShowUserCoursesGUI::$usr_id
protected

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

◆ CMD_APPLY_FILTER

const ilMStShowUserCoursesGUI::CMD_APPLY_FILTER = 'applyFilter'

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

◆ CMD_GET_ACTIONS

const ilMStShowUserCoursesGUI::CMD_GET_ACTIONS = "getActions"

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

◆ CMD_INDEX

const ilMStShowUserCoursesGUI::CMD_INDEX = 'index'

◆ CMD_RESET_FILTER

const ilMStShowUserCoursesGUI::CMD_RESET_FILTER = 'resetFilter'

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


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