Skip to content
Snippets Groups Projects
Commit f723eff1 authored by Kevin Abel's avatar Kevin Abel
Browse files

Coding standards and add WDN include path

parent 38dbb9ce
Branches
Tags
No related merge requests found
...@@ -28,15 +28,21 @@ function loadDefaultSections($page) ...@@ -28,15 +28,21 @@ function loadDefaultSections($page)
$isEmbed = isset($_GET['embed']) && $_GET['embed']; $isEmbed = isset($_GET['embed']) && $_GET['embed'];
$localScriptUrl = './js/search.min.js';
$pageTemplate = 'Fixed';
if (UNL_Search::$mode === 'debug') { if (UNL_Search::$mode === 'debug') {
$page = Templates::factory('Local', Templates::VERSION_4_1); $pageTemplate = 'Local';
$page->addScript('js/search.js'); $localScriptUrl = './js/search.js';
} else {
$page = Templates::factory('Fixed', Templates::VERSION_4_1);
$page->addScript('js/search.min.js');
} }
$page = Templates::factory($pageTemplate, Templates::VERSION_4_1);
if (!$isEmbed) { if (!$isEmbed) {
if (file_exists(__DIR__ . '/wdn/templates_4.1')) {
$page->setLocalIncludePath(__DIR__);
}
$page->doctitle = '<title>Search | University of Nebraska&ndash;Lincoln</title>'; $page->doctitle = '<title>Search | University of Nebraska&ndash;Lincoln</title>';
$page->pagetitle = ''; $page->pagetitle = '';
$page->breadcrumbs = renderTemplate('templates/breadcrumbs.tpl.php'); $page->breadcrumbs = renderTemplate('templates/breadcrumbs.tpl.php');
...@@ -136,14 +142,16 @@ $maincontent .= renderTemplate('templates/search-results.tpl.php', array( ...@@ -136,14 +142,16 @@ $maincontent .= renderTemplate('templates/search-results.tpl.php', array(
if (!$isEmbed) { if (!$isEmbed) {
$page->maincontentarea = $maincontent; $page->maincontentarea = $maincontent;
echo $page; echo $page;
} else { exit;
}
$template = 'templates/embed.tpl.php';
if (UNL_Search::$mode === 'debug') { if (UNL_Search::$mode === 'debug') {
$template = 'templates/embed-debug.tpl.php'; $template = 'templates/embed-debug.tpl.php';
} else {
$template = 'templates/embed.tpl.php';
} }
echo renderTemplate($template, array( echo renderTemplate($template, array(
'head' => $page->head, 'head' => $page->head,
'maincontent' => $maincontent 'maincontent' => $maincontent
)); ));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment