ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSkillTreeAdminGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21// only after ilCtrl is able to handle namespaces
22//namespace ILIAS\Skill\Tree;
30use Psr\Http\Message\RequestInterface;
31
39{
40 protected ilCtrl $ctrl;
43 protected ilLanguage $lng;
44 protected \ILIAS\UI\Factory $ui_fac;
45 protected \ILIAS\UI\Renderer $ui_ren;
46 protected \ILIAS\Data\Factory $df;
47 protected RequestInterface $request;
48 protected int $requested_ref_id = 0;
49 protected ilTabsGUI $tabs;
55 protected Table\TableManager $table_manager;
56
58 {
59 global $DIC;
60
61 $this->toolbar = $DIC->toolbar();
62 $this->ctrl = $DIC->ctrl();
63 $this->main_tpl = $DIC->ui()->mainTemplate();
64 $this->lng = $DIC->language();
65 $this->ui_fac = $DIC->ui()->factory();
66 $this->ui_ren = $DIC->ui()->renderer();
67 $this->df = new \ILIAS\Data\Factory();
68 $this->request = $DIC->http()->request();
69 $this->tabs = $DIC->tabs();
70 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
71
72 $this->requested_ref_id = $this->admin_gui_request->getRefId();
73
74 $this->skill_manager = $skill_manager;
75 $this->skill_tree_manager = $this->skill_manager->getTreeManager();
76 $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
77 $this->skill_management_access_manager = $this->skill_manager->getManagementAccessManager($this->requested_ref_id);
78 $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
79 }
80
81 public function executeCommand(): void
82 {
84
85 $next_class = $ctrl->getNextClass($this);
86 $cmd = $ctrl->getCmd("listTrees");
87
88 switch ($next_class) {
89 case "ilobjskilltreegui":
90 $this->tabs->clearTargets();
91 $gui = new ilObjSkillTreeGUI([], $this->requested_ref_id, true, false);
92 $gui->init($this->skill_manager);
93 $ctrl->forwardCommand($gui);
94 break;
95
96 default:
97 if (in_array($cmd, ["listTrees", "createSkillTree", "updateTree", "createTree"])) {
98 $this->$cmd();
99 }
100 }
101 }
102
103 protected function listTrees(): void
104 {
105 $mtpl = $this->main_tpl;
109
110 $add_tree_button = $this->ui_fac->button()->standard(
111 $lng->txt("skmg_add_skill_tree"),
112 $ctrl->getLinkTargetByClass("ilobjskilltreegui", "create")
113 );
114
115 if ($this->skill_management_access_manager->hasCreateTreePermission()) {
116 $toolbar->addComponent($add_tree_button);
117 }
118
119 $table = $this->table_manager->getTreeTable($this->requested_ref_id)->getComponent();
120
121 $mtpl->setContent($this->ui_ren->render($table));
122 }
123}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
Request wrapper for guis in skill administration.
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
language handling
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...
Skill tree gui class.
Skill tree administration.
Tree SkillTreeManager $skill_tree_manager
SkillAdminGUIRequest $admin_gui_request
Tree SkillTreeFactory $skill_tree_factory
ilGlobalTemplateInterface $main_tpl
Table TableManager $table_manager
SkillManagementAccess $skill_management_access_manager
SkillInternalManagerService $skill_manager
__construct(SkillInternalManagerService $skill_manager)
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...
addComponent(\ILIAS\UI\Component\Component $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
global $DIC
Definition: shib_login.php:26