/** * @see ViewableFilePlugin::displayArticleGalley */ function displayArticleGalley($templateMgr, $request, $params) { $journal = $request->getJournal(); if (!$journal) { return ''; } return parent::displayArticleGalley($templateMgr, $request, $params); }
/** * @see ViewableFilePlugin::displayArticleGalley */ function displayArticleGalley($request, $issue, $article, $galley) { $templateMgr = TemplateManager::getManager($request); $galleyFiles = $galley->getLatestGalleyFiles(); assert(count($galleyFiles) == 1); $templateMgr->assign(array('pluginLensPath' => $this->getLensPath($request), 'firstGalleyFile' => array_shift($galleyFiles), 'pluginTemplatePath' => $this->getTemplatePath())); return parent::displayArticleGalley($request, $issue, $article, $galley); }
/** * @see ViewableFilePlugin::displayArticleGalley */ function displayArticleGalley($templateMgr, $request, $params) { $journal = $request->getJournal(); if (!$journal) { return ''; } $fileId = isset($params['fileId']) && is_numeric($params['fileId']) ? (int) $fileId : null; if (!$fileId) { // unfortunate, but occasionally browsers upload PDF files as application/octet-stream. // Even setting the file type in the display template will not cause a correct render in this case. // So, update the file type if this is the case. $galley = $templateMgr->get_template_vars('galley'); // set in ArticleHandler $file = $galley->getFirstGalleyFile('pdf'); if (!preg_match('/\\.pdf$/', $file->getFileType())) { $file->setFileType('application/pdf'); $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); $submissionFileDao->updateObject($file); } } $templateMgr->assign('pluginJSPath', $this->getJSPath($request)); return parent::displayArticleGalley($templateMgr, $request, $params); }
/** * @see ViewableFilePlugin::displayArticleGalley */ function displayArticleGalley($templateMgr, $request, $params) { $journal = $request->getJournal(); if (!$journal) { return ''; } $fileId = isset($params['fileId']) && is_numeric($params['fileId']) ? (int) $params['fileId'] : null; $galley = $templateMgr->get_template_vars('galley'); // set in ArticleHandler $templateMgr->assign('htmlGalleyContents', $this->_getHTMLContents($request, $galley, $fileId)); return parent::displayArticleGalley($templateMgr, $request, $params); }