diff --git a/sites/all/themes/unl_wdn/html.tpl.php b/sites/all/themes/unl_wdn/html.tpl.php index 0b7bb61cbfcdfeaecd2bfba3f86c926b37dcbb44..553a1a4fbc113ea156fa57e077699d29bd94087c 100644 --- a/sites/all/themes/unl_wdn/html.tpl.php +++ b/sites/all/themes/unl_wdn/html.tpl.php @@ -31,44 +31,26 @@ * @see template_preprocess_html() * @see template_process() */ -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>" - <?php print $rdf_namespaces; ?>> -<head profile="<?php print $grddl_profile; ?>"> -<!-- - Membership and regular participation in the UNL Web Developer Network - is required to use the UNL templates. Visit the WDN site at - http://wdn.unl.edu/. Click the WDN Registry link to log in and - register your unl.edu site. - All UNL template code is the property of the UNL Web Developer Network. - The code seen in a source code view is not, and may not be used as, a - template. You may not use this code, a reverse-engineered version of - this code, or its associated visual presentation in whole or in part to - create a derivative work. - This message may not be removed from any pages based on the UNL site template. - - $Id: php.fixed.dwt.php 536 2009-07-23 15:47:30Z bbieber2 $ ---> -<link rel="stylesheet" type="text/css" media="screen" href="/wdn/templates_3.0/css/all.css" /> -<link rel="stylesheet" type="text/css" media="print" href="/wdn/templates_3.0/css/print.css" /> -<script type="text/javascript" src="/wdn/templates_3.0/scripts/all.js"></script> -<?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/browserspecifics.html'); ?> -<?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/metanfavico.html'); ?> -<!-- TemplateBeginEditable name="doctitle" --> -<title><?php print $head_title; ?></title> -<!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --> -<!-- Place optional header elements here --> -<?php print $head; ?> -<?php print $styles; ?> -<?php print $scripts; ?> -<?php if (theme_get_setting('use_base')) : ?> -<base href="<?php echo url('<front>', array('absolute' => TRUE))?>" /> -<?php endif; ?> -<!-- TemplateEndEditable --> -</head> -<body class="fixed <?php print $classes; ?>" <?php print $attributes;?>> -<?php print $page_top; ?> -<?php print $page; ?> -<?php print $page_bottom; ?> -</body> -</html> \ No newline at end of file + +$t = unl_wdn_get_instance(); + +$t->head .= PHP_EOL + . $head . PHP_EOL + . $styles . PHP_EOL + . $scripts . PHP_EOL + ; + +if (theme_get_setting('use_base')) { + $t->head .= '<base href="' . url('<front>', array('absolute' => TRUE)) . '" />' . PHP_EOL; +} + +$t->doctitle = '<title>'. unl_wdn_head_title() .'</title>'; + +$html = $t->toHtml(); + +$html = strtr($html, array('<div id="maincontent">' => $page_top . PHP_EOL . '<div id="maincontent">', + '<div id="footer">' => $page_bottom . PHP_EOL . '<div id="footer">')); + +echo $html; + + diff --git a/sites/all/themes/unl_wdn/page.tpl.php b/sites/all/themes/unl_wdn/page.tpl.php index 6f04b6eed8692cd5ad274666f50e81d06d1a2e7d..daf24e5416e6dd90c38a6b65de3e4b38b9375aed 100644 --- a/sites/all/themes/unl_wdn/page.tpl.php +++ b/sites/all/themes/unl_wdn/page.tpl.php @@ -1,7 +1,11 @@ +We need to output something to make drupal think this file actually does something. +Any real output is being deferred to html.tpl.php <?php +// $Id: page.tpl.php,v 1.43 2010/01/30 07:59:25 dries Exp $ + /** * @file - * UNL_WDN theme implementation to display a single Drupal page. + * Default theme implementation to display a single Drupal page. * * Available variables: * @@ -63,94 +67,85 @@ * @see template_preprocess_page() * @see template_process() */ -?> -<p class="skipnav"> <a class="skipnav" href="#maincontent">Skip Navigation</a> </p> -<div id="wdn_wrapper"> - <div id="header"> <a href="http://www.unl.edu/" title="UNL website"><img src="/wdn/templates_3.0/images/logo.png" alt="UNL graphic identifier" id="logo" /></a> - <h1>University of Nebraska–Lincoln</h1> - <?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/wdnTools.html'); ?> - </div> - <div id="wdn_navigation_bar"> - <div id="breadcrumbs"> - <!-- WDN: see glossary item 'breadcrumbs' --> - <!-- TemplateBeginEditable name="breadcrumbs" --> - <?php print $breadcrumb; ?> - <!-- TemplateEndEditable --></div> - <div id="wdn_navigation_wrapper"> - <div id="navigation"><!-- TemplateBeginEditable name="navlinks" --> - <?php print render($page['navlinks']); ?> - <!-- TemplateEndEditable --></div> - </div> - </div> - <div id="wdn_content_wrapper"> - <div id="titlegraphic"><!-- TemplateBeginEditable name="titlegraphic" --> - <h1><?php print $site_name; ?></h1> - <!-- TemplateEndEditable --></div> - <div id="pagetitle"><!-- TemplateBeginEditable name="pagetitle" --> - <h2><?php print $title; ?></h2> - <!-- TemplateEndEditable --></div> - <div id="maincontent"> - <!--THIS IS THE MAIN CONTENT AREA; WDN: see glossary item 'main content area' --> - <!-- TemplateBeginEditable name="maincontentarea" --> - <?php // echo '<pre>';var_dump($page);exit();//$messages . PHP_EOL - // . render($tabs) . PHP_EOL - // . render($action_links) . PHP_EOL - // . '<h3>' . render($title_prefix) . $title . render($title_suffix) . '</h3>'?> - <?php print strtr(render($page['content']), array('sticky-enabled' => 'zentable cool')); ?> - <!-- TemplateEndEditable --> - <div class="clear"></div> - <?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/noscript.html'); ?> - <!--THIS IS THE END OF THE MAIN CONTENT AREA.--> - </div> - <div id="footer"> - <div id="footer_floater"></div> - <div class="footer_col"> - <?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/feedback.html'); ?> - </div> - <div class="footer_col"><!-- TemplateBeginEditable name="leftcollinks" --> - <h3>Related Links</h3> - <?php if ($page['leftcollinks']) : ?> - <?php render($page['leftcollinks']); ?> - <?php else : ?> - <ul> - <li><a href="http://ucomm.unl.edu/">University Communications</a></li> - <li><a href="http://www.unl.edu/ucomm/chancllr/">Office of the Chancellor</a></li> - </ul> - <?php endif; ?> - <!-- TemplateEndEditable --></div> - <div class="footer_col"><!-- TemplateBeginEditable name="contactinfo" --> - <h3>Contacting Us</h3> - <?php if ($page['contactinfo']) : ?> - <?php render($page['contactinfo']); ?> - <?php else : ?> - <p> - <strong>University of Nebraska-Lincoln</strong><br /> - 1400 R Street<br /> - Lincoln, NE 68588<br /> - 402-472-7211 - </p> - <?php endif; ?> - <!-- TemplateEndEditable --></div> - <div class="footer_col"> - <?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/socialmediashare.html'); ?> - </div> - <!-- TemplateBeginEditable name="optionalfooter" --> - <?php if ($page['optionalfooter']) : ?> - <?php render($page['optionalfooter']); ?> - <?php endif; ?> - <!-- TemplateEndEditable --> - <div id="wdn_copyright"><!-- TemplateBeginEditable name="footercontent" --> - <?php if ($page['footercontent']) : ?> - <?php render($page['footercontent']); ?> - <?php else : ?> - © 2010 University of Nebraska–Lincoln | Lincoln, NE 68588 | 402-472-7211 | <a href="http://www.unl.edu/ucomm/aboutunl/" title="Click here to know more about UNL">About UNL</a> | <a href="http://www1.unl.edu/comments/" title="Click here to direct your comments and questions">comments?</a><br /> - UNL is an equal opportunity employer with a comprehensive plan for diversity. Find out more: <a href="https://employment.unl.edu/" target="_blank" title="Employment at UNL">employment.unl.edu</a><br /> - <?php endif; ?> - <p style="margin:0.5em 0 -1.4em 0">This site is an instance of <a href="http://unlcms.unl.edu/" title="Go to the UNL CMS website">UNL CMS</a> powered by <a href="http://drupal.org/" title="Go to the official website of Drupal">Drupal</a></p> - <!-- TemplateEndEditable --> - <?php echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/wdn/templates_3.0/includes/wdn.html'); ?> - | <a href="http://validator.unl.edu/check/referer">W3C</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3">CSS</a> <a href="http://www.unl.edu/" title="UNL Home" id="wdn_unl_wordmark"><img src="/wdn/templates_3.0/css/footer/images/wordmark.png" alt="UNL's wordmark" /></a> </div> - </div> - </div> - <div id="wdn_wrapper_footer"> </div> -</div> \ No newline at end of file + +$t = unl_wdn_get_instance(); + + +if (isset($breadcrumb)) { + $t->breadcrumbs = $breadcrumb; +} + +$t->navlinks = render($page['navlinks']); + + +if (isset($site_name) && $site_name) { + $t->titlegraphic = '<h1>' . $site_name . '</h1>'; +} +if (isset($site_slogan) && $site_slogan) { + $t->pagetitle = '<h2>' . $site_slogan . '</h2>'; +} + + +$t->maincontentarea = $messages . PHP_EOL + . render($tabs) . PHP_EOL + . render($action_links) . PHP_EOL + . '<h3>' . render($title_prefix) . $title . render($title_suffix) . '</h3>' . PHP_EOL + . strtr(render($page['content']), array('sticky-enabled' => 'zentable cool')) . PHP_EOL + ; + + + +if ($page['leftcollinks']) { + $leftcollinks = render($page['leftcollinks']); +} else { + $leftcollinks = <<<EOF +<ul> + <li class="first"><a href="http://ucomm.unl.edu/">University Communications</a> + <ul> + <li><a href="http://ucomm.unl.edu/resources.shtml">Print Resources </a></li> + </ul> + </li> + <li><a href="http://www.unl.edu/ucomm/chancllr/">Office of the Chancellor</a> </li> +</ul> +EOF; +} + +$t->leftcollinks = <<<EOF +<h3>Related Links</h3> +$leftcollinks +EOF; + + + +if ($page['contactinfo']) { + $contactinfo = render($page['contactinfo']); +} else { + $contactinfo = <<<EOF +<p> + The WDN is coordinated by:<br /> + <strong>University Communications</strong><br /> + Internet and Interactive Media<br /> + WICK 17<br /> + Lincoln, NE 68583-0218 +</p> +EOF; +} + +$t->contactinfo = <<<EOF +<h3>Contacting Us</h3> +$contactinfo +EOF; + + + +if ($page['optionalfooter']) { + $t->optionalfooter = render($page['optionalfooter']); +} + + + +$t->footercontent = ''; +if ($page['footercontent']) { + $t->footercontent .= '<div>' . render($page['footercontent']) . '</div>'; +} + diff --git a/sites/all/themes/unl_wdn/template.php b/sites/all/themes/unl_wdn/template.php index 8d46e1ef3ed4e70789c78bc58bead02ca6f5db93..1dfe46dc9eca8fa7bd4bc84a1a06f57783a610fa 100644 --- a/sites/all/themes/unl_wdn/template.php +++ b/sites/all/themes/unl_wdn/template.php @@ -1,46 +1,33 @@ <?php -require_once(dirname(__FILE__)).'/includes/form.inc'; -//This is supposed to be how we change $head_title in the <title> tag in html.tpl.php but as of 7.0-alpha5 it don't work for eric -//TODO: fix this -function unl_wdn_preprocess_html(&$vars) +function unl_wdn_get_instance() { - // Based on - // http://api.drupal.org/api/function/menu_get_active_breadcrumb/5 - // We don't have to add the current page, as drupal normally drops it - $path[] = 'Home'; - - // $trail = _menu_get_active_trail(); - $trail = array(); - foreach ($trail as $mid) { - $item = menu_get_item($mid); + static $instance; + if (!$instance) { + set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/lib'); + require_once "UNL/Templates.php"; - if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) { - $path[] = $item['title']; - } + UNL_Templates::$options['version'] = UNL_Templates::VERSION3; + $instance = UNL_Templates::factory('Fixed'); } - // Change 'Home' to be $site_name - array_unshift($path, str_replace( 'Home', variable_get('site_name', 'Department'), array_shift($path))); - - //Prepend UNL - array_unshift($path, 'UNL'); - - $vars['head_title'] = implode(' | ', $path); + return $instance; } +require_once dirname(__FILE__) . '/includes/form.inc'; + function unl_wdn_breadcrumb($variables) { $breadcrumbs = $variables['breadcrumb']; - - if (count($breadcrumbs) == 0) { - $breadcrumbs[] = variable_get('site_name', 'Department'); - } else { - //Change 'Home' to be $site_name - array_unshift($breadcrumbs, - str_replace('Home', variable_get('site_name', 'Department'), - array_shift($breadcrumbs))); - } + + if (count($breadcrumbs) == 0) { + $breadcrumbs[] = variable_get('site_name', 'Department'); + } else { + //Change 'Home' to be $site_name + array_unshift($breadcrumbs, + str_replace('Home', variable_get('site_name', 'Department'), + array_shift($breadcrumbs))); + } //Prepend UNL array_unshift($breadcrumbs, '<a href="http://www.unl.edu/">UNL</a>'); @@ -56,6 +43,32 @@ function unl_wdn_breadcrumb($variables) return $html; } +function unl_wdn_head_title() +{ + // Based on + // http://api.drupal.org/api/function/menu_get_active_breadcrumb/5 + // We don't have to add the current page, as drupal normally drops it + $path[] = 'Home'; + + // $trail = _menu_get_active_trail(); + $trail = array(); + foreach ($trail as $mid) { + $item = menu_get_item($mid); + + if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) { + $path[] = $item['title']; + } + } + + // Change 'Home' to be $site_name + array_unshift($path, str_replace( 'Home', variable_get('site_name', 'Department'), array_shift($path))); + + //Prepend UNL + array_unshift($path, 'UNL'); + + return implode(' | ', $path); +} + function unl_wdn_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { if ($extra_class) { diff --git a/sites/all/themes/unl_wdn/unl_wdn.info b/sites/all/themes/unl_wdn/unl_wdn.info index 85d2b94f93b3b5d44c0c3583de0a63be28d6f68a..5da76797462a29ee7bc87d6b7acd9b4748747fbf 100644 --- a/sites/all/themes/unl_wdn/unl_wdn.info +++ b/sites/all/themes/unl_wdn/unl_wdn.info @@ -1,5 +1,5 @@ name = UNL WDN -description = UNL DWN theme for Drupal +description = UNL WDN Theme screenshot = screenshot.png core = 7.x engine = phptemplate