/[drupal]/contributions/themes/1024px/template.php
ViewVC logotype

Contents of /contributions/themes/1024px/template.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Mon Mar 9 16:25:16 2009 UTC (8 months, 3 weeks ago) by nickbits
Branch: MAIN
CVS Tags: DRUPAL-6--0-0, DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-6--1-2, HEAD
File MIME type: text/x-php
Initial Dev Release
1 <?php
2 // $Id: template.php,v 1.1.6.2 2008/11/28 06:14:30 andregriffin 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($left, $right) {
10 if ($left != '' && $right != '') {
11 $class = 'sidebars';
12 }
13 else {
14 if ($left != '') {
15 $class = 'sidebar-left';
16 }
17 if ($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 function phptemplate_breadcrumb($breadcrumb) {
35 if (!empty($breadcrumb)) {
36 // uncomment the next line to enable current page in the breadcrumb trail
37 // $breadcrumb[] = drupal_get_title();
38 return '<div class="breadcrumb">'. implode(' ยป ', $breadcrumb) .'</div>';
39 }
40 }
41
42 /**
43 * Allow themable wrapping of all comments.
44 */
45 function phptemplate_comment_wrapper($content, $node) {
46 if (!$content || $node->type == 'forum') {
47 return '<div id="comments">'. $content .'</div>';
48 }
49 else {
50 return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
51 }
52 }
53
54 /**
55 * Override or insert PHPTemplate variables into the templates.
56 */
57 function phptemplate_preprocess_page(&$vars) {
58 $vars['tabs2'] = menu_secondary_local_tasks();
59
60 // Hook into color.module
61 if (module_exists('color')) {
62 _color_page_alter($vars);
63 }
64 }
65
66 /**
67 * Returns the rendered local tasks. The default implementation renders
68 * them as tabs. Overridden to split the secondary tasks.
69 *
70 * @ingroup themeable
71 */
72 function phptemplate_menu_local_tasks() {
73 return menu_primary_local_tasks();
74 }
75
76 function phptemplate_comment_submitted($comment) {
77 return t('by <strong>!username</strong> | !datetime',
78 array(
79 '!username' => theme('username', $comment),
80 '!datetime' => format_date($comment->timestamp)
81 ));
82 }
83
84 function phptemplate_node_submitted($node) {
85 return t('by <strong>!username</strong> | !datetime',
86 array(
87 '!username' => theme('username', $node),
88 '!datetime' => format_date($node->created),
89 ));
90 }
91 /**
92 * Adds even and odd classes to <li> tags in ul.menu lists
93 */
94 function phptemplate_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
95 static $zebra = FALSE;
96 $zebra = !$zebra;
97 $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
98 if (!empty($extra_class)) {
99 $class .= ' '. $extra_class;
100 }
101 if ($in_active_trail) {
102 $class .= ' active-trail';
103 }
104 if ($zebra) {
105 $class .= ' even';
106 }
107 else {
108 $class .= ' odd';
109 }
110 return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
111 }

  ViewVC Help
Powered by ViewVC 1.1.2