From fb66420f7b1cb497d4a30ac77c2e7782ad047cd2 Mon Sep 17 00:00:00 2001
From: David Maus <maus@hab.de>
Date: Tue, 24 Apr 2018 09:46:04 +0200
Subject: [PATCH] =?UTF-8?q?Dublin=20Core=20f=C3=BCr=20Titeldaten=20OPAC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 public/instance/proxy/opac-de-23/index.php | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/public/instance/proxy/opac-de-23/index.php b/public/instance/proxy/opac-de-23/index.php
index b823ad2a2..3f8bfcc18 100644
--- a/public/instance/proxy/opac-de-23/index.php
+++ b/public/instance/proxy/opac-de-23/index.php
@@ -95,6 +95,21 @@ switch ($format) {
         }
         $response = new Response('<h1>406 Not Acceptable</h1>', 406, array('Content-Type' => 'text/html'));
         break;
+    case 'dc':
+        $type = (string)$record->getFirstMatchingField('002@/00')->getNthSubfield(0, '0');
+        if ($type[0] === 'T') {
+            $response = new Response('<h1>406 Not Acceptable</h1>', 406, array('Content-Type' => 'text/html'));
+        } else {
+            $templateUri = __DIR__ . '/../../../../src/xslt/mods2dc.xsl';
+            $sourceUri = sprintf(MODS_TEMPLATE, $ident);
+            $content = transform($sourceUri, $templateUri);
+            if ($content) {
+                $response = new Response($content, 200, array('Content-Type' => 'application/xml'));
+                break;
+            }
+        }
+        $response = new Response('<h1>406 Not Acceptable</h1>', 406, array('Content-Type' => 'text/html'));
+        break;
     case 'rdf':
         $type = (string)$record->getFirstMatchingField('002@/00')->getNthSubfield(0, '0');
         if ($type[0] === 'T') {
-- 
GitLab