19 declare(strict_types=1);
51 int $a_mode = self::MODE_SCAT,
56 $this->
ctrl = $DIC->ctrl();
57 $this->
lng = $DIC->language();
58 $this->
access = $DIC->access();
59 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
60 $this->ui_fac = $DIC->ui()->factory();
61 $this->ui_ren = $DIC->ui()->renderer();
63 $ilCtrl = $DIC->ctrl();
64 $lng = $DIC->language();
66 $this->tref_id = $a_tref_id;
67 $ilCtrl->setParameter($a_parent_obj,
"tmpmode", $a_mode);
69 $this->requested_node_id = $this->admin_gui_request->getNodeId();
70 $this->requested_tref_id = $this->admin_gui_request->getTrefId();
71 $this->requested_ref_id = $this->admin_gui_request->getRefId();
73 $this->mode = $a_mode;
74 $this->skill_tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_obj_id);
75 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
79 if ($this->mode == self::MODE_SCAT) {
80 $this->manage_perm = $this->tree_access_manager->hasManageCompetencesPermission();
81 $childs = $this->skill_tree->getChildsByTypeFilter(
83 array(
"skrt",
"skll",
"scat",
"sktr")
87 } elseif ($this->mode == self::MODE_SCTP) {
88 $this->manage_perm = $this->tree_access_manager->hasManageCompetenceTemplatesPermission();
89 $childs = $this->skill_tree->getChildsByTypeFilter(
91 array(
"skrt",
"sktp",
"sctp")
99 if ($this->tref_id == 0 && $this->manage_perm) {
103 if ($this->tref_id == 0) {
104 $this->
addColumn($this->
lng->txt(
"skmg_order"),
"",
"1px");
109 $this->
setRowTemplate(
"tpl.skill_cat_row.html",
"components/ILIAS/Skill");
111 if ($this->tref_id == 0 && $this->manage_perm) {
115 if ($a_mode == self::MODE_SCAT) {
122 protected function fillRow(array $a_set): void
128 switch ($a_set[
"type"]) {
132 $ret = $ilCtrl->getLinkTargetByClass(
"ilskillcategorygui",
"listItems");
133 $ilCtrl->setParameterByClass(
"ilskillcategorygui",
"node_id", $this->requested_node_id);
139 $ilCtrl->setParameterByClass(
"ilskilltemplatereferencegui",
"tref_id", $a_set[
"child"]);
140 $ilCtrl->setParameterByClass(
"ilskilltemplatereferencegui",
"node_id", $tid);
141 $ret = $ilCtrl->getLinkTargetByClass(
"ilskilltemplatereferencegui",
"listItems");
142 $ilCtrl->setParameterByClass(
"ilskilltemplatereferencegui",
"node_id", $this->requested_node_id);
143 $ilCtrl->setParameterByClass(
"ilskilltemplatereferencegui",
"tref_id", $this->requested_tref_id);
148 $ilCtrl->setParameterByClass(
"ilbasicskillgui",
"node_id", $a_set[
"child"]);
149 $ret = $ilCtrl->getLinkTargetByClass(
"ilbasicskillgui",
"edit");
150 $ilCtrl->setParameterByClass(
"ilbasicskillgui",
"node_id", $this->requested_node_id);
157 $ilCtrl->setParameterByClass(
"ilbasicskilltemplategui",
"node_id", $a_set[
"child"]);
158 $ret = $ilCtrl->getLinkTargetByClass(
"ilbasicskilltemplategui",
"edit");
159 $ilCtrl->setParameterByClass(
"ilbasicskilltemplategui",
"node_id", $this->requested_node_id);
164 $ilCtrl->setParameterByClass(
"ilskilltemplatecategorygui",
"node_id", $a_set[
"child"]);
165 $ret = $ilCtrl->getLinkTargetByClass(
"ilskilltemplatecategorygui",
"listItems");
166 $ilCtrl->setParameterByClass(
"ilskilltemplatecategorygui",
"node_id", $this->requested_node_id);
170 if ($this->tref_id == 0) {
171 if ($this->manage_perm) {
172 $this->tpl->setCurrentBlock(
"cb");
173 $this->tpl->setVariable(
"CB_ID", $a_set[
"child"]);
174 $this->tpl->parseCurrentBlock();
177 $this->tpl->setCurrentBlock(
"nr");
178 $this->tpl->setVariable(
"OBJ_ID", $a_set[
"child"]);
179 $this->tpl->setVariable(
"ORDER_NR", $a_set[
"order_nr"]);
180 if (!$this->manage_perm) {
181 $this->tpl->touchBlock(
"disabled");
183 $this->tpl->parseCurrentBlock();
186 $this->tpl->setVariable(
"HREF_TITLE", $ret);
188 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
190 (
int) $a_set[
"child"],
195 $icon = $this->ui_fac->symbol()->icon()->custom(
200 $this->tpl->setVariable(
"ICON", $this->ui_ren->render(
$icon));
static _lookupTemplateId(int $a_obj_id)
static _lookupStatus(int $a_obj_id)
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
Request wrapper for guis in skill administration.
__construct( $a_parent_obj, string $a_parent_cmd, int $a_obj_id, int $a_mode=self::MODE_SCAT, int $a_tref_id=0)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
ILIAS UI Renderer $ui_ren
SkillTreeAccess $tree_access_manager
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
SkillAdminGUIRequest $admin_gui_request
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
addMultiCommand(string $a_cmd, string $a_text)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)