readInputData() public method

Assign form data to user-submitted data.
public readInputData ( )
コード例 #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
 /**
  * Save user notification settings
  */
 function saveSettings()
 {
     $this->validate();
     $this->setupTemplate(true);
     import('notification.form.NotificationSettingsForm');
     $notificationSettingsForm = new NotificationSettingsForm();
     $notificationSettingsForm->readInputData();
     if ($notificationSettingsForm->validate()) {
         $notificationSettingsForm->execute();
         PKPRequest::redirect(NotificationHandler::getContextDepthArray(), 'notification', 'settings');
     } else {
         $notificationSettingsForm->display();
     }
 }
コード例 #3
0
 /**
  * Save user notification settings
  * @param $args array
  * @param $request Request
  */
 function saveSettings($args, &$request)
 {
     $this->validate();
     $this->setupTemplate(true);
     import('classes.notification.form.NotificationSettingsForm');
     $notificationSettingsForm = new NotificationSettingsForm();
     $notificationSettingsForm->readInputData();
     if ($notificationSettingsForm->validate()) {
         $notificationSettingsForm->execute($request);
         $router =& $request->getRouter();
         $request->redirectUrl($router->url($request, null, 'notification', 'settings'));
     } else {
         $notificationSettingsForm->display($request);
     }
 }
コード例 #4
0
 /**
  * Save user notification settings.
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON-formatted response
  */
 function saveNotificationSettings($args, $request)
 {
     $this->setupTemplate($request);
     import('classes.notification.form.NotificationSettingsForm');
     $notificationSettingsForm = new NotificationSettingsForm();
     $notificationSettingsForm->readInputData();
     $json = new JSONMessage();
     if ($notificationSettingsForm->validate()) {
         $notificationSettingsForm->execute($request);
         $user = $request->getUser();
         $notificationMgr = new NotificationManager();
         $notificationMgr->createTrivialNotification($user->getId());
     } else {
         $json->setStatus(false);
     }
     return $json;
 }