Commit a3403924 authored by Michael Fairchild's avatar Michael Fairchild
Browse files

Use the 4.1 framework

parent e4c885de
......@@ -6,3 +6,4 @@
/www/css
/www/less/lib
/.buildpath
/vendor
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "dc84d35e57c178304295428b15c87ac8",
"content-hash": "b16d8ad2bbdabc7ad63c1f4ef5cea709",
"packages": [
{
"name": "unl/php-dwt-parser",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/unl/phpdwtparser.git",
"reference": "0b49f94c19fb21299fe768ada2ac64989b7c6fbb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/unl/phpdwtparser/zipball/0b49f94c19fb21299fe768ada2ac64989b7c6fbb",
"reference": "0b49f94c19fb21299fe768ada2ac64989b7c6fbb",
"shasum": ""
},
"require": {
"php": ">=5.5",
"zaininnari/html-minifier": "*",
"zendframework/zend-code": "^2.5"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"bin": [
"bin/createTemplates.php"
],
"type": "library",
"autoload": {
"psr-4": {
"UNL\\DWT\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kevin Abel (kabel)",
"email": "kabel2@unl.edu",
"role": "Developer"
},
{
"name": "Brett Bieber (saltybeagle)",
"email": "brett.bieber@gmail.com",
"role": "Retired Developer"
}
],
"description": "A PHP library for parsing DWT files and turning them into PHP classes",
"homepage": "http://wdn.unl.edu/",
"time": "2015-12-14 23:51:40"
},
{
"name": "unl/php-wdn-templates",
"version": "v4.1.0",
"source": {
"type": "git",
"url": "https://github.com/unl/phpunltemplates.git",
"reference": "ddece80fce8611c22fa674a0f36eac3ddf4ca423"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/unl/phpunltemplates/zipball/ddece80fce8611c22fa674a0f36eac3ddf4ca423",
"reference": "ddece80fce8611c22fa674a0f36eac3ddf4ca423",
"shasum": ""
},
"require": {
"php": ">=5.5",
"unl/php-dwt-parser": "1.0.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"satooshi/php-coveralls": "^0.7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"UNL\\Templates\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kevin Abel (kabel)",
"email": "kabel2@unl.edu",
"role": "Developer"
},
{
"name": "Brett Bieber (saltybeagle)",
"email": "brett.bieber@gmail.com",
"role": "Retired Developer"
},
{
"name": "Ned Hummel (nhummel2)",
"email": "nhummel2@math.unl.edu",
"role": "Retired Developer"
}
],
"description": "A PHP library for rendering the UNL templates",
"homepage": "http://wdn.unl.edu/",
"time": "2015-12-15 00:14:04"
},
{
"name": "zaininnari/html-minifier",
"version": "0.4.2",
"source": {
"type": "git",
"url": "https://github.com/zaininnari/html-minifier.git",
"reference": "5b94d85705626f9bb33b7c667bc4400088ed4ece"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zaininnari/html-minifier/zipball/5b94d85705626f9bb33b7c667bc4400088ed4ece",
"reference": "5b94d85705626f9bb33b7c667bc4400088ed4ece",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"satooshi/php-coveralls": "dev-master"
},
"type": "library",
"autoload": {
"psr-0": {
"zz": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"The BSD 3-Clause License"
],
"authors": [
{
"name": "Google inc",
"homepage": "http://www.chromium.org/blink",
"role": "Author"
},
{
"name": "zaininnari",
"homepage": "https://github.com/zaininnari/",
"role": "Developer"
}
],
"description": "The Blink HTMLTokenizer ported to PHP.",
"homepage": "https://github.com/zaininnari/html-minifier",
"keywords": [
"Blink",
"HTML minify",
"php"
],
"time": "2015-08-18 14:10:55"
},
{
"name": "zendframework/zend-code",
"version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-code.git",
"reference": "f6c2713c9c5628ccce62d5db3a129c7066af06df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-code/zipball/f6c2713c9c5628ccce62d5db3a129c7066af06df",
"reference": "f6c2713c9c5628ccce62d5db3a129c7066af06df",
"shasum": ""
},
"require": {
"php": ">=5.5",
"zendframework/zend-eventmanager": "^2.6|^3.0"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "~4.0",
"zendframework/zend-stdlib": "~2.7"
},
"suggest": {
"doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features",
"zendframework/zend-stdlib": "Zend\\Stdlib component"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev",
"dev-develop": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Zend\\Code\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "provides facilities to generate arbitrary code using an object oriented interface",
"homepage": "https://github.com/zendframework/zend-code",
"keywords": [
"code",
"zf2"
],
"time": "2015-11-24 15:49:25"
},
{
"name": "zendframework/zend-eventmanager",
"version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-eventmanager.git",
"reference": "a03de810b99b0302059ab744c535d464b8dc4721"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a03de810b99b0302059ab744c535d464b8dc4721",
"reference": "a03de810b99b0302059ab744c535d464b8dc4721",
"shasum": ""
},
"require": {
"php": ">=5.5",
"zendframework/zend-stdlib": "~2.5"
},
"require-dev": {
"athletic/athletic": "dev-master",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev",
"dev-develop": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Zend\\EventManager\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"homepage": "https://github.com/zendframework/zend-eventmanager",
"keywords": [
"eventmanager",
"zf2"
],
"time": "2015-10-06 11:53:40"
},
{
"name": "zendframework/zend-hydrator",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-hydrator.git",
"reference": "f3ed8b833355140350bbed98d8a7b8b66875903f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/f3ed8b833355140350bbed98d8a7b8b66875903f",
"reference": "f3ed8b833355140350bbed98d8a7b8b66875903f",
"shasum": ""
},
"require": {
"php": ">=5.5",
"zendframework/zend-stdlib": "^2.5.1"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "^2.0@dev",
"zendframework/zend-eventmanager": "^2.5.1",
"zendframework/zend-filter": "^2.5.1",
"zendframework/zend-inputfilter": "^2.5.1",
"zendframework/zend-serializer": "^2.5.1",
"zendframework/zend-servicemanager": "^2.5.1"
},
"suggest": {
"zendframework/zend-eventmanager": "^2.5.1, to support aggregate hydrator usage",
"zendframework/zend-filter": "^2.5.1, to support naming strategy hydrator usage",
"zendframework/zend-serializer": "^2.5.1, to use the SerializableStrategy",
"zendframework/zend-servicemanager": "^2.5.1, to support hydrator plugin manager usage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev",
"dev-develop": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Zend\\Hydrator\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"homepage": "https://github.com/zendframework/zend-hydrator",
"keywords": [
"hydrator",
"zf2"
],
"time": "2015-09-17 14:06:43"
},
{
"name": "zendframework/zend-stdlib",
"version": "2.7.4",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-stdlib.git",
"reference": "cae029346a33663b998507f94962eb27de060683"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cae029346a33663b998507f94962eb27de060683",
"reference": "cae029346a33663b998507f94962eb27de060683",
"shasum": ""
},
"require": {
"php": ">=5.5",
"zendframework/zend-hydrator": "~1.0"
},
"require-dev": {
"athletic/athletic": "~0.1",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "~4.0",
"zendframework/zend-config": "~2.5",
"zendframework/zend-eventmanager": "~2.5",
"zendframework/zend-filter": "~2.5",
"zendframework/zend-inputfilter": "~2.5",
"zendframework/zend-serializer": "~2.5",
"zendframework/zend-servicemanager": "~2.5"
},
"suggest": {
"zendframework/zend-eventmanager": "To support aggregate hydrator usage",
"zendframework/zend-filter": "To support naming strategy hydrator usage",
"zendframework/zend-serializer": "Zend\\Serializer component",
"zendframework/zend-servicemanager": "To support hydrator plugin manager usage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev",
"dev-develop": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Zend\\Stdlib\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"homepage": "https://github.com/zendframework/zend-stdlib",
"keywords": [
"stdlib",
"zf2"
],
"time": "2015-10-15 15:57:32"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
......@@ -7,42 +7,39 @@ if (file_exists(__DIR__ . '/../config.inc.php')) {
require_once $config_file;
use UNL\Templates\Templates;
function renderTemplate($file, $params = array())
{
ob_start();
extract($params);
include $file;
return ob_get_clean();
}
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->leftcollinks = file_get_contents('http://www.unl.edu/ucomm/sharedcode/relatedLinks.html');
$page->contactinfo = preg_replace('#<h3>.*</h3>#', '', file_get_contents('http://www.unl.edu/ucomm/sharedcode/footerContactInfo.html'));
$page->footercontent = file_get_contents('http://www.unl.edu/ucomm/sharedcode/footer.html');
$page->breadcrumbs = str_replace('Department', 'Search', $page->breadcrumbs);
$page->navlinks = file_get_contents('http://www.unl.edu/ucomm/sharedcode/navigation.html');
$page->contactinfo = renderTemplate('templates/local-footer.tpl.php');
$page->affiliation = '';
}
$isEmbed = isset($_GET['embed']) && $_GET['embed'];
UNL_Templates::setCachingService(new UNL_Templates_CachingService_Null());
UNL_Templates::$options['version'] = 4.0;
if (UNL_Search::$mode === 'debug') {
$page = UNL_Templates::factory('Local');
$page = Templates::factory('Local', Templates::VERSION_4_1);
$page->addScript('js/search.js');
} else {
$page = UNL_Templates::factory('Fixed');
$page = Templates::factory('Fixed', Templates::VERSION_4_1);
$page->addScript('js/search.min.js');
}
if (!$isEmbed) {
$page->doctitle = '<title>Search | University of Nebraska&ndash;Lincoln</title>';
$page->pagetitle = '';
ob_start();
renderTemplate('templates/breadcrumbs.tpl.php');
$page->breadcrumbs = ob_get_clean();
$page->breadcrumbs = renderTemplate('templates/breadcrumbs.tpl.php');
}
$local_results = '';
......@@ -109,12 +106,10 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
$context = json_encode($context);
$inlineJS .= "var LOCAL_SEARCH_CONTEXT = {$context};\n";
ob_start();
renderTemplate('templates/google-results.tpl.php', array(
$local_results = renderTemplate('templates/google-results.tpl.php', array(
'title' => $page->titlegraphic,
'id' => 'local_results',
));
$local_results = ob_get_clean();
} elseif (!$isEmbed) {
// Default search for no referring site.
loadDefaultSections($page);
......@@ -127,19 +122,16 @@ if (isset($_GET['q'])) {
$page->addScriptDeclaration($inlineJS);
ob_start();
$maincontent = '';
if (!$isEmbed) {
renderTemplate('templates/search-form.tpl.php', array('local_results' => $local_results));
$maincontent .= renderTemplate('templates/search-form.tpl.php', array('local_results' => $local_results));
}
renderTemplate('templates/search-results.tpl.php', array(
$maincontent .= renderTemplate('templates/search-results.tpl.php', array(
'isEmbed' => $isEmbed,
'local_results' => $local_results
));
$maincontent = ob_get_clean();
if (!$isEmbed) {
$page->maincontentarea = $maincontent;
echo $page;
......@@ -149,7 +141,7 @@ if (!$isEmbed) {
} else {
$template = 'templates/embed.tpl.php';
}
renderTemplate($template, array(
echo renderTemplate($template, array(
'head' => $page->head,
'maincontent' => $maincontent
));
......
<div class="wdn-grid-set wdn-footer-links-local">
<div class="bp960-wdn-col-one-fourth">
<div class="wdn-footer-module">
<span role="heading" class="wdn-footer-heading">Contact Us</span>
<?php echo file_get_contents('http://www.unl.edu/ucomm/sharedcode/footerContactInfo.html'); ?>
</div>
</div>
<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'); ?>
</div>
</div>
<div class="bp960-wdn-col-one-fourth">
<div class="wdn-footer-module">
<?php
$related_links = file_get_contents('http://www.unl.edu/sharedcode/relatedLinks.html');
$related_links = preg_replace('#<h3>.*</h3>#', '<span role="heading" class="wdn-footer-heading">Related Links</span>', $related_links);
$related_links = preg_replace('#<ul>#', '<ul class="wdn-related-links-v1">', $related_links);
echo $related_links;
?>
</div>
</div>
</div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment