コード例 #1
0
ファイル: OJSProfileTabHandler.inc.php プロジェクト: pkp/ojs
 /**
  * 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));
 }
コード例 #2
0
 /**
  * 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));
 }