ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
TableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
31{
32 public function __construct(
33 protected InternalDomainService $domain,
34 protected InternalGUIService $gui,
35 protected \ilMediaPoolPage $page,
36 protected bool $include_hist,
37 object $parent_gui,
38 string $parent_cmd
39 ) {
40 parent::__construct($parent_gui, $parent_cmd, false);
41 }
42
43 protected function getId(): string
44 {
45 return "mep_page_usages";
46 }
47
48 protected function getTitle(): string
49 {
50 return $this->domain->lng()->txt("cont_mob_usages");
51 }
52
53 protected function getRetrieval(): RetrievalInterface
54 {
55 return $this->domain->mediaPoolPageUsagesRetrieval(
56 $this->page,
57 $this->include_hist
58 );
59 }
60
61 protected function transformRow(array $data_row): array
62 {
63 return [
64 "id" => $data_row["id"],
65 "object" => $this->buildObjectLink($data_row),
66 "type" => $data_row["type"],
67 "versions" => $data_row["versions"]
68 ];
69 }
70
71 protected function buildObjectLink(array $data_row): Link
72 {
73 $link = $this->gui->ui()->factory()->link()->standard(
74 $data_row["object"],
75 $data_row["object_link"]
76 );
77 if ($data_row["object_link"] === "") {
78 $link = $link->withDisabled();
79 }
80 return $link;
81 }
82
84 {
85 $lng = $this->domain->lng();
86
87 return $table
88 ->linkColumn("object", $lng->txt("mob_object"))
89 ->textColumn("type", $lng->txt("type"))
90 ->textColumn("versions", $lng->txt("cont_versions"));
91 }
92}
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected \ilMediaPoolPage $page, protected bool $include_hist, object $parent_gui, string $parent_cmd)
transformRow(array $data_row)
transform raw data array to table row data array
linkColumn(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...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:26