ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilContainerSkillGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
17  protected $ctrl;
18 
22  protected $tabs;
23 
27  protected $lng;
28 
32  protected $container_gui;
33 
34 
38  protected $container;
39 
43  protected $access;
44 
48  protected $skmg_settings;
49 
55  public function __construct($a_container_gui)
56  {
57  global $DIC;
58 
59  $this->ctrl = $DIC->ctrl();
60  $this->tabs = $DIC->tabs();
61  $this->lng = $DIC->language();
62  $this->access = $DIC->access();
63 
64  $this->container_gui = $a_container_gui;
65  $this->container = $a_container_gui->object;
66  $this->ref_id = $this->container->getRefId();
67  $this->skmg_settings = new ilSkillManagementSettings();
68  }
69 
73  public function executeCommand()
74  {
76 
77  $next_class = $this->ctrl->getNextClass($this);
78  $cmd = $this->ctrl->getCmd("show");
79 
80  $this->addTabs();
81 
82  switch ($next_class) {
83  case "ilcontskillpresentationgui":
84  if ($this->access->checkAccess("read", "", $this->ref_id)) {
85  include_once("./Services/Container/Skills/classes/class.ilContSkillPresentationGUI.php");
86  $gui = new ilContSkillPresentationGUI($this->container_gui);
87  $ctrl->forwardCommand($gui);
88  }
89  break;
90 
91  case "ilcontskilladmingui":
92  if ($this->access->checkAccess("write", "", $this->ref_id) || $this->access->checkAccess("grade", "", $this->ref_id)) {
93  include_once("./Services/Container/Skills/classes/class.ilContSkillAdminGUI.php");
94  $gui = new ilContSkillAdminGUI($this->container_gui);
95  $ctrl->forwardCommand($gui);
96  }
97  break;
98 
99  default:
100  /*if (in_array($cmd, array("show")))
101  {
102  $this->$cmd();
103  }*/
104  }
105  }
106 
112  public function addTabs()
113  {
114  $tabs = $this->tabs;
115  $lng = $this->lng;
116  $ctrl = $this->ctrl;
117 
118  if ($this->access->checkAccess("read", "", $this->ref_id)) {
119  $tabs->addSubTab(
120  "list",
121  $lng->txt("cont_skill_show"),
122  $ctrl->getLinkTargetByClass("ilContSkillPresentationGUI", "")
123  );
124  }
125 
126  if ($this->access->checkAccess("grade", "", $this->ref_id)) {
127  $tabs->addSubTab(
128  "members",
129  $lng->txt("cont_skill_members"),
130  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listMembers")
131  );
132  }
133 
134  if ($this->access->checkAccess("write", "", $this->ref_id)) {
135  $tabs->addSubTab(
136  "competences",
137  $lng->txt("cont_skill_assigned_comp"),
138  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listCompetences")
139  );
140 
141  if ($this->skmg_settings->getLocalAssignmentOfProfiles()
142  || $this->skmg_settings->getAllowLocalProfiles()) {
143  $tabs->addSubTab(
144  "profiles",
145  $lng->txt("cont_skill_assigned_profiles"),
146  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "listProfiles")
147  );
148  }
149 
150  $tabs->addSubTab(
151  "settings",
152  $lng->txt("settings"),
153  $ctrl->getLinkTargetByClass("ilContSkillAdminGUI", "settings")
154  );
155  }
156  }
157 }
executeCommand()
Execute command.
Skills for container (course/group) (top gui class)
__construct($a_container_gui)
Constructor.
Skill presentatio for container (course/group)
global $DIC
Definition: goto.php:24
Container skills administration.