/[drupal]/contributions/themes/adc/adc.theme
ViewVC logotype

Contents of /contributions/themes/adc/adc.theme

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


Revision 1.21 - (show annotations) (download) (as text)
Sun Mar 5 09:13:56 2006 UTC (3 years, 8 months ago) by tdobes
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-4-7
Changes since 1.20: +36 -22 lines
File MIME type: text/x-php
updates to 4.7
1 <?php
2 /** $Id: adc.theme,v 1.20 2005/08/25 21:00:27 dries Exp $
3 * Theme for cuadc.org
4 *
5 * @author Alastair Maw (me@almaw.com)
6 *
7 */
8
9 function adc_features() {
10 return array('toggle_name', 'toggle_slogan', 'toggle_favicon');
11 }
12
13 function adc_regions() {
14 return array(
15 'left' => t('left sidebar'),
16 'right' => t('right sidebar')
17 );
18 }
19
20 function adc_page($content) {
21 if (theme_get_setting('toggle_favicon')) {
22 drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
23 }
24 $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
25 $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n";
26 $output .= "<head>\n";
27 $output .= drupal_get_html_head();
28 $output .= "<title>";
29
30 if ($title = drupal_get_title()) {
31 $output .= strip_tags($title) .' | '. variable_get("site_name", "drupal");
32 }
33 else {
34 $output .= variable_get("site_name", "drupal");
35 $output .= ($slogan = variable_get("site_slogan", "")) ? " | $slogan" : "";
36 }
37
38 $output .= "</title>\n";
39 $output .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"". base_path() . path_to_theme() ."/print.css\" />\n";
40 $output .= theme_get_styles();
41 $output .= "</head>\n";
42 $output .= "<body>\n";
43
44 $output .= "<div id=\"Header\">\n";
45 $output .= "<div class=\"headTitle\">";
46 if (theme_get_setting('toggle_name')) {
47 $output .= l(variable_get("site_name", "drupal"), "", array('title' => t('Home')));
48 }
49 if (theme_get_setting('toggle_slogan')) {
50 $output .= (theme_get_setting('toggle_name') && variable_get("site_name", "drupal") && variable_get("site_slogan", "")) ? " | " : "";
51 $output .= variable_get("site_slogan", "");
52 }
53 $output .= "</div>\n";
54
55 $primary_links = theme('links', menu_primary_links());
56 $secondary_links = theme('links', menu_secondary_links());
57 if (isset($primary_links) || isset($secondary_links)) {
58 $output .= ' <div class="headLinks">';
59 if (isset($primary_links)) {
60 $output .= '<span class="primary">'. $primary_links .'</span>';
61 }
62 if (isset($secondary_links)) {
63 $output .= '<span class="secondary">'. $secondary_links .'</span>';
64 }
65 $output .= " </div>\n";
66 }
67
68 $output .= "</div>\n";
69
70 $leftblocks = theme("blocks", "left");
71 $rightblocks = theme("blocks", "right");
72
73 if ($leftblocks && $rightblocks) {
74 $output .= "<div id=\"MainBoth\">\n";
75 }
76 else if ($leftblocks) {
77 $output .= "<div id=\"MainLeft\">\n";
78 }
79 else if ($rightblocks) {
80 $output .= "<div id=\"MainRight\">\n";
81 }
82 else {
83 $output .= "<div id=\"MainNone\">\n";
84 }
85
86 if ($title) {
87 $output .= theme("breadcrumb", drupal_get_breadcrumb());
88 $output .= "<h2 class=\"title\">$title</h2>";
89 }
90
91 if ($tabs = theme('menu_local_tasks')) {
92 $output .= $tabs;
93 }
94
95 $output .= theme('help');
96
97 $output .= theme('status_messages');
98
99 $output .= "\n<!-- begin content -->\n";
100 $output .= $content;
101 $output .= "\n<!-- end content -->\n";
102
103 $output .= "</div>\n";
104
105 $output .= $leftblocks ? "<div id=\"LeftBlocks\">$leftblocks</div>\n" : "";
106 $output .= $rightblocks ? "<div id=\"RightBlocks\">$rightblocks</div>\n" : "";
107
108 if ($footerText = variable_get(site_footer, "")) {
109 $output .= "<div id=\"Footer\"><div id=\"paddinghalf\">$footerText</div></div>\n";
110 }
111 $output .= theme_closure();
112 $output .= "</body>\n</html>\n";
113
114 return $output;
115 }
116
117 function adc_node($node, $teaser = 0, $page = 0) {
118 $output = "<div class=\"node\">\n";
119 $output .= "<div class=\"nodeTitleBar\">\n";
120 if (theme_get_setting("toggle_node_info_$node->type")) {
121 $output .= "<div class=\"nodeCredits\">" . theme('username', $node) . ' | ' . format_date($node->created, "small") . "</div>\n";
122 }
123 if (!$page) {
124 $output .= "<div class=\"nodeTitle\">" . ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) . "</div>\n";
125 }
126 $output .= "</div>\n";
127 $output .= "<div class=\"nodeContents\">\n";
128 if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {
129 $output .= "<div class=\"nodeTaxonomy\">". theme("links", $taxonomy) ."</div>";
130 }
131 if ($teaser && $node->teaser) {
132 $output .= $node->teaser;
133 }
134 else {
135 $output .= $node->body;
136 }
137
138 if ($node->links) {
139 $output .= "<p class=\"nodeLinks\">" . theme("links", $node->links) . "</p>\n";
140 }
141
142 $output .= "</div>\n</div>\n";
143
144 return $output;
145 }
146
147 function adc_comment($comment, $links = array()) {
148 $output = "<hr size=\"1\" />\n";
149 $output .= theme("links", array(theme('username', $comment), format_date($comment->timestamp, "small"), "&nbsp;"));
150 $output .= "<strong>$comment->subject</strong>\n";
151 $output .= "<br /><br />";
152 $output .= $comment->comment;
153 $output .= "<br /><br />". theme('links', $links) ."<br />";
154
155 return $output;
156 }
157
158 function adc_block($block) {
159 $output = '<div class="block block-'.$block->module.'" id="block-'.$block->module.'-'.$block->delta.'"><div class="nodeTitleBar">';
160 $output .= '<div class="nodeTitle">';
161 $output .= $block->subject ."</div></div><div class=\"nodeContents\">$block->content</div></div>\n";
162 $output .= "<br />\n";
163
164 return $output;
165 }
166
167 function adc_help() {
168 if ($help = menu_get_active_help()) {
169 return '<div class="help">'. $help .'</div><hr />';
170 }
171 }

  ViewVC Help
Powered by ViewVC 1.1.2