From 9ff83745ef2163ba68e3e06e083400ee7a28c0dc Mon Sep 17 00:00:00 2001
From: Michael Fairchild <mfairchild365@gmail.com>
Date: Thu, 17 Dec 2015 14:29:00 -0600
Subject: [PATCH] Use the shared iim app footer

---
 .gitignore                         | 1 +
 src/UNL/Search.php                 | 5 +++++
 www/templates/local-footer.tpl.php | 8 +++++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 5f21c42..1fd9d30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
 /www/less/lib
 /.buildpath
 /vendor
+/tmp
\ No newline at end of file
diff --git a/src/UNL/Search.php b/src/UNL/Search.php
index 2f71e7b..be5d1f2 100644
--- a/src/UNL/Search.php
+++ b/src/UNL/Search.php
@@ -96,4 +96,9 @@ class UNL_Search
     {
         return self::$linkedCSEServer . '?u=' . urlencode($referrer);
     }
+    
+    public static function getProjectRoot()
+    {
+        return dirname(dirname(__DIR__));
+    }
 }
diff --git a/www/templates/local-footer.tpl.php b/www/templates/local-footer.tpl.php
index 109c035..476b90d 100644
--- a/www/templates/local-footer.tpl.php
+++ b/www/templates/local-footer.tpl.php
@@ -8,7 +8,13 @@
     <div class="bp960-wdn-col-one-half">
         <div class="wdn-footer-module">
             <span role="heading" class="wdn-footer-heading">About UNL Search</span>
-            <?php echo file_get_contents('http://iim.unl.edu/iim-app-footer?format=partial'); ?>
+            <?php
+            if ($file = file_get_contents(UNL_Search::getProjectRoot() . '/tmp/iim-app-footer.html')) {
+                echo $file;
+            } else {
+                echo file_get_contents('http://iim.unl.edu/iim-app-footer?format=partial');
+            }
+            ?>
         </div>
     </div>
     <div class="bp960-wdn-col-one-fourth">
-- 
GitLab