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


PHP FileManager::uploadError方法代码示例

本文整理汇总了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'));
         }
     }
 }
开发者ID:ramonsodoma,项目名称:ocs,代码行数:28,代码来源:SubmissionEditHandler.inc.php

示例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();
     }
 }
开发者ID:ramonsodoma,项目名称:ocs,代码行数:30,代码来源:SubmitHandler.inc.php

示例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');
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:33,代码来源:EmailHandler.inc.php

示例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'));
         }
     }
 }
开发者ID:jalperin,项目名称:ocs,代码行数:28,代码来源:SubmissionEditHandler.inc.php

示例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();
     }
 }
开发者ID:sedici,项目名称:ocs,代码行数:30,代码来源:SubmitHandler.inc.php


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