ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilDclMobRecordRepresentation Class Reference
+ Inheritance diagram for ilDclMobRecordRepresentation:
+ Collaboration diagram for ilDclMobRecordRepresentation:

Public Member Functions

 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
- Public Member Functions inherited from ilDclFileRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getSingleHTML (?array $options=null, bool $link=true)
 Returns data for single record view. More...
 
 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
- Public Member Functions inherited from ilDclBaseRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getFormGUI (ilPropertyFormGUI $formGUI)
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 fillFormInput (ilPropertyFormGUI $form)
 Fills the form with the value of a record. More...
 
 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
 getSingleHTML (?array $options=null, bool $link=true)
 Returns data for single record view. More...
 
 getConfirmationHTML ()
 Returns data for confirmation list When returning false, attribute is ignored in list. More...
 
 fillRow (ilTemplate $tpl)
 Fills row with record data. More...
 
 getRecordField ()
 Get Record Field. More...
 
 getField ()
 Getter shortcut for field. More...
 
 getRecord ()
 Getter shortcut for record. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 
- Protected Attributes inherited from ilDclBaseRecordRepresentation
ILIAS UI Factory $factory
 
ilDclBaseRecordFieldModel $record_field
 
ilLanguage $lng
 
ilAccess $access
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ILIAS UI Renderer $renderer
 
ilObjUser $user
 

Detailed Description

Definition at line 23 of file class.ilDclMobRecordRepresentation.php.

Member Function Documentation

◆ getHTML()

ilDclMobRecordRepresentation::getHTML ( bool  $link = true,
array  $options = [] 
)

Outputs html of a certain field.

Reimplemented from ilDclFileRecordRepresentation.

Definition at line 25 of file class.ilDclMobRecordRepresentation.php.

25 : string
26 {
27 $value = $this->getRecordField()->getValue();
28
29 if (is_null($value)) {
30 return "";
31 }
32
33 $mob = new ilObjMediaObject($value);
34 $item = $mob->getMediaItem('Standard');
35 $component = match (explode('/', (string) $item?->getFormat())[0] ?? '') {
36 'image' => $this->factory->image()->responsive($item->getLocationSrc(), $mob->getTitle()),
37 'video' => $this->factory->player()->video($item->getLocationSrc()),
38 'audio' => $this->factory->player()->audio($item->getLocationSrc()),
39 default => $this->factory->image()->responsive('', $mob->getTitle()),
40 };
41
42 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_MOB) && $link) {
43 if ($this->http->wrapper()->query()->has('tableview_id')) {
44 $tableview_id = $this->http->wrapper()->query()->retrieve('tableview_id', $this->refinery->kindlyTo()->int());
45 } else {
46 $tableview_id = $this->getRecord()->getTable()->getFirstTableViewId($this->user->getId());
47 }
48 $page = new ilDclDetailedViewDefinitionGUI($tableview_id);
49 if ($page->getPageObject()->isActive()) {
50 $this->ctrl->setParameterByClass(ilDclDetailedViewGUI::class, 'record_id', $this->getRecord()->getId());
51 $link = $this->ctrl->getLinkTargetByClass(ilDclDetailedViewGUI::class, 'renderRecord');
52 $this->ctrl->clearParameterByClass(ilDclDetailedViewGUI::class, 'record_id');
53 if ($component instanceof Image) {
54 $component = $component->withAction($link);
55 } else {
56 $component = [$component, $this->factory->link()->standard($this->lng->txt('details'), $link)];
57 }
58 }
59 }
60
61 return $this->renderer->render($component);
62 }
renderer()
factory()
@ilCtrl_Calls ilDclDetailedViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI,...
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), factory(), ilDclBaseRecordRepresentation\getField(), ILIAS\Survey\Mode\getId(), ilDclBaseRecordRepresentation\getRecord(), ilDclBaseRecordRepresentation\getRecordField(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_LINK_DETAIL_PAGE_MOB, ILIAS\Repository\refinery(), renderer(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ parseFormInput()

ilDclMobRecordRepresentation::parseFormInput (   $value)

function parses stored value to the variable needed to fill into the form for editing.

Parameters
string | int$value
Returns
string|int

Reimplemented from ilDclFileRecordRepresentation.

Definition at line 64 of file class.ilDclMobRecordRepresentation.php.

65 {
66 if (is_array($value)) {
67 return $value;
68 }
69
70 if ($value === null || !ilObject2::_exists((int) $value) || ilObject2::_lookupType((int) $value) != 'mob') {
71 return '';
72 }
73
74 return $value;
75 }
static _lookupType(int $id, bool $reference=false)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data

References ilObject\_exists(), and ilObject\_lookupType().

+ Here is the call graph for this function:

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