ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
NewItemGroupTableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
30{
31 public function __construct(
32 protected InternalDomainService $domain,
33 protected InternalGUIService $gui,
34 protected bool $has_write_permission,
35 object $parent_gui,
36 string $parent_cmd
37 ) {
38 parent::__construct($parent_gui, $parent_cmd);
39 }
40
41 protected function getId(): string
42 {
43 return 'repnwitgrptbl';
44 }
45
46 protected function getTitle(): string
47 {
48 return $this->domain->lng()->txt('rep_new_item_groups');
49 }
50
51 protected function getRetrieval(): RetrievalInterface
52 {
53 $retrieval = $this->domain->newItemGroupRetrieval();
54 $unassigned_subitems = $retrieval->getUnassignedSubItemCount();
55
56 if ($unassigned_subitems > 0) {
57 $this->gui->mainTemplate()->setOnScreenMessage('info', sprintf(
58 $this->domain->lng()->txt('rep_new_item_group_unassigned_subitems'),
59 $unassigned_subitems
60 ));
61 }
62
63 return $retrieval;
64 }
65
66 protected function getOrderingCommand(): string
67 {
68 return $this->has_write_permission ? 'saveNewItemGroupOrder' : '';
69 }
70
71 protected function transformRow(array $data_row): array
72 {
73 return [
74 'id' => $data_row['id'],
75 'title' => $data_row['title'],
76 'subitems' => $data_row['subitems']
77 ];
78 }
79
81 {
82 $lng = $this->domain->lng();
83
85 ->textColumn('title', $lng->txt('title'))
86 ->textColumn('subitems', $lng->txt('rep_new_item_group_nr_subitems'));
87
88 if ($this->has_write_permission) {
91 'editNewItemGroup',
92 $lng->txt('edit'),
93 [\ilObjRepositorySettingsGUI::class],
94 'editNewItemGroup',
95 'grp_id'
96 )
97 ->singleAction('confirmDeleteNewItemGroup', $lng->txt('delete'), true);
98 }
99
100 return $table;
101 }
102
103}
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected bool $has_write_permission, object $parent_gui, string $parent_cmd)
transformRow(array $data_row)
transform raw data array to table row data array
textColumn(string $key, string $title, bool $sortable=false)
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="", bool $async=false)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:26