Exemplo n.º 1
0
 /**
  * Validate and save changes to user's notifications info.
  * @param $args array
  * @param $request PKPRequest
  */
 function saveNotifications($args, $request)
 {
     $this->setupTemplate($request);
     import('classes.user.form.NotificationSettingsForm');
     $notificationsForm = new NotificationSettingsForm($request->getUser());
     $notificationsForm->readInputData();
     if ($notificationsForm->validate()) {
         $notificationsForm->execute($request);
         return new JSONMessage(true);
     }
     return new JSONMessage(false, $notificationsForm->fetch($request));
 }
 /**
  * Fetch notifications tab content.
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON-formatted response
  */
 function notificationSettings($args, $request)
 {
     $this->setupTemplate($request);
     $user = $request->getUser();
     import('classes.notification.form.NotificationSettingsForm');
     $notificationSettingsForm = new NotificationSettingsForm();
     return new JSONMessage(true, $notificationSettingsForm->fetch($request));
 }