/** * View a file (inlines file). * @param $args array ($articleId, $fileId, [$revision]) */ function viewFile($args) { $articleId = isset($args[0]) ? $args[0] : 0; $fileId = isset($args[1]) ? $args[1] : 0; $revision = isset($args[2]) ? $args[2] : null; list($journal, $submission) = SubmissionEditHandler::validate($articleId); if (!SectionEditorAction::viewFile($articleId, $fileId, $revision)) { Request::redirect(null, null, 'submission', $articleId); } }
/** * View a file (inlines file). * @param $args array ($articleId, $galleyId, $fileId [optional]) */ function viewFile($args) { $articleId = isset($args[0]) ? $args[0] : 0; $galleyId = isset($args[1]) ? $args[1] : 0; $fileId = isset($args[2]) ? (int) $args[2] : 0; list($journal, $issue, $article) = ArticleHandler::validate($articleId, $galleyId); $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO'); $galley =& $galleyDao->getGalley($galleyId, $article->getArticleId()); if (!$galley) { Request::redirect(null, null, 'view', $articleId); } if (!$fileId) { $galleyDao->incrementViews($galleyId); $fileId = $galley->getFileId(); } else { if (!$galley->isDependentFile($fileId)) { Request::redirect(null, null, 'view', $articleId); } } if (!HookRegistry::call('ArticleHandler::viewFile', array(&$article, &$galley, &$fileId))) { // reuse section editor's view file function import('submission.sectionEditor.SectionEditorAction'); SectionEditorAction::viewFile($article->getArticleId(), $fileId); } }
/** * View a file (inlines file). * @param $args array ($articleId, $fileId, [$revision]) */ function viewFile($args) { $articleId = isset($args[0]) ? $args[0] : 0; $fileId = isset($args[1]) ? $args[1] : 0; $revision = isset($args[2]) ? $args[2] : null; $this->validate($articleId); if (!SectionEditorAction::viewFile($articleId, $fileId, $revision)) { Request::redirect(null, null, 'submission', $articleId); } }
/** * View a file (inlines file). * @param $args array ($articleId, $fileId, [$revision]) * @param $request PKPRequest */ function viewFile($args, &$request) { $articleId = (int) array_shift($args); $fileId = (int) array_shift($args); $revision = array_shift($args); // May be null $this->validate($articleId); if (!SectionEditorAction::viewFile($articleId, $fileId, $revision)) { $request->redirect(null, null, 'submission', $articleId); } }