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