ILIAS  release_8 Revision v8.24
ilForumNotificationEventsFormGUI Class Reference
+ Collaboration diagram for ilForumNotificationEventsFormGUI:

Public Member Functions

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

Private Attributes

string $action
 
array $predefined_values
 
ILIAS UI Factory $ui_factory
 
ilLanguage $lng
 
array $events
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ build()

ilForumNotificationEventsFormGUI::build ( )

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

66 {
67 $items = [];
68
69 foreach ($this->events as $key => $id) {
70 $checkbox = $this->ui_factory->input()->field()->checkbox($this->lng->txt($key));
71 if ($this->predefined_values !== null && isset($this->predefined_values[$key])) {
72 $checkbox = $checkbox->withValue($this->predefined_values[$key]);
73 }
74
75 $items[$key] = $checkbox;
76 }
77
78 $hidden = $this->ui_factory->input()->field()->hidden();
79 if ($this->predefined_values !== null && isset($this->predefined_values['hidden_value'])) {
80 $hidden = $hidden->withValue((string) $this->predefined_values['hidden_value']);
81 }
82 $items['hidden_value'] = $hidden;
83
84 return $this->ui_factory->input()->container()->form()->standard(
85 $this->action,
86 $items
87 );
88 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This describes commonalities between all forms.
Definition: Form.php:33
string $key
Consumer key/client ID value.
Definition: System.php:193

References $id, ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getValidEvents()

ilForumNotificationEventsFormGUI::getValidEvents ( )
Returns
list<string>

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

60 : array
61 {
62 return array_keys($this->events);
63 }

◆ getValueForEvent()

ilForumNotificationEventsFormGUI::getValueForEvent ( string  $event)

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

48 : int
49 {
50 if (isset($this->events[$event])) {
51 return $this->events[$event];
52 }
53
54 throw new InvalidArgumentException(sprintf('Event "%s" is not supported.', $event));
55 }

Field Documentation

◆ $action

string ilForumNotificationEventsFormGUI::$action
private

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

Referenced by __construct().

◆ $events

◆ $lng

ilLanguage ilForumNotificationEventsFormGUI::$lng
private

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

Referenced by __construct().

◆ $predefined_values

array ilForumNotificationEventsFormGUI::$predefined_values
private

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

Referenced by __construct().

◆ $ui_factory

ILIAS UI Factory ilForumNotificationEventsFormGUI::$ui_factory
private

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

Referenced by __construct().


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