/**
  * Edit a galley.
  * @param $args array ($articleId, $galleyId)
  */
 function editGalley($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
     $submission =& $this->submission;
     $this->setupTemplate(true, $articleId, 'editing');
     import('classes.submission.form.ArticleGalleyForm');
     $submitForm = new ArticleGalleyForm($articleId, $galleyId);
     if ($submitForm->isLocaleResubmit()) {
         $submitForm->readInputData();
     } else {
         $submitForm->initData();
     }
     $submitForm->display();
 }
 /**
  * Edit a galley.
  * @param $args array ($articleId, $galleyId)
  */
 function editGalley($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $submissionLayoutHandler = new SubmissionLayoutHandler();
     $submissionLayoutHandler->validate($articleId);
     $submission =& $submissionLayoutHandler->submission;
     $this->setupTemplate(true, $articleId, 'editing');
     if ($this->layoutEditingEnabled($submission)) {
         import('classes.submission.form.ArticleGalleyForm');
         $submitForm = new ArticleGalleyForm($articleId, $galleyId);
         if ($submitForm->isLocaleResubmit()) {
             $submitForm->readInputData();
         } else {
             $submitForm->initData();
         }
         $submitForm->display();
     } else {
         // View galley only
         $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
         $galley =& $galleyDao->getGalley($galleyId, $articleId);
         if (!isset($galley)) {
             Request::redirect(null, null, 'submission', $articleId);
         }
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('articleId', $articleId);
         $templateMgr->assign_by_ref('galley', $galley);
         $templateMgr->display('submission/layout/galleyView.tpl');
     }
 }
 /**
  * Edit a galley.
  * @param $args array ($articleId, $galleyId)
  * @param $request PKPRequest
  */
 function editGalley($args, $request)
 {
     $articleId = (int) array_shift($args);
     $galleyId = (int) array_shift($args);
     $this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $galley =& $galleyDao->getGalley($galleyId, $articleId);
     if (!$galley) {
         $request->redirect(null, null, 'submissionEditing', $articleId);
     }
     $this->setupTemplate(true, $articleId, 'editing');
     import('classes.submission.form.ArticleGalleyForm');
     $submitForm = new ArticleGalleyForm($articleId, $galleyId);
     if ($submitForm->isLocaleResubmit()) {
         $submitForm->readInputData();
     } else {
         $submitForm->initData();
     }
     $submitForm->display();
 }