| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* Sets the body-tag class attribute.
|
| 4 |
*
|
| 5 |
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
|
| 6 |
*/
|
| 7 |
function phptemplate_body_class($sidebar_left, $sidebar_right) {
|
| 8 |
if ($sidebar_left != '' && $sidebar_right != '') {
|
| 9 |
$class = 'sidebars';
|
| 10 |
}
|
| 11 |
else {
|
| 12 |
if ($sidebar_left != '') {
|
| 13 |
$class = 'sidebar-left';
|
| 14 |
}
|
| 15 |
if ($sidebar_right != '') {
|
| 16 |
$class = 'sidebar-right';
|
| 17 |
}
|
| 18 |
}
|
| 19 |
|
| 20 |
if (isset($class)) {
|
| 21 |
print ' class="'. $class .'"';
|
| 22 |
}
|
| 23 |
}
|
| 24 |
|
| 25 |
/**
|
| 26 |
* Return a themed breadcrumb trail.
|
| 27 |
*
|
| 28 |
* @param $breadcrumb
|
| 29 |
* An array containing the breadcrumb links.
|
| 30 |
* @return a string containing the breadcrumb output.
|
| 31 |
*/
|
| 32 |
function phptemplate_breadcrumb($breadcrumb) {
|
| 33 |
if (!empty($breadcrumb)) {
|
| 34 |
return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
|
| 35 |
}
|
| 36 |
}
|
| 37 |
|
| 38 |
/**
|
| 39 |
* Allow themable wrapping of all comments.
|
| 40 |
*/
|
| 41 |
function phptemplate_comment_wrapper($content, $type = null) {
|
| 42 |
static $node_type;
|
| 43 |
if (isset($type)) $node_type = $type;
|
| 44 |
|
| 45 |
if (!$content || $node_type == 'forum') {
|
| 46 |
return '<div id="comments">'. $content . '</div>';
|
| 47 |
}
|
| 48 |
else {
|
| 49 |
return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
|
| 50 |
}
|
| 51 |
}
|
| 52 |
|
| 53 |
/**
|
| 54 |
* Override or insert PHPTemplate variables into the templates.
|
| 55 |
*/
|
| 56 |
function _phptemplate_variables($hook, $vars) {
|
| 57 |
if ($hook == 'page') {
|
| 58 |
|
| 59 |
if ($secondary = menu_secondary_local_tasks()) {
|
| 60 |
$output = '<span class="clear"></span>';
|
| 61 |
$output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
|
| 62 |
$vars['tabs2'] = $output;
|
| 63 |
}
|
| 64 |
|
| 65 |
// Hook into color.module
|
| 66 |
if (module_exists('color')) {
|
| 67 |
_color_page_alter($vars);
|
| 68 |
}
|
| 69 |
return $vars;
|
| 70 |
}
|
| 71 |
return array();
|
| 72 |
}
|
| 73 |
|
| 74 |
/**
|
| 75 |
* Returns the rendered local tasks. The default implementation renders
|
| 76 |
* them as tabs.
|
| 77 |
*
|
| 78 |
* @ingroup themeable
|
| 79 |
*/
|
| 80 |
function phptemplate_menu_local_tasks() {
|
| 81 |
$output = '';
|
| 82 |
|
| 83 |
if ($primary = menu_primary_local_tasks()) {
|
| 84 |
$output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
|
| 85 |
}
|
| 86 |
|
| 87 |
return $output;
|
| 88 |
}
|