ILIAS  release_8 Revision v8.24
class.ilDclBaseRecordRepresentation.php
Go to the documentation of this file.
1<?php
2
20{
22 protected ilLanguage $lng;
23 protected ilAccess $access;
24 protected ilCtrl $ctrl;
27 protected \ILIAS\UI\Renderer $renderer;
28 protected ilObjUser $user;
29
31 {
32 global $DIC;
33
34 $this->lng = $DIC->language();
35 $this->access = $DIC->access();
36 $this->ctrl = $DIC->ctrl();
37 $this->http = $DIC->http();
38 $this->refinery = $DIC->refinery();
39 $this->factory = $DIC->ui()->factory();
40 $this->renderer = $DIC->ui()->renderer();
41 $this->user = $DIC->user();
42
43 $this->record_field = $record_field;
44 }
45
46 public function getFormGUI(ilPropertyFormGUI $formGUI): void
47 {
48 // Apply form-elements to record-entry-gui
49 }
50
56 public function parseFormInput($value)
57 {
58 return $value;
59 }
60
64 public function fillFormInput(ilPropertyFormGUI $form): void
65 {
66 $input_field = $form->getItemByPostVar('field_' . $this->getRecordField()->getField()->getId());
67 if ($input_field) {
68 $value = $this->getFormInput();
69 if (!is_null($value)) {
70 $input_field->setValueByArray(array("field_" . $this->getRecordField()->getField()->getId() => $value));
71 }
72 }
73 }
74
79 protected function getFormInput()
80 {
81 return $this->parseFormInput($this->getRecordField()->getValue());
82 }
83
87 public function getHTML(bool $link = true, array $options = []): string
88 {
89 return (string) $this->getRecordField()->getValue();
90 }
91
95 public function getSingleHTML(?array $options = null, bool $link = true): string
96 {
97 return $this->getHTML($link, $options);
98 }
99
104 public function getConfirmationHTML(): string
105 {
106 return $this->getHTML();
107 }
108
113 public function fillRow(ilTemplate $tpl): void
114 {
115 }
116
121 {
122 return $this->record_field;
123 }
124
128 public function getField(): ilDclBaseFieldModel
129 {
130 return $this->record_field->getField();
131 }
132
137 {
138 return $this->record_field->getRecord();
139 }
140}
Builds data types.
Definition: Factory.php:21
Class Services.
Definition: Services.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
global $DIC
Definition: feed.php:28
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
static http()
Fetches the global http state from ILIAS.
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:47