19 declare(strict_types=1);
25 public function getHTML(
bool $link =
true, array $options = []): string
29 $ref_id = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
35 $url = $value[
'link'];
38 if (substr(
$url, 0, 3) ===
'www') {
40 } elseif (filter_var(
$url, FILTER_VALIDATE_EMAIL)) {
43 $links[
'dcl_open_url'] =
$url;
47 if ($this->
http->wrapper()->query()->has(
'tableview_id')) {
48 $tableview_id = $this->
http->wrapper()->query()->retrieve(
'tableview_id', $this->
refinery->kindlyTo()->int());
50 $tableview_id = $this->
getRecord()->getTable()->getFirstTableViewId($this->
user->getId());
56 $this->
ctrl->clearParametersByClass(
"ilDclDetailedViewGUI");
57 $this->
ctrl->setParameterByClass(ilDclDetailedViewGUI::class,
'table_id', $this->
getRecord()->getTableId());
58 $this->
ctrl->setParameterByClass(ilDclDetailedViewGUI::class,
'tableview_id', $tableview_id);
59 $this->
ctrl->setParameterByClass(ilDclDetailedViewGUI::class,
'record_id', $this->
getRecord()->
getId());
60 $links[
'dcl_open_detail_view'] = $this->
ctrl->getLinkTargetByClass(ilDclDetailedViewGUI::class,
'renderRecord');
64 $value = nl2br((
string) $value);
66 switch (count($links)) {
71 $this->
factory->link()->standard(
74 )->withOpenInNewViewport(
true)
79 foreach ($links as $key => $link) {
80 $ui_links[] = $this->
factory->link()->standard(
81 $this->
lng->txt($key),
86 $this->
factory->dropdown()->standard(
96 $value = preg_replace(
'/^(https?:\/\/)?(www\.)?/',
'', $value);
97 $half = (
int) ((self::LINK_MAX_LENGTH - 4) / 2);
98 $value = preg_replace(
'/^(.{' . ($half + 1) .
'})(.{4,})(.{' . $half .
'})$/',
'\1...\3', $value);
108 $value = is_array($raw_input) ? $raw_input[
'link'] : $raw_input;
109 $value = is_string($value) ? $value :
"";
112 $field_values[
"field_" . $this->
getRecordField()->getField()->getId() .
"_title"] = (isset($raw_input[
'title'])) ? $raw_input[
'title'] :
'';
115 $field_values[
"field_" . $this->
getRecordField()->getField()->getId()] = $value;
116 $input_field->setValueByArray($field_values);
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
getHTML(bool $link=true, array $options=[])
getRecord()
Getter shortcut for record.
getField()
Getter shortcut for field.
shortenLink(string $value)
const PROP_LINK_DETAIL_PAGE_TEXT
static http()
Fetches the global http state from ILIAS.
getFormInput()
Gets the value from from the record field.
fillFormInput(ilPropertyFormGUI $form)
getRecordField()
Get Record Field.