%PDF-1.7 GIF89;
| Server IP : 104.20.45.2 / Your IP : 172.16.20.3 Web Server : Apache/2.4.25 (Debian) System : Linux f64a392e70de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : application ( 1000) PHP Version : 5.6.40 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /app/plugins/generic/googleViewer/ |
Upload File : |
<?php
/**
* @file plugins/generic/googleViewer/GoogleViewerPlugin.inc.php
*
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class GoogleViewerPlugin
*
* @brief This plugin enables embedding of the google document viewer for PDF display
*/
import('lib.pkp.classes.plugins.GenericPlugin');
class GoogleViewerPlugin extends GenericPlugin {
function register($category, $path) {
if (parent::register($category, $path)) {
if ($this->getEnabled()) {
HookRegistry::register('TemplateManager::include', array(&$this, '_includeCallback'));
HookRegistry::register('TemplateManager::display', array(&$this, '_displayCallback'));
}
return true;
}
return false;
}
function getDisplayName() {
return __('plugins.generic.googleViewer.name');
}
function getDescription() {
return __('plugins.generic.googleViewer.description');
}
function _includeCallback($hookName, $args) {
if ($this->getEnabled()) {
$templateMgr =& $args[0];
$params =& $args[1];
if (!isset($params['smarty_include_tpl_file'])) return false;
switch ($params['smarty_include_tpl_file']) {
case 'article/pdfViewer.tpl':
$params['smarty_include_tpl_file'] = $this->getTemplatePath() . 'index.tpl';
break;
}
return false;
}
}
function _displayCallback($hookName, $args) {
if ($this->getEnabled()) {
$templateMgr =& $args[0];
$template =& $args[1];
switch ($template) {
case 'issue/issueGalley.tpl':
$template = $this->getTemplatePath() . 'issueGalley.tpl';
break;
}
return false;
}
}
}
?>