当前位置: 首页>>代码示例>>PHP>>正文


PHP Action::downloadFile方法代码示例

本文整理汇总了PHP中Action::downloadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::downloadFile方法的具体用法?PHP Action::downloadFile怎么用?PHP Action::downloadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Action的用法示例。


在下文中一共展示了Action::downloadFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: downloadProposalFromMeetingFile

 /**
  * Download a file.
  * @param $args array ($articleId, $fileId)
  */
 function downloadProposalFromMeetingFile($args)
 {
     $proposalId = isset($args[0]) ? $args[0] : 0;
     $fileId = isset($args[1]) ? $args[1] : 0;
     $this->validate($proposalId);
     if (!Action::downloadFile($proposalId, $fileId)) {
         Request::redirect(null, 'user');
     }
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:13,代码来源:ProposalFromMeetingReviewerHandler.inc.php

示例2: downloadCopyeditorFile

 /**
  * Download a file a copyeditor has access to.
  * @param $submission object
  * @param $fileId int
  * @param $revision int
  */
 function downloadCopyeditorFile($submission, $fileId, $revision = null)
 {
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $canDownload = false;
     // Copyeditors have access to:
     // 1) The first revision of the copyedit file
     // 2) The initial copyedit revision
     // 3) The author copyedit revision, after the author copyedit has been completed
     // 4) The final copyedit revision
     // 5) Layout galleys
     if ($submission->getCopyeditFileId() == $fileId) {
         $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
         $currentRevision =& $articleFileDao->getRevisionNumber($fileId);
         if ($revision == null) {
             $revision = $currentRevision;
         }
         if ($revision == 1) {
             $canDownload = true;
         } else {
             if ($submission->getInitialRevision() == $revision) {
                 $canDownload = true;
             } else {
                 if ($submission->getEditorAuthorRevision() == $revision && $submission->getDateAuthorCompleted() != null) {
                     $canDownload = true;
                 } else {
                     if ($submission->getFinalRevision() == $revision) {
                         $canDownload = true;
                     }
                 }
             }
         }
     } else {
         // Check galley files
         foreach ($submission->getGalleys() as $galleyFile) {
             if ($galleyFile->getFileId() == $fileId) {
                 $canDownload = true;
             }
         }
         // Check supp files
         foreach ($submission->getSuppFiles() as $suppFile) {
             if ($suppFile->getFileId() == $fileId) {
                 $canDownload = true;
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('CopyeditorAction::downloadCopyeditorFile', array(&$submission, &$fileId, &$revision, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($submission->getArticleId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:61,代码来源:CopyeditorAction.inc.php

示例3: download

 /**
  * Download a file.
  * @param $args array ($articleId, $fileId, [$revision])
  */
 function download($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);
     Action::downloadFile($articleId, $fileId, $revision);
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:12,代码来源:TrackSubmissionHandler.inc.php

示例4: downloadReviewerFile

 /**
  * Download a file a reviewer has access to.
  * @param $reviewId int
  * @param $paper object
  * @param $fileId int
  * @param $revision int
  */
 function downloadReviewerFile($reviewId, &$paper, $fileId, $revision = null)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment =& $reviewAssignmentDao->getReviewAssignmentById($reviewId);
     $conference =& Request::getConference();
     $canDownload = false;
     // Reviewers have access to:
     // 1) The current revision of the file to be reviewed.
     // 2) Any file that he uploads.
     // 3) Any supplementary file that is visible to reviewers.
     if ((!$reviewAssignment->getDateConfirmed() || $reviewAssignment->getDeclined()) && $conference->getSetting('restrictReviewerFileAccess')) {
         // Restrict files until review is accepted
     } else {
         if ($reviewAssignment->getReviewFileId() == $fileId) {
             if ($revision != null) {
                 if ($reviewAssignment->getReviewRevision() == null) {
                     $canDownload = true;
                 } else {
                     $canDownload = $reviewAssignment->getReviewRevision() == $revision;
                 }
             }
         } else {
             if ($reviewAssignment->getReviewerFileId() == $fileId) {
                 $canDownload = true;
             } else {
                 foreach ($reviewAssignment->getSuppFiles() as $suppFile) {
                     if ($suppFile->getFileId() == $fileId && $suppFile->getShowReviewers()) {
                         $canDownload = true;
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('ReviewerAction::downloadReviewerFile', array(&$paper, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($paper->getId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:jalperin,项目名称:ocs,代码行数:50,代码来源:ReviewerAction.inc.php

示例5: downloadCopyeditorFile

 /**
  * Download a file a copyeditor has access to.
  * @param $submission object
  * @param $fileId int
  * @param $revision int
  */
 function downloadCopyeditorFile($copyeditorSubmission, $fileId, $revision = null)
 {
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $canDownload = false;
     // Copyeditors have access to:
     // 1) The first revision of the copyedit file
     // 2) The initial copyedit revision
     // 3) The author copyedit revision, after the author copyedit has been completed
     // 4) The final copyedit revision
     // 5) Layout galleys
     if ($copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true) == $fileId) {
         $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
         $signoffDao =& DAORegistry::getDAO('SignoffDAO');
         $currentRevision =& $articleFileDao->getRevisionNumber($fileId);
         if ($revision == null) {
             $revision = $currentRevision;
         }
         $initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
         $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
         $finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
         if ($revision == 1) {
             $canDownload = true;
         } else {
             if ($initialSignoff->getFileRevision() == $revision) {
                 $canDownload = true;
             } else {
                 if ($finalSignoff->getFileRevision() == $revision) {
                     $canDownload = true;
                 }
             }
         }
     } else {
         if ($copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_AUTHOR', true) == $fileId) {
             $signoffDao =& DAORegistry::getDAO('SignoffDAO');
             $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
             if ($authorSignoff->getDateCompleted() != null) {
                 $canDownload = true;
             }
         } else {
             if ($copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL', true) == $fileId) {
                 $canDownload = true;
             } else {
                 // Check galley files
                 foreach ($copyeditorSubmission->getGalleys() as $galleyFile) {
                     if ($galleyFile->getFileId() == $fileId) {
                         $canDownload = true;
                     }
                 }
                 // Check supp files
                 foreach ($copyeditorSubmission->getSuppFiles() as $suppFile) {
                     if ($suppFile->getFileId() == $fileId) {
                         $canDownload = true;
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('CopyeditorAction::downloadCopyeditorFile', array(&$copyeditorSubmission, &$fileId, &$revision, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($copyeditorSubmission->getId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:73,代码来源:CopyeditorAction.inc.php

示例6: downloadAuthorFile


//.........这里部分代码省略.........
 function downloadAuthorFile($article, $fileId, $revision = null)
 {
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $submission =& $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
     $layoutAssignment =& $submission->getLayoutAssignment();
     $canDownload = false;
     // Authors have access to:
     // 1) The original submission file.
     // 2) Any files uploaded by the reviewers that are "viewable",
     //    although only after a decision has been made by the editor.
     // 3) The initial and final copyedit files, after initial copyedit is complete.
     // 4) Any of the author-revised files.
     // 5) The layout version of the file.
     // 6) Any supplementary file
     // 7) Any galley file
     // 8) All review versions of the file
     // 9) Current editor versions of the file
     // THIS LIST SHOULD NOW BE COMPLETE.
     if ($submission->getSubmissionFileId() == $fileId) {
         $canDownload = true;
     } else {
         if ($submission->getCopyeditFileId() == $fileId) {
             if ($revision != null) {
                 $copyAssignmentDao =& DAORegistry::getDAO('CopyAssignmentDAO');
                 $copyAssignment =& $copyAssignmentDao->getCopyAssignmentByArticleId($article->getArticleId());
                 if ($copyAssignment && $copyAssignment->getInitialRevision() == $revision && $copyAssignment->getDateCompleted() != null) {
                     $canDownload = true;
                 } else {
                     if ($copyAssignment && $copyAssignment->getFinalRevision() == $revision && $copyAssignment->getDateFinalCompleted() != null) {
                         $canDownload = true;
                     } else {
                         if ($copyAssignment && $copyAssignment->getEditorAuthorRevision() == $revision) {
                             $canDownload = true;
                         }
                     }
                 }
             } else {
                 $canDownload = false;
             }
         } else {
             if ($submission->getRevisedFileId() == $fileId) {
                 $canDownload = true;
             } else {
                 if ($layoutAssignment->getLayoutFileId() == $fileId) {
                     $canDownload = true;
                 } else {
                     // Check reviewer files
                     foreach ($submission->getReviewAssignments() as $roundReviewAssignments) {
                         foreach ($roundReviewAssignments as $reviewAssignment) {
                             if ($reviewAssignment->getReviewerFileId() == $fileId) {
                                 $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
                                 $articleFile =& $articleFileDao->getArticleFile($fileId, $revision);
                                 if ($articleFile != null && $articleFile->getViewable()) {
                                     $canDownload = true;
                                 }
                             }
                         }
                     }
                     // Check supplementary files
                     foreach ($submission->getSuppFiles() as $suppFile) {
                         if ($suppFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                     // Check galley files
                     foreach ($submission->getGalleys() as $galleyFile) {
                         if ($galleyFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                     // Check current review version
                     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
                     $reviewFilesByRound =& $reviewAssignmentDao->getReviewFilesByRound($article->getArticleId());
                     $reviewFile = @$reviewFilesByRound[$article->getCurrentRound()];
                     if ($reviewFile && $fileId == $reviewFile->getFileId()) {
                         $canDownload = true;
                     }
                     // Check editor version
                     $editorFiles = $submission->getEditorFileRevisions($article->getCurrentRound());
                     if (is_array($editorFiles)) {
                         foreach ($editorFiles as $editorFile) {
                             if ($editorFile->getFileId() == $fileId) {
                                 $canDownload = true;
                             }
                         }
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('AuthorAction::downloadAuthorFile', array(&$article, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($article->getArticleId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:101,代码来源:AuthorAction.inc.php

示例7: downloadReviewerFile

 /**
  * Download a file a reviewer has access to.
  * @param $reviewId int
  * @param $article object
  * @param $fileId int
  */
 function downloadReviewerFile($article, $fileId, $reviewId = null)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     if ($reviewId) {
         $reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
     }
     $canDownload = false;
     $submissionFile = $article->getSubmissionFile();
     $reviewFile = $article->getReviewFile();
     $suppFiles = $article->getSuppFiles();
     // Reviewers have access to:
     // 1) The current revision of the file to be reviewed.
     // 2) Any file that (s)he uploads.
     // 3) Any supplementary file that is visible to reviewers.
     // 4) Any of the previous main proposal files
     // 5) Any of the report files
     // 6) Any of the sae files
     if ($reviewFile->getId() == $fileId) {
         $canDownload = true;
     } else {
         if ($reviewId) {
             if ($reviewAssignment->getReviewerFileId() == $fileId) {
                 $canDownload = true;
             }
         } else {
             if ($submissionFile->getFileId() == $fileId) {
                 $canDownload = true;
             } else {
                 foreach ($suppFiles as $suppFile) {
                     if ($suppFile->getFileId() == $fileId && $suppFile->getShowReviewers()) {
                         $canDownload = true;
                     }
                 }
                 if (!$canDownload) {
                     foreach ($article->getReportFiles() as $reportFile) {
                         if ($reportFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                 }
                 if (!$canDownload) {
                     foreach ($article->getSAEFiles() as $reportFile) {
                         if ($reportFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                 }
                 if (!$canDownload) {
                     $previousFiles =& $articleFileDao->getPreviousFilesByArticleId($article->getId());
                     foreach ($previousFiles as $previousFile) {
                         if ($previousFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('ReviewerAction::downloadReviewerFile', array(&$article, &$fileId, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($article->getId(), $fileId);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:elavaud,项目名称:hrp_ct,代码行数:75,代码来源:ReviewerAction.inc.php

示例8: downloadAuthorFile

 /**
  * Download a file an author has access to.
  * @param $paper object
  * @param $fileId int
  * @param $revision int
  * @return boolean
  * TODO: Complete list of files author has access to
  */
 function downloadAuthorFile($paper, $fileId, $revision = null)
 {
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $submission =& $authorSubmissionDao->getAuthorSubmission($paper->getId());
     $canDownload = false;
     // Authors have access to:
     // 1) The original submission file.
     // 2) Any files uploaded by the reviewers that are "viewable",
     //    although only after a decision has been made by the director.
     // 4) Any of the author-revised files.
     // 5) The layout version of the file.
     // 6) Any supplementary file
     // 7) Any galley file
     // 8) All review versions of the file
     // 9) Current director versions of the file
     // THIS LIST SHOULD NOW BE COMPLETE.
     if ($submission->getSubmissionFileId() == $fileId) {
         $canDownload = true;
     } else {
         if ($submission->getRevisedFileId() == $fileId) {
             $canDownload = true;
         } else {
             if ($submission->getLayoutFileId() == $fileId) {
                 $canDownload = true;
             } else {
                 // Check reviewer files
                 foreach ($submission->getReviewAssignments(null) as $stageReviewAssignments) {
                     foreach ($stageReviewAssignments as $reviewAssignment) {
                         if ($reviewAssignment->getReviewerFileId() == $fileId) {
                             $paperFileDao =& DAORegistry::getDAO('PaperFileDAO');
                             $paperFile =& $paperFileDao->getPaperFile($fileId, $revision);
                             if ($paperFile != null && $paperFile->getViewable()) {
                                 $canDownload = true;
                             }
                         }
                     }
                 }
                 // Check supplementary files
                 foreach ($submission->getSuppFiles() as $suppFile) {
                     if ($suppFile->getFileId() == $fileId) {
                         $canDownload = true;
                     }
                 }
                 // Check galley files
                 foreach ($submission->getGalleys() as $galleyFile) {
                     if ($galleyFile->getFileId() == $fileId) {
                         $canDownload = true;
                     }
                 }
                 // Check current review version
                 $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
                 $reviewFilesByStage =& $reviewAssignmentDao->getReviewFilesByStage($paper->getId());
                 $reviewFile = @$reviewFilesByStage[$paper->getCurrentStage()];
                 if ($reviewFile && $fileId == $reviewFile->getFileId()) {
                     $canDownload = true;
                 }
                 // Check director version
                 $directorFiles = $submission->getDirectorFileRevisions($paper->getCurrentStage());
                 if (is_array($directorFiles)) {
                     foreach ($directorFiles as $directorFile) {
                         if ($directorFile->getFileId() == $fileId) {
                             $canDownload = true;
                         }
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('AuthorAction::downloadAuthorFile', array(&$paper, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($paper->getId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:sedici,项目名称:ocs,代码行数:86,代码来源:AuthorAction.inc.php

示例9: download

 /**
  * Download a file.
  * @param $args array ($paperId, $fileId, [$revision])
  */
 function download($args, $request)
 {
     $paperId = (int) array_shift($args);
     $fileId = (int) array_shift($args);
     $revision = (int) array_shift($args);
     if (!$revision) {
         $revision = null;
     }
     $this->validate($request, $paperId);
     Action::downloadFile($paperId, $fileId, $revision);
 }
开发者ID:ramonsodoma,项目名称:ocs,代码行数:15,代码来源:TrackSubmissionHandler.inc.php

示例10: downloadProofreaderFile

 /**
  * Download a file a proofreader has access to.
  * @param $submission object
  * @param $fileId int
  * @param $revision int
  */
 function downloadProofreaderFile($submission, $fileId, $revision = null)
 {
     $canDownload = false;
     // Proofreaders have access to:
     // 1) All supplementary files.
     // 2) All galley files.
     // Check supplementary files
     foreach ($submission->getSuppFiles() as $suppFile) {
         if ($suppFile->getFileId() == $fileId) {
             $canDownload = true;
         }
     }
     // Check galley files
     foreach ($submission->getGalleys() as $galleyFile) {
         if ($galleyFile->getFileId() == $fileId) {
             $canDownload = true;
         }
     }
     $result = false;
     if (!HookRegistry::call('ProofreaderAction::downloadProofreaderFile', array(&$submission, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($submission->getArticleId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:34,代码来源:ProofreaderAction.inc.php

示例11: downloadFile

 /**
  * Download a file a layout editor has access to.
  * This includes: The layout editor submission file, supplementary files, and galley files.
  * @param $article object
  * @parma $fileId int
  * @param $revision int optional
  * @return boolean
  */
 function downloadFile($article, $fileId, $revision = null)
 {
     $canDownload = false;
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $suppDao =& DAORegistry::getDAO('SuppFileDAO');
     $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
     if ($layoutSignoff->getFileId() == $fileId) {
         $canDownload = true;
     } else {
         if ($galleyDao->galleyExistsByFileId($article->getId(), $fileId)) {
             $canDownload = true;
         } else {
             if ($suppDao->suppFileExistsByFileId($article->getId(), $fileId)) {
                 $canDownload = true;
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('LayoutEditorAction::downloadFile', array(&$article, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return parent::downloadFile($article->getId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:36,代码来源:LayoutEditorAction.inc.php

示例12: downloadAuthorFile


//.........这里部分代码省略.........
     // 4) Any of the author-revised files.
     // 5) The layout version of the file.
     // 6) Any supplementary file
     // 7) Any galley file
     // 8) All review versions of the file
     // 9) Current editor versions of the file
     // THIS LIST SHOULD NOW BE COMPLETE.
     if ($authorSubmission->getSubmissionFileId() == $fileId) {
         $canDownload = true;
     } else {
         if ($authorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true) == $fileId) {
             $initialSignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
             $authorSignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
             $finalSignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
             if ($initialSignoff && $initialSignoff->getDateCompleted() != null) {
                 $canDownload = true;
             } else {
                 if ($finalSignoff && $finalSignoff->getDateCompleted() != null) {
                     $canDownload = true;
                 } else {
                     if ($authorSignoff) {
                         $canDownload = true;
                     }
                 }
             }
         } else {
             if ($authorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_AUTHOR', true) == $fileId) {
                 $canDownload = true;
             } else {
                 if ($authorSubmission->getRevisedFileId() == $fileId) {
                     $canDownload = true;
                 } else {
                     if ($layoutSignoff->getFileId() == $fileId) {
                         $canDownload = true;
                     } else {
                         // Check reviewer files
                         $articleFileDao = DAORegistry::getDAO('ArticleFileDAO');
                         $files =& $articleFileDao->getArticleFilesByArticle($authorSubmission->getArticleId());
                         foreach ($files as $articleFile) {
                             if ($articleFile->getFileId() == $fileId) {
                                 if ($articleFile != null && $articleFile->getViewable()) {
                                     $canDownload = true;
                                 }
                             }
                         }
                         // Check supplementary files
                         foreach ($authorSubmission->getSuppFiles() as $suppFile) {
                             if ($suppFile->getFileId() == $fileId) {
                                 $canDownload = true;
                             }
                         }
                         // Check report files
                         foreach ($authorSubmission->getReportFiles() as $reportFile) {
                             if ($reportFile->getFileId() == $fileId) {
                                 $canDownload = true;
                             }
                         }
                         // Check SAE files
                         foreach ($authorSubmission->getSAEFiles() as $reportFile) {
                             if ($reportFile->getFileId() == $fileId) {
                                 $canDownload = true;
                             }
                         }
                         // Check galley files
                         foreach ($authorSubmission->getGalleys() as $galleyFile) {
                             if ($galleyFile->getFileId() == $fileId) {
                                 $canDownload = true;
                             }
                         }
                         // Check current review version
                         $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
                         $reviewFilesByDecision =& $reviewAssignmentDao->getReviewFilesByDecision($article->getId());
                         $reviewFile = @$reviewFilesByDecision[$article->getLastSectionDecisionId()];
                         if ($reviewFile && $fileId == $reviewFile->getFileId()) {
                             $canDownload = true;
                         }
                         // Check editor version
                         /*
                         $editorFiles = $authorSubmission->getEditorFileRevisions();
                         if (is_array($editorFiles)) foreach ($editorFiles as $editorFile) {
                         	if ($editorFile->getFileId() == $fileId) {
                         		$canDownload = true;
                         	}
                         }
                         */
                     }
                 }
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('AuthorAction::downloadAuthorFile', array(&$article, &$fileId, &$canDownload, &$result))) {
         if ($canDownload) {
             return Action::downloadFile($article->getId(), $fileId);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:101,代码来源:AuthorAction.inc.php

示例13: download

 /**
  * Download a file.
  * @param $args array ($paperId, $fileId, [$revision])
  */
 function download($args)
 {
     $paperId = (int) array_shift($args);
     $fileId = (int) array_shift($args);
     $revision = (int) array_shift($args);
     $this->validate($paperId);
     Action::downloadFile($paperId, $fileId, $revision);
 }
开发者ID:pulipulichen,项目名称:ocs,代码行数:12,代码来源:TrackSubmissionHandler.inc.php

示例14: downloadFile

 /**
  * Download a file a layout editor has access to.
  * This includes: The layout editor submission file, supplementary files, and galley files.
  * @param $article object
  * @parma $fileId int
  * @param $revision int optional
  * @return boolean
  */
 function downloadFile($article, $fileId, $revision = null)
 {
     $canDownload = false;
     $layoutDao =& DAORegistry::getDAO('LayoutAssignmentDAO');
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $suppDao =& DAORegistry::getDAO('SuppFileDAO');
     $layoutAssignment =& $layoutDao->getLayoutAssignmentByArticleId($article->getArticleId());
     if ($layoutAssignment->getLayoutFileId() == $fileId) {
         $canDownload = true;
     } else {
         if ($galleyDao->galleyExistsByFileId($article->getArticleId(), $fileId)) {
             $canDownload = true;
         } else {
             if ($suppDao->suppFileExistsByFileId($article->getArticleId(), $fileId)) {
                 $canDownload = true;
             }
         }
     }
     $result = false;
     if (!HookRegistry::call('LayoutEditorAction::downloadFile', array(&$article, &$fileId, &$revision, &$canDownload, &$result))) {
         if ($canDownload) {
             return parent::downloadFile($article->getArticleId(), $fileId, $revision);
         } else {
             return false;
         }
     }
     return $result;
 }
开发者ID:Jouper,项目名称:jouper,代码行数:36,代码来源:LayoutEditorAction.inc.php

示例15: download

 /**
  * Download a file.
  * @param $args array ($articleId, $fileId, [$revision])
  */
 function download($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) = TrackSubmissionHandler::validate($articleId);
     Action::downloadFile($articleId, $fileId, $revision);
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:12,代码来源:TrackSubmissionHandler.inc.php


注:本文中的Action::downloadFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。