本文整理汇总了PHP中FileManager::uploadError方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::uploadError方法的具体用法?PHP FileManager::uploadError怎么用?PHP FileManager::uploadError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::uploadError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadLayoutFile
/**
* Upload a layout file (either layout version, galley, or supp. file).
*/
function uploadLayoutFile($args, $request)
{
$layoutFileType = $request->getUserVar('layoutFileType');
$round = (int) $request->getUserVar('round');
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
if ($fileManager->uploadError('layoutFile')) {
$templateMgr =& TemplateManager::getManager();
$this->setupTemplate($request, true);
$templateMgr->assign('pageTitle', 'submission.review');
$templateMgr->assign('message', 'common.uploadFailed');
$templateMgr->assign('backLink', $request->url(null, null, null, 'submissionReview', array($request->getUserVar('paperId'))));
$templateMgr->assign('backLinkLabel', 'submission.review');
return $templateMgr->display('common/message.tpl');
}
if ($layoutFileType == 'galley') {
$this->_uploadGalley($request, 'layoutFile', $round);
} else {
if ($layoutFileType == 'supp') {
$this->_uploadSuppFile($request, 'layoutFile', $round);
} else {
$request->redirect(null, null, null, 'submission', $request->getUserVar('paperId'));
}
}
}
示例2: saveSubmitSuppFile
/**
* Save a supplementary file.
* @param $args array optional, if set the first parameter is the supplementary file to update
*/
function saveSubmitSuppFile($args, $request)
{
$paperId = (int) $request->getUserVar('paperId');
$suppFileId = (int) array_shift($args);
$this->validate($request, $paperId, 4);
$this->setupTemplate($request, true);
$schedConf =& $request->getSchedConf();
$paper =& $this->paper;
if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) {
$request->redirect(null, null, 'index');
}
import('classes.author.form.submit.AuthorSubmitSuppFileForm');
$submitForm = new AuthorSubmitSuppFileForm($paper, $suppFileId);
$submitForm->readInputData();
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
if ($fileManager->uploadError('uploadSuppFile') && $suppFileId == 0) {
$submitForm->addError('uploadSubmissionFile', Locale::translate('common.uploadFailed'));
}
if ($submitForm->validate()) {
$submitForm->execute();
$request->redirect(null, null, null, 'submit', '4', array('paperId' => $paperId));
} else {
$submitForm->display();
}
}
示例3: uploadEmails
/**
* Upload a custom email template file
* @param $args array
* @param $request PKPRequest
*/
function uploadEmails($args, $request)
{
$this->validate();
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
$journal = $request->getJournal();
$journalId = $journal->getId();
$uploadName = 'email_file';
$fileName = $fileManager->getUploadedFileName($uploadName);
if (!$fileName) {
$request->redirect(null, null, 'emails');
}
$filesDir = Config::getVar('files', 'files_dir');
$filePath = $filesDir . '/journals/' . $journalId . '/' . $fileName;
if (!$fileManager->uploadError($uploadName)) {
if ($fileManager->uploadedFileExists($uploadName)) {
$uploadedFilePath = $fileManager->getUploadedFilePath($uploadName);
if ($this->_saveEmailTemplates($uploadedFilePath, $journal)) {
if ($fileManager->deleteFile($uploadedFilePath)) {
$this->_showMessage($request);
$request->redirect(null, null, 'emails');
}
}
}
}
$this->_showMessage($request, false);
$request->redirect(null, null, 'emails');
}
示例4: uploadLayoutFile
/**
* Upload a layout file (either layout version, galley, or supp. file).
*/
function uploadLayoutFile()
{
$layoutFileType = Request::getUserVar('layoutFileType');
$stage = (int) Request::getUserVar('stage');
import('file.FileManager');
$fileManager = new FileManager();
if ($fileManager->uploadError('layoutFile')) {
$templateMgr =& TemplateManager::getManager();
$this->setupTemplate(true);
$templateMgr->assign('pageTitle', 'submission.review');
$templateMgr->assign('message', 'common.uploadFailed');
$templateMgr->assign('backLink', Request::url(null, null, null, 'submissionReview', array(Request::getUserVar('paperId'))));
$templateMgr->assign('backLinkLabel', 'submission.review');
return $templateMgr->display('common/message.tpl');
}
if ($layoutFileType == 'galley') {
$this->uploadGalley('layoutFile', $stage);
} else {
if ($layoutFileType == 'supp') {
$this->uploadSuppFile('layoutFile', $stage);
} else {
Request::redirect(null, null, null, 'submission', Request::getUserVar('paperId'));
}
}
}
示例5: saveSubmitSuppFile
/**
* Save a supplementary file.
* @param $args array optional, if set the first parameter is the supplementary file to update
*/
function saveSubmitSuppFile($args)
{
$paperId = (int) Request::getUserVar('paperId');
$suppFileId = isset($args[0]) ? (int) $args[0] : 0;
$this->validate($paperId, 4);
$this->setupTemplate(true);
$schedConf =& Request::getSchedConf();
$paper =& $this->paper;
if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) {
Request::redirect(null, null, 'index');
}
import('author.form.submit.AuthorSubmitSuppFileForm');
$submitForm = new AuthorSubmitSuppFileForm($paper, $suppFileId);
$submitForm->readInputData();
import('file.FileManager');
$fileManager = new FileManager();
if ($fileManager->uploadError('uploadSuppFile') && $suppFileId == 0) {
$submitForm->addError('uploadSubmissionFile', __('common.uploadFailed'));
}
if ($submitForm->validate()) {
$submitForm->execute();
Request::redirect(null, null, null, 'submit', '4', array('paperId' => $paperId));
} else {
$submitForm->display();
}
}