19declare(strict_types=1);
39 protected DataFactory $data_factory,
47 protected function getId(): string
49 return 'mob_overview';
54 return $this->domain->lng()->txt(
'mob_media_objects_overview');
60 $this->sub_object_retrieval,
69 'id' => $data_row[
'id'],
70 'title' => $data_row[
'title'] ??
'',
71 'last_update' => (
new DateTimeImmutable(
'@' . ($data_row[
'last_update'] ?? 0)))
72 ->setTimezone(
new DateTimeZone($this->domain->user()->getTimeZone())),
77 if (($data_row[
'copyright_identifier'] ??
'') !==
'') {
78 $preset = $this->domain->learningObjectMetadata()->copyrightHelper()->getCopyrightPreset($data_row[
'copyright_identifier']);
79 if ($image = $preset->presentAsImageOnly()) {
80 $data[
'copyright_icon'] = $image;
82 if ($link = $preset->presentAsLinkOnly()) {
83 $data[
'copyright'] = $link;
85 } elseif (($data_row[
'copyright'] ??
'') !==
'') {
86 $data[
'copyright'] = $this->gui->ui()->factory()->link()->standard(
87 $data_row[
'copyright'],
96 $ui_factory = $this->gui->ui()->factory();
99 foreach ($usage_data as $usage) {
100 $title = $usage[
'title'] ??
'';
101 $link_string = $usage[
'link'] ??
'';
105 $link = $ui_factory->link()->standard($title, $link_string);
106 if ($link_string ===
'') {
107 $link = $link->withDisabled();
111 return $ui_factory->listing()->unordered($links);
116 $lng = $this->domain->lng();
117 $lom = $this->domain->learningObjectMetadata();
121 ->dateColumn(
'last_update',
$lng->txt(
'mob_last_update'),
true);
122 if ($lom->copyrightHelper()->isCopyrightSelectionActive()) {
124 ->
iconColumn(
'copyright_icon',
$lng->txt(
'mob_copyright_icon'),
false)
125 ->linkColumn(
'copyright',
$lng->txt(
'mob_copyright'),
true);
129 ->linkListingColumn(
'mep_usages',
$lng->txt(
'mob_usages_in_media_pools'))
130 ->linkListingColumn(
'external_usages',
$lng->txt(
'mob_usages_in_other_objects'));
textColumn(string $key, string $title, bool $sortable=false)
linkListingColumn(string $key, string $title, bool $sortable=false)
iconColumn(string $key, string $title, bool $sortable=false)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc