ILIAS  release_8 Revision v8.24
class.ilSkillAssignedObjectsTableGUI.php
Go to the documentation of this file.
1<?php
2
26{
28 protected ilTree $tree;
29 protected \ILIAS\UI\Factory $ui_fac;
30 protected \ILIAS\UI\Renderer $ui_ren;
31
32 public function __construct($a_parent_obj, string $a_parent_cmd, array $a_ass_objects)
33 {
34 global $DIC;
35
36 $this->ctrl = $DIC->ctrl();
37 $this->lng = $DIC->language();
38 $this->access = $DIC->access();
39 $this->tree = $DIC->repositoryTree();
40 $this->ui_fac = $DIC->ui()->factory();
41 $this->ui_ren = $DIC->ui()->renderer();
42
43 parent::__construct($a_parent_obj, $a_parent_cmd);
44
45 $data = [];
46 foreach ($a_ass_objects as $obj) {
48 $data[] = array("obj_id" => $obj);
49 }
50 }
51
52 $this->setData($data);
53 $this->setTitle($this->lng->txt("skmg_assigned_objects"));
54
55 $this->addColumn($this->lng->txt("title"), "title");
56 $this->addColumn($this->lng->txt("path"), "path");
57
58 $this->setRowTemplate("tpl.skill_assigned_objects_row.html", "Services/Skill");
59 }
60
61 protected function fillRow(array $a_set): void
62 {
63 $obj_type = ilObject::_lookupType($a_set["obj_id"]);
64 $icon = $this->ui_fac->symbol()->icon()->standard(
65 $obj_type,
66 $this->lng->txt("icon") . " " . $this->lng->txt($obj_type),
67 "medium"
68 );
69 $this->tpl->setVariable(
70 "OBJECT_IMG",
71 $this->ui_ren->render($icon)
72 );
73 $this->tpl->setVariable("OBJECT_TITLE", ilObject::_lookupTitle($a_set["obj_id"]));
74
75 $obj_ref_id = ilObject::_getAllReferences($a_set["obj_id"]);
76 $obj_ref_id = end($obj_ref_id);
77 $obj_ref_id_parent = $this->tree->getParentId($obj_ref_id);
78
79 $path = new ilPathGUI();
80
81 $this->tpl->setVariable(
82 "PATH",
83 $path->getPath($this->tree->getParentId($obj_ref_id_parent), (int) $obj_ref_id)
84 );
85 }
86}
static _lookupType(int $id, bool $reference=false)
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
Creates a path for a start and endnode.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($a_parent_obj, string $a_parent_cmd, array $a_ass_objects)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$path
Definition: ltiservices.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc