ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilRadioOption.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 {
29  protected string $title = "";
30  protected string $value = "";
31  protected string $info = "";
32  protected array $sub_items = array();
33  protected bool $disabled = false;
34 
35  public function __construct(
36  string $a_title = "",
37  string $a_value = "",
38  string $a_info = ""
39  ) {
40  $this->setTitle($a_title);
41  $this->setValue($a_value);
42  $this->setInfo($a_info);
43  }
44 
45  public function setTitle(string $a_title): void
46  {
47  $this->title = $a_title;
48  }
49 
50  public function getTitle(): string
51  {
52  return $this->title;
53  }
54 
55  public function setInfo(string $a_info): void
56  {
57  $this->info = $a_info;
58  }
59 
60  public function getInfo(): string
61  {
62  return $this->info;
63  }
64 
65  public function setValue(string $a_value): void
66  {
67  $this->value = $a_value;
68  }
69 
70  public function getValue(): string
71  {
72  return $this->value;
73  }
74 
75  public function setDisabled(bool $a_disabled): void
76  {
77  $this->disabled = $a_disabled;
78  }
79 
80  public function getDisabled(): bool
81  {
82  return $this->disabled;
83  }
84 
88  public function addSubItem($a_item): void
89  {
90  $this->sub_items[] = $a_item;
91  }
92 
93  public function getSubItems(): array
94  {
95  return $this->sub_items;
96  }
97 
98  public function getSubInputItemsRecursive(): array
99  {
100  $subInputItems = array();
101 
102  foreach ($this->sub_items as $subItem) {
103  if ($subItem->getType() == 'section_header') {
104  continue;
105  }
106 
107  $subInputItems[] = $subItem;
108 
109  if ($subItem instanceof ilSubEnabledFormPropertyGUI) {
110  $subInputItems = array_merge($subInputItems, $subItem->getSubInputItemsRecursive());
111  }
112  }
113 
114  return $subInputItems;
115  }
116 }
This class represents an option in a radio group.
setDisabled(bool $a_disabled)
setInfo(string $a_info)
info()
description: > Example for rendering a info message box.
Definition: info.php:34
setValue(string $a_value)
__construct(string $a_title="", string $a_value="", string $a_info="")
This class represents a property that may include a sub form.
disabled()
description: > Example showing how to plug a disabled checkbox into a form
Definition: disabled.php:32
setTitle(string $a_title)