ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilNotificationAdminSettingsForm.php
Go to the documentation of this file.
1<?php
2
3require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
4
9{
10 public static function getTypeForm($types)
11 {
12 global $DIC;
13
14 $lng = $DIC->language();
15
16 $lng->loadLanguageModule('notification');
17
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 }
35
36 public static function getChannelForm($types)
37 {
38 global $DIC;
39 $lng = $DIC->language();
40
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 }
58
59 public static function getGeneralSettingsForm()
60 {
61 global $DIC;
62 $lng = $DIC->language();
63
65
66 require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
67
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 }
114}
$result
An exception for terminatinating execution or to throw for unit testing.
This class represents a checkbox property in a property form.
Methods for building the administration forms.
static getAvailableChannels($config_types=array(), $includeDisabled=false)
This class represents a property form user interface.
This class represents a selection list property in a property form.
$type
if(isset($_POST['submit'])) $form
global $DIC
Definition: saml.php:7
$lng