From e6253d47b7a55fdddd9c7fb881bc0cedd84b0126 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Fri, 5 Mar 2021 08:20:05 +0100
Subject: [PATCH] refs #16124 [fid_bbi] browser tab caption

* add head titles to terms and policy
* remove "Holdings" prefix from details tab head title
* force short title as head title in detail view
---
 themes/fid_bbi/templates/RecordTab/holdingsils.phtml | 2 +-
 themes/fid_bbi/templates/fid/user/policy-de.phtml    | 1 +
 themes/fid_bbi/templates/fid/user/policy-en.phtml    | 1 +
 themes/fid_bbi/templates/fid/user/terms-de.phtml     | 1 +
 themes/fid_bbi/templates/fid/user/terms-en.phtml     | 1 +
 themes/fid_bbi/templates/record/view.phtml           | 9 +++++++++
 6 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/themes/fid_bbi/templates/RecordTab/holdingsils.phtml b/themes/fid_bbi/templates/RecordTab/holdingsils.phtml
index 2d258af1eb4..f5398074b4d 100644
--- a/themes/fid_bbi/templates/RecordTab/holdingsils.phtml
+++ b/themes/fid_bbi/templates/RecordTab/holdingsils.phtml
@@ -15,7 +15,7 @@ $id = $this->driver->getUniqueId();
 // finc-specific: externalCatalogueLink
 $extUrls = $this->externalCatalogueLink($this->driver)->getLinks();
 
-$this->headTitle($this->translate('Holdings') . ': ' . $this->driver->getBreadcrumb());
+$this->headTitle($this->driver->getBreadcrumb());
 
 $isFree = in_array('Free', $this->driver->tryMethod('getFacetAvail'));
 ?>
diff --git a/themes/fid_bbi/templates/fid/user/policy-de.phtml b/themes/fid_bbi/templates/fid/user/policy-de.phtml
index 2bf8f02fa3e..fb823ca7c38 100644
--- a/themes/fid_bbi/templates/fid/user/policy-de.phtml
+++ b/themes/fid_bbi/templates/fid/user/policy-de.phtml
@@ -1,3 +1,4 @@
+<?php $this->headTitle('Datenschutzerklärung')?>
 <div class="bbi-policies">
   <br/>
   <h2><strong>Datenschutzerkl&auml;rung</strong></h2>
diff --git a/themes/fid_bbi/templates/fid/user/policy-en.phtml b/themes/fid_bbi/templates/fid/user/policy-en.phtml
index b9915638ee8..175331d994b 100644
--- a/themes/fid_bbi/templates/fid/user/policy-en.phtml
+++ b/themes/fid_bbi/templates/fid/user/policy-en.phtml
@@ -1,3 +1,4 @@
+<?php $this->headTitle('Privacy Policy')?>
 <div class="bbi-policies">
   <br/>
   <h2><strong>Privacy Policy</strong></h2>
diff --git a/themes/fid_bbi/templates/fid/user/terms-de.phtml b/themes/fid_bbi/templates/fid/user/terms-de.phtml
index 4a163baf513..232ce505a99 100644
--- a/themes/fid_bbi/templates/fid/user/terms-de.phtml
+++ b/themes/fid_bbi/templates/fid/user/terms-de.phtml
@@ -1,3 +1,4 @@
+<?php $this->headTitle('Nutzungsbedingungen') ?>
 <h1>Nutzungsbedingungen</h1>
 <P>Der Fachinformationsdienst Buch-, Bibliotheks- und Informationswissenschaft (FID BBI) wird von der Herzog August Bibliothek Wolfenbüttel und der Universitätsbibliothek Leipzig betrieben und im Rahmen des Förderprogramms „Fachinformationsdienste für die Wissenschaft“ von der Deutschen Forschungsgemeinschaft (DFG) gefördert. Der FID BBI richtet sich entsprechend des Förderprogramms an Wissenschaftlerinnen und Wissenschaftler deutscher Einrichtungen der beteiligten sowie angrenzenden Disziplinen und stellt ihre bedarfsorientierte Versorgung mit sowie den schnellen und möglichst direkten Zugriff auf Spezialliteratur und forschungsrelevanten Informationen sicher.</P>
 <p>Mit der Nutzung des Portals erklären Sie sich mit den Nutzungsbedingungen und der Datenschutzerklärung einverstanden.</p>
diff --git a/themes/fid_bbi/templates/fid/user/terms-en.phtml b/themes/fid_bbi/templates/fid/user/terms-en.phtml
index 1df10bc4166..8f430a23f0f 100644
--- a/themes/fid_bbi/templates/fid/user/terms-en.phtml
+++ b/themes/fid_bbi/templates/fid/user/terms-en.phtml
@@ -1,3 +1,4 @@
+<?php $this->headTitle('Terms of Use') ?>
 <h1>Terms of Use</h1>
 <p>Please note: The English version of our terms of is for informational purposes only.
     The German version shall be legally binding only.</p>
diff --git a/themes/fid_bbi/templates/record/view.phtml b/themes/fid_bbi/templates/record/view.phtml
index a05fb9f1c87..77c149dabc5 100644
--- a/themes/fid_bbi/templates/record/view.phtml
+++ b/themes/fid_bbi/templates/record/view.phtml
@@ -87,4 +87,13 @@ if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) {
 </div>
 
 <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET');?>
+<?php
+    // force simple head title, avoid tab name in title
+    // this MUST be performed AFTER the tab rendering, since those might have set
+    // head titles themselves
+    $this->headTitle(
+        $this->driver->getBreadcrumb(),
+        \Zend\View\Helper\Placeholder\Container\AbstractContainer::SET
+    );
+?>
 <!-- fid_bbi: record - view - END -->
-- 
GitLab