ILIAS  release_8 Revision v8.24
class.ilSkillTreeAdminGUI.php
Go to the documentation of this file.
1<?php
2
20// only after ilCtrl is able to handle namespaces
21//namespace ILIAS\Skill\Tree;
22
29use Psr\Http\Message\RequestInterface;
30
38{
39 protected ilCtrl $ctrl;
42 protected UIServices $ui;
43 protected ilLanguage $lng;
44 protected RequestInterface $request;
45 protected int $requested_ref_id = 0;
46 protected ilTabsGUI $tabs;
51
53 {
54 global $DIC;
55
56 $this->toolbar = $DIC->toolbar();
57 $this->ui = $DIC->ui();
58 $this->ctrl = $DIC->ctrl();
59 $this->main_tpl = $DIC->ui()->mainTemplate();
60 $this->lng = $DIC->language();
61 $this->request = $DIC->http()->request();
62 $this->tabs = $DIC->tabs();
63 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
64
65 $this->requested_ref_id = $this->admin_gui_request->getRefId();
66
67 $this->skill_manager = $skill_manager;
68 $this->skill_tree_manager = $this->skill_manager->getTreeManager();
69 $this->skill_management_access_manager = $this->skill_manager->getManagementAccessManager($this->requested_ref_id);
70 }
71
72 public function executeCommand(): void
73 {
75
76 $next_class = $ctrl->getNextClass($this);
77 $cmd = $ctrl->getCmd("listTrees");
78
79 switch ($next_class) {
80
81 case "ilobjskilltreegui":
82 $this->tabs->clearTargets();
83 $gui = new ilObjSkillTreeGUI([], $this->requested_ref_id, true, false);
84 $gui->init($this->skill_manager);
85 $ctrl->forwardCommand($gui);
86 break;
87
88 default:
89 if (in_array($cmd, ["listTrees", "createSkillTree", "updateTree", "createTree"])) {
90 $this->$cmd();
91 }
92 }
93 }
94
95 protected function listTrees(): void
96 {
97 $mtpl = $this->main_tpl;
99 $ui = $this->ui;
102
103 $add_tree_button = $ui->factory()->button()->standard(
104 $lng->txt("skmg_add_skill_tree"),
105 $ctrl->getLinkTargetByClass("ilobjskilltreegui", "create")
106 );
107
108 if ($this->skill_management_access_manager->hasCreateTreePermission()) {
109 $toolbar->addComponent($add_tree_button);
110 }
111
112 $tab = new Tree\SkillTreeTableGUI($this, "listTrees", $this->skill_manager);
113 $mtpl->setContent($tab->getHTML());
114 }
115}
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
factory()
Get the factory that crafts UI components.
Definition: UIServices.php:35
Request wrapper for guis in skill administration.
Class ilCtrl provides processing control methods.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc
forwardCommand(object $a_gui_object)
@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
ilGlobalTemplateInterface $main_tpl
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)
global $DIC
Definition: feed.php:28
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21