ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
AssignRoleTableBuilder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Catgory;
22 
29 
31 {
32  public function __construct(
33  protected InternalDomainService $domain,
34  protected InternalGUIService $gui,
35  protected int $ref_id,
36  protected int $managed_user_id,
37  protected int $managing_user_id,
38  object $parent_gui,
39  string $parent_cmd
40  ) {
41  parent::__construct($parent_gui, $parent_cmd);
42  }
43 
44  protected function getId(): string
45  {
46  return 'ilcatluaar';
47  }
48 
49  protected function getTitle(): string
50  {
51  $lng = $this->domain->lng();
52  return $lng->txt('role_assignment') . ' (' .
53  $this->domain->profile()->getNamePresentation($this->managed_user_id, true) . ')';
54  }
55 
56  protected function getRetrieval(): RetrievalInterface
57  {
58  return $this->domain->assignedRoledRetrieval(
59  $this->ref_id,
60  $this->managed_user_id,
61  $this->managing_user_id
62  );
63  }
64 
65  protected function transformRow(array $data_row): array
66  {
67  $f = $this->gui->ui()->factory();
68 
69  $icon = $data_row["assigned"] ?? false
70  ? $f->symbol()->icon()->custom('assets/images/standard/icon_checked.svg', '', 'small')
71  : $f->symbol()->icon()->custom('assets/images/standard/icon_unchecked.svg', '', 'small');
72 
73  return [
74  'id' => $data_row['id'],
75  'title' => $data_row['title'],
76  'desc' => $data_row['desc'],
77  'type' => $data_row['type'],
78  'icon' => $icon
79  ];
80  }
81 
82 
84  {
85  $lng = $this->domain->lng();
86  $table = $table
87  ->textColumn('title', $lng->txt('title'), true)
88  ->textColumn('desc', $lng->txt('description'))
89  ->textColumn('type', $lng->txt('type'))
90  ->iconColumn('icon', $lng->txt('info_assigned'), false);
91 
92  $table = $table->multiAction(
93  'assignSave',
94  $lng->txt("change_assignment")
95  );
96 
97  return $table;
98  }
99 }
textColumn(string $key, string $title, bool $sortable=false)
$ref_id
Definition: ltiauth.php:65
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $ref_id, protected int $managed_user_id, protected int $managing_user_id, object $parent_gui, string $parent_cmd)
multiAction(string $action, string $title)
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31