2 // $Id: template.php,v 1.4.2.1 2007/04/18 03:38:59 drumm Exp $
5 * Sets the body-tag class attribute.
7 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
9 function phptemplate_body_class($sidebar_left, $sidebar_right) {
10 if ($sidebar_left != '' && $sidebar_right != '') {
14 if ($sidebar_left != '') {
15 $class = 'sidebar-left';
17 if ($sidebar_right != '') {
18 $class = 'sidebar-right';
23 print ' class="'. $class .'"';
28 * Return a themed breadcrumb trail.
31 * An array containing the breadcrumb links.
32 * @return a string containing the breadcrumb output.
34 function phptemplate_breadcrumb($breadcrumb) {
35 if (!empty($breadcrumb)) {
36 return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
41 * Allow themable wrapping of all comments.
43 function phptemplate_comment_wrapper($content, $type = null) {
45 if (isset($type)) $node_type = $type;
47 if (!$content ||
$node_type == 'forum') {
48 return '<div id="comments">'. $content . '</div>';
51 return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
56 * Override or insert PHPTemplate variables into the templates.
58 function _phptemplate_variables($hook, $vars) {
59 if ($hook == 'page') {
61 if ($secondary = menu_secondary_local_tasks()) {
62 $output = '<span class="clear"></span>';
63 $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
64 $vars['tabs2'] = $output;
67 // Hook into color.module
68 if (module_exists('color')) {
69 _color_page_alter($vars);
77 * Returns the rendered local tasks. The default implementation renders
82 function phptemplate_menu_local_tasks() {
85 if ($primary = menu_primary_local_tasks()) {
86 $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";