ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 
 getInputs ()
 

Private Attributes

array $events
 

Detailed Description

Definition at line 23 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 34 of file class.ilForumNotificationEventsFormGUI.php.

39  {
40  }

Member Function Documentation

◆ build()

ilForumNotificationEventsFormGUI::build ( )

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

References getInputs().

Referenced by ilForumSettingsGUI\saveEventsForUser().

59  : \ILIAS\UI\Component\Input\Container\Form\Form
60  {
61  return $this->ui_factory->input()->container()->form()->standard(
62  $this->action,
63  $this->getInputs()
64  );
65  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInputs()

ilForumNotificationEventsFormGUI::getInputs ( )
Returns
array<string, FormInput>

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

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

Referenced by build().

70  : array
71  {
72  $items = [];
73 
74  foreach (array_keys($this->events) as $key) {
75  $checkbox = $this->ui_factory->input()->field()->checkbox($this->lng->txt($key));
76  if ($this->predefined_values !== null && isset($this->predefined_values[$key])) {
77  $checkbox = $checkbox->withValue($this->predefined_values[$key]);
78  }
79 
80  $items[$key] = $checkbox;
81  }
82 
83  $hidden = $this->ui_factory->input()->field()->hidden();
84  if ($this->predefined_values !== null && isset($this->predefined_values['hidden_value'])) {
85  $hidden = $hidden->withValue((string) $this->predefined_values['hidden_value']);
86  }
87  $items['hidden_value'] = $hidden;
88 
89  return $items;
90  }
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 54 of file class.ilForumNotificationEventsFormGUI.php.

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

◆ getValueForEvent()

ilForumNotificationEventsFormGUI::getValueForEvent ( string  $event)

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

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

Field Documentation

◆ $events

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

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


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