/**
  * Edit a chapter
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function editChapter($args, $request)
 {
     $chapter = $this->_getChapterFromRequest($request);
     // Form handling
     import('controllers.grid.users.chapter.form.ChapterForm');
     $chapterForm = new ChapterForm($this->getMonograph(), $chapter);
     $chapterForm->initData();
     return new JSONMessage(true, $chapterForm->fetch($request));
 }
Esempio n. 2
0
 /**
  * Edit a chapter
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function editChapter($args, &$request)
 {
     // Identify the chapter to be updated
     $chapterId = $request->getUserVar('chapterId');
     // Form handling
     import('controllers.grid.users.chapter.form.ChapterForm');
     $chapterForm = new ChapterForm($this->getMonograph(), $chapterId);
     if ($chapterForm->isLocaleResubmit()) {
         $chapterForm->readInputData();
     } else {
         $chapterForm->initData();
     }
     $json = new JSON(true, $chapterForm->fetch($request));
     return $json->getString();
 }