Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#1828 consider keywords for display, DC and GoogleScholar indexing #1518

Merged
merged 6 commits into from
Sep 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 7 additions & 5 deletions plugins/generic/googleScholar/GoogleScholarPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function articleView($hookName, $args) {
$templateMgr->addHeader('googleScholarJournalTitle', '<meta name="citation_journal_title" content="' . htmlspecialchars($journal->getName($journal->getPrimaryLocale())) . '"/>');
if (($issn = $journal->getSetting('onlineIssn')) || ($issn = $journal->getSetting('printIssn')) || ($issn = $journal->getSetting('issn'))) {
$templateMgr->addHeader('googleScholarIssn', '<meta name="citation_issn" content="' . htmlspecialchars($issn) . '"/> ');

}

foreach ($article->getAuthors() as $i => $author) {
Expand Down Expand Up @@ -91,17 +91,19 @@ function articleView($hookName, $args) {
foreach((array) $templateMgr->get_template_vars('pubIdPlugins') as $pubIdPlugin) {
if ($pubId = $article->getStoredPubId($pubIdPlugin->getPubIdType())) {
$templateMgr->addHeader('googleScholarPubId' . $pubIdPlugin->getPubIdDisplayType(), '<meta name="citation_' . htmlspecialchars(strtolower($pubIdPlugin->getPubIdDisplayType())) . '" content="' . htmlspecialchars($pubId) . '"/>');

}
}

$templateMgr->addHeader('googleScholarHtmlUrl', '<meta name="citation_abstract_html_url" content="' . $request->url(null, 'article', 'view', array($article->getBestArticleId())) . '"/>');
if ($language = $article->getLanguage()) $templateMgr->addHeader('googleScholarLanguage', '<meta name="citation_language" content="' . htmlspecialchars($language) . '"/>');

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

Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/ar_IQ/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="ar_IQ" full_name="العربية">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">هذه الإضافة تقوم بتعيين معرفات المكونات الرقمية للمقالات، الأعداد، الألواح الطباعية، والملفات التكميلية في نظام المجلات المفتوحة.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">لطفاً، قم بتهيئة إضافة DOI لتتمكن من إدارة واستعمال DOI في نظام المجلات المفتوحة:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/cs_CZ/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="cs_CZ" full_name="Čeština">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">Tento plugin umožňuje přiřazení identifikátorů digitálních objektů DOI k číslům, článkům a sazebnicím v rámci OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.description">Naonfigurujte, prosím, plugin DOI, abyste mohli spravovat a používat DOI v OJS:</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjects">Obsah časopisu</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjectsRequired">Zvolte, prosím, které objekty mají mít přiděleno DOI.</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/da_DK/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="da_DK" full_name="Dansk">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">Dette plug-in gør det muligt at tildele DOI’er (Digital Object Identifiers) til numre, artikler, satsskibe og supplerende filer i OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.description">Konfigurér dette DOI plug-in, så det bliver muligt at administrere og bruge DOI’er i OJS:</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjects">Tidsskriftsindhold</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjectsRequired">Vælg de elementer, der skal have tildelt et DOI.</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/de_DE/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="de_DE" full_name="Deutsch (Deutschland)">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">Dieses Plugin ermöglicht die Zuweisung von DOIs (persistent identifiers) zu Ausgaben, Artikeln und Fahnen in OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Bitte konfigurieren Sie das DOI-Plugin, damit Sie DOI in OJS verwalten und benutzen können:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/en_US/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="en_US" full_name="U.S. English">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">This plugin enables the assignment of the Digital Object Identifiers to issues, articles and galleys in OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Please configure the DOI plugin to be able to manage and use DOIs in OJS:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/fi_FI/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="fi_FI" full_name="Suomi">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">Tämä lisäosa mahdollistaa DOI-tunnisteiden (Digital Object Identifier) määrittämisen OJS-järjestelmässä oleville numeroille, artikkeleille ja julkaistaville tiedostoille.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Määritä DOI-lisäosa, jotta voit hallinnoida ja käyttää DOI-tunnisteita OJS:ssä:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/fr_CA/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="fr_CA" full_name="Français (Canada)">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.description">Ce plugiciel permet l'attribution d'identifiants numériques d'objets (DOI) à des articles, numéro ou épreuve crées dans OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.description">Veuillez configurer le plugiciel DOI pour ainsi pouvoir utiliser et gérer les DOI dans OJS:</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjects">Contenu de la revue</message>
<message key="plugins.pubIds.doi.manager.settings.doiObjectsRequired">Veuillez choisir les objets auxquels des DOIs seront attribués.</message>
Expand Down
1 change: 1 addition & 0 deletions plugins/pubIds/doi/locale/id_ID/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<locale name="id_ID" full_name="Bahasa Indonesia">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Silahkan konfigurasikan plugin DOI untuk dapat mengatur dan menggunakan DOIs dalam OJS:</message>
Expand Down
1 change: 1 addition & 0 deletions plugins/pubIds/doi/locale/it_IT/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<locale name="it_IT" full_name="Italiano">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Seguire il setup per essere in grado di gestire e utilizzare DOI in OJS:</message>
Expand Down
1 change: 1 addition & 0 deletions plugins/pubIds/doi/locale/nl_NL/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<locale name="nl_NL" full_name="Nederlands">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Configureer de DOI plugin om DOIs in OJS te kunnen beheren en gebruiken:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/pt_BR/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<message key="plugins.pubIds.doi.editor.doiObjectTypeGalley">composição</message>
<message key="plugins.pubIds.doi.editor.doiSuffixCustomIdentifierNotUnique">O sufixo DOI informado já está em uso por outro item publicado. Informe um sufixo DOI único para cada item.</message>
<message key="plugins.pubIds.doi.description">Este plugin permite a atribuição dos Identificadores Digitais de Objetos a edições, artigos e composições finais no OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.doiReassign.description">Se você alterar sua configuração DOI, os DOIs que já foram atribuídas não serão afetadas. Uma vez que a configuração DOI é salva, use este botão para limpar todas as DOIs existentes para que as novas configurações tenham efeito sobre os objetos existentes. ATENÇÃO, não utilize esse botão para atribuir DOIs a artigos com DOIs já depositados (O mesmo documento não pode ter dois DOI)</message>
<message key="plugins.pubIds.doi.editor.doiObjectTypeRepresentation">composição final</message>
<message key="plugins.pubIds.doi.editor.customSuffixMissing">O DOI não pode ser atribuído porque o sufixo personalizado está faltando.</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/pt_PT/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<message key="plugins.pubIds.doi.editor.clearIssueObjectsDoi">Limpar DOI da Edição</message>
<message key="plugins.pubIds.doi.editor.clearIssueObjectsDoi.description">Use este botão para remover todos os DOIs associados a todas as publicações (artigos, números completos, e ficheiros suplementares) actualmetne agendados para esta edição/número.</message>
<message key="plugins.pubIds.doi.description">Este plugin permite a atribuição do DOI a números, artigos e composições no OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.doiSuffixCustomIdentifier">Insira um sufixo DOI individual para cada publicação. Encontrará um campo de entrada DOI adicional na página de metadados de cada publicação.</message>
<message key="plugins.pubIds.doi.editor.assignDoi.assigned">Foi atribuído o DOI {$pubId}.</message>
<message key="plugins.pubIds.doi.manager.settings.doiReassign.description">Se alterar a configuração DOI, os DOIs atribuídos não serão afectados. Uma vez guardada a configuração do DOI, use este botão para limpar todos os DOI existentes para que as novas configurações tenham efeito com as publicações existentes.</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/ru_RU/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<locale name="ru_RU" full_name="Русский">
<message key="plugins.pubIds.doi.displayName">Модуль «DOI»</message>
<message key="plugins.pubIds.doi.description">Включает присвоение идентификаторов цифровых объектов (Digital Object Identifier) выпускам, статьям и гранкам в OJS.</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- форма настройки -->
<message key="plugins.pubIds.doi.manager.settings.description">Пожалуйста, настройте модуль «DOI», чтобы иметь возможность использовать DOI в OJS и управлять ими:</message>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/locale/sr_RS@latin/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<message key="plugins.pubIds.doi.editor.doiObjectTypeSubmission">članak</message>
<message key="plugins.pubIds.doi.editor.doiSuffixCustomIdentifierNotUnique">Dati DOI sufiks je već u upotrebi. Unesite jedinstveni DOI sufiks za svaku stavku.</message>
<message key="plugins.pubIds.doi.description">Ovaj dodatak omogućuje dodeljivanje DOI-a</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI:</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>
<message key="plugins.pubIds.doi.manager.settings.doiReassign.description">Ukoliko promenite vašu DOI konfiguraciju, dodeljeni DOI-i neće biti promenjeni. Kada je konfiguracija sačuvana, koristite opciju čišćenja postojećih DOI-a i dodeljivanja novih.</message>
<message key="plugins.pubIds.doi.editor.doiObjectTypeRepresentation">fajl prikaza</message>
<message key="plugins.pubIds.doi.editor.customSuffixMissing">Nedostaje prilagođeni sufiks</message>
Expand Down
1 change: 1 addition & 0 deletions plugins/pubIds/doi/locale/tr_TR/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<locale name="tr_TR" full_name="Türkçe">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">ADS'de DOI'leri kullanmak ve yönetebilmek için lütfen DOI eklentilerini yapılandırın.</message>
Expand Down
1 change: 1 addition & 0 deletions plugins/pubIds/doi/locale/uk_UA/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<locale name="uk_UA" full_name="Українська">
<message key="plugins.pubIds.doi.displayName">DOI</message>
<message key="plugins.pubIds.doi.readerDisplayName">DOI</message>

<!-- settings form -->
<message key="plugins.pubIds.doi.manager.settings.description">Щоб мати можливість використовувати DOI у OJS, будь ласка, налаштуйте модуль DOI:</message>
Expand Down
3 changes: 2 additions & 1 deletion plugins/themes/default/styles/objects/article_details.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
}
}

.item.doi {
.item.doi,
.item.keywords {
padding-top: 0;

.label {
Expand Down
35 changes: 19 additions & 16 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
{assign var="doiUrl" value=$pubIdPlugin->getResolvingURL($currentJournal->getId(), $pubId)|escape}
<div class="item doi">
<span class="label">
{translate key="plugins.pubIds.doi.readerDisplayName"}
{capture assign=translatedDOI}{translate key="plugins.pubIds.doi.readerDisplayName"}{/capture}
{translate key="semicolon" label=$translatedDOI}
</span>
<span class="value">
<a href="{$doiUrl}">
Expand All @@ -129,6 +130,23 @@
{/if}
{/foreach}

{* Keywords *}
{if !empty($keywords[$currentLocale])}
<div class="item keywords">
<span class="label">
{capture assign=translatedKeywords}{translate key="article.subject"}{/capture}
{translate key="semicolon" label=$translatedKeywords}
</span>
<span class="value">
{foreach from=$keywords item=keyword}
{foreach name=keywords from=$keyword item=keywordItem}
{$keywordItem|escape}{if !$smarty.foreach.keywords.last}, {/if}
{/foreach}
{/foreach}
</span>
</div>
{/if}

{* Abstract *}
{if $article->getLocalizedAbstract()}
<div class="item abstract">
Expand Down Expand Up @@ -302,21 +320,6 @@
{/if}
</div>

{* Keywords *}
{* @todo keywords not yet implemented *}

{* Article Subject *}
{if $article->getLocalizedSubject()}
<div class="item subject">
<h3 class="label">
{translate key="article.subject"}
</h3>
<div class="value">
{$article->getLocalizedSubject()|escape}
</div>
</div>
{/if}

{* PubIds (requires plugins) *}
{foreach from=$pubIdPlugins item=pubIdPlugin}
{if $pubIdPlugin->getPubIdType() == 'doi'}
Expand Down