ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ObjectsBuilder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use ilLanguage;
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 "start_objs_" . $this->start_objects->getObjId();
45  }
46 
47  protected function getTitle(): string
48  {
49  return $this->lng->txt('crs_start_objects');
50  }
51 
52  protected function getRetrieval(): RetrievalInterface
53  {
54  return new ObjectsRetrieval($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 
73  protected function getOrderingCommand(): string
74  {
75  return 'saveSorting';
76  }
77 
79  {
80  return $table
81  ->iconColumn('type', $this->lng->txt('type'))
82  ->textColumn('title', $this->lng->txt('title'))
83  ->textColumn('description', $this->lng->txt('description'))
84  ->standardAction('askDeleteStarter', $this->lng->txt('remove'));
85  }
86 }
__construct(object $parent_gui, string $parent_cmd, protected ilContainerStartObjects $start_objects, protected ilLanguage $lng, protected UIFactory $ui_factory)
iconColumn(string $key, string $title, bool $sortable=false)
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31