diff --git a/sites/all/themes/unl_wdn/block.tpl.php b/sites/all/themes/unl_wdn/block.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..cc0299786a8fe8293825641c09c3e850a352bdc9 --- /dev/null +++ b/sites/all/themes/unl_wdn/block.tpl.php @@ -0,0 +1,4 @@ +<?php + + +echo $content; \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/html.tpl.php b/sites/all/themes/unl_wdn/html.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..65f3e942e12d2305e00c309e0203b1df83b6343a --- /dev/null +++ b/sites/all/themes/unl_wdn/html.tpl.php @@ -0,0 +1,52 @@ +<?php +/** + * @file + * Default theme implementation to display the basic html structure of a single + * Drupal page. + * + * Variables: + * - $css: An array of CSS files for the current page. + * - $language: (object) The language the site is being displayed in. + * $language->language contains its textual representation. + * $language->dir contains the language direction. It will either be 'ltr' or 'rtl'. + * - $rdf_namespaces: All the RDF namespace prefixes used in the HTML document. + * - $grddl_profile: A GRDDL profile allowing agents to extract the RDF data. + * - $head_title: A modified version of the page title, for use in the TITLE tag. + * - $head: Markup for the HEAD section (including meta tags, keyword tags, and + * so on). + * - $styles: Style tags necessary to import all CSS files for the page. + * - $scripts: Script tags necessary to load the JavaScript files and settings + * for the page. + * - $page_top: Initial markup from any modules that have altered the + * page. This variable should always be output first, before all other dynamic + * content. + * - $page: The rendered page content. + * - $page_bottom: Final closing markup from any modules that have altered the + * page. This variable should always be output last, after all other dynamic + * content. + * - $classes String of classes that can be used to style contextually through + * CSS. + * + * @see template_preprocess() + * @see template_preprocess_html() + * @see template_process() + */ + +$t = unl_wdn_get_instance(); + +$t->head .= PHP_EOL + . $head . PHP_EOL + . $styles . PHP_EOL + . $scripts . 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/includes/form.inc b/sites/all/themes/unl_wdn/includes/form.inc new file mode 100644 index 0000000000000000000000000000000000000000..90b26ed7f46ceb2b4507070b3e1019e85479ddb8 --- /dev/null +++ b/sites/all/themes/unl_wdn/includes/form.inc @@ -0,0 +1,138 @@ +<?php +/** + * Return a themed form element. + * + * @param element + * An associative array containing the properties of the element. + * Properties used: title, description, id, required + * @param $value + * The form element's data. + * @return + * A string representing the form element. + * + * @ingroup themeable + */ +function unl_wdn_form_element($element, $value) { + //Based on + //http://api.drupal.org/api/function/theme_form_element/5 + // +//print_r($element); + $output = ''; + $output .= '<!-- start ' . $element['#type'] . '::' . $element['#id'] . ' -->' . PHP_EOL; + + $output .= '<li class="form-item">'."\n"; + $required = !empty($element['#required']) ? '<span class="required" title="'. t('This field is required.') .'">*</span>' : ''; + + if (!empty($element['#title'])) { + $title = $element['#title']; + if (!empty($element['#id'])) { + $output .= ' <label for="'. $element['#id'] .'">'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n"; + } + else { + $output .= ' <label>'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n"; + } + } + + if ($element['#children']) { + $output .= '<ol>' . PHP_EOL; + } + + $output .= " $value\n"; + + if ($element['#children']) { + $output .= '</ol>' . PHP_EOL; + } + + if (!empty($element['#description'])) { + $output .= ' <div class="description">'. $element['#description'] ."</div>\n"; + } + $output .= "</li>\n"; + + $output .= '<!-- end ' . $element['#id'] . ' -->' . PHP_EOL; + + return $output; +} + +/** + * Format a set of radio buttons. + * + * @param $element + * An associative array containing the properties of the element. + * Properties used: title, value, options, description, required and attributes. + * @return + * A themed HTML string representing the radio button set. + * + * @ingroup themeable + */ +function unl_wdn_radios($element) { + $class = 'form-radios'; + if (isset($element['#attributes']['class'])) { + $class .= ' '. $element['#attributes']['class']; + } +// $element['#children'] = '<div class="'. $class .'">'. (!empty($element['#children']) ? $element['#children'] : '') .'</div>'; + if ($element['#title'] || $element['#description']) { + unset($element['#id']); + return theme('form_element', $element, $element['#children']); + } + else { + return $element['#children']; + } +} + +/** + * Format a group of form items. + * + * @param $element + * An associative array containing the properties of the element. + * Properties used: attributes, title, value, description, children, collapsible, collapsed + * @return + * A themed HTML string representing the form item group. + * + * @ingroup themeable + */ +function unl_wdn_fieldset($element) { + if (!empty($element['#collapsible'])) { + drupal_add_js('misc/collapse.js'); + + if (!isset($element['#attributes']['class'])) { + $element['#attributes']['class'] = ''; + } + + $element['#attributes']['class'] .= ' collapsible'; + if (!empty($element['#collapsed'])) { + $element['#attributes']['class'] .= ' collapsed'; + } + } + + return '<fieldset'. drupal_attributes($element['#attributes']) .'>' + . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') + . (isset($element['#description']) && $element['#description'] ? '<div class="description">' . $element['#description'] .'</div>' : '') + . '<ol>' . PHP_EOL + . (!empty($element['#children']) ? $element['#children'] : '') + . (isset($element['#value']) ? $element['#value'] : '') + . "</ol></fieldset>\n"; +} +/** + * Format a form. + * + * @param $element + * An associative array containing the properties of the element. + * Properties used: action, method, attributes, children + * @return + * A themed HTML string representing the form. + * + * @ingroup themeable + */ +function unl_wdn_form($element) { + // Anonymous div to satisfy XHTML compliance. + $action = $element['#action'] ? 'action="'. check_url($element['#action']) .'" ' : ''; + return '<script type="text/javascript"> + WDN.loadCSS("http://localhost/wdn/templates_3.0/css/content/forms.css"); + WDN.loadCSS("http://localhost/workspace/UNL_ENews/www/css/all.css"); + </script> + <form class="energetic" '. $action .' accept-charset="UTF-8" method="'. $element['#method'] .'" id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n". $element['#children'] ."\n</form>\n"; +} + + + + diff --git a/sites/all/themes/unl_wdn/layouts/fourcol.inc b/sites/all/themes/unl_wdn/layouts/fourcol.inc new file mode 100644 index 0000000000000000000000000000000000000000..625c1f5cba483a3628ab16754ce2fafb452b4972 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/fourcol.inc @@ -0,0 +1,21 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_fourcol_panels_layouts() { + $items['fourcol'] = array( + 'title' => t('UNL Four Column'), + 'icon' => 'fourcol.png', + 'theme' => 'fourcol', + 'panels' => array( + 'left' => t('Far Left'), + 'center-left' => t('Center Left'), + 'center-right' => t('Center Right'), + 'right' => t('Far Right'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/fourcol.png b/sites/all/themes/unl_wdn/layouts/fourcol.png new file mode 100644 index 0000000000000000000000000000000000000000..9d462c383623ac0bdf8bf3cb17dbeb0336849300 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/fourcol.png differ diff --git a/sites/all/themes/unl_wdn/layouts/fourcol.tpl.php b/sites/all/themes/unl_wdn/layouts/fourcol.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..47e24837c93da3f8783701b54ef7289bffc7e7a3 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/fourcol.tpl.php @@ -0,0 +1,33 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="col left"> + <?php echo $content['left']; ?> + </div> + <div class="col"> + <?php echo $content['center-left']; ?> + </div> + <div class="col"> + <?php echo $content['center-right']; ?> + </div> + <div class="col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/singlecol.inc b/sites/all/themes/unl_wdn/layouts/singlecol.inc new file mode 100644 index 0000000000000000000000000000000000000000..33d52f23b26baf73f384a3b89ea4949fc5d43dc7 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/singlecol.inc @@ -0,0 +1,18 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_singlecol_panels_layouts() { + $items['singlecol'] = array( + 'title' => t('UNL Single Column'), + 'icon' => 'singlecol.png', + 'theme' => 'singlecol', + 'panels' => array( + 'center' => t('Center') + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/singlecol.png b/sites/all/themes/unl_wdn/layouts/singlecol.png new file mode 100644 index 0000000000000000000000000000000000000000..3953488205a47ca9a91ef1ce56dd8c9d5c25b703 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/singlecol.png differ diff --git a/sites/all/themes/unl_wdn/layouts/singlecol.tpl.php b/sites/all/themes/unl_wdn/layouts/singlecol.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..48e3b7f3f17ca2b8be60ae99ff2b636ba1ca3022 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/singlecol.tpl.php @@ -0,0 +1,22 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <?php echo $content['center']; ?> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/threecol_112.inc b/sites/all/themes/unl_wdn/layouts/threecol_112.inc new file mode 100644 index 0000000000000000000000000000000000000000..8015fbcb47b30f416e7404fc4d4a560d8a81b990 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_112.inc @@ -0,0 +1,20 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_threecol_112_panels_layouts() { + $items['threecol_112'] = array( + 'title' => t('UNL Three Column (1/1/2 layout)'), + 'icon' => 'threecol_112.png', + 'theme' => 'threecol_112', + 'panels' => array( + 'left' => t('Left side'), + 'center' => t('Center'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/threecol_112.png b/sites/all/themes/unl_wdn/layouts/threecol_112.png new file mode 100644 index 0000000000000000000000000000000000000000..5346db85efdb6dd8c82e734ef936b13ab6cb79f5 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/threecol_112.png differ diff --git a/sites/all/themes/unl_wdn/layouts/threecol_112.tpl.php b/sites/all/themes/unl_wdn/layouts/threecol_112.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..b179edd25d3f20f2818d75765198d54592146e6a --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_112.tpl.php @@ -0,0 +1,30 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="col left"> + <?php echo $content['left']; ?> + </div> + <div class="col"> + <?php echo $content['center']; ?> + </div> + <div class="two_col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/threecol_121.inc b/sites/all/themes/unl_wdn/layouts/threecol_121.inc new file mode 100644 index 0000000000000000000000000000000000000000..71eb1117e00d4b989f9e3b782fd812f152ad300a --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_121.inc @@ -0,0 +1,20 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_threecol_121_panels_layouts() { + $items['threecol_121'] = array( + 'title' => t('UNL Three Column (1/2/1 layout)'), + 'icon' => 'threecol_121.png', + 'theme' => 'threecol_121', + 'panels' => array( + 'left' => t('Left side'), + 'center' => t('Center'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/threecol_121.png b/sites/all/themes/unl_wdn/layouts/threecol_121.png new file mode 100644 index 0000000000000000000000000000000000000000..a56cefe42ca7bac01df4cde07222ff36ee5c9f10 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/threecol_121.png differ diff --git a/sites/all/themes/unl_wdn/layouts/threecol_121.tpl.php b/sites/all/themes/unl_wdn/layouts/threecol_121.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..55abc69634e3e598294969f6940268c67efee405 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_121.tpl.php @@ -0,0 +1,30 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="col left"> + <?php echo $content['left']; ?> + </div> + <div class="two_col"> + <?php echo $content['center']; ?> + </div> + <div class="col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/threecol_211.inc b/sites/all/themes/unl_wdn/layouts/threecol_211.inc new file mode 100644 index 0000000000000000000000000000000000000000..5054d5405bb4e49477f598606d55b96ebc86629b --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_211.inc @@ -0,0 +1,20 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_threecol_211_panels_layouts() { + $items['threecol_211'] = array( + 'title' => t('UNL Three Column (2/1/1 layout)'), + 'icon' => 'threecol_211.png', + 'theme' => 'threecol_211', + 'panels' => array( + 'left' => t('Left side'), + 'center' => t('Center'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/threecol_211.png b/sites/all/themes/unl_wdn/layouts/threecol_211.png new file mode 100644 index 0000000000000000000000000000000000000000..b9bdd61150355ef98d90e86ceb34585609d3efc5 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/threecol_211.png differ diff --git a/sites/all/themes/unl_wdn/layouts/threecol_211.tpl.php b/sites/all/themes/unl_wdn/layouts/threecol_211.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..fc4a77da24131641a1472d0489c28e495dd62fbe --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/threecol_211.tpl.php @@ -0,0 +1,30 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="two_col left"> + <?php echo $content['left']; ?> + </div> + <div class="col"> + <?php echo $content['center']; ?> + </div> + <div class="col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/twocol_13.inc b/sites/all/themes/unl_wdn/layouts/twocol_13.inc new file mode 100644 index 0000000000000000000000000000000000000000..9c94b130ee4e90bba4841e083fcc299580ef4d4f --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_13.inc @@ -0,0 +1,19 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_twocol_13_panels_layouts() { + $items['twocol_13'] = array( + 'title' => t('UNL Two Column (1/3 layout)'), + 'icon' => 'twocol_13.png', + 'theme' => 'twocol_13', + 'panels' => array( + 'left' => t('Left side'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/twocol_13.png b/sites/all/themes/unl_wdn/layouts/twocol_13.png new file mode 100644 index 0000000000000000000000000000000000000000..dae6f974111aa12ffb93a61e89e4c461d8255140 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/twocol_13.png differ diff --git a/sites/all/themes/unl_wdn/layouts/twocol_13.tpl.php b/sites/all/themes/unl_wdn/layouts/twocol_13.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..a6c8acf72d845eba83a8f61be2b71bf3252ef9fe --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_13.tpl.php @@ -0,0 +1,27 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="col left"> + <?php echo $content['left']; ?> + </div> + <div class="three_col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/twocol_22.inc b/sites/all/themes/unl_wdn/layouts/twocol_22.inc new file mode 100644 index 0000000000000000000000000000000000000000..48ebab837f15a874c8cfc759046e823405698ba9 --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_22.inc @@ -0,0 +1,19 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_twocol_22_panels_layouts() { + $items['twocol_22'] = array( + 'title' => t('UNL Two Column (2/2 layout)'), + 'icon' => 'twocol_22.png', + 'theme' => 'twocol_22', + 'panels' => array( + 'left' => t('Left side'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/twocol_22.png b/sites/all/themes/unl_wdn/layouts/twocol_22.png new file mode 100644 index 0000000000000000000000000000000000000000..56f4def2118aa3d44a65c48e1b5a0628cc9d12d6 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/twocol_22.png differ diff --git a/sites/all/themes/unl_wdn/layouts/twocol_22.tpl.php b/sites/all/themes/unl_wdn/layouts/twocol_22.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..d0290fc720c559f360acbf0f1da90811a6404f6b --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_22.tpl.php @@ -0,0 +1,27 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="two_col left"> + <?php echo $content['left']; ?> + </div> + <div class="two_col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/layouts/twocol_31.inc b/sites/all/themes/unl_wdn/layouts/twocol_31.inc new file mode 100644 index 0000000000000000000000000000000000000000..cb1d2d4a5e5ab87c43b716cac5a2ec720b39b8cd --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_31.inc @@ -0,0 +1,19 @@ +<?php +// $Id: twocol_stacked.inc,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ + +/** + * Implementation of hook_panels_layouts(). + */ +function unl_wdn_twocol_31_panels_layouts() { + $items['twocol_31'] = array( + 'title' => t('UNL Two Column (3/1 layout)'), + 'icon' => 'twocol_31.png', + 'theme' => 'twocol_31', + 'panels' => array( + 'left' => t('Left side'), + 'right' => t('Right side'), + ), + ); + + return $items; +} diff --git a/sites/all/themes/unl_wdn/layouts/twocol_31.png b/sites/all/themes/unl_wdn/layouts/twocol_31.png new file mode 100644 index 0000000000000000000000000000000000000000..fe610deb29f336e5bcdb9ab0da166ee46cb29f27 Binary files /dev/null and b/sites/all/themes/unl_wdn/layouts/twocol_31.png differ diff --git a/sites/all/themes/unl_wdn/layouts/twocol_31.tpl.php b/sites/all/themes/unl_wdn/layouts/twocol_31.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..a0090d259182d48e32a488ab1e7c363144fa69ea --- /dev/null +++ b/sites/all/themes/unl_wdn/layouts/twocol_31.tpl.php @@ -0,0 +1,27 @@ +<?php +// $Id: panels-twocol-stacked.tpl.php,v 1.1.2.1 2008/12/16 21:27:59 merlinofchaos Exp $ +/** + * @file + * Template for a 2 column panel layout. + * + * This template provides a two column panel display layout, with + * additional areas for the top and the bottom. + * + * Variables: + * - $id: An optional CSS id to use for the layout. + * - $content: An array of content, each item in the array is keyed to one + * panel of the layout. This layout supports the following sections: + * - $content['left']: Content in the left column. + * - $content['right']: Content in the right column. + */ +?> +<div <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> + <div class="three_col left"> + <?php echo $content['left']; ?> + </div> + <div class="col right"> + <?php echo $content['right']; ?> + </div> + <div style="clear: both;"></div> +</div> + diff --git a/sites/all/themes/unl_wdn/lib/Cache/Lite.php b/sites/all/themes/unl_wdn/lib/Cache/Lite.php new file mode 100644 index 0000000000000000000000000000000000000000..a691e2e42cff726fad3451a15b3a79d5d946d5f0 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/Cache/Lite.php @@ -0,0 +1,835 @@ +<?php + +/** +* Fast, light and safe Cache Class +* +* Cache_Lite is a fast, light and safe cache system. It's optimized +* for file containers. It is fast and safe (because it uses file +* locking and/or anti-corruption tests). +* +* There are some examples in the 'docs/examples' file +* Technical choices are described in the 'docs/technical' file +* +* Memory Caching is from an original idea of +* Mike BENOIT <ipso@snappymail.ca> +* +* Nota : A chinese documentation (thanks to RainX <china_1982@163.com>) is +* available at : +* http://rainx.phpmore.com/manual/cache_lite.html +* +* @package Cache_Lite +* @category Caching +* @version $Id: Lite.php,v 1.54 2009/07/07 05:34:37 tacker Exp $ +* @author Fabien MARTY <fab@php.net> +*/ + +define('CACHE_LITE_ERROR_RETURN', 1); +define('CACHE_LITE_ERROR_DIE', 8); + +class Cache_Lite +{ + + // --- Private properties --- + + /** + * Directory where to put the cache files + * (make sure to add a trailing slash) + * + * @var string $_cacheDir + */ + var $_cacheDir = '/tmp/'; + + /** + * Enable / disable caching + * + * (can be very usefull for the debug of cached scripts) + * + * @var boolean $_caching + */ + var $_caching = true; + + /** + * Cache lifetime (in seconds) + * + * If null, the cache is valid forever. + * + * @var int $_lifeTime + */ + var $_lifeTime = 3600; + + /** + * Enable / disable fileLocking + * + * (can avoid cache corruption under bad circumstances) + * + * @var boolean $_fileLocking + */ + var $_fileLocking = true; + + /** + * Timestamp of the last valid cache + * + * @var int $_refreshTime + */ + var $_refreshTime; + + /** + * File name (with path) + * + * @var string $_file + */ + var $_file; + + /** + * File name (without path) + * + * @var string $_fileName + */ + var $_fileName; + + /** + * Enable / disable write control (the cache is read just after writing to detect corrupt entries) + * + * Enable write control will lightly slow the cache writing but not the cache reading + * Write control can detect some corrupt cache files but maybe it's not a perfect control + * + * @var boolean $_writeControl + */ + var $_writeControl = true; + + /** + * Enable / disable read control + * + * If enabled, a control key is embeded in cache file and this key is compared with the one + * calculated after the reading. + * + * @var boolean $_writeControl + */ + var $_readControl = true; + + /** + * Type of read control (only if read control is enabled) + * + * Available values are : + * 'md5' for a md5 hash control (best but slowest) + * 'crc32' for a crc32 hash control (lightly less safe but faster, better choice) + * 'strlen' for a length only test (fastest) + * + * @var boolean $_readControlType + */ + var $_readControlType = 'crc32'; + + /** + * Pear error mode (when raiseError is called) + * + * (see PEAR doc) + * + * @see setToDebug() + * @var int $_pearErrorMode + */ + var $_pearErrorMode = CACHE_LITE_ERROR_RETURN; + + /** + * Current cache id + * + * @var string $_id + */ + var $_id; + + /** + * Current cache group + * + * @var string $_group + */ + var $_group; + + /** + * Enable / Disable "Memory Caching" + * + * NB : There is no lifetime for memory caching ! + * + * @var boolean $_memoryCaching + */ + var $_memoryCaching = false; + + /** + * Enable / Disable "Only Memory Caching" + * (be carefull, memory caching is "beta quality") + * + * @var boolean $_onlyMemoryCaching + */ + var $_onlyMemoryCaching = false; + + /** + * Memory caching array + * + * @var array $_memoryCachingArray + */ + var $_memoryCachingArray = array(); + + /** + * Memory caching counter + * + * @var int $memoryCachingCounter + */ + var $_memoryCachingCounter = 0; + + /** + * Memory caching limit + * + * @var int $memoryCachingLimit + */ + var $_memoryCachingLimit = 1000; + + /** + * File Name protection + * + * if set to true, you can use any cache id or group name + * if set to false, it can be faster but cache ids and group names + * will be used directly in cache file names so be carefull with + * special characters... + * + * @var boolean $fileNameProtection + */ + var $_fileNameProtection = true; + + /** + * Enable / disable automatic serialization + * + * it can be used to save directly datas which aren't strings + * (but it's slower) + * + * @var boolean $_serialize + */ + var $_automaticSerialization = false; + + /** + * Disable / Tune the automatic cleaning process + * + * The automatic cleaning process destroy too old (for the given life time) + * cache files when a new cache file is written. + * 0 => no automatic cache cleaning + * 1 => systematic cache cleaning + * x (integer) > 1 => automatic cleaning randomly 1 times on x cache write + * + * @var int $_automaticCleaning + */ + var $_automaticCleaningFactor = 0; + + /** + * Nested directory level + * + * Set the hashed directory structure level. 0 means "no hashed directory + * structure", 1 means "one level of directory", 2 means "two levels"... + * This option can speed up Cache_Lite only when you have many thousands of + * cache file. Only specific benchs can help you to choose the perfect value + * for you. Maybe, 1 or 2 is a good start. + * + * @var int $_hashedDirectoryLevel + */ + var $_hashedDirectoryLevel = 0; + + /** + * Umask for hashed directory structure + * + * @var int $_hashedDirectoryUmask + */ + var $_hashedDirectoryUmask = 0700; + + /** + * API break for error handling in CACHE_LITE_ERROR_RETURN mode + * + * In CACHE_LITE_ERROR_RETURN mode, error handling was not good because + * for example save() method always returned a boolean (a PEAR_Error object + * would be better in CACHE_LITE_ERROR_RETURN mode). To correct this without + * breaking the API, this option (false by default) can change this handling. + * + * @var boolean + */ + var $_errorHandlingAPIBreak = false; + + // --- Public methods --- + + /** + * Constructor + * + * $options is an assoc. Available options are : + * $options = array( + * 'cacheDir' => directory where to put the cache files (string), + * 'caching' => enable / disable caching (boolean), + * 'lifeTime' => cache lifetime in seconds (int), + * 'fileLocking' => enable / disable fileLocking (boolean), + * 'writeControl' => enable / disable write control (boolean), + * 'readControl' => enable / disable read control (boolean), + * 'readControlType' => type of read control 'crc32', 'md5', 'strlen' (string), + * 'pearErrorMode' => pear error mode (when raiseError is called) (cf PEAR doc) (int), + * 'memoryCaching' => enable / disable memory caching (boolean), + * 'onlyMemoryCaching' => enable / disable only memory caching (boolean), + * 'memoryCachingLimit' => max nbr of records to store into memory caching (int), + * 'fileNameProtection' => enable / disable automatic file name protection (boolean), + * 'automaticSerialization' => enable / disable automatic serialization (boolean), + * 'automaticCleaningFactor' => distable / tune automatic cleaning process (int), + * 'hashedDirectoryLevel' => level of the hashed directory system (int), + * 'hashedDirectoryUmask' => umask for hashed directory structure (int), + * 'errorHandlingAPIBreak' => API break for better error handling ? (boolean) + * ); + * + * @param array $options options + * @access public + */ + function Cache_Lite($options = array(NULL)) + { + foreach($options as $key => $value) { + $this->setOption($key, $value); + } + } + + /** + * Generic way to set a Cache_Lite option + * + * see Cache_Lite constructor for available options + * + * @var string $name name of the option + * @var mixed $value value of the option + * @access public + */ + function setOption($name, $value) + { + $availableOptions = array('errorHandlingAPIBreak', 'hashedDirectoryUmask', 'hashedDirectoryLevel', 'automaticCleaningFactor', 'automaticSerialization', 'fileNameProtection', 'memoryCaching', 'onlyMemoryCaching', 'memoryCachingLimit', 'cacheDir', 'caching', 'lifeTime', 'fileLocking', 'writeControl', 'readControl', 'readControlType', 'pearErrorMode'); + if (in_array($name, $availableOptions)) { + $property = '_'.$name; + $this->$property = $value; + } + } + + /** + * Test if a cache is available and (if yes) return it + * + * @param string $id cache id + * @param string $group name of the cache group + * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested + * @return string data of the cache (else : false) + * @access public + */ + function get($id, $group = 'default', $doNotTestCacheValidity = false) + { + $this->_id = $id; + $this->_group = $group; + $data = false; + if ($this->_caching) { + $this->_setRefreshTime(); + $this->_setFileName($id, $group); + clearstatcache(); + if ($this->_memoryCaching) { + if (isset($this->_memoryCachingArray[$this->_file])) { + if ($this->_automaticSerialization) { + return unserialize($this->_memoryCachingArray[$this->_file]); + } + return $this->_memoryCachingArray[$this->_file]; + } + if ($this->_onlyMemoryCaching) { + return false; + } + } + if (($doNotTestCacheValidity) || (is_null($this->_refreshTime))) { + if (file_exists($this->_file)) { + $data = $this->_read(); + } + } else { + if ((file_exists($this->_file)) && (@filemtime($this->_file) > $this->_refreshTime)) { + $data = $this->_read(); + } + } + if (($data) and ($this->_memoryCaching)) { + $this->_memoryCacheAdd($data); + } + if (($this->_automaticSerialization) and (is_string($data))) { + $data = unserialize($data); + } + return $data; + } + return false; + } + + /** + * Save some data in a cache file + * + * @param string $data data to put in cache (can be another type than strings if automaticSerialization is on) + * @param string $id cache id + * @param string $group name of the cache group + * @return boolean true if no problem (else : false or a PEAR_Error object) + * @access public + */ + function save($data, $id = NULL, $group = 'default') + { + if ($this->_caching) { + if ($this->_automaticSerialization) { + $data = serialize($data); + } + if (isset($id)) { + $this->_setFileName($id, $group); + } + if ($this->_memoryCaching) { + $this->_memoryCacheAdd($data); + if ($this->_onlyMemoryCaching) { + return true; + } + } + if ($this->_automaticCleaningFactor>0 && ($this->_automaticCleaningFactor==1 || mt_rand(1, $this->_automaticCleaningFactor)==1)) { + $this->clean(false, 'old'); + } + if ($this->_writeControl) { + $res = $this->_writeAndControl($data); + if (is_bool($res)) { + if ($res) { + return true; + } + // if $res if false, we need to invalidate the cache + @touch($this->_file, time() - 2*abs($this->_lifeTime)); + return false; + } + } else { + $res = $this->_write($data); + } + if (is_object($res)) { + // $res is a PEAR_Error object + if (!($this->_errorHandlingAPIBreak)) { + return false; // we return false (old API) + } + } + return $res; + } + return false; + } + + /** + * Remove a cache file + * + * @param string $id cache id + * @param string $group name of the cache group + * @param boolean $checkbeforeunlink check if file exists before removing it + * @return boolean true if no problem + * @access public + */ + function remove($id, $group = 'default', $checkbeforeunlink = false) + { + $this->_setFileName($id, $group); + if ($this->_memoryCaching) { + if (isset($this->_memoryCachingArray[$this->_file])) { + unset($this->_memoryCachingArray[$this->_file]); + $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; + } + if ($this->_onlyMemoryCaching) { + return true; + } + } + if ( $checkbeforeunlink ) { + if (!file_exists($this->_file)) return true; + } + return $this->_unlink($this->_file); + } + + /** + * Clean the cache + * + * if no group is specified all cache files will be destroyed + * else only cache files of the specified group will be destroyed + * + * @param string $group name of the cache group + * @param string $mode flush cache mode : 'old', 'ingroup', 'notingroup', + * 'callback_myFunction' + * @return boolean true if no problem + * @access public + */ + function clean($group = false, $mode = 'ingroup') + { + return $this->_cleanDir($this->_cacheDir, $group, $mode); + } + + /** + * Set to debug mode + * + * When an error is found, the script will stop and the message will be displayed + * (in debug mode only). + * + * @access public + */ + function setToDebug() + { + $this->setOption('pearErrorMode', CACHE_LITE_ERROR_DIE); + } + + /** + * Set a new life time + * + * @param int $newLifeTime new life time (in seconds) + * @access public + */ + function setLifeTime($newLifeTime) + { + $this->_lifeTime = $newLifeTime; + $this->_setRefreshTime(); + } + + /** + * Save the state of the caching memory array into a cache file cache + * + * @param string $id cache id + * @param string $group name of the cache group + * @access public + */ + function saveMemoryCachingState($id, $group = 'default') + { + if ($this->_caching) { + $array = array( + 'counter' => $this->_memoryCachingCounter, + 'array' => $this->_memoryCachingArray + ); + $data = serialize($array); + $this->save($data, $id, $group); + } + } + + /** + * Load the state of the caching memory array from a given cache file cache + * + * @param string $id cache id + * @param string $group name of the cache group + * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested + * @access public + */ + function getMemoryCachingState($id, $group = 'default', $doNotTestCacheValidity = false) + { + if ($this->_caching) { + if ($data = $this->get($id, $group, $doNotTestCacheValidity)) { + $array = unserialize($data); + $this->_memoryCachingCounter = $array['counter']; + $this->_memoryCachingArray = $array['array']; + } + } + } + + /** + * Return the cache last modification time + * + * BE CAREFUL : THIS METHOD IS FOR HACKING ONLY ! + * + * @return int last modification time + */ + function lastModified() + { + return @filemtime($this->_file); + } + + /** + * Trigger a PEAR error + * + * To improve performances, the PEAR.php file is included dynamically. + * The file is so included only when an error is triggered. So, in most + * cases, the file isn't included and perfs are much better. + * + * @param string $msg error message + * @param int $code error code + * @access public + */ + function raiseError($msg, $code) + { + include_once('PEAR.php'); + return PEAR::raiseError($msg, $code, $this->_pearErrorMode); + } + + /** + * Extend the life of a valid cache file + * + * see http://pear.php.net/bugs/bug.php?id=6681 + * + * @access public + */ + function extendLife() + { + @touch($this->_file); + } + + // --- Private methods --- + + /** + * Compute & set the refresh time + * + * @access private + */ + function _setRefreshTime() + { + if (is_null($this->_lifeTime)) { + $this->_refreshTime = null; + } else { + $this->_refreshTime = time() - $this->_lifeTime; + } + } + + /** + * Remove a file + * + * @param string $file complete file path and name + * @return boolean true if no problem + * @access private + */ + function _unlink($file) + { + if (!@unlink($file)) { + return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); + } + return true; + } + + /** + * Recursive function for cleaning cache file in the given directory + * + * @param string $dir directory complete path (with a trailing slash) + * @param string $group name of the cache group + * @param string $mode flush cache mode : 'old', 'ingroup', 'notingroup', + 'callback_myFunction' + * @return boolean true if no problem + * @access private + */ + function _cleanDir($dir, $group = false, $mode = 'ingroup') + { + if ($this->_fileNameProtection) { + $motif = ($group) ? 'cache_'.md5($group).'_' : 'cache_'; + } else { + $motif = ($group) ? 'cache_'.$group.'_' : 'cache_'; + } + if ($this->_memoryCaching) { + foreach($this->_memoryCachingArray as $key => $v) { + if (strpos($key, $motif) !== false) { + unset($this->_memoryCachingArray[$key]); + $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; + } + } + if ($this->_onlyMemoryCaching) { + return true; + } + } + if (!($dh = opendir($dir))) { + return $this->raiseError('Cache_Lite : Unable to open cache directory !', -4); + } + $result = true; + while ($file = readdir($dh)) { + if (($file != '.') && ($file != '..')) { + if (substr($file, 0, 6)=='cache_') { + $file2 = $dir . $file; + if (is_file($file2)) { + switch (substr($mode, 0, 9)) { + case 'old': + // files older than lifeTime get deleted from cache + if (!is_null($this->_lifeTime)) { + if ((time() - @filemtime($file2)) > $this->_lifeTime) { + $result = ($result and ($this->_unlink($file2))); + } + } + break; + case 'notingrou': + if (strpos($file2, $motif) === false) { + $result = ($result and ($this->_unlink($file2))); + } + break; + case 'callback_': + $func = substr($mode, 9, strlen($mode) - 9); + if ($func($file2, $group)) { + $result = ($result and ($this->_unlink($file2))); + } + break; + case 'ingroup': + default: + if (strpos($file2, $motif) !== false) { + $result = ($result and ($this->_unlink($file2))); + } + break; + } + } + if ((is_dir($file2)) and ($this->_hashedDirectoryLevel>0)) { + $result = ($result and ($this->_cleanDir($file2 . '/', $group, $mode))); + } + } + } + } + return $result; + } + + /** + * Add some date in the memory caching array + * + * @param string $data data to cache + * @access private + */ + function _memoryCacheAdd($data) + { + $this->_memoryCachingArray[$this->_file] = $data; + if ($this->_memoryCachingCounter >= $this->_memoryCachingLimit) { + list($key, ) = each($this->_memoryCachingArray); + unset($this->_memoryCachingArray[$key]); + } else { + $this->_memoryCachingCounter = $this->_memoryCachingCounter + 1; + } + } + + /** + * Make a file name (with path) + * + * @param string $id cache id + * @param string $group name of the group + * @access private + */ + function _setFileName($id, $group) + { + + if ($this->_fileNameProtection) { + $suffix = 'cache_'.md5($group).'_'.md5($id); + } else { + $suffix = 'cache_'.$group.'_'.$id; + } + $root = $this->_cacheDir; + if ($this->_hashedDirectoryLevel>0) { + $hash = md5($suffix); + for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) { + $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; + } + } + $this->_fileName = $suffix; + $this->_file = $root.$suffix; + } + + /** + * Read the cache file and return the content + * + * @return string content of the cache file (else : false or a PEAR_Error object) + * @access private + */ + function _read() + { + $fp = @fopen($this->_file, "rb"); + if ($this->_fileLocking) @flock($fp, LOCK_SH); + if ($fp) { + clearstatcache(); + $length = @filesize($this->_file); + $mqr = get_magic_quotes_runtime(); + if ($mqr) { + set_magic_quotes_runtime(0); + } + if ($this->_readControl) { + $hashControl = @fread($fp, 32); + $length = $length - 32; + } + if ($length) { + $data = @fread($fp, $length); + } else { + $data = ''; + } + if ($mqr) { + set_magic_quotes_runtime($mqr); + } + if ($this->_fileLocking) @flock($fp, LOCK_UN); + @fclose($fp); + if ($this->_readControl) { + $hashData = $this->_hash($data, $this->_readControlType); + if ($hashData != $hashControl) { + if (!(is_null($this->_lifeTime))) { + @touch($this->_file, time() - 2*abs($this->_lifeTime)); + } else { + @unlink($this->_file); + } + return false; + } + } + return $data; + } + return $this->raiseError('Cache_Lite : Unable to read cache !', -2); + } + + /** + * Write the given data in the cache file + * + * @param string $data data to put in cache + * @return boolean true if ok (a PEAR_Error object else) + * @access private + */ + function _write($data) + { + if ($this->_hashedDirectoryLevel > 0) { + $hash = md5($this->_fileName); + $root = $this->_cacheDir; + for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) { + $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; + if (!(@is_dir($root))) { + @mkdir($root, $this->_hashedDirectoryUmask); + } + } + } + $fp = @fopen($this->_file, "wb"); + if ($fp) { + if ($this->_fileLocking) @flock($fp, LOCK_EX); + if ($this->_readControl) { + @fwrite($fp, $this->_hash($data, $this->_readControlType), 32); + } + $mqr = get_magic_quotes_runtime(); + if ($mqr) { + set_magic_quotes_runtime(0); + } + @fwrite($fp, $data); + if ($mqr) { + set_magic_quotes_runtime($mqr); + } + if ($this->_fileLocking) @flock($fp, LOCK_UN); + @fclose($fp); + return true; + } + return $this->raiseError('Cache_Lite : Unable to write cache file : '.$this->_file, -1); + } + + /** + * Write the given data in the cache file and control it just after to avoir corrupted cache entries + * + * @param string $data data to put in cache + * @return boolean true if the test is ok (else : false or a PEAR_Error object) + * @access private + */ + function _writeAndControl($data) + { + $result = $this->_write($data); + if (is_object($result)) { + return $result; # We return the PEAR_Error object + } + $dataRead = $this->_read(); + if (is_object($dataRead)) { + return $dataRead; # We return the PEAR_Error object + } + if ((is_bool($dataRead)) && (!$dataRead)) { + return false; + } + return ($dataRead==$data); + } + + /** + * Make a control key with the string containing datas + * + * @param string $data data + * @param string $controlType type of control 'md5', 'crc32' or 'strlen' + * @return string control key + * @access private + */ + function _hash($data, $controlType) + { + switch ($controlType) { + case 'md5': + return md5($data); + case 'crc32': + return sprintf('% 32d', crc32($data)); + case 'strlen': + return sprintf('% 32d', strlen($data)); + default: + return $this->raiseError('Unknown controlType ! (available values are only \'md5\', \'crc32\', \'strlen\')', -5); + } + } + +} + +?> diff --git a/sites/all/themes/unl_wdn/lib/Cache/Lite/File.php b/sites/all/themes/unl_wdn/lib/Cache/Lite/File.php new file mode 100644 index 0000000000000000000000000000000000000000..e34da4ef31765e8e487ff237899f3cae4f4461c4 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/Cache/Lite/File.php @@ -0,0 +1,93 @@ +<?php + +/** +* This class extends Cache_Lite and offers a cache system driven by a master file +* +* With this class, cache validity is only dependent of a given file. Cache files +* are valid only if they are older than the master file. It's a perfect way for +* caching templates results (if the template file is newer than the cache, cache +* must be rebuild...) or for config classes... +* There are some examples in the 'docs/examples' file +* Technical choices are described in the 'docs/technical' file +* +* @package Cache_Lite +* @version $Id: File.php,v 1.4 2009/03/07 12:55:39 tacker Exp $ +* @author Fabien MARTY <fab@php.net> +*/ + +require_once('Cache/Lite.php'); + +class Cache_Lite_File extends Cache_Lite +{ + + // --- Private properties --- + + /** + * Complete path of the file used for controlling the cache lifetime + * + * @var string $_masterFile + */ + var $_masterFile = ''; + + /** + * Masterfile mtime + * + * @var int $_masterFile_mtime + */ + var $_masterFile_mtime = 0; + + // --- Public methods ---- + + /** + * Constructor + * + * $options is an assoc. To have a look at availables options, + * see the constructor of the Cache_Lite class in 'Cache_Lite.php' + * + * Comparing to Cache_Lite constructor, there is another option : + * $options = array( + * (...) see Cache_Lite constructor + * 'masterFile' => complete path of the file used for controlling the cache lifetime(string) + * ); + * + * @param array $options options + * @access public + */ + function Cache_Lite_File($options = array(NULL)) + { + $options['lifetime'] = 0; + $this->Cache_Lite($options); + if (isset($options['masterFile'])) { + $this->_masterFile = $options['masterFile']; + } else { + return $this->raiseError('Cache_Lite_File : masterFile option must be set !'); + } + if (!($this->_masterFile_mtime = @filemtime($this->_masterFile))) { + return $this->raiseError('Cache_Lite_File : Unable to read masterFile : '.$this->_masterFile, -3); + } + } + + /** + * Test if a cache is available and (if yes) return it + * + * @param string $id cache id + * @param string $group name of the cache group + * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested + * @return string data of the cache (else : false) + * @access public + */ + function get($id, $group = 'default', $doNotTestCacheValidity = false) + { + if ($data = parent::get($id, $group, true)) { + if ($filemtime = $this->lastModified()) { + if ($filemtime > $this->_masterFile_mtime) { + return $data; + } + } + } + return false; + } + +} + +?> diff --git a/sites/all/themes/unl_wdn/lib/Cache/Lite/Function.php b/sites/all/themes/unl_wdn/lib/Cache/Lite/Function.php new file mode 100644 index 0000000000000000000000000000000000000000..63a96d9e5d89139baf68e059c5ea2609c95ddb06 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/Cache/Lite/Function.php @@ -0,0 +1,211 @@ +<?php + +/** +* This class extends Cache_Lite and can be used to cache the result and output of functions/methods +* +* This class is completly inspired from Sebastian Bergmann's +* PEAR/Cache_Function class. This is only an adaptation to +* Cache_Lite +* +* There are some examples in the 'docs/examples' file +* Technical choices are described in the 'docs/technical' file +* +* @package Cache_Lite +* @version $Id: Function.php,v 1.11 2006/12/14 12:59:43 cweiske Exp $ +* @author Sebastian BERGMANN <sb@sebastian-bergmann.de> +* @author Fabien MARTY <fab@php.net> +*/ + +require_once('Cache/Lite.php'); + +class Cache_Lite_Function extends Cache_Lite +{ + + // --- Private properties --- + + /** + * Default cache group for function caching + * + * @var string $_defaultGroup + */ + var $_defaultGroup = 'Cache_Lite_Function'; + + /** + * Don't cache the method call when its output contains the string "NOCACHE" + * + * if set to true, the output of the method will never be displayed (because the output is used + * to control the cache) + * + * @var boolean $_dontCacheWhenTheOutputContainsNOCACHE + */ + var $_dontCacheWhenTheOutputContainsNOCACHE = false; + + /** + * Don't cache the method call when its result is false + * + * @var boolean $_dontCacheWhenTheResultIsFalse + */ + var $_dontCacheWhenTheResultIsFalse = false; + + /** + * Don't cache the method call when its result is null + * + * @var boolean $_dontCacheWhenTheResultIsNull + */ + var $_dontCacheWhenTheResultIsNull = false; + + /** + * Debug the Cache_Lite_Function caching process + * + * @var boolean $_debugCacheLiteFunction + */ + var $_debugCacheLiteFunction = false; + + // --- Public methods ---- + + /** + * Constructor + * + * $options is an assoc. To have a look at availables options, + * see the constructor of the Cache_Lite class in 'Cache_Lite.php' + * + * Comparing to Cache_Lite constructor, there is another option : + * $options = array( + * (...) see Cache_Lite constructor + * 'debugCacheLiteFunction' => (bool) debug the caching process, + * 'defaultGroup' => default cache group for function caching (string), + * 'dontCacheWhenTheOutputContainsNOCACHE' => (bool) don't cache when the function output contains "NOCACHE", + * 'dontCacheWhenTheResultIsFalse' => (bool) don't cache when the function result is false, + * 'dontCacheWhenTheResultIsNull' => (bool don't cache when the function result is null + * ); + * + * @param array $options options + * @access public + */ + function Cache_Lite_Function($options = array(NULL)) + { + $availableOptions = array('debugCacheLiteFunction', 'defaultGroup', 'dontCacheWhenTheOutputContainsNOCACHE', 'dontCacheWhenTheResultIsFalse', 'dontCacheWhenTheResultIsNull'); + while (list($name, $value) = each($options)) { + if (in_array($name, $availableOptions)) { + $property = '_'.$name; + $this->$property = $value; + } + } + reset($options); + $this->Cache_Lite($options); + } + + /** + * Calls a cacheable function or method (or not if there is already a cache for it) + * + * Arguments of this method are read with func_get_args. So it doesn't appear + * in the function definition. Synopsis : + * call('functionName', $arg1, $arg2, ...) + * (arg1, arg2... are arguments of 'functionName') + * + * @return mixed result of the function/method + * @access public + */ + function call() + { + $arguments = func_get_args(); + $id = $this->_makeId($arguments); + $data = $this->get($id, $this->_defaultGroup); + if ($data !== false) { + if ($this->_debugCacheLiteFunction) { + echo "Cache hit !\n"; + } + $array = unserialize($data); + $output = $array['output']; + $result = $array['result']; + } else { + if ($this->_debugCacheLiteFunction) { + echo "Cache missed !\n"; + } + ob_start(); + ob_implicit_flush(false); + $target = array_shift($arguments); + if (is_array($target)) { + // in this case, $target is for example array($obj, 'method') + $object = $target[0]; + $method = $target[1]; + $result = call_user_func_array(array(&$object, $method), $arguments); + } else { + if (strstr($target, '::')) { // classname::staticMethod + list($class, $method) = explode('::', $target); + $result = call_user_func_array(array($class, $method), $arguments); + } else if (strstr($target, '->')) { // object->method + // use a stupid name ($objet_123456789 because) of problems where the object + // name is the same as this var name + list($object_123456789, $method) = explode('->', $target); + global $$object_123456789; + $result = call_user_func_array(array($$object_123456789, $method), $arguments); + } else { // function + $result = call_user_func_array($target, $arguments); + } + } + $output = ob_get_contents(); + ob_end_clean(); + if ($this->_dontCacheWhenTheResultIsFalse) { + if ((is_bool($result)) && (!($result))) { + echo($output); + return $result; + } + } + if ($this->_dontCacheWhenTheResultIsNull) { + if (is_null($result)) { + echo($output); + return $result; + } + } + if ($this->_dontCacheWhenTheOutputContainsNOCACHE) { + if (strpos($output, 'NOCACHE') > -1) { + return $result; + } + } + $array['output'] = $output; + $array['result'] = $result; + $this->save(serialize($array), $id, $this->_defaultGroup); + } + echo($output); + return $result; + } + + /** + * Drop a cache file + * + * Arguments of this method are read with func_get_args. So it doesn't appear + * in the function definition. Synopsis : + * remove('functionName', $arg1, $arg2, ...) + * (arg1, arg2... are arguments of 'functionName') + * + * @return boolean true if no problem + * @access public + */ + function drop() + { + $id = $this->_makeId(func_get_args()); + return $this->remove($id, $this->_defaultGroup); + } + + /** + * Make an id for the cache + * + * @var array result of func_get_args for the call() or the remove() method + * @return string id + * @access private + */ + function _makeId($arguments) + { + $id = serialize($arguments); // Generate a cache id + if (!$this->_fileNameProtection) { + $id = md5($id); + // if fileNameProtection is set to false, then the id has to be hashed + // because it's a very bad file name in most cases + } + return $id; + } + +} + +?> diff --git a/sites/all/themes/unl_wdn/lib/Cache/Lite/Output.php b/sites/all/themes/unl_wdn/lib/Cache/Lite/Output.php new file mode 100644 index 0000000000000000000000000000000000000000..97322736d99990bc14e0cc19e811801a9cba2e14 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/Cache/Lite/Output.php @@ -0,0 +1,72 @@ +<?php + +/** +* This class extends Cache_Lite and uses output buffering to get the data to cache. +* +* There are some examples in the 'docs/examples' file +* Technical choices are described in the 'docs/technical' file +* +* @package Cache_Lite +* @version $Id: Output.php,v 1.4 2006/01/29 00:22:07 fab Exp $ +* @author Fabien MARTY <fab@php.net> +*/ + +require_once('Cache/Lite.php'); + +class Cache_Lite_Output extends Cache_Lite +{ + + // --- Public methods --- + + /** + * Constructor + * + * $options is an assoc. To have a look at availables options, + * see the constructor of the Cache_Lite class in 'Cache_Lite.php' + * + * @param array $options options + * @access public + */ + function Cache_Lite_Output($options) + { + $this->Cache_Lite($options); + } + + /** + * Start the cache + * + * @param string $id cache id + * @param string $group name of the cache group + * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested + * @return boolean true if the cache is hit (false else) + * @access public + */ + function start($id, $group = 'default', $doNotTestCacheValidity = false) + { + $data = $this->get($id, $group, $doNotTestCacheValidity); + if ($data !== false) { + echo($data); + return true; + } + ob_start(); + ob_implicit_flush(false); + return false; + } + + /** + * Stop the cache + * + * @access public + */ + function end() + { + $data = ob_get_contents(); + ob_end_clean(); + $this->save($data, $this->_id, $this->_group); + echo($data); + } + +} + + +?> diff --git a/sites/all/themes/unl_wdn/lib/UNL/DWT.php b/sites/all/themes/unl_wdn/lib/UNL/DWT.php new file mode 100644 index 0000000000000000000000000000000000000000..43aac0a311532abae9bb8f3e81cd18d4ea71e70a --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/DWT.php @@ -0,0 +1,274 @@ +<?php +/** + * This package is intended to create PHP Class files (Objects) from + * Dreamweaver template (.dwt) files. It allows designers to create a + * standalone Dreamweaver template for the website design, and developers + * to use that design in php pages without interference. + * + * Similar to the way DB_DataObject works, the DWT package uses a + * Generator to scan a .dwt file for editable regions and creates an + * appropriately named class for that .dwt file with member variables for + * each region. + * + * Once the objects have been generated, you can render a html page from + * the template. + * + * $page = new UNL_DWT::factory('Template_style1'); + * $page->pagetitle = "Contact Information"; + * $page->maincontent = "Contact us by telephone at 111-222-3333."; + * echo $page->toHtml(); + * + * Parts of this package are modeled on (borrowed from) the PEAR package + * DB_DataObject. + * + * PHP version 5 + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ + +/** + * Base class which understands Dreamweaver Templates. + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +class UNL_DWT +{ + + public $__template; + + /** + * Run-time configuration options + * + * @var array + * @see UNL_DWT::setOption() + */ + static public $options = array( + 'debug' => 0, + ); + + /** + * Constructor + */ + function __construct() + { + + } + + /** + * Returns the given DWT with all regions replaced with their assigned + * content. + * + * @return string + */ + public function toHtml() + { + $options = &UNL_DWT::$options; + if (!isset($this->__template)) { + return ''; + } + /* + More Options for this method: + Extend this to automatically generate the .tpl files and cache. + Check for a cached copy of the template file. + Connect to a template server and get the latest template copy. + + Ex: $p = file_get_contents("http://pear.unl.edu/UNL/Templates/server.php?template=".$this->__template); + */ + $p = file_get_contents($options['tpl_location'].$this->__template); + + $regions = get_object_vars($this); + return $this->replaceRegions($p, $regions); + } + + /** + * Replaces region tags within a template file wth their contents. + * + * @param string $p Page with DW Region tags. + * @param array $regions Associative array with content to replace. + * + * @return string page with replaced regions + */ + function replaceRegions($p, $regions) + { + UNL_DWT::debug('Replacing regions.', 'replaceRegions', 5); + foreach ($regions as $region=>$value) { + /* Replace the region with the replacement text */ + if (strpos($p, "<!--"." TemplateBeginEditable name=\"{$region}\" -->")) { + $p = str_replace(UNL_DWT_between("<!--"." TemplateBeginEditable name=\"{$region}\" -->", + "<!--"." TemplateEndEditable -->", $p), + $value, $p); + UNL_DWT::debug("$region is replaced with $value.", + 'replaceRegions', 5); + } elseif (strpos($p, "<!--"." InstanceBeginEditable name=\"{$region}\" -->")) { + $p = str_replace("<!--"." InstanceBeginEditable name=\"{$region}\" -->". + UNL_DWT_between("<!--"." InstanceBeginEditable name=\"{$region}\" -->", "<!--"." InstanceEndEditable -->", $p). + "<!--"." InstanceEndEditable -->", "<!--"." InstanceBeginEditable name=\"{$region}\" -->".$value."<!--"." InstanceEndEditable -->", $p); + UNL_DWT::debug("$region is replaced with $value.", 'replaceRegions', 5); + } else { + UNL_DWT::debug("Could not find region $region!", 'replaceRegions', 3); + } + } + return $p; + } + + + /** + * Create a new UNL_DWT object for the specified layout type + * + * @param string $type the template type (eg "fixed") + * @param array $coptions an associative array of option names and values + * + * @return object a new UNL_DWT. A UNL_DWT_Error object on failure. + * + * @see UNL_DWT::setOption() + */ + static function &factory($type, $coptions = false) + { + $options =& UNL_DWT::$options; + + include_once $options['class_location']."{$type}.php"; + + if (!is_array($coptions)) { + $coptions = array(); + } + + $classname = $options['class_prefix'].$type; + + if (!class_exists($classname)) { + throw new UNL_DWT_Exception("Unable to include the {$options['class_location']}{$type}.php file."); + } + + @$obj = new $classname; + + foreach ($coptions as $option => $value) { + $test = $obj->setOption($option, $value); + } + + return $obj; + } + + /** + * Sets options. + * + * @param string $option Option to set + * @param mixed $value Value to set for this option + * + * @return void + */ + function setOption($option, $value) + { + self::$options[$option] = $value; + } + + /* ----------------------- Debugger ------------------ */ + + /** + * Debugger. - use this in your extended classes to output debugging + * information. + * + * Uses UNL_DWT::debugLevel(x) to turn it on + * + * @param string $message message to output + * @param string $logtype bold at start + * @param string $level output level + * + * @return none + */ + static function debug($message, $logtype = 0, $level = 1) + { + if (empty(self::$options['debug']) || + (is_numeric(self::$options['debug']) && self::$options['debug'] < $level)) { + return; + } + // this is a bit flaky due to php's wonderfull class passing around crap.. + // but it's about as good as it gets.. + $class = (isset($this) && ($this instanceof UNL_DWT)) ? get_class($this) : 'UNL_DWT'; + + if (!is_string($message)) { + $message = print_r($message, true); + } + if (!is_numeric(self::$options['debug']) && is_callable(self::$options['debug'])) { + return call_user_func(self::$options['debug'], $class, $message, $logtype, $level); + } + + if (!ini_get('html_errors')) { + echo "$class : $logtype : $message\n"; + flush(); + return; + } + if (!is_string($message)) { + $message = print_r($message, true); + } + $colorize = ($logtype == 'ERROR') ? '<font color="red">' : '<font>'; + echo "<code>{$colorize}<strong>$class: $logtype:</strong> ". nl2br(htmlspecialchars($message)) . "</font></code><br />\n"; + flush(); + } + + /** + * sets and returns debug level + * eg. UNL_DWT::debugLevel(4); + * + * @param int $v level + * + * @return void + */ + function debugLevel($v = null) + { + if ($v !== null) { + $r = isset(self::$options['debug']) ? self::$options['debug'] : 0; + self::$options['debug'] = $v; + return $r; + } + return isset(self::$options['debug']) ? self::$options['debug'] : 0; + } + +} + +/** + * exception used by the UNL_DWT class + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +class UNL_DWT_Exception extends Exception +{ + +} + +if (!function_exists('UNL_DWT_between')) { + /** + * Returns content between two strings + * + * @param string $start String which bounds the start + * @param string $end end collecting content when you see this + * @param string $p larger body of content to search + * + * @return string + */ + function UNL_DWT_between($start, $end, $p) + { + if (!empty($start) && strpos($p, $start)!=false) { + $p = substr($p, strpos($p, $start)+strlen($start)); + } + if (strpos($p, $end)!=false) { + $p = substr($p, 0, strpos($p, $end)); + } + return $p; + } +} \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/DWT/Generator.php b/sites/all/themes/unl_wdn/lib/UNL/DWT/Generator.php new file mode 100644 index 0000000000000000000000000000000000000000..172ac6a885d4d1edcd16764e6fed87c530d3bb4d --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/DWT/Generator.php @@ -0,0 +1,476 @@ +<?php +/** + * The Generator is used to generate UNL_DWT classes and cached .tpl files from + * Dreamweaver Template files. + * + * PHP version 5 + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ + +require_once 'UNL/DWT.php'; +require_once 'UNL/DWT/Region.php'; + +/** + * The generator parses actual .dwt Dreamweaver Template files to create object relationship + * files which have member variables for editable regions within the dreamweaver templates. + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +class UNL_DWT_Generator extends UNL_DWT +{ + + /** + * Array of template names. + */ + var $templates; + + /** + * Current template being output + */ + var $template; + + /** + * Assoc array of template region names. + * $_regions[$template] = array(); + */ + var $_regions; + + /** + * class being extended (can be overridden by + * [UNL_DWT_Generator] extends=xxxx + * + * @var string + * @access private + */ + var $_extends = 'UNL_DWT'; + + /** + * line to use for require_once 'UNL/DWT.php'; + * + * @var string + * @access private + */ + var $_extendsFile = 'UNL/DWT.php'; + + /** + * begins generation of template files + * + * @return void + */ + function start() + { + $this->debugLevel(3); + $this->createTemplateList(); + $this->generateTemplates(); + $this->generateClasses(); + } + + /** + * Generates .tpl files from .dwt + * + * @return void + */ + function generateTemplates() + { + $dwt_location = UNL_DWT::$options['dwt_location']; + if (!file_exists(UNL_DWT::$options['dwt_location'])) { + include_once 'System.php'; + System::mkdir(array('-p', UNL_DWT::$options['dwt_location'])); + } + if (!file_exists($options['tpl_location'])) { + include_once 'System.php'; + System::mkdir(array('-p', UNL_DWT::$options['tpl_location'])); + } + foreach ($this->templates as $this->template) { + $dwt = file_get_contents($dwt_location.$this->template); + $dwt = $this->scanRegions($dwt); + + $sanitizedName = $this->sanitizeTemplateName($this->template); + //Write out the .tpl file? + if (strpos(UNL_DWT::$options['tpl_location'], '%s') !== false) { + $outfilename = sprintf(UNL_DWT::$options['tpl_location'], $sanitizedName); + } else { + $outfilename = UNL_DWT::$options['tpl_location']."/{$sanitizedName}.tpl"; + } + $this->debug("Writing {$sanitizedName} to {$outfilename}", + 'generateTemplates'); + $fh = fopen($outfilename, "w"); + fputs($fh, $dwt); + fclose($fh); + } + } + + /** + * Create a list of dwts + * + * @return void + */ + function createTemplateList() + { + $this->templates = array(); + + $dwt_location = UNL_DWT::$options['dwt_location']; + if (is_dir($dwt_location)) { + $handle = opendir($dwt_location); + while (false !== ($file = readdir($handle))) { + if (isset(UNL_DWT::$options['generator_include_regex']) && + !preg_match(UNL_DWT::$options['generator_include_regex'], $file)) { + continue; + } else if (isset(UNL_DWT::$options['generator_exclude_regex']) && + preg_match(UNL_DWT::$options['generator_exclude_regex'], $file)) { + continue; + } + if (substr($file, strlen($file)-4) == '.dwt') { + $this->debug("Adding {$file} to the list of templates.", + 'createTemplateList'); + $this->templates[] = $file; + } + } + } else { + throw new UNL_DWT_Exception("dwt_location is incorrect\n"); + } + } + + /** + * Generate the classes for templates in $this->templates + * + * @return void + */ + function generateClasses() + { + if ($extends = @UNL_DWT::$options['extends']) { + $this->_extends = $extends; + $this->_extendsFile = UNL_DWT::$options['extends_location']; + } + + foreach ($this->templates as $this->template) { + $this->classname = $this->generateClassName($this->template); + if (strpos(UNL_DWT::$options['class_location'], '%s') !== false) { + $outfilename = sprintf(UNL_DWT::$options['class_location'], + sanitizeTemplateName($this->template)); + } else { + $outfilename = UNL_DWT::$options['class_location']."/".$this->sanitizeTemplateName($this->template).".php"; + } + $oldcontents = ''; + if (file_exists($outfilename)) { + // file_get_contents??? + $oldcontents = implode('', file($outfilename)); + } + $out = $this->_generateClassTemplate($oldcontents); + $this->debug("Writing {$this->classname} to {$outfilename}", + 'generateClasses'); + $fh = fopen($outfilename, "w"); + fputs($fh, $out); + fclose($fh); + } + } + + /** + * Generates the class name from a filename. + * + * @param string $filename The filename of the template. + * + * @return string Sanitized filename prefixed with the class_prefix + * defined in the ini. + */ + function generateClassName($filename) + { + if (!($class_prefix = @UNL_DWT::$options['class_prefix'])) { + $class_prefix = ''; + } + return $class_prefix.$this->sanitizeTemplateName($filename);; + } + + /** + * Cleans the template filename. + * + * @param string $filename Filename of the template + * + * @return string Sanitized template name + */ + function sanitizeTemplateName($filename) + { + return preg_replace('/[^A-Z0-9]/i', '_', + ucfirst(str_replace('.dwt', '', $filename))); + } + + /** + * Scans the .dwt for regions - all found are loaded into assoc array + * $this->_regions[$template]. + * + * @param string $dwt Dreamweaver template file to scan. + * + * @return string derived template file. + */ + function scanRegions($dwt) + { + + $this->_regions[$this->template] = array(); + + $dwt = str_replace("\r", "\n", $dwt); + $dwt = preg_replace("/(\<\!-- InstanceBeginEditable name=\"([A-Za-z0-9]*)\" -->)/i", "\n\\0\n", $dwt); + $dwt = preg_replace("/(\<\!-- TemplateBeginEditable name=\"([A-Za-z0-9]*)\" -->)/i", "\n\\0\n", $dwt); + $dwt = preg_replace("/\<\!-- InstanceEndEditable -->/", "\n\\0\n", $dwt); + $dwt = preg_replace("/\<\!-- TemplateEndEditable -->/", "\n\\0\n", $dwt); + $dwt = explode("\n", $dwt); + + $newRegion = false; + $region = new UNL_DWT_Region(); + $this->debug("Checking {$this->template}", 'scanRegions', 0); + foreach ($dwt as $key=>$fileregion) { + $matches = array(); + if (preg_match("/\<\!-- InstanceBeginEditable name=\"([A-Za-z0-9]*)\" -->/i", $fileregion, $matches) + || preg_match("/\<\!-- TemplateBeginEditable name=\"([A-Za-z0-9]*)\" -->/i", $fileregion, $matches)) { + if ($newRegion == true) { + // Found a new nested region. + // Remove the previous one. + $dwt[$region->line] = str_replace(array("<!--"." InstanceBeginEditable name=\"{$region->name}\" -->"), '', $dwt[$region->line]); + } + $newRegion = true; + $region = new UNL_DWT_Region(); + $region->name = $matches[1]; + $region->line = $key; + $region->value = ""; + } elseif ((preg_match("/\<\!-- InstanceEndEditable -->/i", $fileregion, $matches) || preg_match("/\<\!-- TemplateEndEditable -->/", $fileregion, $matches))) { + // Region is closing. + if ($newRegion===true) { + $region->value = trim($region->value); + if (strpos($region->value, "@@(\" \")@@") === false) { + $this->_regions[$this->template][] = $region; + } else { + // Editable Region tags must be removed within .tpl + unset($dwt[$region->line], $dwt[$key]); + } + $newRegion = false; + } else { + // Remove the nested region closing tag. + $dwt[$key] = str_replace("<!--"." InstanceEndEditable -->", '', $fileregion); + } + } else { + if ($newRegion===true) { + // Add the value of this region. + $region->value .= trim($fileregion)." "; + } + } + } + $dwt = implode("\n", $dwt); + $dwt = preg_replace("/<!--"." InstanceParam name=\"([\w]*)\" type=\"([\w]*)\" value=\"([\w]*)\" -->/", '', $dwt); + $dwt = str_replace(array( "<!--"." TemplateBeginEditable ", + "<!--"." TemplateEndEditable -->", + "\n\n"), + array( "<!--"." InstanceBeginEditable ", + "<!--"." InstanceEndEditable -->", + "\n"), $dwt); + if (preg_match("<!--"." InstanceBegin template=\"([\/\w\d\.]+)\" codeOutsideHTMLIsLocked=\"([\w]+)\" -->", $dwt)) { + $dwt = preg_replace("/<!--"." InstanceBegin template=\"([\/\w\d\.]+)\" codeOutsideHTMLIsLocked=\"([\w]+)\" -->/", "<!--"." InstanceBegin template=\"/Templates/{$this->template}\" codeOutsideHTMLIsLocked=\"\\2\" -->", $dwt); + } else { + $dwt = preg_replace("/<html[^>]*>/", "\\0<!--"." InstanceBegin template=\"/Templates/{$this->template}\" codeOutsideHTMLIsLocked=\"false\" -->", $dwt); + } + $dwt = str_replace('@@(" ")@@', '', $dwt); + return $dwt; + } + + /** + * The template class geneation part - single file. + * + * @param string $input file to generate a class for. + * + * @return updated .php file + */ + private function _generateClassTemplate($input = '') + { + // title = expand me! + $foot = ""; + $head = "<?php\n/**\n * Template Definition for {$this->template}\n */\n"; + // requires + $head .= "require_once '{$this->_extendsFile}';\n\n"; + // add dummy class header in... + // class + $head .= "class {$this->classname} extends {$this->_extends} \n{"; + + $body = "\n ###START_AUTOCODE\n"; + $body .= " /* the code below is auto generated do not remove the above tag */\n\n"; + // table + $padding = (30 - strlen($this->template)); + if ($padding < 2) { + $padding =2; + } + $p = str_repeat(' ', $padding); + + $var = (substr(phpversion(), 0, 1) > 4) ? 'public' : 'var'; + $body .= " {$var} \$__template = '".$this->sanitizeTemplateName($this->template).".tpl'; {$p}// template name\n"; + + $regions = $this->_regions[$this->template]; + + foreach ($regions as $t) { + if (!strlen(trim($t->name))) { + continue; + } + $padding = (30 - strlen($t->name)); + if ($padding < 2) $padding =2; + $p = str_repeat(' ', $padding); + + $body .=" {$var} \${$t->name} = \"".addslashes($t->value)."\"; {$p}// {$t->type}({$t->len}) {$t->flags}\n"; + } + + // simple creation tools ! (static stuff!) + $body .= "\n"; + $body .= " /* Static get */\n"; + $body .= " function staticGet(\$k,\$v=NULL) { return UNL_DWT::staticGet('{$this->classname}',\$k,\$v); }\n"; + + // generate getter and setter methods + $body .= $this->_generateGetters($input); + $body .= $this->_generateSetters($input); + + $body .= "\n /* the code above is auto generated do not remove the tag below */"; + $body .= "\n ###END_AUTOCODE\n"; + + $foot .= "}\n"; + $full = $head . $body . $foot; + + if (!$input) { + return $full; + } + if (!preg_match('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n)/s', $input)) { + return $full; + } + if (!preg_match('/(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', $input)) { + return $full; + } + + $class_rewrite = 'UNL_DWT'; + if (!($class_rewrite = @UNL_DWT::$options['generator_class_rewrite'])) { + $class_rewrite = 'UNL_DWT'; + } + if ($class_rewrite == 'ANY') { + $class_rewrite = '[a-z_]+'; + } + $input = preg_replace('/(\n|\r\n)class\s*[a-z0-9_]+\s*extends\s*' .$class_rewrite . '\s*\{(\n|\r\n)/si', + "\nclass {$this->classname} extends {$this->_extends} \n{\n", + $input); + + return preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', + $body, $input); + + } + + /** + * Generate getter methods for class definition + * + * @param string $input Existing class contents + * + * @return string + */ + function _generateGetters($input) + { + $getters = ''; + + // only generate if option is set to true + if (empty(UNL_DWT::$options['generate_getters'])) { + return ''; + } + + /* + * remove auto-generated code from input to be able to check if + * the method exists outside of the auto-code + */ + $input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input); + + $getters .= "\n\n"; + $regions = $this->_regions[$this->table]; + + // loop through properties and create getter methods + foreach ($regions = $regions as $t) { + + // build mehtod name + $methodName = 'get' . ucfirst($t->name); + + if (!strlen(trim($t->name)) + || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) { + continue; + } + + $getters .= " /**\n"; + $getters .= " * Getter for \${$t->name}\n"; + $getters .= " *\n"; + $getters .= (stristr($t->flags, 'multiple_key')) ? " * @return object\n" + : " * @return {$t->type}\n"; + $getters .= " * @access public\n"; + $getters .= " */\n"; + $getters .= (substr(phpversion(), 0, 1) > 4) ? ' public ' + : ' '; + $getters .= "function $methodName() {\n"; + $getters .= " return \$this->{$t->name};\n"; + $getters .= " }\n\n"; + } + + return $getters; + } + + /** + * Generate setter methods for class definition + * + * @param string $input Existing class contents + * + * @return string + */ + function _generateSetters($input) + { + + $setters = ''; + + // only generate if option is set to true + if (empty(UNL_DWT::$options['generate_setters'])) { + return ''; + } + + /* + * remove auto-generated code from input to be able to check if + * the method exists outside of the auto-code + */ + $input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input); + + $setters .= "\n"; + $regions = $this->_regions[$this->table]; + + // loop through properties and create setter methods + foreach ($regions = $regions as $t) { + + // build mehtod name + $methodName = 'set' . ucfirst($t->name); + + if (!strlen(trim($t->name)) + || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) { + continue; + } + + $setters .= " /**\n"; + $setters .= " * Setter for \${$t->name}\n"; + $setters .= " *\n"; + $setters .= " * @param mixed input value\n"; + $setters .= " * @access public\n"; + $setters .= " */\n"; + $setters .= (substr(phpversion(), 0, 1) > 4) ? ' public ' + : ' '; + $setters .= "function $methodName(\$value) {\n"; + $setters .= " \$this->{$t->name} = \$value;\n"; + $setters .= " }\n\n"; + } + + return $setters; + } + +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/DWT/Region.php b/sites/all/themes/unl_wdn/lib/UNL/DWT/Region.php new file mode 100644 index 0000000000000000000000000000000000000000..b0963a1d9f4046c6ff6c322915ab6c1548b06bef --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/DWT/Region.php @@ -0,0 +1,22 @@ +<?php +/** + * Object representing a Dreamweaver template region + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +class UNL_DWT_Region +{ + var $name; + var $type = 'string'; + var $len; + var $line; + var $flags; + var $value; +} +?> \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/DWT/Scanner.php b/sites/all/themes/unl_wdn/lib/UNL/DWT/Scanner.php new file mode 100644 index 0000000000000000000000000000000000000000..67b60600d126cd315f200ea85871d4521e996105 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/DWT/Scanner.php @@ -0,0 +1,138 @@ +<?php +/** + * Handles scanning a dwt file for regions. + * + * PHP version 5 + * + * @category Templates + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +require_once 'UNL/DWT/Region.php'; + +/** + * Will scan a dreamweaver templated file for regions and other relevant info. + * + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ +class UNL_DWT_Scanner +{ + protected $_regions; + + /** + * The contents of the .dwt file you wish to scan. + * + * @param string $dwt Source of the .dwt file + */ + function __construct($dwt) + { + $this->scanRegions($dwt); + } + + function scanRegions($dwt) + { + $this->_regions[] = array(); + + $dwt = str_replace("\r", "\n", $dwt); + $dwt = preg_replace("/(\<\!-- InstanceBeginEditable name=\"([A-Za-z0-9]*)\" -->)/i", "\n\\0\n", $dwt); + $dwt = preg_replace("/(\<\!-- TemplateBeginEditable name=\"([A-Za-z0-9]*)\" -->)/i", "\n\\0\n", $dwt); + $dwt = preg_replace("/\<\!-- InstanceEndEditable -->/", "\n\\0\n", $dwt); + $dwt = preg_replace("/\<\!-- TemplateEndEditable -->/", "\n\\0\n", $dwt); + $dwt = explode("\n", $dwt); + + $newRegion = false; + $region = new UNL_DWT_Region(); + foreach ($dwt as $key=>$fileregion) { + $matches = array(); + if (preg_match("/\<\!-- InstanceBeginEditable name=\"([A-Za-z0-9]*)\" -->/i", $fileregion, $matches) + || preg_match("/\<\!-- TemplateBeginEditable name=\"([A-Za-z0-9]*)\" -->/i", $fileregion, $matches)) { + if ($newRegion == true) { + // Found a new nested region. + // Remove the previous one. + $dwt[$region->line] = str_replace(array("<!--"." InstanceBeginEditable name=\"{$region->name}\" -->"), '', $dwt[$region->line]); + } + $newRegion = true; + $region = new UNL_DWT_Region(); + $region->name = $matches[1]; + $region->line = $key; + $region->value = ""; + } elseif ((preg_match("/\<\!-- InstanceEndEditable -->/i", $fileregion, $matches) || preg_match("/\<\!-- TemplateEndEditable -->/", $fileregion, $matches))) { + // Region is closing. + if ($newRegion===true) { + $region->value = trim($region->value); + if (strpos($region->value, "@@(\" \")@@") === false) { + $this->_regions[$region->name] = $region; + } else { + // Editable Region tags must be removed within .tpl + unset($dwt[$region->line], $dwt[$key]); + } + $newRegion = false; + } else { + // Remove the nested region closing tag. + $dwt[$key] = str_replace("<!--"." InstanceEndEditable -->", '', $fileregion); + } + } else { + if ($newRegion===true) { + // Add the value of this region. + $region->value .= trim($fileregion)." "; + } + } + } + } + + /** + * returns the region object + * + * @param string $region + * + * @return UNL_DWT_Region + */ + public function getRegion($region) + { + if (isset($this->_regions[$region])) { + return $this->_regions[$region]; + } + return null; + } + + /** + * returns array of all the regions found + * + * @return array(UNL_DWT_Region) + */ + public function getRegions() + { + return $this->_regions; + } + + public function __isset($region) + { + return isset($this->_regions[$region]); + } + + public function __get($region) + { + if (isset($this->_regions[$region])) { + return $this->_regions[$region]->value; + } + + $trace = debug_backtrace(); + trigger_error( + 'Undefined property: ' . $region . + ' in ' . $trace[0]['file'] . + ' on line ' . $trace[0]['line'], + E_USER_NOTICE); + return null; + } + +} + +?> \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/DWT/createTemplates.php b/sites/all/themes/unl_wdn/lib/UNL/DWT/createTemplates.php new file mode 100644 index 0000000000000000000000000000000000000000..df87cc257c420ce1f7aa665cec00d73422baa512 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/DWT/createTemplates.php @@ -0,0 +1,44 @@ +#!/usr/bin/php -q +<?php +/** + * Tool to generate objects for dreamweaver template files. + * + * PHP version 5 + * + * @package UNL_DWT + * @author Brett Bieber <brett.bieber@gmail.com> + * @created 01/18/2006 + * @copyright 2008 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_DWT + */ + +// since this version doesnt use overload, +// and I assume anyone using custom generators should add this.. +define('UNL_DWT_NO_OVERLOAD',1); +ini_set('display_errors',true); +require_once 'UNL/DWT/Generator.php'; + +if (!ini_get('register_argc_argv')) { + throw new Exception("\nERROR: You must turn register_argc_argv On in your php.ini file for this to work\neg.\n\nregister_argc_argv = On\n\n"); +} + +if (!@$_SERVER['argv'][1]) { + throw new Exception("\nERROR: createTemplates.php usage:\n\nC:\php\pear\UNL\DWT\createTemplates.php example.ini\n\n"); +} + +$config = parse_ini_file($_SERVER['argv'][1], true); +foreach($config as $class=>$values) { + if ($class == 'UNL_DWT') { + UNL_DWT::$options = $values; + } +} + +if (empty(UNL_DWT::$options)) { + throw new Exception("\nERROR: could not read ini file\n\n"); +} +set_time_limit(0); +//UNL_DWT::debugLevel(1); +$generator = new UNL_DWT_Generator; +$generator->start(); + diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates.php b/sites/all/themes/unl_wdn/lib/UNL/Templates.php new file mode 100644 index 0000000000000000000000000000000000000000..3ab6bda514cd97c98409ee867e0cce264e8d924e --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates.php @@ -0,0 +1,331 @@ +<?php +/** + * Object oriented interface to create UNL Template based HTML pages. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ + +/** + * Utilizes the UNL_DWT Dreamweaver template class. + */ +require_once 'UNL/DWT.php'; + +/** + * Allows you to create UNL Template based HTML pages through an object + * oriented interface. + * + * Install on your PHP server with: + * pear channel-discover pear.unl.edu + * pear install unl/UNL_Templates + * + * <code> + * <?php + * require_once 'UNL/Templates.php'; + * $page = UNL_Templates::factory('Fixed'); + * $page->titlegraphic = '<h1>UNL Templates</h1>'; + * $page->maincontentarea = 'Hello world!'; + * $page->loadSharedcodeFiles(); + * echo $page; + * </code> + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates extends UNL_DWT +{ + const VERSION2 = 2; + const VERSION3 = 3; + + /** + * Cache object for output caching + * + * @var UNL_Templates_CachingService + */ + static protected $cache; + + static public $options = array( + 'debug' => 0, + 'sharedcodepath' => 'sharedcode', + 'templatedependentspath' => '', + 'cache' => array(), + 'version' => self::VERSION2 + ); + + /** + * The version of the templates we're using. + * + * @var UNL_Templates_Version + */ + static public $template_version; + + /** + * Construct a UNL_Templates object + */ + public function __construct() + { + date_default_timezone_set(date_default_timezone_get()); + self::$options['templatedependentspath'] = $_SERVER['DOCUMENT_ROOT']; + } + + /** + * Initialize the configuration for the UNL_DWT class + * + * @return void + */ + public static function loadDefaultConfig() + { + include_once 'UNL/Templates/Version'.self::$options['version'].'.php'; + $class = 'UNL_Templates_Version'.self::$options['version']; + self::$template_version = new $class(); + UNL_DWT::$options = array_merge(UNL_DWT::$options, self::$template_version->getConfig()); + } + + /** + * The factory returns a template object for any UNL Template style requested: + * * Fixed + * * Liquid + * * Popup + * * Document + * * Secure + * * Unlaffiliate + * + * <code> + * $page = UNL_Templates::factory('Fixed'); + * </code> + * + * @param string $type Type of template to get, Fixed, Liquid, Doc, Popup + * @param mixed $coptions Options for the constructor + * + * @return UNL_Templates + */ + static function &factory($type, $coptions = false) + { + UNL_Templates::loadDefaultConfig(); + return parent::factory($type, $coptions); + } + + /** + * Attempts to connect to the template server and grabs the latest cache of the + * template (.tpl) file. Set options for Cache_Lite in self::$options['cache'] + * + * @return string + */ + function getCache() + { + $cache = self::getCachingService(); + $cache_key = self::$options['version'].$this->__template; + // Test if there is a valid cache for this template + if ($data = $cache->get($cache_key)) { + // Content is in $data + self::debug('Using cached version from '. + date('Y-m-d H:i:s', $cache->lastModified()), 'getCache', 3); + } else { // No valid cache found + if ($data = self::$template_version->getTemplate($this->__template)) { + self::debug('Updating cache.', 'getCache', 3); + $data = $this->makeIncludeReplacements($data); + $cache->save($data, $cache_key); + } else { + // Error getting updated version of the templates. + self::debug('Could not connect to template server. ' . PHP_EOL . + 'Extending life of template cache.', 'getCache', 3); + $cache->extendLife(); + $data = $cache->get($this->__template); + } + } + return $data; + } + + /** + * Loads standard customized content (sharedcode) files from the filesystem. + * + * @return void + */ + function loadSharedcodeFiles() + { + $includes = array( + 'footercontent' => 'footer.html', + 'contactinfo' => 'footerContactInfo.html', + 'navlinks' => 'navigation.html', + 'leftcollinks' => 'relatedLinks.html', + 'optionalfooter' => 'optionalFooter.html', + 'collegenavigationlist' => 'unitNavigation.html', + ); + foreach ($includes as $element=>$filename) { + if (file_exists(self::$options['sharedcodepath'].'/'.$filename)) { + $this->{$element} = file_get_contents(self::$options['sharedcodepath'].'/'.$filename); + } + } + } + + + /** + * Add a link within the head of the page. + * + * @param string $href URI to the resource + * @param string $relation Relation of this link element (alternate) + * @param string $relType The type of relation (rel) + * @param array $attributes Any additional attribute=>value combinations + * + * @return void + */ + function addHeadLink($href, $relation, $relType = 'rel', array $attributes = array()) + { + $attributeString = ''; + foreach ($attributes as $name=>$value) { + $attributeString .= $name.'="'.$value.'" '; + } + + $this->head .= '<link '.$relType.'="'.$relation.'" href="'.$href.'" '.$attributeString.' />'.PHP_EOL; + + } + + /** + * Add a (java)script to the page. + * + * @param string $url URL to the script + * @param string $type Type of script text/javascript + * + * @return void + */ + function addScript($url, $type = 'text/javascript') + { + $this->head .= '<script type="'.$type.'" src="'.$url.'"></script>'.PHP_EOL; + } + + /** + * Adds a script declaration to the page. + * + * @param string $content The javascript you wish to add. + * @param string $type Type of script tag. + * + * @return void + */ + function addScriptDeclaration($content, $type = 'text/javascript') + { + $this->head .= '<script type="'.$type.'">//<![CDATA['.PHP_EOL.$content.PHP_EOL.'//]]></script>'.PHP_EOL; + } + + /** + * Add a style declaration to the head of the document. + * <code> + * $page->addStyleDeclaration('.course {font-size:1.5em}'); + * </code> + * + * @param string $content CSS content to add + * @param string $type type attribute for the style element + * + * @return void + */ + function addStyleDeclaration($content, $type = 'text/css') + { + $this->head .= '<style type="'.$type.'">'.$content.'</style>'.PHP_EOL; + } + + /** + * Add a link to a stylesheet. + * + * @param string $url Address of the stylesheet, absolute or relative + * @param string $media Media target (screen/print/projector etc) + * + * @return void + */ + function addStyleSheet($url, $media = 'all') + { + $this->addHeadLink($url, 'stylesheet', 'rel', array('media'=>$media, 'type'=>'text/css')); + } + + /** + * Returns the page in HTML form. + * + * @return string THe full HTML of the page. + */ + function toHtml() + { + $p = $this->getCache(); + $regions = get_object_vars($this); + return $this->replaceRegions($p, $regions); + } + + /** + * returns this template as a string. + * + * @return string + */ + function __toString() + { + return $this->toHtml(); + } + + + /** + * Populates templatedependents files + * + * Replaces the template dependent include statements with the corresponding + * files from the /ucomm/templatedependents/ directory. To specify the location + * of your templatedependents directory, use something like + * $page->options['templatedependentspath'] = '/var/www/'; + * and set the path to the directory containing /ucomm/templatedependents/ + * + * @param string $p Page to make replacements in + * + * @return string + */ + function makeIncludeReplacements($p) + { + return self::$template_version->makeIncludeReplacements($p); + } + + /** + * Debug handler for messages. + * + * @param string $message Message to send to debug output + * @param int $logtype Which log to send this to + * @param int $level The threshold to send this message or not. + * + * @return void + */ + static function debug($message, $logtype = 0, $level = 1) + { + UNL_DWT::$options['debug'] = self::$options['debug']; + parent::debug($message, $logtype, $level); + } + + /** + * Cleans the cache. + * + * @param mixed $o Pass a cached object to clean it's cache, or a string id. + * + * @return bool true if cache was successfully cleared. + */ + public function cleanCache($object = null) + { + return self::getCachingService()->clean($object); + } + + static public function setCachingService(UNL_Templates_CachingService $cache) + { + self::$cache = $cache; + } + + static public function getCachingService() + { + if (!isset(self::$cache)) { + include_once 'UNL/Templates/CachingService/CacheLite.php'; + self::$cache = new UNL_Templates_CachingService_CacheLite(self::$options['cache']); + } + return self::$cache; + } +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService.php new file mode 100644 index 0000000000000000000000000000000000000000..3dc28c46dc8c581b1ed3ca664d2d611210ab91e8 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService.php @@ -0,0 +1,20 @@ +<?php +/** + * An interface for a caching service. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +interface UNL_Templates_CachingService +{ + public function get($key); + public function save($data, $key); + public function clean($object = null); +} \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService/CacheLite.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService/CacheLite.php new file mode 100644 index 0000000000000000000000000000000000000000..98853e323b73e70f902782126c13cec954a81ced --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/CachingService/CacheLite.php @@ -0,0 +1,64 @@ +<?php +/** + * A Cache Service using Cache_Lite + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates/CachingService.php'; +class UNL_Templates_CachingService_CacheLite implements UNL_Templates_CachingService +{ + protected $cache; + + function __construct($options = array()) + { + include_once 'Cache/Lite.php'; + $options = array_merge(array('lifeTime'=>3600), $options); + $this->cache = new Cache_Lite($options); + } + + function get($key) + { + return $this->cache->get($key, 'UNL_Templates'); + } + + function save($data, $key) + { + return $this->cache->save($data, $key, 'UNL_Templates'); + } + + function clean($object = null) + { + if (isset($object)) { + if (is_object($object) + && $object instanceof UNL_UCBCN_Cacheable) { + $key = $object->getCacheKey(); + if ($key === false) { + // This is a non-cacheable object. + return true; + } + } else { + $key = (string) $object; + } + if ($this->cache->get($key) !== false) { + // Remove the cache for this individual object. + return $this->cache->remove($key, 'UNL_Templates'); + } + } else { + return $this->cache->clean('UNL_Templates'); + } + return false; + } + function __call($method, $params) + { + return $this->cache->$method($params); + } + +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Scanner.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Scanner.php new file mode 100644 index 0000000000000000000000000000000000000000..c8fdf51bfb346d2c8aafff1a3e5693f0bacb3b32 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Scanner.php @@ -0,0 +1,32 @@ +<?php +/** + * This class will scan a template file for the regions, which you can use to + * analyze and use a rendered template file. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/DWT/Scanner.php'; + + +class UNL_Templates_Scanner extends UNL_DWT_Scanner +{ + /** + * Construct a remote file. + * + * @param string $html Contents of the page + */ + function __construct($html) + { + parent::__construct($html); + } +} + +?> \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version.php new file mode 100644 index 0000000000000000000000000000000000000000..074d6af725d699c12e340562c0c0e3318aedbc15 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version.php @@ -0,0 +1,21 @@ +<?php +/** + * Interface for a version of the template files. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +interface UNL_Templates_Version +{ + function getConfig(); + function getTemplate($template); + function makeIncludeReplacements($html); +} +?> \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2.php new file mode 100644 index 0000000000000000000000000000000000000000..e89a38f40c98e971ee7792ca2a8e281467e5c8bc --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2.php @@ -0,0 +1,51 @@ +<?php +/** + * Base class for version 2 (2006) of the template files. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates/Version.php'; + +class UNL_Templates_Version2 implements UNL_Templates_Version +{ + function getConfig() + { + return array('class_location' => 'UNL/Templates/Version2/', + 'class_prefix' => 'UNL_Templates_Version2_'); + } + + function getTemplate($template) + { + return file_get_contents('http://pear.unl.edu/UNL/Templates/server.php?template='.$template); + } + + function makeIncludeReplacements($html) + { + UNL_Templates::debug('Now making template include replacements.', + 'makeIncludeReplacements', 3); + $includes = array(); + preg_match_all('<!--#include virtual="(/ucomm/templatedependents/[A-Za-z0-9\.\/]+)" -->', + $html, $includes); + UNL_Templates::debug(print_r($includes, true), 'makeIncludeReplacements', 3); + foreach ($includes[1] as $include) { + UNL_Templates::debug('Replacing '.$include, 'makeIncludeReplacements', 3); + $file = UNL_Templates::$options['templatedependentspath'].$include; + if (!file_exists($file)) { + UNL_Templates::debug('File does not exist:'.$file, + 'makeIncludeReplacements', 3); + $file = 'http://www.unl.edu'.$include; + } + $html = str_replace('<!--#include virtual="'.$include.'" -->', + file_get_contents($file), $html); + } + return $html; + } +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Document.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Document.php new file mode 100644 index 0000000000000000000000000000000000000000..62e6d3bc6f643adf9b015d9b1222382d6cf0ec5e --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Document.php @@ -0,0 +1,42 @@ +<?php +/** + * Template Definition for document.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Document template object. + * + * @package UNL_Templates + */ +class UNL_Templates_Version2_Document extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Document.tpl'; // template name + public $doctitle = "<title>UNL | Document Template</title>"; // string() + public $head = "<script type=\"text/javascript\"> var navl2Links = 0; //Default navline2 links to display (zero based counting) </script>"; // string() + public $breadcrumbs = ""; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $maincontentarea = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Document',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Fixed.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Fixed.php new file mode 100644 index 0000000000000000000000000000000000000000..fa02b80041bc2bba5cfbce61073a932fd85d12a4 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Fixed.php @@ -0,0 +1,47 @@ +<?php +/** + * Template Definition for fixed.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + * + */ +require_once 'UNL/Templates.php'; + +/** + * Fixed width template object. + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Fixed extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Fixed.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<script type=\"text/javascript\"> var navl2Links = 0; //Default navline2 links to display (zero based counting) </script>"; // string() + public $breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li><a href=\"http://www.unl.edu/\">Department</a></li> <li>New Page</li> </ul>"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $leftRandomPromo = "<div class=\"image_small_short\" id=\"leftRandomPromo\"> <a href=\"#\" id=\"leftRandomPromoAnchor\"><img id=\"leftRandomPromoImage\" alt=\"\" src=\"/ucomm/templatedependents/templatecss/images/transpixel.gif\" /></a> <script type=\"text/javascript\" src=\"../sharedcode/leftRandomPromo.js\"></script> </div>"; // string() + public $leftcollinks = "<!-- WDN: see glossary item \'sidebar links\' --> <!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $maincontentarea = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Fixed',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Liquid.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Liquid.php new file mode 100644 index 0000000000000000000000000000000000000000..673bc993a3fb16dd085ba6c2190f10e3164b28e9 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Liquid.php @@ -0,0 +1,47 @@ +<?php +/** + * Template Definition for liquid.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + * + */ +require_once 'UNL/Templates.php'; + +/** + * Liquid width template object + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Liquid extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Liquid.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<script type=\"text/javascript\"> var navl2Links = 0; //Default navline2 links to display (zero based counting) </script>"; // string() + public $breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li><a href=\"http://www.unl.edu/\">Department</a></li> <li>New Page</li> </ul>"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $leftRandomPromo = "<div class=\"image_small_short\" id=\"leftRandomPromo\"> <a href=\"#\" id=\"leftRandomPromoAnchor\"><img id=\"leftRandomPromoImage\" alt=\"\" src=\"/ucomm/templatedependents/templatecss/images/transpixel.gif\" /></a> <script type=\"text/javascript\" src=\"../sharedcode/leftRandomPromo.js\"></script> </div>"; // string() + public $leftcollinks = "<!-- WDN: see glossary item \'sidebar links\' --> <!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $maincontentarea = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Liquid',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Popup.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Popup.php new file mode 100644 index 0000000000000000000000000000000000000000..44e5f823fede57c1cb45811096e00dbc4f7da3e3 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Popup.php @@ -0,0 +1,42 @@ +<?php +/** + * Template Definition for popup.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * popup template object + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Popup extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Popup.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<script type=\"text/javascript\"> var navl2Links = 0; //Default navline2 links to display (zero based counting) </script>"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $maincontentarea = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Popup',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Secure.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Secure.php new file mode 100644 index 0000000000000000000000000000000000000000..90ac4755bf745f192267c538f597446d92c2d138 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Secure.php @@ -0,0 +1,45 @@ +<?php +/** + * Template Definition for secure.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Secure template object + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Secure extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Secure.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<script type=\"text/javascript\"> var navl2Links = 0; //Default navline2 links to display (zero based counting) </script>"; // string() + public $breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li><a href=\"http://www.unl.edu/\">Department</a></li> <li>New Page</li> </ul> <!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/badges/secure.html\" -->"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $leftcollinks = "<!-- WDN: see glossary item \'sidebar links\' --> <!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $maincontentarea = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Secure',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlaffiliate.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlaffiliate.php new file mode 100644 index 0000000000000000000000000000000000000000..194231ae963ba67fd8a9d8cdb1068b17bec38a8c --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlaffiliate.php @@ -0,0 +1,41 @@ +<?php +/** + * Template Definition for unlaffiliate.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +class UNL_Templates_Version2_Unlaffiliate extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Unlaffiliate.tpl'; // template name + public $doctitle = "<title>UNL Redesign</title>"; // string() + public $head = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"/ucomm/templatedependents/templatecss/layouts/affiliate.css\" />"; // string() + public $siteheader = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/siteheader/affiliate.shtml\" -->"; // string() + public $breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li>UNL Framework</li> </ul>"; // string() + public $shelf = ""; // string() + public $titlegraphic = "<h1>Affiliate</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $leftRandomPromo = "<div class=\"image_small_short\" id=\"leftRandomPromo\"> <a href=\"#\" id=\"leftRandomPromoAnchor\"><img id=\"leftRandomPromoImage\" alt=\"\" src=\"/ucomm/templatedependents/templatecss/images/transpixel.gif\" /></a> <script type=\"text/javascript\" src=\"../sharedcode/leftRandomPromo.js\"></script> </div>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $maincontentarea = "<h2 class=\"sec_main\">This template is only for affiliates of UNL, or units that have been granted a marketing exemption from the university. Confirm your use of this template before using it!</h2> <p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p> <!--THIS IS THE END OF THE MAIN CONTENT AREA.-->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Unlaffiliate',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlframework.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlframework.php new file mode 100644 index 0000000000000000000000000000000000000000..47b4261693c11c4d01a3192e73646796390f2d6d --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlframework.php @@ -0,0 +1,45 @@ +<?php +/** + * Template Definition for unlframework.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Unlframework template object + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Unlframework extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Unlframework.tpl'; // template name + public $doctitle = "<title>UNL Redesign</title>"; // string() + public $head = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/browsersniffers/ie.html\" --> <!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/comments/developersnote.html\" --> <!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/metanfavico/metanfavico.html\" -->"; // string() + public $siteheader = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/siteheader/siteheader.shtml\" -->"; // string() + public $breadcrumbs = "<!-- WDN: see glossary item \'breadcrumbs\' --> <ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li>UNL Framework</li> </ul>"; // string() + public $shelf = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/shelf/shelf.shtml\" -->"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $leftcolcontent = "<div id=\"navigation\"> <h4 id=\"sec_nav\">Navigation</h4> <div id=\"navlinks\"> <!--#include virtual=\"../sharedcode/navigation.html\" --> </div> <div id=\"nav_end\"></div> <div class=\"image_small_short\" id=\"leftRandomPromo\"> <a href=\"#\" id=\"leftRandomPromoAnchor\"><img id=\"leftRandomPromoImage\" alt=\"\" src=\"/ucomm/templatedependents/templatecss/images/transpixel.gif\" /></a> <script type=\"text/javascript\" src=\"../sharedcode/leftRandomPromo.js\"></script> </div> <!-- WDN: see glossary item \'sidebar links\' --> <div id=\"leftcollinks\"> <!--#include virtual=\"../sharedcode/relatedLinks.html\" --> </div> </div> <!-- close navigation -->"; // string() + public $maincolcontent = "<!-- optional main big content image --> <div id=\"maincontent\"> <p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p> </div> <!-- close right-area -->"; // string() + public $bigfooter = "<div id=\"footer\"> <div id=\"footer_floater\"> <div id=\"copyright\"> <!--#include virtual=\"../sharedcode/footer.html\" --> <span><a href=\"http://jigsaw.w3.org/css-validator/check/referer\">CSS</a> <a href=\"http://validator.unl.edu/check/referer\">W3C</a> <a href=\"http://www1.unl.edu/feeds/\">RSS</a> </span><a href=\"http://www.unl.edu/\" title=\"UNL Home\"><img src=\"/ucomm/templatedependents/templatecss/images/wordmark.png\" alt=\"UNL\'s wordmark\" id=\"wordmark\" /></a></div> </div> </div>"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Unlframework',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlstandardtemplate.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlstandardtemplate.php new file mode 100644 index 0000000000000000000000000000000000000000..5aff6955702cb8efadde4d09afbe9f35a7e61bb2 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version2/Unlstandardtemplate.php @@ -0,0 +1,48 @@ +<?php +/** + * Template Definition for unlstandardtemplate.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Unlstandardtemplate object + * + * @package UNL_Templates + * + */ +class UNL_Templates_Version2_Unlstandardtemplate extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Unlstandardtemplate.tpl'; // template name + public $doctitle = "<title>UNL Redesign</title>"; // string() + public $head = ""; // string() + public $siteheader = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/siteheader/siteheader.shtml\" -->"; // string() + public $breadcrumbs = "<ul> <li class=\"first\"><a href=\"http://www.unl.edu/\">UNL</a></li> <li>UNL Standard Template</li> </ul>"; // string() + public $shelf = "<!--#include virtual=\"/ucomm/templatedependents/templatesharedcode/includes/shelf/shelf.shtml\" -->"; // string() + public $collegenavigationlist = ""; // string() + public $titlegraphic = "<h1>Department</h1> <h2>Taglines - We Do The Heavy Lifting</h2>"; // string() + public $navcontent = "<div id=\"navlinks\"> <!--#include virtual=\"../sharedcode/navigation.html\" --> </div>"; // string() + public $leftRandomPromo = "<div class=\"image_small_short\" id=\"leftRandomPromo\"> <a href=\"#\" id=\"leftRandomPromoAnchor\"><img id=\"leftRandomPromoImage\" alt=\"\" src=\"/ucomm/templatedependents/templatecss/images/transpixel.gif\" /></a> <script type=\"text/javascript\" src=\"../sharedcode/leftRandomPromo.js\"></script> </div>"; // string() + public $leftcollinks = "<h3>Related Links</h3> <!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $maincontent = "<p style=\"margin:20px; border:3px solid #CC0000;padding:10px; text-align:center\"> <strong>Delete this box and place your content here.</strong><br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://www.unl.edu/webdevnet/\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Click here to check Validation</a> </p>"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version2_Unlstandardtemplate',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3.php new file mode 100644 index 0000000000000000000000000000000000000000..b55f6709aa0560dd38f824bb24c95d23086aea86 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3.php @@ -0,0 +1,67 @@ +<?php +/** + * Base class for Version 3 (2009) template files. + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates/Version.php'; + +/** + * Base class for Version 3 (2009) template files. + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3 implements UNL_Templates_Version +{ + function getConfig() + { + return array('class_location' => 'UNL/Templates/Version3/', + 'class_prefix' => 'UNL_Templates_Version3_'); + } + + function getTemplate($template) + { + if (!file_exists(UNL_Templates::$options['templatedependentspath'].'/wdn/templates_3.0')) { + UNL_Templates::debug('ERROR You should have a local copy of wdn/templates_3.0!' + . ' Overriding your specified template to use absolute references' , + 'getTemplate', 1); + $template = 'Absolute.tpl'; + } + return file_get_contents('http://pear.unl.edu/UNL/Templates/server.php?version=3&template='.$template); + } + + function makeIncludeReplacements($html) + { + UNL_Templates::debug('Now making template include replacements.', + 'makeIncludeReplacements', 3); + $includes = array(); + preg_match_all('<!--#include virtual="(/wdn/templates_3.0/[A-Za-z0-9\.\/]+)" -->', + $html, $includes); + UNL_Templates::debug(print_r($includes, true), 'makeIncludeReplacements', 3); + foreach ($includes[1] as $include) { + UNL_Templates::debug('Replacing '.$include, 'makeIncludeReplacements', 3); + $file = UNL_Templates::$options['templatedependentspath'].$include; + if (!file_exists($file)) { + UNL_Templates::debug('File does not exist:'.$file, + 'makeIncludeReplacements', 3); + $file = 'http://www.unl.edu'.$include; + } + $html = str_replace('<!--#include virtual="'.$include.'" -->', + file_get_contents($file), $html); + } + return $html; + } +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Absolute.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Absolute.php new file mode 100644 index 0000000000000000000000000000000000000000..3a7f120bf874ce4097e8a8e06a5602f32917d3a2 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Absolute.php @@ -0,0 +1,50 @@ +<?php +/** + * Template Definition for absolute.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for absolute.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Absolute extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Absolute.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Absolute',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Debug.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Debug.php new file mode 100644 index 0000000000000000000000000000000000000000..2a8e34e5fc5cc1cb04f80b35fc8567f7be41937c --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Debug.php @@ -0,0 +1,30 @@ +<?php +/** + * Template Definition for debug.dwt + */ +require_once 'UNL/Templates.php'; + +class UNL_Templates_Version3_Debug extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Debug.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Debug',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Document.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Document.php new file mode 100644 index 0000000000000000000000000000000000000000..efc4581930ed56de0d311bd540605a7b33f2c57b --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Document.php @@ -0,0 +1,46 @@ +<?php +/** + * Template Definition for document.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for document.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Document extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Document.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Document',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Fixed.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Fixed.php new file mode 100644 index 0000000000000000000000000000000000000000..5f7a566d3233a80865ccb0a6557467a7d49e2076 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Fixed.php @@ -0,0 +1,50 @@ +<?php +/** + * Template Definition for fixed.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for fixed.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Fixed extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Fixed.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Fixed',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Liquid.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Liquid.php new file mode 100644 index 0000000000000000000000000000000000000000..065d3fc61a53447e0a3f070d649c02501b4393a8 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Liquid.php @@ -0,0 +1,50 @@ +<?php +/** + * Template Definition for liquid.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for liquid.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Liquid extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Liquid.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Liquid',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Popup.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Popup.php new file mode 100644 index 0000000000000000000000000000000000000000..f8a9cb83992e3ceaea7ae59654db7e5400944ccc --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Popup.php @@ -0,0 +1,45 @@ +<?php +/** + * Template Definition for popup.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for popup.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Popup extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Popup.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Popup',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Secure.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Secure.php new file mode 100644 index 0000000000000000000000000000000000000000..21a45250fd5f1a83c58f58e40b33278e7f8abaa8 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Secure.php @@ -0,0 +1,48 @@ +<?php +/** + * Template Definition for secure.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for secure.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Secure extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Secure.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $identitymanagement = "<a href=\"https://login.unl.edu/cas/logout\">Logout</a>"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Secure',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_left.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_left.php new file mode 100644 index 0000000000000000000000000000000000000000..af770692bf5ba9437526c509758d6a044a3769db --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_left.php @@ -0,0 +1,51 @@ +<?php +/** + * Template Definition for shared_column_left.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template definition for shared_column_left.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Shared_column_left extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Shared_column_left.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $sharedcolumn = "<div class=\"col left\"> <!--#include virtual=\"../sharedcode/sharedColumn.html\" --> </div>"; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Shared_column_left',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_right.php b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_right.php new file mode 100644 index 0000000000000000000000000000000000000000..00247c20de1569557549fcca068d371f13d04b34 --- /dev/null +++ b/sites/all/themes/unl_wdn/lib/UNL/Templates/Version3/Shared_column_right.php @@ -0,0 +1,51 @@ +<?php +/** + * Template Definition for shared_column_right.dwt + * + * PHP version 5 + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @author Ned Hummel <nhummel2@unl.edu> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +require_once 'UNL/Templates.php'; + +/** + * Template Definition for shared_column_right.dwt + * + * @category Templates + * @package UNL_Templates + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/ + */ +class UNL_Templates_Version3_Shared_column_right extends UNL_Templates +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__template = 'Shared_column_right.tpl'; // template name + public $doctitle = "<title>UNL | Department | New Page</title>"; // string() + public $head = "<!-- Place optional header elements here -->"; // string() + public $breadcrumbs = "<ul> <li><a href=\"http://www.unl.edu/\" title=\"University of Nebraska–Lincoln\">UNL</a></li> <li>Department</li> </ul>"; // string() + public $navlinks = "<!--#include virtual=\"../sharedcode/navigation.html\" -->"; // string() + public $titlegraphic = "<h1>Department</h1>"; // string() + public $pagetitle = ""; // string() + public $maincontentarea = "<p>Place your content here.<br /> Remember to validate your pages before publishing! Sample layouts are available through the <a href=\"http://wdn.unl.edu//\">Web Developer Network</a>. <br /> <a href=\"http://validator.unl.edu/check/referer\">Check this page</a> </p>"; // string() + public $sharedcolumn = "<div class=\"col right\"> <!--#include virtual=\"../sharedcode/sharedColumn.html\" --> </div>"; // string() + public $leftcollinks = "<!--#include virtual=\"../sharedcode/relatedLinks.html\" -->"; // string() + public $contactinfo = "<!--#include virtual=\"../sharedcode/footerContactInfo.html\" -->"; // string() + public $optionalfooter = ""; // string() + public $footercontent = "<!--#include virtual=\"../sharedcode/footer.html\" -->"; // string() + + /* Static get */ + function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_Templates_Version3_Shared_column_right',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/sites/all/themes/unl_wdn/page.tpl.php b/sites/all/themes/unl_wdn/page.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..0ad236710d71832732fd73a7eedb2ce78f8fa8c7 --- /dev/null +++ b/sites/all/themes/unl_wdn/page.tpl.php @@ -0,0 +1,168 @@ +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 + * Default theme implementation to display a single Drupal page. + * + * Available variables: + * + * General utility variables: + * - $base_path: The base URL path of the Drupal installation. At the very + * least, this will always default to /. + * - $directory: The directory the template is located in, e.g. modules/system + * or themes/garland. + * - $is_front: TRUE if the current page is the front page. + * - $logged_in: TRUE if the user is registered and signed in. + * - $is_admin: TRUE if the user has permission to access administration pages. + * + * Site identity: + * - $front_page: The URL of the front page. Use this instead of $base_path, + * when linking to the front page. This includes the language domain or + * prefix. + * - $logo: The path to the logo image, as defined in theme configuration. + * - $site_name: The name of the site, empty when display has been disabled + * in theme settings. + * - $site_slogan: The slogan of the site, empty when display has been disabled + * in theme settings. + * + * Navigation: + * - $main_menu (array): An array containing the Main menu links for the + * site, if they have been configured. + * - $secondary_menu (array): An array containing the Secondary menu links for + * the site, if they have been configured. + * - $breadcrumb: The breadcrumb trail for the current page. + * + * Page content (in order of occurrence in the default page.tpl.php): + * - $title_prefix (array): An array containing additional output populated by + * modules, intended to be displayed in front of the main title tag that + * appears in the template. + * - $title: The page title, for use in the actual HTML content. + * - $title_suffix (array): An array containing additional output populated by + * modules, intended to be displayed after the main title tag that appears in + * the template. + * - $messages: HTML for status and error messages. Should be displayed + * prominently. + * - $tabs (array): Tabs linking to any sub-pages beneath the current page + * (e.g., the view and edit tabs when displaying a node). + * - $action_links (array): Actions local to the page, such as 'Add menu' on the + * menu administration interface. + * - $feed_icons: A string of all feed icons for the current page. + * - $node: The node object, if there is an automatically-loaded node + * associated with the page, and the node ID is the second argument + * in the page's path (e.g. node/12345 and node/12345/revisions, but not + * comment/reply/12345). + * + * Regions: + * - $page['navlinks']: Navigation Links + * - $page['content']: Main Content Area + * - $page['leftcollinks']: Related Links + * - $page['contactinfo']: Contact Us + * - $page['optionalfooter']: Optional Footer + * - $page['footercontent']: Footer Content + * + * @see template_preprocess() + * @see template_preprocess_page() + * @see template_process() + */ + +$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>'; +} + + +if ($messages) { + $messages = <<<EOF +<script type="text/javascript"> +WDN.initializePlugin('notice'); +</script> +<div class="wdn_notice"> + <div class="close"> + <a href="#" title="Close this notice">Close this notice</a> + </div> + <div class="message"> + $messages + </div> +</div> +EOF; + +} + +$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/screenshot.png b/sites/all/themes/unl_wdn/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..5f09b1181adfc4a2cb44e9bfb5cb80fc91872746 Binary files /dev/null and b/sites/all/themes/unl_wdn/screenshot.png differ diff --git a/sites/all/themes/unl_wdn/style.css b/sites/all/themes/unl_wdn/style.css new file mode 100644 index 0000000000000000000000000000000000000000..5ce55a49d6f22ecae705fb804836b54a9545866c --- /dev/null +++ b/sites/all/themes/unl_wdn/style.css @@ -0,0 +1,41 @@ + +ul.primary li a { + border-width: 0px; + margin-right:0; +} + +ul.secondary li { + border-width: 0; + padding:0; +} +#maincontent { + width: 940px; +} + +/* begin nested nav UL fixes */ +#navigation ul li ul { + overflow:hidden; +} + +#navigation ul li ul li ul li{ + margin-left: 10px; + overflow:hidden; +} +/* end nested nav UL fixes */ + +li.leaf { + list-style-image:none; +} +#edit-body-wrapper { + margin-left: -23px; + width: 986px; +} +html.tinyMceEditor#maincontent { + width: inherit; + padding: 0; +} +.tinyMceEditor body { + width: 940px; + margin: 0px 23px 0px 23px; + line-height: inherit; +} \ No newline at end of file diff --git a/sites/all/themes/unl_wdn/template.php b/sites/all/themes/unl_wdn/template.php new file mode 100644 index 0000000000000000000000000000000000000000..c79c567905b786584ba8c0339dcd755a70ce975e --- /dev/null +++ b/sites/all/themes/unl_wdn/template.php @@ -0,0 +1,145 @@ +<?php + +function unl_wdn_get_instance() +{ + static $instance; + if (!$instance) { + set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/lib'); + require_once "UNL/Templates.php"; + + UNL_Templates::$options['version'] = UNL_Templates::VERSION3; + $instance = UNL_Templates::factory('Fixed'); + } + + return $instance; +} + + +//include 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))); + } + //Prepend UNL + array_unshift($breadcrumbs, '<a href="http://www.unl.edu/">UNL</a>'); + + //Append title of current page -- http://drupal.org/node/133242 + $breadcrumbs[] = drupal_get_title(); + + $html = '<ul>' . PHP_EOL; + foreach ($breadcrumbs as $breadcrumb) { + $html .= '<li>' . $breadcrumb . '</li>'; + } + $html .= '</ul>'; + + 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) { + return '<li class="' . $extra_class . '">' . $link . $menu . '</li>' . "\n"; + } else { + return '<li>' . $link . $menu . '</li>' . PHP_EOL; + } +} + +function unl_wdn_menu_tree($variables) +{ + $tree = $variables['tree']; + return '<ul>' . $tree . '</ul>' . PHP_EOL; +} + +function unl_wdn_theme() +{ + return array('page_node_form' => array('arguments' => array('form' => NULL),)); +} + +function unl_wdn_menu_local_tasks() +{ + $output = array(); + + if ($primary = menu_primary_local_tasks()) { + $primary['#prefix'] = '<ul class="wdn_tabs disableSwitching">'; + $primary['#suffix'] = '</ul>'; + $output[] = $primary; + } + if ($secondary = menu_secondary_local_tasks()) { + $secondary['#prefix'] = '<ul class="wdn_tabs disableSwitching">'; + $secondary['#suffix'] = '</ul>'; + $output[] = $secondary; + } + + return $output; +} + +function unl_wdn_menu_local_task($variables) +{ + $link = $variables['element']['#link']; + $link_text = $link['title']; + + if (!empty($variables['element']['#active'])) { + // If the link does not contain HTML already, check_plain() it now. + // After we set 'html'=TRUE the link will not be sanitized by l(). + if (empty($link['localized_options']['html'])) { + $link['title'] = check_plain($link['title']); + } + $link['localized_options']['html'] = TRUE; + $link_text = t('!local-task-title !active', array('!local-task-title' => $link['title'], '!active' => '')); + } + return '<li' . (!empty($variables['element']['#active']) ? ' class="selected"' : '') . '>' . l($link_text, $link['href'], $link['localized_options']) . "</li>\n"; +} + + +function unl_wdn_status_messages($display) +{ + foreach (drupal_get_messages($display) as $type => $messages) { + $output .= '<div>' . PHP_EOL; + if (count($messages) > 1) { + $output .= '<ul>' . PHP_EOL; + foreach ($messages as $message) { + $output .= '<li>' . $message . '</li>' . PHP_EOL; + } + $output .= '</ul>' . PHP_EOL; + } else { + $output .= $messages[0]; + } + $output .= '</div>' . PHP_EOL; + } + return $output; +} diff --git a/sites/all/themes/unl_wdn/unl_wdn.info b/sites/all/themes/unl_wdn/unl_wdn.info new file mode 100644 index 0000000000000000000000000000000000000000..adf9bee4cffcc39b9dde73969498db85bce84f5d --- /dev/null +++ b/sites/all/themes/unl_wdn/unl_wdn.info @@ -0,0 +1,12 @@ +name = UNL WDN +description = UNL DWN theme for Drupal +screenshot = screenshot.png +core = 7.x +engine = phptemplate +regions[content] = Main Content +regions[navlinks] = Navigation Links +regions[leftcollinks] = Related Links +regions[contactinfo] = Contact Us +regions[optionalfooter] = Optional Footer +regions[footercontent] = Footer Content +plugins[panels][layouts] = layouts