Skip to content

Commit

Permalink
pkp/pkp-lib#1828 consider keywords in DublicCoreMetaPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Sep 1, 2017
1 parent 929049b commit 1d08aac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function articleView($hookName, $args) {
}

$i=0;
foreach (explode($article->getAuthorString(), ', ') as $author) {
foreach (explode(', ', $article->getAuthorString()) as $author) {
$templateMgr->addHeader('dublinCoreAuthor' . $i++, '<meta name="DC.Creator.PersonalName" content="' . htmlspecialchars($author) . '"/>');
}

Expand Down Expand Up @@ -119,9 +119,11 @@ function articleView($hookName, $args) {
$templateMgr->addHeader('dublinCoreSourceUri', '<meta name="DC.Source.URI" content="' . $request->url($journal->getPath()) . '"/>');

$i=0;
if ($subjects = $article->getSubject(null)) foreach ($subjects as $locale => $localeSubject) {
foreach (explode($localeSubject, '; ') as $subject) if ($subject) {
$templateMgr->addHeader('dublinCoreSubject' . $i++, '<meta name="DC.Subject" xml:lang="' . htmlspecialchars(substr($locale, 0, 2)) . '" content="' . htmlspecialchars($subject) . '"/>');
$dao = DAORegistry::getDAO('SubmissionKeywordDAO');
$keywords = $dao->getKeywords($article->getId(), array(AppLocale::getLocale()));
foreach ($keywords as $locale => $localeKeywords) {
foreach ($localeKeywords as $keyword) {
$templateMgr->addHeader('dublinCoreSubject' . $i++, '<meta name="DC.Subject" xml:lang="' . htmlspecialchars(substr($locale, 0, 2)) . '" content="' . htmlspecialchars($keyword) . '"/>');
}
}

Expand Down

0 comments on commit 1d08aac

Please sign in to comment.