ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\MediaObjects\OverviewGUI\Table\Builder Class Reference
+ Inheritance diagram for ILIAS\MediaObjects\OverviewGUI\Table\Builder:
+ Collaboration diagram for ILIAS\MediaObjects\OverviewGUI\Table\Builder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected DataFactory $data_factory, protected SubObjectRetrieval $sub_object_retrieval, object $parent_gui, string $parent_cmd)
 
- Public Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 __construct (protected object $parent_gui, protected string $parent_cmd, bool $numeric_ids=true)
 
 getTable ()
 

Protected Member Functions

 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 buildLinkListingFromData (array $usage_data)
 
 build (TableAdapterGUI $table)
 
- Protected Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getNamespace ()
 
 getOrderingCommand ()
 
 activeAction (string $action, array $data_row)
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 34 of file Builder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected DataFactory  $data_factory,
protected SubObjectRetrieval  $sub_object_retrieval,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 36 of file Builder.php.

43 {
44 parent::__construct($parent_gui, $parent_cmd, true);
45 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 114 of file Builder.php.

114 : TableAdapterGUI
115 {
116 $lng = $this->domain->lng();
117 $lom = $this->domain->learningObjectMetadata();
118
119 $table = $table
120 ->textColumn('title', $lng->txt('mob'), true)
121 ->dateColumn('last_update', $lng->txt('mob_last_update'), true);
122 if ($lom->copyrightHelper()->isCopyrightSelectionActive()) {
123 $table = $table
124 ->iconColumn('copyright_icon', $lng->txt('mob_copyright_icon'), false)
125 ->linkColumn('copyright', $lng->txt('mob_copyright'), true);
126 }
127 return $table
128 ->linkListingColumn('internal_usages', $lng->txt('mob_internal_usages_in_object'))
129 ->linkListingColumn('mep_usages', $lng->txt('mob_usages_in_media_pools'))
130 ->linkListingColumn('external_usages', $lng->txt('mob_usages_in_other_objects'));
131 }
textColumn(string $key, string $title, bool $sortable=false)
linkListingColumn(string $key, string $title, bool $sortable=false)
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:31

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, ILIAS\Repository\Table\TableAdapterGUI\iconColumn(), ILIAS\Repository\Table\TableAdapterGUI\linkListingColumn(), and ILIAS\Repository\Table\TableAdapterGUI\textColumn().

+ Here is the call graph for this function:

◆ buildLinkListingFromData()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::buildLinkListingFromData ( array  $usage_data)
protected

Definition at line 94 of file Builder.php.

94 : UnorderedListing
95 {
96 $ui_factory = $this->gui->ui()->factory();
97
98 $links = [];
99 foreach ($usage_data as $usage) {
100 $title = $usage['title'] ?? '';
101 $link_string = $usage['link'] ?? '';
102 if ($title === '') {
103 continue;
104 }
105 $link = $ui_factory->link()->standard($title, $link_string);
106 if ($link_string === '') {
107 $link = $link->withDisabled();
108 }
109 $links[] = $link;
110 }
111 return $ui_factory->listing()->unordered($links);
112 }

Referenced by ILIAS\MediaObjects\OverviewGUI\Table\Builder\transformRow().

+ Here is the caller graph for this function:

◆ getId()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 47 of file Builder.php.

47 : string
48 {
49 return 'mob_overview';
50 }

◆ getRetrieval()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 57 of file Builder.php.

57 : RetrievalInterface
58 {
59 return new Retrieval(
60 $this->sub_object_retrieval,
61 $this->domain,
62 $this->data_factory
63 );
64 }

◆ getTitle()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 52 of file Builder.php.

52 : string
53 {
54 return $this->domain->lng()->txt('mob_media_objects_overview');
55 }

◆ transformRow()

ILIAS\MediaObjects\OverviewGUI\Table\Builder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 66 of file Builder.php.

66 : array
67 {
68 $data = [
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())),
73 'internal_usages' => $this->buildLinkListingFromData($data_row['internal_usages'] ?? []),
74 'mep_usages' => $this->buildLinkListingFromData($data_row['mep_usages'] ?? []),
75 'external_usages' => $this->buildLinkListingFromData($data_row['external_usages'] ?? [])
76 ];
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;
81 }
82 if ($link = $preset->presentAsLinkOnly()) {
83 $data['copyright'] = $link;
84 }
85 } elseif (($data_row['copyright'] ?? '') !== '') {
86 $data['copyright'] = $this->gui->ui()->factory()->link()->standard(
87 $data_row['copyright'],
88 ''
89 )->withDisabled();
90 }
91 return $data;
92 }

References $data, and ILIAS\MediaObjects\OverviewGUI\Table\Builder\buildLinkListingFromData().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: