Imported drupal-5.5
[drupal.git] / themes / garland / template.php
blobc94cb1519122bde4ff1260363ae07ce41c6d92c7
1 <?php
2 // $Id: template.php,v 1.4.2.1 2007/04/18 03:38:59 drumm Exp $
4 /**
5 * Sets the body-tag class attribute.
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';
13 else {
14 if ($sidebar_left != '') {
15 $class = 'sidebar-left';
17 if ($sidebar_right != '') {
18 $class = 'sidebar-right';
22 if (isset($class)) {
23 print ' class="'. $class .'"';
27 /**
28 * Return a themed breadcrumb trail.
30 * @param $breadcrumb
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>';
40 /**
41 * Allow themable wrapping of all comments.
43 function phptemplate_comment_wrapper($content, $type = null) {
44 static $node_type;
45 if (isset($type)) $node_type = $type;
47 if (!$content || $node_type == 'forum') {
48 return '<div id="comments">'. $content . '</div>';
50 else {
51 return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
55 /**
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);
71 return $vars;
73 return array();
76 /**
77 * Returns the rendered local tasks. The default implementation renders
78 * them as tabs.
80 * @ingroup themeable
82 function phptemplate_menu_local_tasks() {
83 $output = '';
85 if ($primary = menu_primary_local_tasks()) {
86 $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
89 return $output;