ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMStListUsersGUI.php
Go to the documentation of this file.
1<?php
2
5
14{
15 const CMD_RESET_FILTER = 'resetFilter';
16 const CMD_APPLY_FILTER = 'applyFilter';
17 const CMD_INDEX = 'index';
18 const CMD_GET_ACTIONS = "getActions";
19 const CMD_ADD_USER_AUTO_COMPLETE = 'addUserAutoComplete';
23 protected $table;
27 protected $access;
31 protected $help;
32
33
37 public function __construct()
38 {
39 global $DIC;
40 $this->access = ilMyStaffAccess::getInstance();
41 $this->help = $DIC->help();
42 $this->help->setScreenIdComponent('msta');
43 }
44
45
49 protected function checkAccessOrFail()
50 {
51 global $DIC;
52
53 if ($this->access->hasCurrentUserAccessToMyStaff()) {
54 return;
55 } else {
56 ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
57 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
58 }
59 }
60
61
65 public function executeCommand()
66 {
67 global $DIC;
68
69 $this->checkAccessOrFail();
70
71 $cmd = $DIC->ctrl()->getCmd();
72
73 switch ($cmd) {
76 case self::CMD_INDEX:
79 $this->$cmd();
80 break;
81 default:
82 $this->index();
83 break;
84 }
85 }
86
87
91 public function index()
92 {
93 $this->listUsers();
94 }
95
96
100 public function listUsers()
101 {
102 global $DIC;
103
104 $this->help->setScreenId('users_list');
105 $this->table = new ilMStListUsersTableGUI($this, self::CMD_INDEX);
106 $DIC->ui()->mainTemplate()->setTitle($DIC->language()->txt('mst_list_users'));
107 $DIC->ui()->mainTemplate()->setTitleIcon(ilUtil::getImagePath('icon_stff.svg'));
108 $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
109 }
110
111
115 public function applyFilter()
116 {
117 $this->table = new ilMStListUsersTableGUI($this, self::CMD_APPLY_FILTER);
118 $this->table->writeFilterToSession();
119 $this->table->resetOffset();
120 $this->index();
121 }
122
123
127 public function resetFilter()
128 {
129 $this->table = new ilMStListUsersTableGUI($this, self::CMD_RESET_FILTER);
130 $this->table->resetOffset();
131 $this->table->resetFilter();
132 $this->index();
133 }
134
135
139 public function cancel()
140 {
141 global $DIC;
142
143 $DIC->ctrl()->redirect($this);
144 }
145}
An exception for terminatinating execution or to throw for unit testing.
Class ilMStListUsersGUI.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2