ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Skill\Table\AssignedObjectsTable Class Reference
+ Collaboration diagram for ILIAS\Skill\Table\AssignedObjectsTable:

Public Member Functions

 __construct (object $parent_obj, array $objects, int $skill_id=0, int $tref_id=0, int $profile_id=0)
 
 getComponent ()
 

Protected Member Functions

 getColumns ()
 
 getDataRetrieval ()
 

Protected Attributes

ilLanguage $lng
 
ilTree $tree
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
ServerRequestInterface $request
 
object $parent_obj
 
array $objects = []
 
int $skill_id = 0
 
int $tref_id = 0
 
int $profile_id = 0
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 30 of file class.AssignedObjectsTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Skill\Table\AssignedObjectsTable::__construct ( object  $parent_obj,
array  $objects,
int  $skill_id = 0,
int  $tref_id = 0,
int  $profile_id = 0 
)

Definition at line 43 of file class.AssignedObjectsTable.php.

49 {
50 global $DIC;
51
52 $this->lng = $DIC->language();
53 $this->tree = $DIC->repositoryTree();
54 $this->ui_fac = $DIC->ui()->factory();
55 $this->ui_ren = $DIC->ui()->renderer();
56 $this->request = $DIC->http()->request();
57
58 $this->parent_obj = $parent_obj;
59 $this->objects = $objects;
60 $this->skill_id = $skill_id;
61 $this->tref_id = $tref_id;
62 $this->profile_id = $profile_id;
63 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Skill\Table\AssignedObjectsTable\$objects, ILIAS\Skill\Table\AssignedObjectsTable\$parent_obj, ILIAS\Skill\Table\AssignedObjectsTable\$profile_id, ILIAS\Skill\Table\AssignedObjectsTable\$skill_id, ILIAS\Skill\Table\AssignedObjectsTable\$tref_id, and ILIAS\Repository\lng().

Referenced by ILIAS\Skill\Table\AssignedObjectsTable\getDataRetrieval().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ getColumns()

ILIAS\Skill\Table\AssignedObjectsTable::getColumns ( )
protected

Definition at line 84 of file class.AssignedObjectsTable.php.

84 : array
85 {
86 $columns = [
87 "type" => $this->ui_fac->table()->column()->statusIcon($this->lng->txt("type"))
88 ->withIsSortable(false),
89 "title" => $this->ui_fac->table()->column()->text($this->lng->txt("title")),
90 "path" => $this->ui_fac->table()->column()->text($this->lng->txt("path"))
91 ->withIsSortable(false)
92 ];
93
94 return $columns;
95 }

References ILIAS\Repository\lng().

Referenced by ILIAS\Skill\Table\AssignedObjectsTable\getComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponent()

ILIAS\Skill\Table\AssignedObjectsTable::getComponent ( )

Definition at line 65 of file class.AssignedObjectsTable.php.

65 : UI\Component\Table\Data
66 {
67 $columns = $this->getColumns();
68 $data_retrieval = $this->getDataRetrieval();
69
70 $table = $this->ui_fac->table()
71 ->data($data_retrieval, $this->lng->txt("skmg_assigned_objects"), $columns)
72 ->withId(
73 self::class . "_" .
74 $this->parent_obj::class . "_" .
75 $this->skill_id . "_" .
76 $this->tref_id . "_" .
77 $this->profile_id
78 )
79 ->withRequest($this->request);
80
81 return $table;
82 }

References ILIAS\Skill\Table\AssignedObjectsTable\getColumns(), ILIAS\Skill\Table\AssignedObjectsTable\getDataRetrieval(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getDataRetrieval()

ILIAS\Skill\Table\AssignedObjectsTable::getDataRetrieval ( )
protected

Definition at line 97 of file class.AssignedObjectsTable.php.

97 : UI\Component\Table\DataRetrieval
98 {
99 $data_retrieval = new class (
105 ) implements UI\Component\Table\DataRetrieval {
106 use TableRecords;
107
108 public function __construct(
109 protected \ilLanguage $lng,
110 protected UI\Factory $ui_fac,
111 protected UI\Renderer $ui_ren,
112 protected \ilTree $tree,
113 protected array $objects
114 ) {
115 }
116
117 public function getRows(
118 UI\Component\Table\DataRowBuilder $row_builder,
119 array $visible_column_ids,
120 Data\Range $range,
121 Data\Order $order,
122 ?array $filter_data,
123 ?array $additional_parameters
124 ): \Generator {
125 $records = $this->getRecords($range, $order);
126 foreach ($records as $idx => $record) {
127 $row_id = (string) $record["obj_id"];
128
129 yield $row_builder->buildDataRow($row_id, $record);
130 }
131 }
132
133 public function getTotalRowCount(
134 ?array $filter_data,
135 ?array $additional_parameters
136 ): ?int {
137 return count($this->getRecords());
138 }
139
140 protected function getRecords(?Data\Range $range = null, ?Data\Order $order = null): array
141 {
142 $records = [];
143 $i = 0;
144 foreach ($this->objects as $obj_id) {
145 $obj_ref_id = \ilObject::_getAllReferences($obj_id);
146 $obj_ref_id = end($obj_ref_id);
147
148 if (!$obj_ref_id) {
149 continue;
150 }
151
152 $records[$i]["obj_id"] = $obj_id;
153 $records[$i]["title"] = \ilObject::_lookupTitle($obj_id);
154
155 $obj_type = \ilObject::_lookupType($obj_id);
156 $icon = $this->ui_fac->symbol()->icon()->standard(
157 $obj_type,
158 $this->lng->txt("icon") . " " . $this->lng->txt($obj_type),
159 "medium"
160 );
161 $records[$i]["type"] = $icon;
162
163 $obj_ref_id_parent = $this->tree->getParentId($obj_ref_id);
164 $path = new \ilPathGUI();
165 $records[$i]["path"] = $path->getPath($this->tree->getParentId($obj_ref_id_parent), $obj_ref_id);
166
167 $i++;
168 }
169
170 if ($order) {
171 $records = $this->orderRecords($records, $order);
172 }
173
174 if ($range) {
175 $records = $this->limitRecords($records, $range);
176 }
177
178 return $records;
179 }
180 };
181
182 return $data_retrieval;
183 }
__construct(object $parent_obj, array $objects, int $skill_id=0, int $tref_id=0, int $profile_id=0)
language handling
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$path
Definition: ltiservices.php:30

References ILIAS\Skill\Table\AssignedObjectsTable\$lng, ILIAS\Skill\Table\AssignedObjectsTable\$objects, $path, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\Skill\Table\AssignedObjectsTable\$tree, ILIAS\Skill\Table\AssignedObjectsTable\$ui_fac, ILIAS\Skill\Table\AssignedObjectsTable\$ui_ren, ILIAS\Skill\Table\AssignedObjectsTable\__construct(), ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilObject\_lookupType(), and ILIAS\Repository\lng().

Referenced by ILIAS\Skill\Table\AssignedObjectsTable\getComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\Skill\Table\AssignedObjectsTable::$lng
protected

◆ $objects

array ILIAS\Skill\Table\AssignedObjectsTable::$objects = []
protected

◆ $parent_obj

object ILIAS\Skill\Table\AssignedObjectsTable::$parent_obj
protected

◆ $profile_id

int ILIAS\Skill\Table\AssignedObjectsTable::$profile_id = 0
protected

◆ $request

ServerRequestInterface ILIAS\Skill\Table\AssignedObjectsTable::$request
protected

Definition at line 36 of file class.AssignedObjectsTable.php.

◆ $skill_id

int ILIAS\Skill\Table\AssignedObjectsTable::$skill_id = 0
protected

◆ $tree

ilTree ILIAS\Skill\Table\AssignedObjectsTable::$tree
protected

◆ $tref_id

int ILIAS\Skill\Table\AssignedObjectsTable::$tref_id = 0
protected

◆ $ui_fac

UI Factory ILIAS\Skill\Table\AssignedObjectsTable::$ui_fac
protected

◆ $ui_ren

UI Renderer ILIAS\Skill\Table\AssignedObjectsTable::$ui_ren
protected

The documentation for this class was generated from the following file: