ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclBaseRecordRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected \ILIAS\UI\Factory $factory;
25 protected ilLanguage $lng;
26 protected ilAccess $access;
27 protected ilCtrl $ctrl;
30 protected \ILIAS\UI\Renderer $renderer;
31 protected ilObjUser $user;
32
34 {
35 global $DIC;
36
37 $this->lng = $DIC->language();
38 $this->access = $DIC->access();
39 $this->ctrl = $DIC->ctrl();
40 $this->http = $DIC->http();
41 $this->refinery = $DIC->refinery();
42 $this->factory = $DIC->ui()->factory();
43 $this->renderer = $DIC->ui()->renderer();
44 $this->user = $DIC->user();
45
46 $this->record_field = $record_field;
47 }
48
49 public function getFormGUI(ilPropertyFormGUI $formGUI): void
50 {
51 // Apply form-elements to record-entry-gui
52 }
53
59 public function parseFormInput($value)
60 {
61 return $value;
62 }
63
67 public function fillFormInput(ilPropertyFormGUI $form): void
68 {
69 $input_field = $form->getItemByPostVar('field_' . $this->getRecordField()->getField()->getId());
70 if ($input_field) {
71 $value = $this->getFormInput();
72 if (!is_null($value)) {
73 $input_field->setValueByArray(["field_" . $this->getRecordField()->getField()->getId() => $value]);
74 }
75 }
76 }
77
82 protected function getFormInput()
83 {
84 return $this->parseFormInput($this->getRecordField()->getValue());
85 }
86
90 public function getHTML(bool $link = true, array $options = []): string
91 {
92 return (string) $this->getRecordField()->getValue();
93 }
94
98 public function getSingleHTML(?array $options = null, bool $link = true): string
99 {
100 return $this->getHTML($link, $options);
101 }
102
107 public function getConfirmationHTML(): string
108 {
109 return $this->getHTML();
110 }
111
116 public function fillRow(ilTemplate $tpl): void
117 {
118 }
119
124 {
125 return $this->record_field;
126 }
127
131 public function getField(): ilDclBaseFieldModel
132 {
133 return $this->record_field->getField();
134 }
135
140 {
141 return $this->record_field->getRecord();
142 }
143}
renderer()
factory()
Builds data types.
Definition: Factory.php:36
Class Services.
Definition: Services.php:38
Class ilAccessHandler Checks access for ILIAS objects.
Class ilCtrl provides processing control methods.
getSingleHTML(?array $options=null, bool $link=true)
Returns data for single record view.
fillRow(ilTemplate $tpl)
Fills row with record data.
getFormInput()
Gets the value from from the record field.
getHTML(bool $link=true, array $options=[])
Outputs html of a certain field.
__construct(ilDclBaseRecordFieldModel $record_field)
getConfirmationHTML()
Returns data for confirmation list When returning false, attribute is ignored in list.
fillFormInput(ilPropertyFormGUI $form)
Fills the form with the value of a record.
parseFormInput($value)
function parses stored value to the variable needed to fill into the form for editing.
language handling
User class.
This class represents a property form user interface.
getItemByPostVar(string $a_post_var)
special template class to simplify handling of ITX/PEAR
static http()
Fetches the global http state from ILIAS.
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:49
global $DIC
Definition: shib_login.php:26