19 declare(strict_types=1);
36 protected \ilLanguage
$lng;
39 protected Data\Factory
$df;
49 $this->
ctrl = $DIC->ctrl();
50 $this->
lng = $DIC->language();
51 $this->ui_fac = $DIC->ui()->factory();
52 $this->request = $DIC->http()->request();
53 $this->df =
new Data\Factory();
54 $this->skill_manager = $DIC->skills()->internal()->manager();
55 $this->skill_management_access_manager = $this->skill_manager->getManagementAccessManager($ref_id);
56 $this->skill_tree_manager = $this->skill_manager->getTreeManager();
57 $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
64 $data_retrieval = $this->getDataRetrieval();
66 $table = $this->ui_fac->table()
67 ->data($data_retrieval, $this->
lng->txt(
"skmg_skill_trees"), $columns)
69 ->withActions($actions)
70 ->withRequest($this->request);
78 "title" => $this->ui_fac->table()->column()->link($this->
lng->txt(
"title"))
86 $query_params_namespace = [
"skl_tree_table"];
88 $uri_delete = $this->df->uri(
89 ILIAS_HTTP_PATH .
"/" . $this->
ctrl->getLinkTargetByClass(
"ilobjskilltreegui",
"delete")
91 $url_builder_delete =
new UI\URLBuilder($uri_delete);
92 list($url_builder_delete, $action_parameter_token_delete, $row_id_token_delete) =
93 $url_builder_delete->acquireParameters(
94 $query_params_namespace,
100 if ($this->skill_management_access_manager->hasCreateTreePermission()) {
101 $actions[
"delete"] = $this->ui_fac->table()->action()->multi(
102 $this->
lng->txt(
"delete"),
103 $url_builder_delete->withParameter($action_parameter_token_delete,
"deleteTrees"),
111 protected function getDataRetrieval(): UI\Component\Table\DataRetrieval
113 $data_retrieval =
new class (
123 protected Service\SkillInternalManagerService $skill_manager,
124 protected Tree\SkillTreeManager $skill_tree_manager,
125 protected Tree\SkillTreeFactory $skill_tree_factory,
131 public function getRows(
133 array $visible_column_ids,
137 ?array $additional_parameters
139 $records = $this->getRecords($range, $order);
140 foreach ($records as $idx => $record) {
141 $row_id = (string) $record[
"tree_id"];
143 yield $row_builder->buildDataRow($row_id, $record);
147 public function getTotalRowCount(
149 ?array $additional_parameters
151 return count($this->getRecords());
158 $tree_access_manager = $this->skill_manager->getTreeAccessManager($skillTree->
getRefId());
159 if ($tree_access_manager->hasVisibleTreePermission()) {
166 iterator_to_array($this->skill_tree_manager->getTrees())
171 foreach ($items as $item) {
173 $tree_obj = $item[
"tree"];
174 $tree = $this->skill_tree_factory->getTreeById($tree_obj->getId());
175 $records[$i][
"tree_id"] = $tree->readRootId();
176 $this->
ctrl->setParameterByClass(
"ilobjskilltreegui",
"ref_id", $tree_obj->getRefId());
177 $records[$i][
"title"] = $this->ui_fac->link()->standard(
178 $tree_obj->getTitle(),
179 $this->
ctrl->getLinkTargetByClass(
"ilobjskilltreegui",
"editSkills")
181 $this->
ctrl->clearParameterByClass(
"ilobjskilltreegui",
"ref_id");
186 $records = $this->orderRecords($records, $order);
190 $records = $this->limitRecords($records, $range);
197 return $data_retrieval;
Skill tree object in skill management (repository object class)
Both the subject and the direction need to be specified when expressing an order. ...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Service SkillInternalManagerService $skill_manager
This is how the factory for UI elements looks.
Tree SkillTreeManager $skill_tree_manager
Access SkillManagementAccess $skill_management_access_manager
ServerRequestInterface $request
Tree SkillTreeFactory $skill_tree_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A simple class to express a naive range of whole positive numbers.