ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PossibleObjectsBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ilLanguage;
27use ILIAS\UI\Factory as UIFactory;
29
31{
32 public function __construct(
33 object $parent_gui,
34 string $parent_cmd,
35 protected ilContainerStartObjects $start_objects,
36 protected ilLanguage $lng,
37 protected UIFactory $ui_factory
38 ) {
39 parent::__construct($parent_gui, $parent_cmd, true);
40 }
41
42 protected function getId(): string
43 {
44 return "poss_start_objs_" . $this->start_objects->getObjId();
45 }
46
47 protected function getTitle(): string
48 {
49 return $this->lng->txt('crs_select_starter');
50 }
51
52 protected function getRetrieval(): RetrievalInterface
53 {
54 return new PossibleObjectsRetrieval($this->start_objects);
55 }
56
57 protected function transformRow(array $data_row): array
58 {
59 $data = [
60 'id' => $data_row['id'],
61 'title' => $data_row['title'],
62 'type' => $this->ui_factory->symbol()->icon()->standard(
63 $data_row['type'],
64 $this->lng->txt('obj_' . $data_row['type']),
65 )
66 ];
67 if (isset($data_row['description'])) {
68 $data['description'] = $data_row['description'];
69 }
70 return $data;
71 }
72
74 {
75 return $table
76 ->iconColumn('type', $this->lng->txt('type'))
77 ->textColumn('title', $this->lng->txt('title'))
78 ->textColumn('description', $this->lng->txt('description'))
79 ->standardAction('addStarter', $this->lng->txt('crs_add_starter'));
80 }
81}
transformRow(array $data_row)
transform raw data array to table row data array
__construct(object $parent_gui, string $parent_cmd, protected ilContainerStartObjects $start_objects, protected ilLanguage $lng, protected UIFactory $ui_factory)
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
iconColumn(string $key, string $title, bool $sortable=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language handling
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:31