| 1 |
<?php
|
| 2 |
// $Id: template.php,v 1.1.2.1 2008/09/05 15:30:24 njt1982 Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Sets the body-tag class attribute.
|
| 6 |
*
|
| 7 |
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
|
| 8 |
*/
|
| 9 |
function phptemplate_body_class($sidebar_left, $sidebar_right) {
|
| 10 |
if ($sidebar_left != '' && $sidebar_right != '') {
|
| 11 |
$class = 'sidebars';
|
| 12 |
}
|
| 13 |
else {
|
| 14 |
if ($sidebar_left != '') {
|
| 15 |
$class = 'sidebar-left';
|
| 16 |
}
|
| 17 |
if ($sidebar_right != '') {
|
| 18 |
$class = 'sidebar-right';
|
| 19 |
}
|
| 20 |
}
|
| 21 |
|
| 22 |
if (isset($class)) {
|
| 23 |
print ' class="'. $class .'"';
|
| 24 |
}
|
| 25 |
}
|
| 26 |
|
| 27 |
/**
|
| 28 |
* Return a themed breadcrumb trail.
|
| 29 |
*
|
| 30 |
* @param $breadcrumb
|
| 31 |
* An array containing the breadcrumb links.
|
| 32 |
* @return a string containing the breadcrumb output.
|
| 33 |
*/
|
| 34 |
|
| 35 |
function phptemplate_breadcrumb($breadcrumb) {
|
| 36 |
if (!empty($breadcrumb)) {
|
| 37 |
return '<div class="breadcrumb">'. implode(' // ', $breadcrumb) .'</div>';
|
| 38 |
}
|
| 39 |
}
|
| 40 |
|
| 41 |
/**
|
| 42 |
* Override or insert PHPTemplate variables into the templates.
|
| 43 |
*/
|
| 44 |
function _phptemplate_variables($hook, $vars) {
|
| 45 |
if ($hook == 'page') {
|
| 46 |
$vars['footer_message'] = trim($vars['footer_message']);
|
| 47 |
}
|
| 48 |
|
| 49 |
return $vars;
|
| 50 |
}
|