ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumNotificationEventsFormGUI Class Reference
+ Collaboration diagram for ilForumNotificationEventsFormGUI:

Public Member Functions

array __construct (private readonly string $action, private ?array $predefined_values, private readonly \ILIAS\UI\Factory $ui_factory, private readonly ilLanguage $lng)
 
 getValueForEvent (string $event)
 
 getValidEvents ()
 
 build ()
 

Private Attributes

array $events
 

Detailed Description

Definition at line 21 of file class.ilForumNotificationEventsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

array ilForumNotificationEventsFormGUI::__construct ( private readonly string  $action,
private ?array  $predefined_values,
private readonly \ILIAS\UI\Factory  $ui_factory,
private readonly ilLanguage  $lng 
)

Definition at line 32 of file class.ilForumNotificationEventsFormGUI.php.

37  {
38  }

Member Function Documentation

◆ build()

ilForumNotificationEventsFormGUI::build ( )

Definition at line 57 of file class.ilForumNotificationEventsFormGUI.php.

References ILIAS\Repository\lng(), and null.

Referenced by ilForumSettingsGUI\saveEventsForUser().

57  : \ILIAS\UI\Component\Input\Container\Form\Form
58  {
59  $items = [];
60 
61  foreach (array_keys($this->events) as $key) {
62  $checkbox = $this->ui_factory->input()->field()->checkbox($this->lng->txt($key));
63  if ($this->predefined_values !== null && isset($this->predefined_values[$key])) {
64  $checkbox = $checkbox->withValue($this->predefined_values[$key]);
65  }
66 
67  $items[$key] = $checkbox;
68  }
69 
70  $hidden = $this->ui_factory->input()->field()->hidden();
71  if ($this->predefined_values !== null && isset($this->predefined_values['hidden_value'])) {
72  $hidden = $hidden->withValue((string) $this->predefined_values['hidden_value']);
73  }
74  $items['hidden_value'] = $hidden;
75 
76  return $this->ui_factory->input()->container()->form()->standard(
77  $this->action,
78  $items
79  );
80  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidEvents()

ilForumNotificationEventsFormGUI::getValidEvents ( )
Returns
list<string>

Definition at line 52 of file class.ilForumNotificationEventsFormGUI.php.

52  : array
53  {
54  return array_keys($this->events);
55  }

◆ getValueForEvent()

ilForumNotificationEventsFormGUI::getValueForEvent ( string  $event)

Definition at line 40 of file class.ilForumNotificationEventsFormGUI.php.

40  : int
41  {
42  if (isset($this->events[$event])) {
43  return $this->events[$event];
44  }
45 
46  throw new InvalidArgumentException(sprintf('Event "%s" is not supported.', $event));
47  }

Field Documentation

◆ $events

array ilForumNotificationEventsFormGUI::$events
private
Initial value:
= [

Definition at line 24 of file class.ilForumNotificationEventsFormGUI.php.


The documentation for this class was generated from the following file: