ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilContainerSkillGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
30  protected ilCtrl $ctrl;
31  protected ilTabsGUI $tabs;
32  protected ilLanguage $lng;
37  protected int $ref_id = 0;
38 
39  public function __construct(ilContainerGUI $a_container_gui)
40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->tabs = $DIC->tabs();
45  $this->lng = $DIC->language();
46  $this->access = $DIC->access();
47 
48  $this->container_gui = $a_container_gui;
49  /* @var $obj ilContainer */
50  $obj = $this->container_gui->getObject();
51  $this->container = $obj;
52  $this->ref_id = $this->container->getRefId();
53  $this->skmg_settings = new ilSkillManagementSettings();
54  }
55 
56  public function executeCommand(): void
57  {
58  $ctrl = $this->ctrl;
59 
60  $next_class = $this->ctrl->getNextClass($this);
61  $cmd = $this->ctrl->getCmd("showProfiles");
62 
63  $this->addTabs();
64 
65  switch ($next_class) {
66  case "ilcontskillpresentationgui":
67  if ($this->access->checkAccess("read", "", $this->ref_id)) {
68  $gui = new ilContSkillPresentationGUI($this->container_gui);
69  $ctrl->forwardCommand($gui);
70  }
71  break;
72 
73  case "ilcontskilladmingui":
74  if ($this->access->checkAccess("write", "", $this->ref_id) || $this->access->checkAccess("grade", "", $this->ref_id)) {
75  $gui = new ilContSkillAdminGUI($this->container_gui);
76  $ctrl->forwardCommand($gui);
77  }
78  break;
79 
80  default:
81  /*if (in_array($cmd, array("show")))
82  {
83  $this->$cmd();
84  }*/
85  }
86  }
87 
88  public function addTabs(): void
89  {
90  $tabs = $this->tabs;
91  $lng = $this->lng;
92  $ctrl = $this->ctrl;
93 
94  if ($this->access->checkAccess("read", "", $this->ref_id)) {
95  $tabs->addSubTab(
96  "mem_profiles",
97  $lng->txt("cont_skill_profiles"),
98  $ctrl->getLinkTargetByClass("ilContSkillPresentationGUI", "")
99  );
100  $tabs->addSubTab(
101  "mem_records",
102  $lng->txt("cont_skill_records"),
103  $ctrl->getLinkTargetByClass("ilContSkillPresentationGUI", "showRecords")
104  );
105  }
106 
107  if ($this->access->checkAccess("grade", "", $this->ref_id)) {
108  $tabs->addSubTab(
109  "members",
110  $lng->txt("cont_skill_members"),
111  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listMembers")
112  );
113  }
114 
115  if ($this->access->checkAccess("write", "", $this->ref_id)) {
116  $tabs->addSubTab(
117  "competences",
118  $lng->txt("cont_skill_assigned_comp"),
119  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listCompetences")
120  );
121 
122  if ($this->skmg_settings->getLocalAssignmentOfProfiles()
123  || $this->skmg_settings->getAllowLocalProfiles()) {
124  $tabs->addSubTab(
125  "profiles",
126  $lng->txt("cont_skill_assigned_profiles"),
127  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listProfiles")
128  );
129  }
130 
131  $tabs->addSubTab(
132  "settings",
133  $lng->txt("settings"),
134  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "settings")
135  );
136  }
137  }
138 }
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...
forwardCommand(object $a_gui_object)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
__construct(ilContainerGUI $a_container_gui)
Skills for container (course/group) (top gui class)
Skill presentation for container (course/group)
global $DIC
Definition: shib_login.php:22
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
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)