From 1822826ae50f78a8d7da05faed2591582d8ceafa Mon Sep 17 00:00:00 2001
From: Ryan Dee <ryan@skoolbus39.com>
Date: Thu, 16 Aug 2018 18:58:07 -0500
Subject: [PATCH] Add 5.0-specific stylesheets in PHP files

---
 www/index.php                         | 11 +++++++----
 www/templates/5.0/end-scripts.tpl.php |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/index.php b/www/index.php
index 3477550..df56939 100644
--- a/www/index.php
+++ b/www/index.php
@@ -61,13 +61,16 @@ if (!$isEmbed) {
     $page->head = '<link rel="home" href="./" />';
     $page->pagetitle = '';
     $page->breadcrumbs = renderTemplate('templates/breadcrumbs.tpl.php');
+    $page->addStyleSheet('css/search.css?v=20161215');
+}
+
+if ($isEmbed && $_GET['embed'] === '5.0') {
+  $page->addStyleSheet('css/search-5.0.css?v=20180816');
 }
 
 $localResults = '';
 $context = '';
 
-$page->addStyleSheet('css/search.css?v=20161215');
-
 //u is referring site
 if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
     // Add local site search results
@@ -77,7 +80,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
             //require_once 'HTMLPurifier.auto.php';
             $config = HTMLPurifier_Config::createDefault();
             $config->set('Cache.SerializerPath', '/tmp');
-            
+
             //Trick the purifier into accepting HTML5 elements/attributes
             $config->set('HTML.DefinitionID', 'html5-definitions'); // unqiue id
             $config->set('HTML.DefinitionRev', 1);
@@ -85,7 +88,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
                 //Allow everything to have a role
                 $def->addAttribute('*', 'role', 'Text');
             }
-            
+
             $purifier = new HTMLPurifier($config);
 
             $page->head        .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
diff --git a/www/templates/5.0/end-scripts.tpl.php b/www/templates/5.0/end-scripts.tpl.php
index a8ae6a8..acf0993 100644
--- a/www/templates/5.0/end-scripts.tpl.php
+++ b/www/templates/5.0/end-scripts.tpl.php
@@ -19,7 +19,7 @@ require(['jquery', '<?php echo $localScriptUrl ?>'], function($, UNLSearch) {
     }).appendTo($('body'));
 
     var $localCss = $('<link>', {
-        'href': './css/search-google.css?v=20170404'
+        'href': './css/search-google-5.0.css?v=20180816'
     });
 
     gSearchDefer.done(function(google) {
-- 
GitLab