ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjNotificationSettingsGUI Class Reference

Handles general notification settings, see e.g. More...

+ Collaboration diagram for ilObjNotificationSettingsGUI:

Public Member Functions

 __construct ($a_ref_id)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

 show ()
 Show form. More...
 
 initForm ()
 Init settings form. More...
 
 save ()
 Save. More...
 

Protected Attributes

 $lng
 
 $ctrl
 
 $tpl
 
 $obj_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjNotificationSettingsGUI::__construct (   $a_ref_id)

Constructor.

Definition at line 37 of file class.ilObjNotificationSettingsGUI.php.

38 {
39 global $DIC;
40
41 $this->ctrl = $DIC->ctrl();
42 $this->lng = $DIC->language();
43 $this->tpl = $DIC["tpl"];
44 $this->ref_id = $a_ref_id;
45 $this->obj_id = ilObject::_lookupObjId($a_ref_id);
46 include_once("./Services/Notification/classes/class.ilObjNotificationSettings.php");
47 $this->settings = new ilObjNotificationSettings($this->obj_id);
48 }
Handles general object notification settings, see e.g.
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
settings()
Definition: settings.php:2

References $DIC, ilObject\_lookupObjId(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjNotificationSettingsGUI::executeCommand ( )

Execute command.

Definition at line 53 of file class.ilObjNotificationSettingsGUI.php.

54 {
56
57 $next_class = $ctrl->getNextClass($this);
58 $cmd = $ctrl->getCmd("show");
59
60 switch ($next_class) {
61 default:
62 if (in_array($cmd, array("show", "save"))) {
63 $this->$cmd();
64 }
65 }
66 }

References $ctrl.

◆ initForm()

ilObjNotificationSettingsGUI::initForm ( )
protected

Init settings form.

Returns
ilPropertyFormGUI

Definition at line 84 of file class.ilObjNotificationSettingsGUI.php.

85 {
88
89 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
90 $form = new ilPropertyFormGUI();
91
92 $form->setFormAction($ctrl->getFormAction($this, 'save'));
93 $form->setTitle($lng->txt('obj_notification_settings'));
94
95 $radio_grp = new ilRadioGroupInputGUI($lng->txt("obj_activation"), 'notification_type');
96 $radio_grp->setValue('0');
97
98 $opt_default = new ilRadioOption($lng->txt("obj_user_decides_notification"), '0');
99 $opt_0 = new ilRadioOption($lng->txt("obj_settings_for_all_members"), '1');
100
101 $radio_grp->addOption($opt_default);
102 $radio_grp->addOption($opt_0);
103
104 $chb_2 = new ilCheckboxInputGUI($lng->txt('obj_user_not_disable_not'), 'no_opt_out');
105 $chb_2->setValue(1);
106
107 $opt_0->addSubItem($chb_2);
108 $form->addItem($radio_grp);
109
111 $radio_grp->setValue('1');
112 }
114 $radio_grp->setValue('1');
115 $chb_2->setChecked(true);
116 }
117
118 $form->addCommandButton("save", $lng->txt("save"));
119
120 $form->setTitle($this->lng->txt("notifications"));
121
122 return $form;
123 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References $ctrl, $lng, ilObjNotificationSettings\MODE_DEF_ON_NO_OPT_OUT, ilObjNotificationSettings\MODE_DEF_ON_OPT_OUT, and settings().

Referenced by save(), and show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjNotificationSettingsGUI::save ( )
protected

Save.

Definition at line 128 of file class.ilObjNotificationSettingsGUI.php.

129 {
131
132 $form = $this->initForm();
133 if ($form->checkInput()) {
135 if ($_POST['notification_type'] == "1") {
136 if ((int) $form->getInput('no_opt_out')) {
138 } else {
140 }
141 }
142 $this->settings->save();
143 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
144 $ctrl->redirect($this, "show");
145 }
146
147 $form->setValuesByPost();
148 $this->show();
149 }
$_POST["username"]

References $_POST, $ctrl, initForm(), ilObjNotificationSettings\MODE_DEF_OFF_USER_ACTIVATION, ilObjNotificationSettings\MODE_DEF_ON_NO_OPT_OUT, ilObjNotificationSettings\MODE_DEF_ON_OPT_OUT, settings(), and show().

+ Here is the call graph for this function:

◆ show()

ilObjNotificationSettingsGUI::show ( )
protected

Show form.

Definition at line 71 of file class.ilObjNotificationSettingsGUI.php.

72 {
74
75 $form = $this->initForm();
76 $tpl->setContent($form->getHTML());
77 }

References $tpl, and initForm().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilObjNotificationSettingsGUI::$ctrl
protected

Definition at line 22 of file class.ilObjNotificationSettingsGUI.php.

Referenced by executeCommand(), initForm(), and save().

◆ $lng

ilObjNotificationSettingsGUI::$lng
protected

Definition at line 17 of file class.ilObjNotificationSettingsGUI.php.

Referenced by initForm().

◆ $obj_id

ilObjNotificationSettingsGUI::$obj_id
protected

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

◆ $tpl

ilObjNotificationSettingsGUI::$tpl
protected

Definition at line 27 of file class.ilObjNotificationSettingsGUI.php.

Referenced by show().


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