ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilNotificationAdminSettingsForm Class Reference

Methods for building the administration forms. More...

+ Collaboration diagram for ilNotificationAdminSettingsForm:

Static Public Member Functions

static getTypeForm ($types)
 
static getChannelForm ($types)
 
static getGeneralSettingsForm ()
 

Detailed Description

Methods for building the administration forms.

Definition at line 8 of file class.ilNotificationAdminSettingsForm.php.

Member Function Documentation

◆ getChannelForm()

static ilNotificationAdminSettingsForm::getChannelForm (   $types)
static

Definition at line 36 of file class.ilNotificationAdminSettingsForm.php.

References $DIC, $form, $lng, PHPMailer\PHPMailer\$options, $type, and ilSelectInputGUI\setOptions().

Referenced by ilObjNotificationAdminGUI\showChannelsObject().

37  {
38  global $DIC;
39  $lng = $DIC->language();
40 
41  $form = new ilPropertyFormGUI();
42 
43  $options = array(
44  'set_by_user' => $lng->txt('set_by_user'),
45  'set_by_admin' => $lng->txt('set_by_admin'),
46  'disabled' => $lng->txt('disabled'),
47  );
48 
49  foreach ($types as $type) {
50  $select = new ilSelectInputGUI($lng->txt('notc_' . $type['name']), 'notifications[' . $type['name'] . ']');
51  $select->setOptions($options);
52  $select->setValue($type['config_type']);
53  $form->addItem($select);
54  }
55 
56  return $form;
57  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$type
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form
$lng
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralSettingsForm()

static ilNotificationAdminSettingsForm::getGeneralSettingsForm ( )
static
Todo:
dirty...
Todo:
dirty...
Todo:
dirty...

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

References $DIC, $form, $lng, PHPMailer\PHPMailer\$options, $result, ilNotificationDatabaseHandler\getAvailableChannels(), and ilSelectInputGUI\setOptions().

Referenced by ilObjNotificationAdminGUI\saveGeneralSettingsObject(), and ilObjNotificationAdminGUI\showGeneralSettingsObject().

60  {
61  global $DIC;
62  $lng = $DIC->language();
63 
64  $form = new ilPropertyFormGUI();
65 
66  require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
67 
68  $channels = ilNotificationDatabaseHandler::getAvailableChannels(array(), true);
69 
70  $options = array(
71  'set_by_user' => $lng->txt('set_by_user'),
72  'set_by_admin' => $lng->txt('set_by_admin'),
73  //'disabled' => $lng->txt('disabled'),
74  );
78  $form->restored_values = array();
79  $store_values = array();
80  foreach ($channels as $channel) {
81  $chb = new ilCheckboxInputGUI($lng->txt('enable_' . $channel['name']), 'enable_' . $channel['name']);
82 
83  $store_values[] = 'enable_' . $channel['name'];
84 
85  $select = new ilSelectInputGUI($lng->txt('config_type'), 'notifications[' . $channel['name'] . ']');
86  $select->setOptions($options);
87  $select->setValue($channel['config_type']);
88  $chb->addSubItem($select);
89 
93  $form->restored_values['notifications[' . $channel['name'] . ']'] = $channel['config_type'];
94  require_once $channel['include'];
95 
96  // let the channel display their own settings below the "enable channel"
97  // checkbox
98  $result = call_user_func(array($channel['handler'], 'showSettings'), $chb);
99  if ($result) {
100  $store_values = array_merge($result, $store_values);
101  }
102 
103 
104  $form->addItem($chb);
105  }
106 
110  $form->store_values = $store_values;
111 
112  return $form;
113  }
This class represents a selection list property in a property form.
$result
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This class represents a checkbox property in a property form.
if(isset($_POST['submit'])) $form
$lng
setOptions($a_options)
Set Options.
static getAvailableChannels($config_types=array(), $includeDisabled=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTypeForm()

static ilNotificationAdminSettingsForm::getTypeForm (   $types)
static

Definition at line 10 of file class.ilNotificationAdminSettingsForm.php.

References $DIC, $form, $lng, PHPMailer\PHPMailer\$options, $type, and ilSelectInputGUI\setOptions().

Referenced by ilObjNotificationAdminGUI\showTypesObject().

11  {
12  global $DIC;
13 
14  $lng = $DIC->language();
15 
16  $lng->loadLanguageModule('notification');
17 
18  $form = new ilPropertyFormGUI();
19 
20  $options = array(
21  'set_by_user' => $lng->txt('set_by_user'),
22  'set_by_admin' => $lng->txt('set_by_admin'),
23  'disabled' => $lng->txt('disabled'),
24  );
25 
26  foreach ($types as $type) {
27  $select = new ilSelectInputGUI($lng->txt('nott_' . $type['name']), 'notifications[' . $type['name'] . ']');
28  $select->setOptions($options);
29  $select->setValue($type['config_type']);
30  $form->addItem($select);
31  }
32 
33  return $form;
34  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$type
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form
$lng
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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