From 2fe1c7898bfb2b8d07cdaf7f3126e375c6524d18 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 16 May 2014 10:09:49 -0400
Subject: [PATCH] Allow some advanced search elements to be overridden. - Will
 be used by forthcoming EDS implementation.

---
 .../blueprint/templates/search/advanced/layout.phtml  | 11 +++++++++--
 .../bootstrap/templates/search/advanced/layout.phtml  | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/themes/blueprint/templates/search/advanced/layout.phtml b/themes/blueprint/templates/search/advanced/layout.phtml
index 5d398551995..9dcf8c67fe3 100644
--- a/themes/blueprint/templates/search/advanced/layout.phtml
+++ b/themes/blueprint/templates/search/advanced/layout.phtml
@@ -21,9 +21,16 @@
     // Step 1: Define our search arrays so they are usuable in the javascript
     $this->headScript()->appendScript($this->render('search/advanced/globals.phtml'));
     // Step 2: Call the javascript to make use of the above
-    $this->headScript()->appendFile('advanced_search.js');
+    $this->headScript()->appendFile(
+        isset($this->advancedSearchJsOverride) ? $this->advancedSearchJsOverride : 'advanced_search.js'
+    );
     // Step 3: Build the page
-    $this->headScript()->appendScript($this->partial('search/advanced/build_page.phtml', array('searchDetails' => $searchDetails)));
+    $this->headScript()->appendScript(
+        $this->partial(
+            isset($this->buildPageOverride) ? $this->buildPageOverride : 'search/advanced/build_page.phtml',
+            array('searchDetails' => $searchDetails)
+        )
+    );
 ?>
 <form method="get" action="<?=$this->url($this->options->getSearchAction())?>" id="advSearchForm" name="searchForm" class="search">
   <div class="<?=$this->layoutClass('mainbody')?>">
diff --git a/themes/bootstrap/templates/search/advanced/layout.phtml b/themes/bootstrap/templates/search/advanced/layout.phtml
index a46b130461a..3b0310c44dc 100644
--- a/themes/bootstrap/templates/search/advanced/layout.phtml
+++ b/themes/bootstrap/templates/search/advanced/layout.phtml
@@ -22,9 +22,16 @@
   // Step 1: Define our search arrays so they are usuable in the javascript
   $this->headScript()->appendScript($this->render('search/advanced/globals.phtml'));
   // Step 2: Call the javascript to make use of the above
-  $this->headScript()->appendFile('advanced_search.js');
+  $this->headScript()->appendFile(
+    isset($this->advancedSearchJsOverride) ? $this->advancedSearchJsOverride : 'advanced_search.js'
+  );
   // Step 3: Build the page
-  $this->headScript()->appendScript($this->partial('search/advanced/build_page.phtml', array('searchDetails' => $searchDetails)));
+  $this->headScript()->appendScript(
+    $this->partial(
+      isset($this->buildPageOverride) ? $this->buildPageOverride : 'search/advanced/build_page.phtml',
+      array('searchDetails' => $searchDetails)
+    )
+  );
 ?>
 
 <?=$this->flashmessages()?>
-- 
GitLab