ILIAS  release_8 Revision v8.24
class.ilRadioOption.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
27{
28 protected string $title = "";
29 protected string $value = "";
30 protected string $info = "";
31 protected array $sub_items = array();
32 protected bool $disabled = false;
33
34 public function __construct(
35 string $a_title = "",
36 string $a_value = "",
37 string $a_info = ""
38 ) {
39 $this->setTitle($a_title);
40 $this->setValue($a_value);
41 $this->setInfo($a_info);
42 }
43
44 public function setTitle(string $a_title): void
45 {
46 $this->title = $a_title;
47 }
48
49 public function getTitle(): string
50 {
51 return $this->title;
52 }
53
54 public function setInfo(string $a_info): void
55 {
56 $this->info = $a_info;
57 }
58
59 public function getInfo(): string
60 {
61 return $this->info;
62 }
63
64 public function setValue(string $a_value): void
65 {
66 $this->value = $a_value;
67 }
68
69 public function getValue(): string
70 {
71 return $this->value;
72 }
73
74 public function setDisabled(bool $a_disabled): void
75 {
76 $this->disabled = $a_disabled;
77 }
78
79 public function getDisabled(): bool
80 {
81 return $this->disabled;
82 }
83
87 public function addSubItem($a_item): void
88 {
89 $this->sub_items[] = $a_item;
90 }
91
92 public function getSubItems(): array
93 {
94 return $this->sub_items;
95 }
96
97 public function getSubInputItemsRecursive(): array
98 {
99 $subInputItems = array();
100
101 foreach ($this->sub_items as $subItem) {
102 if ($subItem->getType() == 'section_header') {
103 continue;
104 }
105
106 $subInputItems[] = $subItem;
107
108 if ($subItem instanceof ilSubEnabledFormPropertyGUI) {
109 $subInputItems = array_merge($subInputItems, $subItem->getSubInputItemsRecursive());
110 }
111 }
112
113 return $subInputItems;
114 }
115}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
setDisabled(bool $a_disabled)
setValue(string $a_value)
__construct(string $a_title="", string $a_value="", string $a_info="")
setTitle(string $a_title)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
disabled()
Example showing how to plug a disabled checkbox into a form.
Definition: disabled.php:10