本文整理汇总了PHP中ArticleFileManager::copyPublicFile方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleFileManager::copyPublicFile方法的具体用法?PHP ArticleFileManager::copyPublicFile怎么用?PHP ArticleFileManager::copyPublicFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleFileManager
的用法示例。
在下文中一共展示了ArticleFileManager::copyPublicFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: expediteSubmission
/**
* Rush a new submission into the end of the editing queue.
* @param $article object
*/
function expediteSubmission($article, $request)
{
$user =& $request->getUser();
import('classes.submission.editor.EditorAction');
import('classes.submission.sectionEditor.SectionEditorAction');
import('classes.submission.proofreader.ProofreaderAction');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$submissionFile = $sectionEditorSubmission->getSubmissionFile();
// Add a log entry before doing anything.
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($request, $article, ARTICLE_LOG_EDITOR_EXPEDITE, 'log.editor.submissionExpedited', array('editorName' => $user->getFullName()));
// 1. Ensure that an editor is assigned.
$editAssignments =& $sectionEditorSubmission->getEditAssignments();
if (empty($editAssignments)) {
// No editors are currently assigned; assign self.
EditorAction::assignEditor($article->getId(), $user->getId(), true, false, $request);
}
// 2. Accept the submission and send to copyediting.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
if (!$sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true)) {
SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT, $request);
$reviewFile = $sectionEditorSubmission->getReviewFile();
SectionEditorAction::setCopyeditFile($sectionEditorSubmission, $reviewFile->getFileId(), $reviewFile->getRevision(), $request);
}
// 3. Add a galley.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$galleys =& $sectionEditorSubmission->getGalleys();
if (empty($galleys)) {
// No galley present -- use copyediting file.
import('classes.file.ArticleFileManager');
$copyeditFile =& $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
$fileType = $copyeditFile->getFileType();
$articleFileManager = new ArticleFileManager($article->getId());
$fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
if (strstr($fileType, 'html')) {
$galley = new ArticleHTMLGalley();
} else {
$galley = new ArticleGalley();
}
$galley->setArticleId($article->getId());
$galley->setFileId($fileId);
$galley->setLocale(AppLocale::getLocale());
if ($galley->isHTMLGalley()) {
$galley->setLabel('HTML');
} else {
if (strstr($fileType, 'pdf')) {
$galley->setLabel('PDF');
} else {
if (strstr($fileType, 'postscript')) {
$galley->setLabel('Postscript');
} else {
if (strstr($fileType, 'xml')) {
$galley->setLabel('XML');
} else {
$galley->setLabel(__('common.untitled'));
}
}
}
}
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$galleyDao->insertGalley($galley);
// Update file search index
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_GALLEY_FILE, $fileId);
}
$sectionEditorSubmission->setStatus(STATUS_QUEUED);
$sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
}
示例2: expediteSubmission
/**
* Rush a new submission into the end of the editing queue.
* @param $article object
*/
function expediteSubmission($article)
{
$user =& Request::getUser();
import('classes.submission.editor.EditorAction');
import('classes.submission.sectionEditor.SectionEditorAction');
import('classes.submission.proofreader.ProofreaderAction');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$submissionFile = $sectionEditorSubmission->getSubmissionFile();
// Add a long entry before doing anything.
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getId(), ARTICLE_LOG_EDITOR_EXPEDITE, ARTICLE_LOG_TYPE_EDITOR, $user->getId(), 'log.editor.submissionExpedited', array('editorName' => $user->getFullName(), 'articleId' => $article->getId()));
// 1. Accept the submission and send to copyediting.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
if (!$sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true)) {
SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_SECTION_DECISION_APPROVED);
$reviewFile = $sectionEditorSubmission->getReviewFile();
SectionEditorAction::setCopyeditFile($sectionEditorSubmission, $reviewFile->getFileId());
}
// 2. Add a galley.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$galleys =& $sectionEditorSubmission->getGalleys();
if (empty($galleys)) {
// No galley present -- use copyediting file.
import('classes.file.ArticleFileManager');
$copyeditFile =& $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
$fileType = $copyeditFile->getFileType();
$articleFileManager = new ArticleFileManager($article->getId());
$fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
if (strstr($fileType, 'html')) {
$galley = new ArticleHTMLGalley();
} else {
$galley = new ArticleGalley();
}
$galley->setArticleId($article->getId());
$galley->setFileId($fileId);
$galley->setLocale(Locale::getLocale());
if ($galley->isHTMLGalley()) {
$galley->setLabel('HTML');
} else {
if (strstr($fileType, 'pdf')) {
$galley->setLabel('PDF');
} else {
if (strstr($fileType, 'postscript')) {
$galley->setLabel('Postscript');
} else {
if (strstr($fileType, 'xml')) {
$galley->setLabel('XML');
} else {
$galley->setLabel(Locale::translate('common.untitled'));
}
}
}
}
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$galleyDao->insertGalley($galley);
}
$sectionEditorSubmission->setStatus(STATUS_QUEUED);
$sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
}