當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。