本文整理汇总了PHP中ArticleFileManager::downloadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleFileManager::downloadFile方法的具体用法?PHP ArticleFileManager::downloadFile怎么用?PHP ArticleFileManager::downloadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleFileManager
的用法示例。
在下文中一共展示了ArticleFileManager::downloadFile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: downloadFile
/**
* Download a file.
* @param $args array ($articleId, $fileId, [$revision])
*/
function downloadFile($args)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$fileId = isset($args[1]) ? $args[1] : 0;
$revision = isset($args[2]) ? $args[2] : null;
$articleIdRepo = isset($args[3]) ? $args[3] : null;
//TODO: validation
//%CBP% is we have passed a PID and namespace, download the file from the repository
import('classes.file.ArticleFileManager');
// FIXME
if (intval($articleId) == false && intval($fileId) == false) {
return ArticleFileManager::downloadFile($articleId, $fileId, false, false, false, $articleIdRepo);
} else {
$articleFileManager = new ArticleFileManager($articleId);
return $articleFileManager->downloadFile($fileId, $revision);
}
}
示例2: viewFile
/**
* View file.
* @param $articleId int
* @param $fileId int
* @param $revision int
*/
function viewFile($articleId, $fileId, $revision = null)
{
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($articleId);
return $articleFileManager->downloadFile($fileId, $revision, true);
}
示例3: downloadFinalReport
/**
* Download published final report
* @param $args ($articleId, fileId)
*/
function downloadFinalReport($args)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$fileId = isset($args[1]) ? $args[1] : 0;
import("classes.file.ArticleFileManager");
$articleFileManager = new ArticleFileManager($articleId);
return $articleFileManager->downloadFile($fileId);
}
示例4: downloadSuppFile
/**
* Download a supplementary file
* @param $args array
* @param $request Request
*/
function downloadSuppFile($args, &$request)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$suppId = isset($args[1]) ? $args[1] : 0;
$this->validate($request, $articleId);
$journal =& $this->journal;
$issue =& $this->issue;
$article =& $this->article;
$suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
if ($journal->getSetting('enablePublicSuppFileId')) {
$suppFile =& $suppFileDao->getSuppFileByBestSuppFileId($article->getId(), $suppId);
} else {
$suppFile =& $suppFileDao->getSuppFile((int) $suppId, $article->getId());
}
if ($article && $suppFile) {
import('file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($article->getId());
if ($suppFile->isInlineable()) {
$articleFileManager->viewFile($suppFile->getFileId());
} else {
$articleFileManager->downloadFile($suppFile->getFileId());
}
}
}
示例5: downloadFile
/**
* Download file.
* @param $articleId int
* @param $fileId int
*/
function downloadFile($articleId, $fileId)
{
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($articleId);
return $articleFileManager->downloadFile($fileId);
}
示例6: downloadSuppFile
/**
* Download a supplementary file
* @param $args array
* @param $request Request
*/
function downloadSuppFile($args, &$request)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$suppId = isset($args[1]) ? $args[1] : 0;
$this->validate($request, $articleId);
$journal =& $this->journal;
$issue =& $this->issue;
$article =& $this->article;
$suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
if ($journal->getSetting('enablePublicSuppFileId')) {
$suppFile =& $suppFileDao->getSuppFileByBestSuppFileId($suppId, $article->getId());
} else {
$suppFile =& $suppFileDao->getSuppFile((int) $suppId, $article->getId());
}
if ($article && $suppFile && !HookRegistry::call('ArticleHandler::downloadSuppFile', array(&$article, &$suppFile))) {
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($article->getId());
if ($suppFile->getRemoteURL()) {
$request->redirectUrl($suppFile->getRemoteURL());
}
$articleFileManager->downloadFile($suppFile->getFileId(), null, $suppFile->isInlineable());
}
}
示例7: viewFile
/**
* View a file in a browser (inline)
* @param array $args
* @param PKPRequest $request
*/
function viewFile($args, $request, $hookName = 'ArticleHandler::viewFile', $inline = true)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? $args[1] : 0;
$fileId = isset($args[2]) ? (int) $args[2] : 0;
if ($this->userCanViewGalley($request, $articleId, $galleyId)) {
if (!$fileId) {
$submissionFile = $this->galley->getFirstGalleyFile();
if ($submissionFile) {
$fileId = $submissionFile->getFileId();
// The file manager expects the real article id. Extract it from the submission file.
$articleId = $submissionFile->getSubmissionId();
} else {
// no proof files assigned to this galley!
assert(false);
return null;
}
}
if (!HookRegistry::call($hookName, array($this->article, &$this->galley, &$fileId))) {
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($articleId);
$articleFileManager->downloadFile($fileId, null, $inline);
}
}
}
示例8: downloadFile
/**
* Download file.
* @param $articleId int
* @param $fileId int
* @param $revision int
*/
function downloadFile($articleId, $fileId, $revision = null)
{
import('file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($articleId);
return $articleFileManager->downloadFile($fileId, $revision);
}