Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PKPNotificationSettingsForm.inc.php
1 <?php
20 import('lib.pkp.classes.form.Form');
21 
27  parent::Form('notification/settings.tpl');
28 
29  // Validation checks for this form
30  $this->addCheck(new FormValidatorPost($this));
31  }
32 
36  function display($request) {
37  $context = $request->getContext();
38  $user = $request->getUser();
39  $userId = $user->getId();
40 
41  $notificationSubscriptionSettingsDao = DAORegistry::getDAO('NotificationSubscriptionSettingsDAO');
42  $blockedNotifications = $notificationSubscriptionSettingsDao->getNotificationSubscriptionSettings('blocked_notification', $userId, $context->getId());
43  $emailSettings = $notificationSubscriptionSettingsDao->getNotificationSubscriptionSettings('emailed_notification', $userId, $context->getId());
44 
45  $templateMgr = TemplateManager::getManager($request);
46  $templateMgr->assign('blockedNotifications', $blockedNotifications);
47  $templateMgr->assign('emailSettings', $emailSettings);
48  $templateMgr->assign('titleVar', __('common.title'));
49  $templateMgr->assign('userVar', __('common.user'));
50  return parent::display();
51  }
52 }
53 
54 ?>
static & getDAO($name, $dbconn=null)
addCheck($formValidator)
Definition: Form.inc.php:396
Form validation check to make sure the form is POSTed.
Class defining basic operations for handling HTML forms.
Definition: Form.inc.php:47
Form to edit notification settings.