ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclFileRecordRepresentation Class Reference

@noinspection AutoloadingIssuesInspection More...

+ Inheritance diagram for ilDclFileRecordRepresentation:
+ Collaboration diagram for ilDclFileRecordRepresentation:

Public Member Functions

 __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...
 

Private Member Functions

 buildDownloadLink ()
 

Private Attributes

ILIAS ResourceStorage Services $irss
 
ILIAS DI UIServices $ui_services
 

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

@noinspection AutoloadingIssuesInspection

Definition at line 24 of file class.ilDclFileRecordRepresentation.php.

Constructor & Destructor Documentation

◆ __construct()

ilDclFileRecordRepresentation::__construct ( ilDclBaseRecordFieldModel  $record_field)

Reimplemented from ilDclBaseRecordRepresentation.

Definition at line 31 of file class.ilDclFileRecordRepresentation.php.

32 {
33 global $DIC;
35 $this->irss = $DIC->resourceStorage();
36 $this->ui_services = $DIC->ui();
37 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilDclBaseRecordRepresentation\$record_field, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildDownloadLink()

ilDclFileRecordRepresentation::buildDownloadLink ( )
private

Definition at line 82 of file class.ilDclFileRecordRepresentation.php.

82 : string
83 {
85
86 $this->ctrl->setParameterByClass(
87 ilDclRecordListGUI::class,
88 "record_id",
89 $record_field->getRecord()->getId()
90 );
91 $this->ctrl->setParameterByClass(
92 ilDclRecordListGUI::class,
93 "field_id",
94 $record_field->getField()->getId()
95 );
96 return $this->ctrl->getLinkTargetByClass(
97 ilDclRecordListGUI::class,
98 "sendFile"
99 );
100 }

References ilDclBaseRecordRepresentation\$record_field, ILIAS\Repository\ctrl(), ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getRecord(), and ilDclBaseRecordRepresentation\getRecordField().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

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

Outputs html of a certain field.

Reimplemented from ilDclBaseRecordRepresentation.

Reimplemented in ilDclMobRecordRepresentation.

Definition at line 44 of file class.ilDclFileRecordRepresentation.php.

44 : string
45 {
46 $value = $this->record_field->getValue();
47
48 if ($value === null) {
49 return '';
50 }
51
52 if (is_array($value)) {
53 return $value['name'] ?? 'undefined';
54 }
55
56 $title = $this->valueToFileTitle($value);
57
58 if ($title === '') {
59 return $this->lng->txt('file_not_found');
60 }
61
62 if ($link) {
63 $link_component = $this->ui_services->factory()->link()->standard(
64 $title,
65 $this->buildDownloadLink()
66 );
67
68 return $this->ui_services->renderer()->render($link_component);
69 }
70
71 return $title;
72 }

References buildDownloadLink(), and ILIAS\Repository\lng().

Referenced by getSingleHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleHTML()

ilDclFileRecordRepresentation::getSingleHTML ( ?array  $options = null,
bool  $link = true 
)

Returns data for single record view.

Reimplemented from ilDclBaseRecordRepresentation.

Definition at line 39 of file class.ilDclFileRecordRepresentation.php.

39 : string
40 {
41 return $this->getHTML(true, $options ?? []);
42 }
getHTML(bool $link=true, array $options=[])
Outputs html of a certain field.

References getHTML().

+ Here is the call graph for this function:

◆ parseFormInput()

ilDclFileRecordRepresentation::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 ilDclBaseRecordRepresentation.

Reimplemented in ilDclMobRecordRepresentation.

Definition at line 74 of file class.ilDclFileRecordRepresentation.php.

75 {
76 if ($value === null || is_array($value)) {
77 return '';
78 }
79 return $this->valueToFileTitle($value);
80 }

Field Documentation

◆ $irss

ILIAS ResourceStorage Services ilDclFileRecordRepresentation::$irss
private

Definition at line 28 of file class.ilDclFileRecordRepresentation.php.

◆ $ui_services

ILIAS DI UIServices ilDclFileRecordRepresentation::$ui_services
private

Definition at line 29 of file class.ilDclFileRecordRepresentation.php.


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