本文整理匯總了PHP中ArticleFileManager::copyToCopyeditFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArticleFileManager::copyToCopyeditFile方法的具體用法?PHP ArticleFileManager::copyToCopyeditFile怎麽用?PHP ArticleFileManager::copyToCopyeditFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArticleFileManager
的用法示例。
在下文中一共展示了ArticleFileManager::copyToCopyeditFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setCopyeditFile
/**
* Set the file to use as the default copyedit file.
* @param $sectionEditorSubmission object
* @param $fileId int
* @param $revision int
* TODO: SECURITY!
*/
function setCopyeditFile($sectionEditorSubmission, $fileId, $revision, $request)
{
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($sectionEditorSubmission->getId());
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$user =& $request->getUser();
if (!HookRegistry::call('SectionEditorAction::setCopyeditFile', array(&$sectionEditorSubmission, &$fileId, &$revision))) {
// Copy the file from the editor decision file folder to the copyedit file folder
$newFileId = $articleFileManager->copyToCopyeditFile($fileId, $revision);
$copyeditSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $sectionEditorSubmission->getId());
$copyeditSignoff->setFileId($newFileId);
$copyeditSignoff->setFileRevision(1);
$signoffDao->updateObject($copyeditSignoff);
// Add log
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($request, $sectionEditorSubmission, ARTICLE_LOG_COPYEDIT_SET_FILE, 'log.copyedit.copyeditFileSet');
}
}
示例2: setCopyeditFile
/**
* Set the file to use as the default copyedit file.
* @param $sectionEditorSubmission object
* @param $fileId int
* TODO: SECURITY!
*/
function setCopyeditFile($sectionEditorSubmission, $fileId)
{
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($sectionEditorSubmission->getArticleId());
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$user =& Request::getUser();
if (!HookRegistry::call('SectionEditorAction::setCopyeditFile', array(&$sectionEditorSubmission, &$fileId))) {
// Copy the file from the editor decision file folder to the copyedit file folder
$newFileId = $articleFileManager->copyToCopyeditFile($fileId);
$copyeditSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $sectionEditorSubmission->getArticleId());
$copyeditSignoff->setFileId($newFileId);
// No revision anymore
//$copyeditSignoff->setFileRevision(1);
$signoffDao->updateObject($copyeditSignoff);
// Add log
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));
ArticleLog::logEvent($sectionEditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_SET_FILE, ARTICLE_LOG_TYPE_COPYEDIT, $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true), 'log.copyedit.copyeditFileSet');
}
}