ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMStListCompetencesSkillsGUI.php
Go to the documentation of this file.
1 <?php
2 
6 
15 {
16  const CMD_APPLY_FILTER = 'applyFilter';
17  const CMD_INDEX = 'index';
18  const CMD_GET_ACTIONS = "getActions";
19  const CMD_RESET_FILTER = 'resetFilter';
23  protected $table;
27  protected $access;
31  private $dic;
32 
33 
37  public function __construct(Container $dic)
38  {
39  $this->access = ilMyStaffAccess::getInstance();
40  $this->dic = $dic;
41  }
42 
43 
44  protected function checkAccessOrFail() : void
45  {
46  if ($this->access->hasCurrentUserAccessToCompetences()) {
47  return;
48  } else {
49  ilUtil::sendFailure($this->dic->language()->txt("permission_denied"), true);
50  $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
51  }
52  }
53 
54 
55  public function executeCommand() : void
56  {
57  $cmd = $this->dic->ctrl()->getCmd();
58  $next_class = $this->dic->ctrl()->getNextClass();
59  switch ($next_class) {
60  default:
61  switch ($cmd) {
62  case self::CMD_RESET_FILTER:
63  case self::CMD_APPLY_FILTER:
64  case self::CMD_INDEX:
65  case self::CMD_GET_ACTIONS:
66  $this->$cmd();
67  break;
68  default:
69  $this->index();
70  break;
71  }
72  break;
73  }
74  }
75 
76 
77  public function index() : void
78  {
79  $this->listUsers();
80  }
81 
82 
83  public function listUsers() : void
84  {
85  $this->checkAccessOrFail();
86 
87  $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
88  $this->dic->ui()->mainTemplate()->setTitle($this->dic->language()->txt('mst_list_competences'));
89  $this->dic->ui()->mainTemplate()->setTitleIcon(ilUtil::getImagePath('icon_skmg.svg'));
90  $this->dic->ui()->mainTemplate()->setContent($this->table->getHTML());
91  }
92 
93 
94  public function applyFilter() : void
95  {
96  $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_APPLY_FILTER, $this->dic);
97  $this->table->writeFilterToSession();
98  $this->table->resetOffset();
99  $this->index();
100  }
101 
102 
103  public function resetFilter() : void
104  {
105  $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_RESET_FILTER, $this->dic);
106  $this->table->resetOffset();
107  $this->table->resetFilter();
108  $this->index();
109  }
110 
111 
115  public function getId() : string
116  {
117  $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
118 
119  return $this->table->getId();
120  }
121 
122 
123  public function cancel() : void
124  {
125  $this->dic->ctrl()->redirect($this);
126  }
127 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.