19declare(strict_types=1);
49 $this->irss =
$DIC->resourceStorage();
50 $this->information = $this->revision->getInformation();
56 $properties = array_merge(
60 $item = $this->ui_factory->item()->standard($this->revision->getTitle())
61 ->withDescription($this->information->getTitle())
62 ->withProperties($properties);
65 return $item->withLeadImage($this->
getImage());
72 return $this->ui_factory->card()->repositoryObject(
73 $this->information->getTitle(),
75 )->
withSections([$this->ui_factory->listing()->descriptive($this->getCommonProperties())]);
84 $actions = $this->action_generator->getActionsForRevision($this->revision);
85 if ($actions !== []) {
87 $this->ui_factory->dropdown()->standard(
95 ->withSubheadline($this->revision->getTitle())
110 if ($this->irss->flavours()->possible($this->revision->getIdentification(), $this->preview_definition)) {
111 $flavour = $this->irss->flavours()->get($this->revision->getIdentification(), $this->preview_definition);
112 $src = $this->irss->consume()->flavourUrls($flavour)->getURLsAsArray()[0] ??
null;
115 return $this->ui_factory->image()->responsive(
117 $this->information->getTitle()
118 )->
withAlt($this->information->getTitle());
123 return './assets/images/placeholder/file_placeholder.svg';
129 $this->
formatDate($this->information->getCreationDate()),
130 $this->
formatSize($this->information->getSize()),
137 $this->
language->txt(
'file_size') => $this->
formatSize($this->information->getSize()),
138 $this->
language->txt(
'type') => $this->information->getMimeType(),
146 $this->
language->txt(
'create_date') => $this->
formatDate($this->information->getCreationDate()),
148 'revision_status_' . $this->revision->getStatus()->value
Class ResourceIdentification.
ActionGenerator $action_generator
formatDate(\DateTimeImmutable $date)
getAsItem(bool $with_image)
__construct(private Revision $revision, ?ActionGenerator $action_generator=null)
PreviewDefinition $preview_definition
withSections(array $sections)
Set multiple sections of the card as array.
This describes a Standard Dropdown.
withAlt(string $alt)
Set the alternative text for screen readers.
This describes a Row used in Presentation Table.
withAction($action)
Get a row like this with a button or a dropdown for actions in the expanded row.
withHeadline(string $headline)
Get a row like this with the given headline.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc