ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Skill\Table\ProfileTable Class Reference
+ Collaboration diagram for ILIAS\Skill\Table\ProfileTable:

Public Member Functions

 __construct (int $ref_id, int $skill_tree_id)
 
 getComponent ()
 

Protected Member Functions

 getColumns ()
 
 getActions ()
 
 getDataRetrieval ()
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
ServerRequestInterface $request
 
ArrayBasedRequestWrapper $query
 
Data Factory $df
 
Access SkillTreeAccess $tree_access_manager
 
Profile SkillProfileManager $profile_manager
 
Service SkillAdminGUIRequest $admin_gui_request
 
string $requested_table_profile_action = ""
 
array $requested_table_profile_ids = []
 
int $skill_tree_id = 0
 

Detailed Description

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

Definition at line 34 of file class.ProfileTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Skill\Table\ProfileTable::__construct ( int  $ref_id,
int  $skill_tree_id 
)

Definition at line 54 of file class.ProfileTable.php.

55 {
56 global $DIC;
57
58 $this->ctrl = $DIC->ctrl();
59 $this->lng = $DIC->language();
60 $this->ui_fac = $DIC->ui()->factory();
61 $this->ui_ren = $DIC->ui()->renderer();
62 $this->request = $DIC->http()->request();
63 $this->query = $DIC->http()->wrapper()->query();
64 $this->df = new Data\Factory();
65 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($ref_id);
66 $this->profile_manager = $DIC->skills()->internal()->manager()->getProfileManager();
67 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
68 $this->requested_table_profile_action = $this->admin_gui_request->getTableProfileAction();
69 $this->requested_table_profile_ids = $this->admin_gui_request->getTableProfileIds();
70 $this->skill_tree_id = $skill_tree_id;
71 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Skill\Table\ProfileTable\$skill_tree_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

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

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

Member Function Documentation

◆ getActions()

ILIAS\Skill\Table\ProfileTable::getActions ( )
protected

Definition at line 139 of file class.ProfileTable.php.

139 : array
140 {
141 $query_params_namespace = ["skl_profile_table"];
142
143 $url_builder_delete = new UI\URLBuilder($this->df->uri($this->request->getUri()->__toString()));
144 list($url_builder_delete, $action_parameter_token_delete, $row_id_token_delete) =
145 $url_builder_delete->acquireParameters(
146 $query_params_namespace,
147 "action",
148 "profile_ids"
149 );
150
151 $uri_export = $this->df->uri(
152 ILIAS_HTTP_PATH . "/" . $this->ctrl->getLinkTargetByClass("ilskillprofilegui", "exportProfiles")
153 );
154 $url_builder_export = new UI\URLBuilder($uri_export);
155 list($url_builder_export, $action_parameter_token_export, $row_id_token_export) =
156 $url_builder_export->acquireParameters(
157 $query_params_namespace,
158 "action",
159 "profile_ids"
160 );
161
162 $actions = [];
163 if ($this->tree_access_manager->hasManageProfilesPermission()) {
164 $actions["delete"] = $this->ui_fac->table()->action()->multi(
165 $this->lng->txt("delete"),
166 $url_builder_delete->withParameter($action_parameter_token_delete, "deleteProfiles"),
167 $row_id_token_delete
168 )
169 ->withAsync();
170 $actions["export"] = $this->ui_fac->table()->action()->multi(
171 $this->lng->txt("export"),
172 $url_builder_export->withParameter($action_parameter_token_export, "exportProfiles"),
173 $row_id_token_export
174 );
175 }
176
177 return $actions;
178 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

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

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

◆ getColumns()

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

Definition at line 123 of file class.ProfileTable.php.

123 : array
124 {
125 $columns = [
126 "title" => $this->ui_fac->table()->column()->link($this->lng->txt("title"))
127 ->withIsSortable(true),
128 "context" => $this->ui_fac->table()->column()->text($this->lng->txt("context"))
129 ->withIsSortable(false),
130 "users" => $this->ui_fac->table()->column()->text($this->lng->txt("users"))
131 ->withIsSortable(false),
132 "roles" => $this->ui_fac->table()->column()->text($this->lng->txt("roles"))
133 ->withIsSortable(false),
134 ];
135
136 return $columns;
137 }

References ILIAS\Repository\lng().

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

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

◆ getComponent()

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

Definition at line 73 of file class.ProfileTable.php.

73 : UI\Component\Table\Data
74 {
75 $columns = $this->getColumns();
76 $actions = $this->getActions();
77 $data_retrieval = $this->getDataRetrieval();
78
79 if ($this->requested_table_profile_action === "deleteProfiles") {
80 $items = [];
81 foreach ($this->requested_table_profile_ids as $id) {
82 if ($id === "ALL_OBJECTS") {
83 $profiles = $this->skill_tree_id
84 ? $this->profile_manager->getProfilesForSkillTree($this->skill_tree_id)
85 : $this->profile_manager->getProfilesForAllSkillTrees();
86 foreach ($profiles as $profile) {
87 $items[] = $this->ui_fac->modal()->interruptiveItem()->standard(
88 (string) $profile->getId(),
89 $profile->getTitle()
90 );
91 }
92 } else {
93 $items[] = $this->ui_fac->modal()->interruptiveItem()->standard(
94 $id,
95 $this->profile_manager->lookupTitle((int) $id)
96 );
97 }
98 }
99 echo($this->ui_ren->renderAsync([
100 $this->ui_fac->modal()->interruptive(
101 "",
102 empty($items) ? $this->lng->txt("no_checkbox") : $this->lng->txt("skmg_delete_profiles"),
103 $this->ctrl->getFormActionByClass("ilskillprofilegui", "deleteProfiles")
104 )
105 ->withAffectedItems($items)
106 ->withActionButtonLabel(empty($items) ? $this->lng->txt("ok") : $this->lng->txt("delete"))
107 ]));
108 exit();
109 }
110
111 $table = $this->ui_fac->table()
112 ->data($data_retrieval, $this->lng->txt("skmg_skill_profiles"), $columns)
113 ->withId(
114 str_replace('\\', '', self::class) . "_" .
115 $this->skill_tree_id
116 )
117 ->withActions($actions)
118 ->withRequest($this->request);
119
120 return $table;
121 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $id, exit, ILIAS\Skill\Table\ProfileTable\getActions(), ILIAS\Skill\Table\ProfileTable\getColumns(), ILIAS\Skill\Table\ProfileTable\getDataRetrieval(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getDataRetrieval()

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

Definition at line 180 of file class.ProfileTable.php.

180 : UI\Component\Table\DataRetrieval
181 {
182 $data_retrieval = new class (
188 ) implements UI\Component\Table\DataRetrieval {
189 use TableRecords;
190
191 public function __construct(
192 protected \ilLanguage $lng,
193 protected int $skill_tree_id,
194 protected Profile\SkillProfileManager $skill_profile_manager,
195 protected UI\Factory $ui_fac,
196 protected \ilCtrl $ctrl
197 ) {
198 }
199
200 public function getRows(
201 UI\Component\Table\DataRowBuilder $row_builder,
202 array $visible_column_ids,
203 Data\Range $range,
204 Data\Order $order,
205 mixed $additional_viewcontrol_data,
206 mixed $filter_data,
207 mixed $additional_parameters
208 ): \Generator {
209 $records = $this->getRecords($range, $order);
210 foreach ($records as $idx => $record) {
211 $row_id = (string) $record["profile_id"];
212
213 yield $row_builder->buildDataRow($row_id, $record);
214 }
215 }
216
217 public function getTotalRowCount(
218 mixed $additional_viewcontrol_data,
219 mixed $filter_data,
220 mixed $additional_parameters
221 ): ?int {
222 return count($this->getRecords());
223 }
224
225 protected function getRecords(?Data\Range $range = null, ?Data\Order $order = null): array
226 {
227 if ($this->skill_tree_id) {
228 $profiles = $this->skill_profile_manager->getProfilesForSkillTree($this->skill_tree_id);
229 } else {
230 $profiles = $this->skill_profile_manager->getProfilesForAllSkillTrees();
231 }
232
233 $records = [];
234 $i = 0;
235 foreach ($profiles as $profile) {
236 $records[$i]["profile_id"] = $profile->getId();
237 $this->ctrl->setParameterByClass("ilskillprofilegui", "sprof_id", $profile->getId());
238 $records[$i]["title"] = $this->ui_fac->link()->standard(
239 $profile->getTitle(),
240 $this->ctrl->getLinkTargetByClass("ilskillprofilegui", "showLevels")
241 );
242 $this->ctrl->clearParameterByClass("ilskillprofilegui", "sprof_id");
243 $profile_ref_id = $this->skill_profile_manager->lookupRefId($profile->getId());
244 $profile_obj_id = \ilContainerReference::_lookupObjectId($profile_ref_id);
245 $profile_obj_title = \ilObject::_lookupTitle($profile_obj_id);
246 if ($profile_ref_id > 0) {
247 $records[$i]["context"] = $this->lng->txt("skmg_context_local") . " (" . $profile_obj_title . ")";
248 } else {
249 $records[$i]["context"] = $this->lng->txt("skmg_context_global");
250 }
251 $records[$i]["users"] = $this->skill_profile_manager->countUsers($profile->getId());
252 $records[$i]["roles"] = $this->skill_profile_manager->countRoles($profile->getId());
253 $i++;
254 }
255
256 if ($order) {
257 $records = $this->orderRecords($records, $order);
258 }
259
260 if ($range) {
261 $records = $this->limitRecords($records, $range);
262 }
263
264 return $records;
265 }
266 };
267
268 return $data_retrieval;
269 }
__construct(int $ref_id, int $skill_tree_id)
Profile SkillProfileManager $profile_manager
Class ilCtrl provides processing control methods.
language handling
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
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\ProfileTable\$ctrl, ILIAS\Skill\Table\ProfileTable\$lng, ILIAS\Skill\Table\ProfileTable\$profile_manager, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\Skill\Table\ProfileTable\$skill_tree_id, ILIAS\Skill\Table\ProfileTable\$ui_fac, ILIAS\Skill\Table\ProfileTable\__construct(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

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

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

Field Documentation

◆ $admin_gui_request

Service SkillAdminGUIRequest ILIAS\Skill\Table\ProfileTable::$admin_gui_request
protected

Definition at line 45 of file class.ProfileTable.php.

◆ $ctrl

ilCtrl ILIAS\Skill\Table\ProfileTable::$ctrl
protected

◆ $df

Data Factory ILIAS\Skill\Table\ProfileTable::$df
protected

Definition at line 42 of file class.ProfileTable.php.

◆ $lng

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

◆ $profile_manager

Profile SkillProfileManager ILIAS\Skill\Table\ProfileTable::$profile_manager
protected

◆ $query

ArrayBasedRequestWrapper ILIAS\Skill\Table\ProfileTable::$query
protected

Definition at line 41 of file class.ProfileTable.php.

◆ $request

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

Definition at line 40 of file class.ProfileTable.php.

◆ $requested_table_profile_action

string ILIAS\Skill\Table\ProfileTable::$requested_table_profile_action = ""
protected

Definition at line 46 of file class.ProfileTable.php.

◆ $requested_table_profile_ids

array ILIAS\Skill\Table\ProfileTable::$requested_table_profile_ids = []
protected

Definition at line 51 of file class.ProfileTable.php.

◆ $skill_tree_id

int ILIAS\Skill\Table\ProfileTable::$skill_tree_id = 0
protected

◆ $tree_access_manager

Access SkillTreeAccess ILIAS\Skill\Table\ProfileTable::$tree_access_manager
protected

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

◆ $ui_fac

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

◆ $ui_ren

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

Definition at line 39 of file class.ProfileTable.php.


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