19 declare(strict_types=1);
26 public function getHTML(
bool $link =
true, array $options = []): string
30 if (is_null($value)) {
35 $has_ilfilehash = $this->
http->wrapper()->post()->has(
'ilfilehash');
36 if (is_array($value) && $has_ilfilehash) {
37 $ilfilehash = $this->
http->wrapper()->post()->retrieve(
'ilfilehash', $this->
refinery->kindlyTo()->string());
39 $this->
ctrl->setParameterByClass(ilDclRecordListGUI::class,
"ilfilehash", $ilfilehash);
40 $this->
ctrl->setParameterByClass(
41 ilDclRecordListGUI::class,
46 return '<a href="' . $this->
ctrl->getLinkTargetByClass(
47 ilDclRecordListGUI::class,
49 ) .
'">' . $value[
'name'] .
'</a>';
53 $med = $mob->getMediaItem(
'Standard');
55 if (!$med || $med->getLocation() ===
"") {
63 if ($this->
http->wrapper()->query()->has(
"tableview_id")) {
64 $tableview_id = $this->
http->wrapper()->query()->retrieve(
73 if (in_array($med->getSuffix(), [
'jpg',
'jpeg',
'png',
'gif'])) {
79 if ($is_linked_field && $has_view && $link) {
80 $this->
ctrl->setParameterByClass(
81 'ilDclDetailedViewGUI',
85 $image = $image->withAction($this->
ctrl->getLinkTargetByClass(
"ilDclDetailedViewGUI",
'renderRecord'));
87 $components[] = $image;
90 if ($med->getSuffix() ==
'mp3') {
91 $components[] = $this->factory->player()->audio(
$location);
93 $components[] = $this->factory->player()->video(
$location);
96 if ($is_linked_field && $has_view) {
97 $this->
ctrl->setParameterByClass(
98 'ilDclDetailedViewGUI',
102 $components[] = $this->factory->link()->standard(
103 $this->
lng->txt(
'details'),
104 $this->
ctrl->getLinkTargetByClass(
105 "ilDclDetailedViewGUI",
120 $content = $this->renderer->render($components);
121 return "<div style='width:$width; height:$height;'>$content</div>";
126 if (is_array($value)) {
getRecord()
Getter shortcut for record.
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getField()
Getter shortcut for field.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static http()
Fetches the global http state from ILIAS.
AutoloadingIssuesInspection
getHTML(bool $link=true, array $options=[])
Outputs html of a certain field.
const PROP_LINK_DETAIL_PAGE_MOB
getRecordField()
Get Record Field.
static signFile(string $path_to_file)
static _lookupType(int $id, bool $reference=false)