17 import(
'lib.pkp.classes.plugins.GatewayPlugin');
27 parent::__construct();
28 $this->_parentPlugin = $parentPlugin;
44 return 'WebFeedGatewayPlugin';
51 return __(
'plugins.generic.webfeed.displayName');
58 return __(
'plugins.generic.webfeed.description');
66 return $this->_parentPlugin->getPluginPath();
75 public function getEnabled($contextId =
null) {
76 return $this->_parentPlugin->getEnabled($contextId);
88 if (!$journal)
return false;
92 $issue = $issueDao->getCurrent($journal->getId(),
true);
93 if (!$issue)
return false;
95 if (!$this->_parentPlugin->getEnabled($journal->getId()))
return false;
98 $type = array_shift($args);
101 'rss2' =>
'rss2.tpl',
104 $mimeTypeMap = array(
105 'rss' =>
'application/rdf+xml',
106 'rss2' =>
'application/rss+xml',
107 'atom' =>
'application/atom+xml'
109 if (!isset($typeMap[$type]))
return false;
112 $displayItems = $this->_parentPlugin->getSetting($journal->getId(),
'displayItems');
113 $recentItems = (int) $this->_parentPlugin->getSetting($journal->getId(),
'recentItems');
115 if ($displayItems ==
'recent' && $recentItems > 0) {
116 $submissionsIterator =
Services::get(
'submission')->getMany([
'contextId' => $journal->getId(),
'count' => $recentItems]);
117 $submissionsInSections = [];
118 foreach ($submissionsIterator as $submission) {
119 $submissionsInSections[][
'articles'][] = $submission;
122 $submissionsInSections =
Services::get(
'submission')->getInSections($issue->getId(), $journal->getId());
126 $version = $versionDao->getCurrentVersion();
129 $templateMgr->assign(array(
130 'ojsVersion' => $version->getVersionString(),
131 'publishedSubmissions' => $submissionsInSections,
132 'journal' => $journal,
139 $templateMgr->display($this->_parentPlugin->getTemplateResource($typeMap[$type]), $mimeTypeMap[$type]);