From e166c813eb54010d54f9ad68a761945d334fcb97 Mon Sep 17 00:00:00 2001
From: Jeff Sturek <jsturek8@unl.edu>
Date: Wed, 27 Jan 2021 16:04:29 -0600
Subject: [PATCH] Support WDN version 5.3

---
 composer.json                         |  2 +-
 composer.lock                         | 19 ++++++++++++-------
 www/index.php                         |  8 ++++----
 www/templates/5.0/embed-debug.tpl.php |  6 +++---
 www/templates/5.0/embed.tpl.php       |  8 ++++----
 5 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/composer.json b/composer.json
index 283feca..9d4adeb 100644
--- a/composer.json
+++ b/composer.json
@@ -5,7 +5,7 @@
     }
   },
   "require": {
-    "unl/php-wdn-templates": "^5.2",
+    "unl/php-wdn-templates": "^5.3",
     "ezyang/htmlpurifier": "^4.7"
   }
 }
diff --git a/composer.lock b/composer.lock
index 7647059..a755d41 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "4809634aac5a9b0350d6a0c7d7de5805",
+    "content-hash": "da8d7d7163891b3718434cb4ef424d29",
     "packages": [
         {
             "name": "ezyang/htmlpurifier",
@@ -106,16 +106,16 @@
         },
         {
             "name": "unl/php-wdn-templates",
-            "version": "v5.2.1",
+            "version": "v5.3.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/unl/phpunltemplates.git",
-                "reference": "7648850d99cc8b6f03307a7feca7d31b18e9a233"
+                "reference": "090d6c7c8ac8ab2828165bd06574ecb48caf1a88"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/unl/phpunltemplates/zipball/7648850d99cc8b6f03307a7feca7d31b18e9a233",
-                "reference": "7648850d99cc8b6f03307a7feca7d31b18e9a233",
+                "url": "https://api.github.com/repos/unl/phpunltemplates/zipball/090d6c7c8ac8ab2828165bd06574ecb48caf1a88",
+                "reference": "090d6c7c8ac8ab2828165bd06574ecb48caf1a88",
                 "shasum": ""
             },
             "require": {
@@ -159,7 +159,11 @@
             ],
             "description": "A PHP library for rendering the UNL templates",
             "homepage": "http://wdn.unl.edu/",
-            "time": "2020-07-16T20:24:35+00:00"
+            "support": {
+                "issues": "https://github.com/unl/phpunltemplates/issues",
+                "source": "https://github.com/unl/phpunltemplates/tree/v5.3.0"
+            },
+            "time": "2021-01-27T17:05:21+00:00"
         },
         {
             "name": "zaininnari/html-minifier",
@@ -328,5 +332,6 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": [],
-    "platform-dev": []
+    "platform-dev": [],
+    "plugin-api-version": "2.0.0"
 }
diff --git a/www/index.php b/www/index.php
index 9dbecb8..ad42efd 100644
--- a/www/index.php
+++ b/www/index.php
@@ -31,7 +31,7 @@ $isEmbed = isset($_GET['embed']) && $_GET['embed'];
 // While the site proper is skinned with a specific version, the templates used
 // used in embed search need to be supported in legacy sites.
 // ?embed=1 : 4.1
