Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Digital Experience Group
UNL_Search
Commits
c79982a6
Commit
c79982a6
authored
Aug 09, 2018
by
Eric Rasmussen
Browse files
Add the option to switch to 5.0 theme for the embed version
parent
138e376d
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
c79982a6
...
...
@@ -9,3 +9,5 @@
/.buildpath
/vendor
/tmp
.DS_Store
.idea
package-lock.json
0 → 100644
View file @
c79982a6
This diff is collapsed.
Click to expand it.
www/index.php
View file @
c79982a6
...
...
@@ -11,6 +11,17 @@ require_once $config_file;
use
UNL\Templates\Templates
;
$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=5.0 : 5.0
$templatePath
=
'templates/4.1/'
;
if
(
$isEmbed
&&
$_GET
[
'embed'
]
===
'5.0'
)
{
$templatePath
=
'templates/5.0/'
;
}
function
renderTemplate
(
$file
,
$params
=
array
())
{
ob_start
();
...
...
@@ -23,7 +34,7 @@ function loadDefaultSections($page)
{
$page
->
titlegraphic
=
'UNL Search'
;
$page
->
breadcrumbs
=
str_replace
(
'Department'
,
'Search'
,
$page
->
breadcrumbs
);
$page
->
navlinks
=
file_get_contents
(
'http://www.unl.edu/ucomm/sharedcode/navigation.html'
);
$page
->
navlinks
=
file_get_contents
(
'http
s
://www.unl.edu/ucomm/sharedcode/navigation.html'
);
$page
->
contactinfo
=
renderTemplate
(
'templates/local-footer.tpl.php'
);
$page
->
affiliation
=
''
;
...
...
@@ -31,8 +42,6 @@ function loadDefaultSections($page)
$page
->
navlinks
=
UNL_Search
::
removeRelativePaths
(
$page
->
navlinks
,
'https://www.unl.edu/'
);
}
$isEmbed
=
isset
(
$_GET
[
'embed'
])
&&
$_GET
[
'embed'
];
$localScriptUrl
=
'./js/search.min.js?v=4.1.20'
;
$pageTemplate
=
'Fixed'
;
...
...
@@ -112,7 +121,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
$context
=
$_GET
[
'u'
];
}
$localResults
=
renderTemplate
(
'
template
s/
google-results.tpl.php'
,
array
(
$localResults
=
renderTemplate
(
$
template
Path
.
'
google-results.tpl.php'
,
array
(
'title'
=>
$page
->
titlegraphic
,
'id'
=>
'local_results'
,
));
...
...
@@ -126,7 +135,7 @@ if (!$isEmbed) {
$maincontent
.
=
renderTemplate
(
'templates/search-form.tpl.php'
,
array
(
'local_results'
=>
$localResults
));
}
$maincontent
.
=
renderTemplate
(
'
template
s/
search-results.tpl.php'
,
array
(
$maincontent
.
=
renderTemplate
(
$
template
Path
.
'
search-results.tpl.php'
,
array
(
'isEmbed'
=>
$isEmbed
,
'local_results'
=>
$localResults
));
...
...
@@ -147,10 +156,10 @@ if (!$isEmbed) {
exit
;
}
$template
=
'
template
s/
embed.tpl.php'
;
$template
=
$
template
Path
.
'
embed.tpl.php'
;
if
(
UNL_Search
::
$mode
===
'debug'
)
{
$template
=
'
template
s/
embed-debug.tpl.php'
;
$template
=
$
template
Path
.
'
embed-debug.tpl.php'
;
}
echo
renderTemplate
(
$template
,
array
(
...
...
www/templates/embed-debug.tpl.php
→
www/templates/
4.1/
embed-debug.tpl.php
View file @
c79982a6
File moved
www/templates/embed.tpl.php
→
www/templates/
4.1/
embed.tpl.php
View file @
c79982a6
File moved
www/templates/google-results.tpl.php
→
www/templates/
4.1/
google-results.tpl.php
View file @
c79982a6
File moved
www/templates/search-results.tpl.php
→
www/templates/
4.1/
search-results.tpl.php
View file @
c79982a6
...
...
@@ -17,7 +17,7 @@
</div>
<div
class=
"search-results"
>
<?php
echo
$local_results
?>
<?php
echo
renderTemplate
(
'templates/google-results.tpl.php'
,
array
(
<?php
echo
renderTemplate
(
'templates/
4.1/
google-results.tpl.php'
,
array
(
'title'
=>
'All of UNL'
,
'id'
=>
'unl_results'
,
))
?>
...
...
www/templates/5.0/embed-debug.tpl.php
0 → 100644
View file @
c79982a6
<!DOCTYPE html>
<html
class=
"no-js embed"
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"x-ua-compatible"
content=
"ie=edge"
/>
<title>
Search | University of Nebraska
–
Lincoln
</title>
<link
rel=
"stylesheet"
href=
"https://cloud.typography.com/7717652/616662/css/fonts.css"
/>
<link
rel=
"stylesheet"
href=
"/wdn/templates_5.0/css/all.css"
/>
<script
data-main=
"js/embed-src/main.js"
src=
"js/embed-src/require.js"
></script>
<?php
echo
$head
?>
</head>
<body>
<main>
<?php
echo
$maincontent
?>
</main>
</body>
</html>
www/templates/5.0/embed.tpl.php
0 → 100644
View file @
c79982a6
<!DOCTYPE html>
<html
class=
"no-js embed"
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"x-ua-compatible"
content=
"ie=edge"
/>
<title>
Search | University of Nebraska
–
Lincoln
</title>
<link
rel=
"stylesheet"
href=
"https://cloud.typography.com/7717652/616662/css/fonts.css"
/>
<link
rel=
"stylesheet"
href=
"https://unlcms.unl.edu/wdn/templates_5.0/css/all.css"
/>
<script
src=
"js/embed/all.js?v=20170404"
></script>
<?php
echo
$head
?>
</head>
<body>
<main>
<?php
echo
$maincontent
?>
</main>
</body>
</html>
www/templates/5.0/google-results.tpl.php
0 → 100644
View file @
c79982a6
<?php
if
(
isset
(
$title
))
:
?>
<h3>
<?php
echo
$title
?>
Results
</h3>
<?php
endif
;
?>
<div
id=
"
<?php
echo
isset
(
$id
)
?
$id
:
''
?>
"
class=
"google-results"
></div>
www/templates/5.0/search-results.tpl.php
0 → 100644
View file @
c79982a6
<section
<?php
if
(
!
$isEmbed
)
:
?>
class=
"wdn-band"
<?php
endif
?>
id=
"search_wrapper"
>
<?php
if
(
!
$isEmbed
)
:
?>
<div
class=
"wdn-inner-wrapper wdn-inner-padding-sm"
>
<?php
endif
;
?>
<div
class=
"wdn-grid-set search-set"
>
<div
id=
"search_results"
class=
"results-group"
>
<div
class=
"result-head"
>
<h2>
Web Results
</h2>
<ul
class=
"result-tab
<?php
if
(
empty
(
$local_results
))
:
?>
no-local
<?php
endif
;
?>
"
>
<?php
if
(
!
empty
(
$local_results
))
:
?>
<li><a
href=
"#"
>
This unit
</a></li>
<?php
endif
;
?>
<li><a
href=
"#"
>
All of UNL
</a></li>
</ul>
</div>
<div
class=
"search-results"
>
<?php
echo
$local_results
?>
<?php
echo
renderTemplate
(
'templates/5.0/google-results.tpl.php'
,
array
(
'title'
=>
'All of UNL'
,
'id'
=>
'unl_results'
,
))
?>
</div>
</div>
<div
id=
"directory_results"
class=
"results-group"
>
<div
class=
"result-head"
>
<h2>
Directory Results
</h2>
<ul
class=
"result-tab"
>
<li><a
href=
"#"
>
People
</a></li>
<li><a
href=
"#"
>
Departments
</a></li>
</ul>
</div>
<div
id=
"ppl_results"
class=
"search-results"
></div>
</div>
</div>
<?php
if
(
!
$isEmbed
)
:
?>
</div>
<?php
endif
;
?>
</section>
www/templates/breadcrumbs.tpl.php
View file @
c79982a6
<ul>
<li><a
href=
"http://www.unl.edu/"
title=
"University of Nebraska–Lincoln"
>
UNL
</a></li>
<li><a
href=
"http
s
://www.unl.edu/"
title=
"University of Nebraska–Lincoln"
>
Nebraska
</a></li>
<li>
Search
</li>
</ul>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment