ILIAS  release_8 Revision v8.24
class.ilContSkillPresentationGUI.php
Go to the documentation of this file.
1<?php
2
27{
28 protected ilCtrl $ctrl;
29 protected ilTabsGUI $tabs;
30 protected ilLanguage $lng;
34 protected ilObjUser $user;
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->tpl = $DIC["tpl"];
48 $this->user = $DIC->user();
49
50 $this->container_gui = $a_container_gui;
51 /* @var $obj ilContainer */
52 $obj = $this->container_gui->getObject();
53 $this->container = $obj;
54
55 $this->container_skills = new ilContainerSkills($this->container->getId());
56 $this->container_global_profiles = new ilContainerGlobalProfiles($this->container->getId());
57 $this->container_local_profiles = new ilContainerLocalProfiles($this->container->getId());
58
59 $this->container_skill_collector = new ilContSkillCollector(
60 $this->container_skills,
61 $this->container_global_profiles,
62 $this->container_local_profiles
63 );
64 }
65
66 public function executeCommand(): void
67 {
70
71 $tabs->activateSubTab("list");
72
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd("show");
75 $this->setPermanentLink();
76
77 switch ($next_class) {
78 case "ilpersonalskillsgui":
80 break;
81
82 default:
83 if ($cmd === "show") {
84 $this->$cmd();
85 }
86 }
87 }
88
89 protected function setPermanentLink(): void
90 {
91 $type = $this->container->getType();
92 $ref_id = $this->container->getRefId();
93 $this->tpl->setPermanentLink($type, 0, $ref_id . "_comp", "", "");
94 }
95
97 {
99
100 $gui = new ilPersonalSkillsGUI();
101 $gui->setGapAnalysisActualStatusModePerObject($this->container->getId());
102 $gui->setTriggerObjectsFilter($this->getSubtreeObjectIds());
103 $gui->setHistoryView(true); // NOT IMPLEMENTED YET
104 $skills = $this->container_skill_collector->getSkillsForPresentationGUI();
105 $gui->setObjectSkills($this->container_skills->getId(), $skills);
106 $gui->setObjectSkillProfiles($this->container_global_profiles, $this->container_local_profiles);
107 return $gui;
108 }
109
110 public function show(): void
111 {
112 $gui = $this->getPersonalSkillsGUI();
113 $gui->listProfilesForGap();
114 }
115
116 protected function getSubtreeObjectIds(): array
117 {
118 global $DIC; /* @var ILIAS\DI\Container $DIC */
119
120 $nodes = $DIC->repositoryTree()->getSubTree(
121 $DIC->repositoryTree()->getNodeData($this->container->getRefId())
122 );
123
124 $objects = [];
125
126 foreach ($nodes as $node) {
127 $objects[] = $node['obj_id'];
128 }
129
130 return $objects;
131 }
132
133 public static function isAccessible(int $ref_id): bool
134 {
135 global $DIC;
136
137 $access = $DIC->access();
138
140 if ($access->checkAccess('read', '', $ref_id) && ilContainer::_lookupContainerSetting(
141 $obj_id,
143 '0'
144 )) {
145 $skmg_set = new ilSetting("skmg");
146 if ($skmg_set->get("enable_skmg")) {
147 return true;
148 }
149 }
150 return false;
151 }
152}
Collector of skills for a container.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilContainerGUI $a_container_gui)
ilContainerGlobalProfiles $container_global_profiles
ilContainerLocalProfiles $container_local_profiles
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Skills of a container.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
Class ilCtrl provides processing control methods.
forwardCommand(object $a_gui_object)
@inheritDoc
language handling
User class.
static _lookupObjId(int $ref_id)
Personal skills GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateSubTab(string $a_id)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
$type