19declare(strict_types=1);
33 protected bool $edit_order,
40 protected function getId(): string
47 return $this->domain->lng()->txt($this->edit_order ?
'mcst_media_cast' :
'mcst_items');
62 return $this->edit_order ?
'saveOrder' :
'';
65 protected function activeAction(
string $action, array $data_row): bool
67 if ($action ===
'determinePlaytimeObject') {
68 return !($data_row[
'is_image'] ??
false);
76 $mob = new \ilObjMediaObject((
int) $data_row[
'mob_id']);
77 $med = $mob->getMediaItem(
'Standard');
78 $format = $med?->getFormat() ??
'';
81 'id' => (
int) $data_row[
'id'],
82 'title' => (
string) ($data_row[
'title'] ??
''),
83 'type' => $format !==
'' ? $format :
'-',
85 'playtime' => ($data_row[
'playtime'] ??
'') !==
'00:00:00'
86 ? (
string) ($data_row[
'playtime'] ??
'')
92 'preview' => $this->
getPreview($mob, (
string) ($data_row[
'title'] ??
'')),
100 $lng = $this->domain->lng();
104 ->textColumn(
'type',
$lng->txt(
'type'))
105 ->textColumn(
'size',
$lng->txt(
'size'))
106 ->textColumn(
'playtime',
$lng->txt(
'mcst_play_time'))
107 ->textColumn(
'creation_date',
$lng->txt(
'created'))
108 ->textColumn(
'update_date',
$lng->txt(
'last_update'));
116 ->singleAction(
'showCastItemObject',
$lng->txt(
'show'),
true);
120 'determinePlaytimeObject',
121 $lng->txt(
'mcst_det_playtime')
124 if ($this->media_cast->getDownloadable()) {
129 'confirmItemDeletionObject',
138 if (!is_file($file)) {
142 return sprintf(
'%.1f MB', filesize($file) / 1024 / 1024);
147 if (($data_row[
'update_date'] ??
'') === ($data_row[
'creation_date'] ??
'')) {
151 return \ilDatePresentation::formatDate(
159 if ($preview ===
'') {
163 $image = $this->gui->ui()->factory()->image()->responsive($preview, $title);
166 "<img style='max-width:150px;' ",
167 $this->gui->ui()->renderer()->render($image)
textColumn(string $key, string $title, bool $sortable=false)
singleAction(string $action, string $title, bool $async=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc