/** * @see ViewableFilePlugin::displayArticleGalley */ function displayArticleGalley($templateMgr, $request, $params) { $journal = $request->getJournal(); if (!$journal) { return ''; } return parent::displayArticleGalley($templateMgr, $request, $params); }
/** * @copydoc ViewableFilePlugin::displaySubmissionFile */ function displaySubmissionFile($publishedMonograph, $publicationFormat, $submissionFile) { $request = $this->getRequest(); $router = $request->getRouter(); $dispatcher = $request->getDispatcher(); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('pluginTemplatePath' => $this->getTemplatePath(), 'pluginUrl' => $request->getBaseUrl() . DIRECTORY_SEPARATOR . $this->getPluginPath(), 'downloadUrl' => $dispatcher->url($request, ROUTE_PAGE, null, null, 'download', array($publishedMonograph->getBestId(), $publicationFormat->getBestId(), $submissionFile->getBestId()), array('inline' => true)))); return parent::displaySubmissionFile($publishedMonograph, $publicationFormat, $submissionFile); }
/** * @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); }
/** * @copydoc ViewableFilePlugin::displaySubmissionFile */ function displaySubmissionFile($publishedMonograph, $submissionFile) { $templateMgr = TemplateManager::getManager($this->getRequest()); $templateMgr->assign(array('pluginTemplatePath' => $this->getTemplatePath(), 'pluginUrl' => $this->getRequest()->getBaseUrl() . DIRECTORY_SEPARATOR . $this->getPluginPath())); return parent::displaySubmissionFile($publishedMonograph, $submissionFile); }
/** * Get the template path * @return string */ function getTemplatePath() { return parent::getTemplatePath() . 'templates/'; }