ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilContainerSkillGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
30 {
31  protected ilCtrl $ctrl;
32  protected ilTabsGUI $tabs;
33  protected ilLanguage $lng;
38  protected int $ref_id = 0;
39 
40  public function __construct(ilContainerGUI $a_container_gui)
41  {
42  global $DIC;
43 
44  $this->ctrl = $DIC->ctrl();
45  $this->tabs = $DIC->tabs();
46  $this->lng = $DIC->language();
47  $this->access = $DIC->access();
48 
49  $this->container_gui = $a_container_gui;
50  /* @var $obj ilContainer */
51  $obj = $this->container_gui->getObject();
52  $this->container = $obj;
53  $this->ref_id = $this->container->getRefId();
54  $this->skmg_settings = new ilSkillManagementSettings();
55  }
56 
57  public function executeCommand(): void
58  {
59  $ctrl = $this->ctrl;
60 
61  $next_class = $this->ctrl->getNextClass($this);
62  $cmd = $this->ctrl->getCmd("showProfiles");
63 
64  $this->addTabs();
65 
66  switch ($next_class) {
67  case "ilcontskillpresentationgui":
68  if ($this->access->checkAccess("read", "", $this->ref_id)) {
69  $gui = new ilContSkillPresentationGUI($this->container_gui);
70  $ctrl->forwardCommand($gui);
71  }
72  break;
73 
74  case "ilcontskilladmingui":
75  if ($this->access->checkAccess("write", "", $this->ref_id) || $this->access->checkAccess("grade", "", $this->ref_id)) {
76  $gui = new ilContSkillAdminGUI($this->container_gui);
77  $ctrl->forwardCommand($gui);
78  }
79  break;
80 
81  default:
82  /*if (in_array($cmd, array("show")))
83  {
84  $this->$cmd();
85  }*/
86  }
87  }
88 
89  public function addTabs(): void
90  {
91  $tabs = $this->tabs;
92  $lng = $this->lng;
93  $ctrl = $this->ctrl;
94 
95  if ($this->access->checkAccess("read", "", $this->ref_id)) {
96  $tabs->addSubTab(
97  "mem_profiles",
98  $lng->txt("cont_skill_profiles"),
99  $ctrl->getLinkTargetByClass("ilContSkillPresentationGUI", "")
100  );
101  $tabs->addSubTab(
102  "mem_records",
103  $lng->txt("cont_skill_records"),
104  $ctrl->getLinkTargetByClass("ilContSkillPresentationGUI", "showRecords")
105  );
106  }
107 
108  if ($this->access->checkAccess("grade", "", $this->ref_id)) {
109  $tabs->addSubTab(
110  "members",
111  $lng->txt("cont_skill_members"),
112  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listMembers")
113  );
114  }
115 
116  if ($this->access->checkAccess("write", "", $this->ref_id)) {
117  $tabs->addSubTab(
118  "competences",
119  $lng->txt("cont_skill_assigned_comp"),
120  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listCompetences")
121  );
122 
123  if ($this->skmg_settings->getLocalAssignmentOfProfiles()
124  || $this->skmg_settings->getAllowLocalProfiles()) {
125  $tabs->addSubTab(
126  "profiles",
127  $lng->txt("cont_skill_assigned_profiles"),
128  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listProfiles")
129  );
130  }
131 
132  $tabs->addSubTab(
133  "settings",
134  $lng->txt("settings"),
135  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "settings")
136  );
137  }
138  }
139 }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
forwardCommand(object $a_gui_object)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
__construct(ilContainerGUI $a_container_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Skill presentation for container (course/group)
global $DIC
Definition: shib_login.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Container skills administration.
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
ilSkillManagementSettings $skmg_settings