ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 str_replace('\\', '', 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 mixed $additional_viewcontrol_data,
123 mixed $filter_data,
124 mixed $additional_parameters
125 ): \Generator {
126 $records = $this->getRecords($range, $order);
127 foreach ($records as $idx => $record) {
128 $row_id = (string) $record["obj_id"];
129
130 yield $row_builder->buildDataRow($row_id, $record);
131 }
132 }
133
134 public function getTotalRowCount(
135 mixed $additional_viewcontrol_data,
136 mixed $filter_data,
137 mixed $additional_parameters
138 ): ?int {
139 return count($this->getRecords());
140 }
141
142 protected function getRecords(?Data\Range $range = null, ?Data\Order $order = null): array
143 {
144 $records = [];
145 $i = 0;
146 foreach ($this->objects as $obj_id) {
147 $obj_ref_id = \ilObject::_getAllReferences($obj_id);
148 $obj_ref_id = end($obj_ref_id);
149
150 if (!$obj_ref_id) {
151 continue;
152 }
153
154 $records[$i]["obj_id"] = $obj_id;
155 $records[$i]["title"] = \ilObject::_lookupTitle($obj_id);
156
157 $obj_type = \ilObject::_lookupType($obj_id);
158 $icon = $this->ui_fac->symbol()->icon()->standard(
159 $obj_type,
160 $this->lng->txt("icon") . " " . $this->lng->txt($obj_type),
161 "medium"
162 );
163 $records[$i]["type"] = $icon;
164
165 $obj_ref_id_parent = $this->tree->getParentId($obj_ref_id);
166 $path = new \ilPathGUI();
167 $records[$i]["path"] = $path->getPath($this->tree->getParentId($obj_ref_id_parent), $obj_ref_id);
168
169 $i++;
170 }
171
172 if ($order) {
173 $records = $this->orderRecords($records, $order);
174 }
175
176 if ($range) {
177 $records = $this->limitRecords($records, $range);
178 }
179
180 return $records;
181 }
182 };
183
184 return $data_retrieval;
185 }
__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['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'vtt', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Skill\Table\AssignedObjectsTable\$lng, ILIAS\Skill\Table\AssignedObjectsTable\$objects, 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: