本文整理汇总了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');
}
}