ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilContSkillPresentationGUI.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 $tpl;
33 
37  protected $container_gui;
38 
42  protected $container;
43 
47  protected $user;
48 
54  public function __construct($a_container_gui)
55  {
56  global $DIC;
57 
58  $this->ctrl = $DIC->ctrl();
59  $this->tabs = $DIC->tabs();
60  $this->lng = $DIC->language();
61  $this->tpl = $DIC["tpl"];
62  $this->user = $DIC->user();
63 
64  $this->container_gui = $a_container_gui;
65  $this->container = $a_container_gui->object;
66 
67  include_once("./Services/Container/Skills/classes/class.ilContainerSkills.php");
68  $this->container_skills = new ilContainerSkills($this->container->getId());
69  }
70 
74  public function executeCommand()
75  {
78 
79  $tabs->activateSubTab("list");
80 
81  $next_class = $this->ctrl->getNextClass($this);
82  $cmd = $this->ctrl->getCmd("show");
83 
84  switch ($next_class) {
85  case "ilpersonalskillsgui":
86  $ctrl->forwardCommand($this->getPersonalSkillsGUI());
87  break;
88 
89  default:
90  if (in_array($cmd, array("show"))) {
91  $this->$cmd();
92  }
93  }
94  }
95 
101  protected function getPersonalSkillsGUI()
102  {
103  $lng = $this->lng;
104 
105  include_once("./Services/Skill/classes/class.ilPersonalSkillsGUI.php");
106  $gui = new ilPersonalSkillsGUI();
107  $gui->setGapAnalysisActualStatusModePerObject($this->container->getId());
108  $gui->setTriggerObjectsFilter($this->getSubtreeObjectIds());
109  $gui->setHistoryView(true); // NOT IMPLEMENTED YET
110  $skills = array_map(function ($v) {
111  return array(
112  "base_skill_id" => $v["skill_id"],
113  "tref_id" => $v["tref_id"]
114  );
115  }, $this->container_skills->getSkills());
116  $gui->setObjectSkills($this->container_skills->getId(), $skills);
117  return $gui;
118  }
119 
120 
121 
125  public function show()
126  {
127  $gui = $this->getPersonalSkillsGUI();
128  $gui->listProfilesForGap();
129  }
130 
131  protected function getSubtreeObjectIds()
132  {
133  global $DIC; /* @var ILIAS\DI\Container $DIC */
134 
135  $nodes = $DIC->repositoryTree()->getSubTree(
136  $DIC->repositoryTree()->getNodeData($this->container->getRefId())
137  );
138 
139  $objects = array();
140 
141  foreach ($nodes as $node) {
142  $objects[] = $node['obj_id'];
143  }
144 
145 
146  return $objects;
147  }
148 }
__construct($a_container_gui)
Constructor.
global $DIC
Definition: saml.php:7
Skills of a container.
user()
Definition: user.php:4
Personal skills GUI class.
Skill presentatio for container (course/group)
getPersonalSkillsGUI()
Get personal skills gui.