Skip to content
Snippets Groups Projects
Select Git revision
  • 65572495589b57af68cf7218b53e851237986c34
  • main default protected
2 results

index.css

Blame
  • Forked from SOFT Core / SOFT 260 / React Redux Starter Code
    Source project has a limited visibility.
    index.php 5.34 KiB
    <?php
    
    $config_file = __DIR__ . '/../config.sample.php';
    if (file_exists(__DIR__ . '/../config.inc.php')) {
        $config_file = __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->contactinfo = renderTemplate('templates/local-footer.tpl.php');
        $page->affiliation = '';
    }
    
    $isEmbed = isset($_GET['embed']) && $_GET['embed'];
    
    $localScriptUrl = './js/search.min.js?v=4.1';
    $pageTemplate = 'Fixed';
    
    if (UNL_Search::$mode === 'debug') {
        $pageTemplate = 'Local';
        $localScriptUrl = './js/search.js';
    }
    
    $page = Templates::factory($pageTemplate, Templates::VERSION_4_1);
    
    if (!$isEmbed) {
        if (file_exists(__DIR__ . '/wdn/templates_4.1')) {
            $page->setLocalIncludePath(__DIR__);
        }
    
        $page->doctitle = '<title>Search | University of Nebraska&ndash;Lincoln</title>';
        $page->head = '<link rel="home" href="./" />';
        $page->pagetitle = '';
        $page->breadcrumbs = renderTemplate('templates/breadcrumbs.tpl.php');
    }
    
    $localResults = '';
    $context = '';
    
    $page->addStyleSheet('css/search.css?v=20160602');
    
    //u is referring site
    if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
        // Add local site search results
        // we're scrapping the navigation and other content from the originatting site.
        if (!$isEmbed) {
            if (isset($scanned->titlegraphic)) {
                //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);
                if ($def = $config->maybeGetRawHTMLDefinition()) {