From 1b7eae4a89aad2db007a634a612ca2f7a652a93a Mon Sep 17 00:00:00 2001
From: Rui Francisco <blackmolly@gmail.com>
Date: Fri, 16 Oct 2015 10:44:28 -0400
Subject: [PATCH] Add support for ebook-pdf documents and custom link
 retrieval.

---
 module/VuFind/src/VuFind/RecordDriver/EDS.php | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/RecordDriver/EDS.php b/module/VuFind/src/VuFind/RecordDriver/EDS.php
index 78c3e34627c..08ae4df8028 100644
--- a/module/VuFind/src/VuFind/RecordDriver/EDS.php
+++ b/module/VuFind/src/VuFind/RecordDriver/EDS.php
@@ -137,6 +137,17 @@ class EDS extends SolrDefault
         $this->fields['CustomLinks'] : [];
     }
 
+    /**
+     * Get the full text custom links of the record.
+     *
+     * @return array
+     */
+    public function getFTCustomLinks()
+    {
+        return isset($this->fields['FullText']['CustomLinks']) ?
+        $this->fields['FullText']['CustomLinks'] : [];
+    }
+
     /**
      * Get the database label of the record.
      *
@@ -242,6 +253,10 @@ class EDS extends SolrDefault
                 if (isset($link['Type']) && 'pdflink' == $link['Type']) {
                     return true;
                 }
+                // 2015-05-10 RF - added support for pdf
+                if (isset($link['Type']) && 'ebook-pdf' == $link['Type']) {
+                    return true;
+                }
             }
         }
         return false;
@@ -259,7 +274,10 @@ class EDS extends SolrDefault
         ) {
             foreach ($this->fields['FullText']['Links'] as $link) {
                 if (isset($link['Type']) && 'pdflink' == $link['Type']) {
-                    return isset($link['Url']) ? $link['Url'] : false;
+                    return $link["Url"]; // return PDF link
+                }
+                if (isset($link['Type']) && 'ebook-pdf' == $link['Type']) {
+                    return $link["Url"]; // return PDF link
                 }
             }
         }
-- 
GitLab