/** * @copydoc PKPManageFileApiHandler::removeFileIndex() */ function removeFileIndex($submission, $submissionFile) { // update the submission's search index if this was a proof file if ($submissionFile->getFileStage() == SUBMISSION_FILE_PROOF) { import('lib.pkp.classes.search.SubmissionSearch'); import('classes.search.ArticleSearchIndex'); ArticleSearchIndex::deleteTextIndex($submission->getId(), SUBMISSION_SEARCH_GALLEY_FILE, $submissionFile->getFileId()); } }
/** * Delete a supplementary file. * @param $article object * @param $suppFileId int */ function deleteSuppFile($article, $suppFileId) { import('classes.file.ArticleFileManager'); $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getId()); if (isset($suppFile) && !HookRegistry::call('LayoutEditorAction::deleteSuppFile', array(&$article, &$suppFile))) { if ($suppFile->getFileId()) { $articleFileManager = new ArticleFileManager($article->getId()); $articleFileManager->deleteFile($suppFile->getFileId()); import('classes.search.ArticleSearchIndex'); ArticleSearchIndex::deleteTextIndex($article->getId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $suppFile->getFileId()); } $suppFileDao->deleteSuppFile($suppFile); } }