public function showConfigMatrixObject()
 {
     global $ilTabs;
     $ilTabs->activateSubTab('notification_admin_matrix');
     require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
     require_once 'Services/Notifications/classes/class.ilNotificationSettingsTable.php';
     global $ilCtrl, $lng;
     $userdata = ilNotificationDatabaseHandler::loadUserConfig(-1);
     $table = new ilNotificationSettingsTable($this, 'a title', ilNotificationDatabaseHandler::getAvailableChannels(), $userdata, true);
     $table->setFormAction($ilCtrl->getFormAction($this, 'saveConfigMatrix'));
     $table->setData(ilNotificationDatabaseHandler::getAvailableTypes());
     $table->setDescription($lng->txt('notification_admin_matrix_settings_table_desc'));
     $table->addCommandButton('saveConfigMatrix', $lng->txt('save'));
     $table->addCommandButton('showConfigMatrix', $lng->txt('cancel'));
     $this->tpl->setContent($table->getHtml());
 }
예제 #2
0
 public function showSettingsObject()
 {
     global $tpl, $ilCtrl, $ilUser, $lng;
     require_once 'Services/Notifications/classes/class.ilNotificationSettingsTable.php';
     require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
     $userTypes = ilNotificationDatabaseHandler::loadUserConfig($ilUser->getId());
     $lng->loadLanguageModule('notification');
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $chk = new ilCheckboxInputGUI($lng->txt('enable_custom_notification_configuration'), 'enable_custom_notification_configuration');
     $chk->setValue('1');
     $chk->setChecked($ilUser->getPref('use_custom_notification_setting') == 1);
     $form->addItem($chk);
     $form->setFormAction($ilCtrl->getFormAction($this, 'showSettingsObject'));
     $form->addCommandButton('saveCustomizingOption', $lng->txt('save'));
     $form->addCommandButton('showSettings', $lng->txt('cancel'));
     $table = new ilNotificationSettingsTable($this, 'a title', $this->getAvailableChannels(array('set_by_user')), $userTypes);
     $table->setFormAction($ilCtrl->getFormAction($this, 'saveSettings'));
     $table->setData($this->getAvailableTypes(array('set_by_user')));
     if ($ilUser->getPref('use_custom_notification_setting') == 1) {
         $table->addCommandButton('saveSettings', $lng->txt('save'));
         $table->addCommandButton('showSettings', $lng->txt('cancel'));
         $table->setEditable(true);
     } else {
         $table->setEditable(false);
     }
     $tpl->setContent($form->getHtml() . $table->getHTML());
 }