/**
  * Proof galley (outputs file contents).
  * @param $args array ($articleId, $galleyId)
  */
 function proofGalleyFile($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     list($journal, $submission) = SubmissionProofreadHandler::validate($articleId);
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $galley =& $galleyDao->getGalley($galleyId, $articleId);
     import('file.ArticleFileManager');
     // FIXME
     if (isset($galley)) {
         if ($galley->isHTMLGalley()) {
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign_by_ref('galley', $galley);
             if ($galley->isHTMLGalley() && ($styleFile =& $galley->getStyleFile())) {
                 $templateMgr->addStyleSheet(Request::url(null, 'article', 'viewFile', array($articleId, $galleyId, $styleFile->getFileId())));
             }
             $templateMgr->display('submission/layout/proofGalleyHTML.tpl');
         } else {
             // View non-HTML file inline
             SubmissionProofreadHandler::viewFile(array($articleId, $galley->getFileId()));
         }
     }
 }
 function viewFile($args)
 {
     import('pages.proofreader.SubmissionProofreadHandler');
     SubmissionProofreadHandler::viewFile($args);
 }