ILIAS  release_8 Revision v8.24
class.ilFormSectionHeaderGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
27{
28 protected string $type = "";
29 protected string $title = "";
30 protected string $info = "";
31 protected array $section_icon = [];
32 protected string $section_anchor = "";
33 protected ?ilPropertyFormGUI $parentform = null;
34
35 public function __construct()
36 {
37 $this->setType("section_header");
38 }
39
40 public function checkInput(): bool
41 {
42 return true;
43 }
44
45 public function setType(string $a_type): void
46 {
47 $this->type = $a_type;
48 }
49
50 public function getType(): string
51 {
52 return $this->type;
53 }
54
55 public function setSectionIcon(
56 string $a_file,
57 string $a_alt
58 ): void {
59 $this->section_icon['file'] = $a_file;
60 $this->section_icon['alt'] = $a_alt;
61 }
62
63 public function getSectionIcon(): array
64 {
65 return $this->section_icon ?: array();
66 }
67
68 public function setTitle(string $a_title): void
69 {
70 $this->title = $a_title;
71 }
72
73 public function getTitle(): string
74 {
75 return $this->title;
76 }
77
78 public function setInfo(string $a_info): void
79 {
80 $this->info = $a_info;
81 }
82
83 public function getInfo(): string
84 {
85 return $this->info;
86 }
87
88 public function setParentForm(ilPropertyFormGUI $a_parentform): void
89 {
90 $this->parentform = $a_parentform;
91 }
92
94 {
95 return $this->parentform;
96 }
97
98 public function setSectionAnchor(string $value): void
99 {
100 $this->section_anchor = $value;
101 }
102
103 public function insert(ilTemplate $a_tpl): void
104 {
105 $section_icon = $this->getSectionIcon();
106
107 if (isset($section_icon['file']) && is_file($section_icon['file'])) {
108 $a_tpl->setCurrentBlock("title_icon");
109 $a_tpl->setVariable("IMG_ICON", $section_icon['file']);
110 $a_tpl->setVariable('IMG_ALT', $section_icon['alt']);
111 $a_tpl->parseCurrentBlock();
112 }
113
114 $a_tpl->setCurrentBlock("header");
115 $a_tpl->setVariable("TXT_TITLE", $this->getTitle());
116 $a_tpl->setVariable("TXT_DESCRIPTION", $this->getInfo());
117 $a_tpl->setVariable('HEAD_COLSPAN', 2);
118 if (isset($this->section_anchor)) {
119 $a_tpl->setVariable('LABEL', $this->section_anchor);
120 }
121 $a_tpl->parseCurrentBlock();
122 }
123
124 public function setValueByArray(array $a_values): void
125 {
126 }
127
128 public function getPostVar(): string
129 {
130 return "";
131 }
132}
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setSectionIcon(string $a_file, string $a_alt)
setParentForm(ilPropertyFormGUI $a_parentform)
This class represents a property form user interface.
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)