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


PHP ArticleFileManager::uploadSubmissionNoteFile方法代码示例

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


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

示例1: updateSubmissionNote

 /**
  * Updates Submission Note
  * @param $articleId int
  */
 function updateSubmissionNote($articleId, $request)
 {
     import('classes.file.ArticleFileManager');
     $noteDao =& DAORegistry::getDAO('NoteDAO');
     $user =& $request->getUser();
     $journal =& $request->getJournal();
     $note = new Note();
     $note->setId($request->getUserVar('noteId'));
     $note->setAssocType(ASSOC_TYPE_ARTICLE);
     $note->setAssocId($articleId);
     $note->setUserId($user->getId());
     $note->setDateModified(Core::getCurrentDate());
     $note->setContextId($journal->getId());
     $note->setTitle($request->getUserVar('title'));
     $note->setContents($request->getUserVar('note'));
     $note->setFileId($request->getUserVar('fileId'));
     if (HookRegistry::call('SectionEditorAction::updateSubmissionNote', array(&$articleId, &$note))) {
         return;
     }
     $articleFileManager = new ArticleFileManager($articleId);
     // if there is a new file being uploaded
     if ($articleFileManager->uploadedFileExists('upload')) {
         // Attach the new file to the note, overwriting existing file if necessary
         $fileId = $articleFileManager->uploadSubmissionNoteFile('upload', $note->getFileId(), true);
         $note->setFileId($fileId);
     } else {
         if ($request->getUserVar('removeUploadedFile')) {
             $articleFileManager = new ArticleFileManager($articleId);
             $articleFileManager->deleteFile($note->getFileId());
             $note->setFileId(0);
         }
     }
     $noteDao->updateObject($note);
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:38,代码来源:SectionEditorAction.inc.php

示例2: updateSubmissionNote

 /**
  * Updates Submission Note
  * @param $articleId int
  */
 function updateSubmissionNote($articleId)
 {
     import('file.ArticleFileManager');
     $articleNoteDao =& DAORegistry::getDAO('ArticleNoteDAO');
     $user =& Request::getUser();
     $articleNote = new ArticleNote();
     $articleNote->setId(Request::getUserVar('noteId'));
     $articleNote->setArticleId($articleId);
     $articleNote->setUserId($user->getId());
     $articleNote->setDateModified(Core::getCurrentDate());
     $articleNote->setTitle(Request::getUserVar('title'));
     $articleNote->setNote(Request::getUserVar('note'));
     $articleNote->setFileId(Request::getUserVar('fileId'));
     if (HookRegistry::call('SectionEditorAction::updateSubmissionNote', array(&$articleId, &$articleNote))) {
         return;
     }
     $articleFileManager = new ArticleFileManager($articleId);
     // if there is a new file being uploaded
     if ($articleFileManager->uploadedFileExists('upload')) {
         // Attach the new file to the note, overwriting existing file if necessary
         $fileId = $articleFileManager->uploadSubmissionNoteFile('upload', $articleNote->getFileId(), true);
         $articleNote->setFileId($fileId);
     } else {
         if (Request::getUserVar('removeUploadedFile')) {
             $articleFileManager = new ArticleFileManager($articleId);
             $articleFileManager->deleteFile($articleNote->getFileId());
             $articleNote->setFileId(0);
         }
     }
     $articleNoteDao->updateArticleNote($articleNote);
 }
开发者ID:philschatz,项目名称:ojs,代码行数:35,代码来源:SectionEditorAction.inc.php


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