-// ?embed=(not 1) : 5.2
+// ?embed=(not 1) : 5.3
 if ($isEmbed && $_GET['embed'] === '1') {
     $pageTemplate = 'Fixed';
     $page = Templates::factory($pageTemplate, Templates::VERSION_4_1);
@@ -47,7 +47,7 @@ if ($isEmbed && $_GET['embed'] === '1') {
 
 } else {
     $pageTemplate = 'AppLocal';
-    $page = Templates::factory($pageTemplate, Templates::VERSION_5_2);
+    $page = Templates::factory($pageTemplate, Templates::VERSION_5_3);
     $templatePath = 'templates/5.0/';
 
     $localScriptUrl = './js/search-tabs.min.js?v=' . $cacheVersion;
@@ -58,7 +58,7 @@ if ($isEmbed && $_GET['embed'] === '1') {
     }
 
     if (!$isEmbed) {
-        if (file_exists(__DIR__ . '/wdn/templates_5.2')) {
+        if (file_exists(__DIR__ . '/wdn/templates_5.3')) {
             $page->setLocalIncludePath(__DIR__);
         }
 
@@ -66,7 +66,7 @@ if ($isEmbed && $_GET['embed'] === '1') {
         $page->head .= '<link rel="home" href="./" />';
 
         // Add WDN Deprecated Styles
-        $page->head .= '<link rel="preload" href="/wdn/templates_5.2/css/deprecated.css" as="style" onload="this.onload=null;this.rel=\'stylesheet\'"> <noscript><link rel="stylesheet" href="/wdn/templates_5.2/css/deprecated.css"></noscript>';
+        $page->head .= '<link rel="preload" href="/wdn/templates_5.3/css/deprecated.css" as="style" onload="this.onload=null;this.rel=\'stylesheet\'"> <noscript><link rel="stylesheet" href="/wdn/templates_5.3/css/deprecated.css"></noscript>';
 
         // no menu items, so hide mobile menu
         $page->addStyleDeclaration("#dcf-mobile-toggle-menu {display: none!important}");
diff --git a/www/templates/5.0/embed-debug.tpl.php b/www/templates/5.0/embed-debug.tpl.php
index 959ba49..77db1e9 100644
--- a/www/templates/5.0/embed-debug.tpl.php
+++ b/www/templates/5.0/embed-debug.tpl.php
@@ -5,8 +5,8 @@
   <meta http-equiv="x-ua-compatible" content="ie=edge" />
   <title>Search | University of Nebraska&ndash;Lincoln</title>
   <link rel="stylesheet" href="https://cloud.typography.com/7717652/6968572/css/fonts.css" />
-  <link rel="stylesheet" href="/wdn/templates_5.2/css/main.css" />
-  <link rel="stylesheet" href="/wdn/templates_5.2/js/js-css/tabs.css" />
+  <link rel="stylesheet" href="/wdn/templates_5.3/css/main.css" />
+  <link rel="stylesheet" href="/wdn/templates_5.3/js/js-css/tabs.css" />
   <script data-main="js/embed-src/main.js" src="js/embed-src/require.js"></script>
   <?php echo $head ?>
 </head>
@@ -15,7 +15,7 @@
     <?php echo $maincontent ?>
   </main>
   <script>
-    require(['https://unlcms.unl.edu/wdn/templates_5.2/js/compressed/dcf-utility.js', 'https://unlcms.unl.edu/wdn/templates_5.2/js/compressed/dcf-tabs.js'], function() {
+    require(['https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-utility.js', 'https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-tabs.js'], function() {
       DCFUtility.flagSupportsWebP();
       DCFUtility.flagSupportsJavaScript();
 
diff --git a/www/templates/5.0/embed.tpl.php b/www/templates/5.0/embed.tpl.php
index 9f23740..3ea5e89 100644
--- a/www/templates/5.0/embed.tpl.php
+++ b/www/templates/5.0/embed.tpl.php
@@ -5,8 +5,8 @@
   <meta http-equiv="x-ua-compatible" content="ie=edge" />
   <title>Search | University of Nebraska&ndash;Lincoln</title>
   <link rel="stylesheet" href="https://cloud.typography.com/7717652/6968572/css/fonts.css" />
-  <link rel="stylesheet" href="https://unlcms.unl.edu/wdn/templates_5.2/css/main.css" />
-  <link rel="stylesheet" href="https://unlcms.unl.edu/wdn/templates_5.2/js/js-css/tabs.css" />
+  <link rel="stylesheet" href="https://unlcms.unl.edu/wdn/templates_5.3/css/main.css" />
+  <link rel="stylesheet" href="https://unlcms.unl.edu/wdn/templates_5.3/js/js-css/tabs.css" />
   <script src="js/embed/all.js?v=<?php echo $cacheVersion; ?>"></script>
   <?php echo $head ?>
 </head>
@@ -16,8 +16,8 @@
   </main>
 </body>
 <script>
-    require(['https://unlcms.unl.edu/wdn/templates_5.2/js/compressed/dcf-utility.js',
-        'https://unlcms.unl.edu/wdn/templates_5.2/js/compressed/dcf-tabs.js'], function() {
+    require(['https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-utility.js',
+        'https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-tabs.js'], function() {
       DCFUtility.flagSupportsWebP();
       DCFUtility.flagSupportsJavaScript();
 
-- 
GitLab