| 1 |
<?php
|
| 2 |
// $Id: interlaced.theme,v 1.23 2006/03/05 09:13:56 tdobes Exp $
|
| 3 |
|
| 4 |
// default stylesheets are styles1.css, styles2.css, styles3.css, and styles4.css
|
| 5 |
define('INTERLACED_STYLESHEET', 'styles1.css');
|
| 6 |
|
| 7 |
function interlaced_features() {
|
| 8 |
return array(
|
| 9 |
'toggle_logo',
|
| 10 |
'toggle_favicon',
|
| 11 |
'toggle_name',
|
| 12 |
'toggle_slogan',
|
| 13 |
'toggle_search');
|
| 14 |
}
|
| 15 |
|
| 16 |
function interlaced_regions() {
|
| 17 |
return array(
|
| 18 |
'left' => t('left sidebar'),
|
| 19 |
'right' => t('right sidebar')
|
| 20 |
);
|
| 21 |
}
|
| 22 |
|
| 23 |
function interlaced_page($content) {
|
| 24 |
|
| 25 |
if (theme_get_setting('toggle_favicon')) {
|
| 26 |
drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
|
| 27 |
}
|
| 28 |
|
| 29 |
$theme_path = path_to_theme();
|
| 30 |
|
| 31 |
// Javascript hack for properly displaying transparent .png in IE.
|
| 32 |
drupal_set_html_head('
|
| 33 |
<!--[if lt IE 7.]>
|
| 34 |
<script defer type="text/javascript" src="'. base_path() . $theme_path .'/pngfix.js"></script>
|
| 35 |
<![endif]-->
|
| 36 |
');
|
| 37 |
|
| 38 |
drupal_add_css($theme_path .'/default.css');
|
| 39 |
drupal_add_css($theme_path .'/'. INTERLACED_STYLESHEET);
|
| 40 |
|
| 41 |
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
| 42 |
$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
|
| 43 |
$output .= "<head>\n";
|
| 44 |
|
| 45 |
$output .= ' <title>';
|
| 46 |
$slogan = variable_get('site_slogan', '');
|
| 47 |
if ($title = drupal_get_title()) {
|
| 48 |
$output .= strip_tags($title) .' - '. variable_get('site_name', 'drupal');
|
| 49 |
}
|
| 50 |
else {
|
| 51 |
$output .= variable_get('site_name', 'drupal');
|
| 52 |
$output .= $slogan ? " - $slogan" : '';
|
| 53 |
}
|
| 54 |
$output .= "</title>\n";
|
| 55 |
|
| 56 |
$output .= drupal_get_html_head();
|
| 57 |
$output .= drupal_get_css();
|
| 58 |
$output .= drupal_get_js();
|
| 59 |
|
| 60 |
$output .= "</head>\n";
|
| 61 |
|
| 62 |
$output .= "<body>\n";
|
| 63 |
|
| 64 |
$output .= '<table style="width: 100%; vertical-align: top;" cellspacing="0" cellpadding="0">';
|
| 65 |
$output .= '
|
| 66 |
<tr>';
|
| 67 |
|
| 68 |
$output .= '
|
| 69 |
<td class="header">
|
| 70 |
';
|
| 71 |
|
| 72 |
if ($logo = theme_get_setting('logo')) {
|
| 73 |
// If it's a png, then add height and width so the IE png hack will work.
|
| 74 |
$image = getimagesize(substr($logo, strlen(base_path())));
|
| 75 |
$image = $image[2] == 3 ? ' '. $image[3] : '';
|
| 76 |
$output .= '
|
| 77 |
<span class="headerlogo">
|
| 78 |
<a href="'. base_path() .'" title="'. t('Home') .'"><img src="'. $logo .'" alt="'. t('Home') .'"'. $image .' /></a>
|
| 79 |
</span>';
|
| 80 |
}
|
| 81 |
|
| 82 |
if (theme_get_setting('toggle_search')) {
|
| 83 |
$search_form = drupal_get_form('search_block_form');
|
| 84 |
$output .= "
|
| 85 |
<span class=\"headersearch\">
|
| 86 |
$search_form
|
| 87 |
</span>";
|
| 88 |
}
|
| 89 |
|
| 90 |
$output .= '
|
| 91 |
<div class="headersitename">';
|
| 92 |
|
| 93 |
$output .= theme_get_setting('toggle_name') ? variable_get('site_name', 'drupal') : ' ';
|
| 94 |
|
| 95 |
$output .= '
|
| 96 |
</div>';
|
| 97 |
|
| 98 |
$output .= '
|
| 99 |
<div class="headerslogan">';
|
| 100 |
|
| 101 |
$output .= theme_get_setting('toggle_slogan') ? $slogan : ' ';
|
| 102 |
|
| 103 |
$output .= '
|
| 104 |
</div>';
|
| 105 |
|
| 106 |
$primary_links = theme('links', menu_primary_links());
|
| 107 |
if ($primary_links) {
|
| 108 |
$output .= '
|
| 109 |
<div class="headerlinks">
|
| 110 |
'. $primary_links .'
|
| 111 |
</div>
|
| 112 |
|
| 113 |
';
|
| 114 |
}
|
| 115 |
|
| 116 |
$output .= '
|
| 117 |
</td>
|
| 118 |
</tr>
|
| 119 |
|
| 120 |
';
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
$output .= '<tr>
|
| 125 |
<td class="headerspace"> </td>
|
| 126 |
</tr>
|
| 127 |
</table>
|
| 128 |
|
| 129 |
<table style="width: 100%" cellspacing="0" cellpadding="0">
|
| 130 |
|
| 131 |
<tr>
|
| 132 |
';
|
| 133 |
|
| 134 |
$blocks = theme('blocks', 'left');
|
| 135 |
if ($blocks) {
|
| 136 |
$output .= " <td class=\"leftcolumn\" style=\"vertical-align: top;\">\n";
|
| 137 |
$output .= $blocks;
|
| 138 |
$output .= " </td>\n";
|
| 139 |
$output .= " <td class=\"linev\"> </td>\n";
|
| 140 |
}
|
| 141 |
|
| 142 |
$output .= " <td style=\"vertical-align: top;\" class=\"centercolumn\">\n";
|
| 143 |
|
| 144 |
if ($title) {
|
| 145 |
$output .= '<div class="breadcrumb">'. theme('breadcrumb', drupal_get_breadcrumb()) .'</div>';
|
| 146 |
$output .= "<div class=\"page-title\">$title</div>";
|
| 147 |
}
|
| 148 |
|
| 149 |
if ($tabs = theme('menu_local_tasks')) {
|
| 150 |
$output .= $tabs;
|
| 151 |
}
|
| 152 |
|
| 153 |
$output .= theme('help');
|
| 154 |
|
| 155 |
$output .= theme('status_messages');
|
| 156 |
|
| 157 |
$output .= "\n<!-- begin content -->\n";
|
| 158 |
$output .= $content;
|
| 159 |
$output .= "\n<!-- end content -->\n";
|
| 160 |
|
| 161 |
$output .= " </td>\n";
|
| 162 |
|
| 163 |
$blocks = theme('blocks', 'right');
|
| 164 |
if ($blocks) {
|
| 165 |
$output .= " <td class=\"linev\"> </td>\n";
|
| 166 |
$output .= " <td class=\"rightcolumn\" style=\"vertical-align: top;\">\n";
|
| 167 |
$output .= $blocks;
|
| 168 |
$output .= " </td>\n";
|
| 169 |
}
|
| 170 |
|
| 171 |
|
| 172 |
$output .= ' </tr>
|
| 173 |
</table>
|
| 174 |
|
| 175 |
<table style="width: 100%;" cellspacing="0" cellpadding="0">
|
| 176 |
|
| 177 |
<tr>
|
| 178 |
<td style="vertical-align: top;" class="lineh"> </td>
|
| 179 |
</tr>
|
| 180 |
|
| 181 |
<tr>
|
| 182 |
<td style="vertical-align: top;" class="headerlinks">' . variable_get(site_footer, '') . '</td>
|
| 183 |
</tr>
|
| 184 |
</table>
|
| 185 |
|
| 186 |
' . theme_closure() . '
|
| 187 |
|
| 188 |
</body>
|
| 189 |
</html>';
|
| 190 |
|
| 191 |
return $output;
|
| 192 |
}
|
| 193 |
|
| 194 |
function interlaced_node($node, $teaser = 0, $page = 0) {
|
| 195 |
$output = ' <!-- node: "'. check_plain($node->title) .'" -->';
|
| 196 |
if (!$page) {
|
| 197 |
$output .= ' <div class="nodetitle">' . ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) . '</div>';
|
| 198 |
}
|
| 199 |
$output .= '
|
| 200 |
<div class="nodebody">
|
| 201 |
<span class="nodedate">';
|
| 202 |
$nodedate = array();
|
| 203 |
|
| 204 |
if (theme_get_setting("toggle_node_info_$node->type")) {
|
| 205 |
$nodedate[] = theme('username', $node);
|
| 206 |
$nodedate[] = format_date($node->created, "small");
|
| 207 |
|
| 208 |
if (module_exists('taxonomy') && ($taxonomy = taxonomy_link('taxonomy terms', $node))) {
|
| 209 |
foreach ($taxonomy as $taxo) {
|
| 210 |
$nodedate[] = $taxo;
|
| 211 |
}
|
| 212 |
}
|
| 213 |
}
|
| 214 |
|
| 215 |
if (count($nodedate)) {
|
| 216 |
$separator = '<span class="delimiter"> </span>';
|
| 217 |
$output .= $separator . implode($separator, $nodedate) . $separator;
|
| 218 |
}
|
| 219 |
|
| 220 |
$output .= "</span>\n";
|
| 221 |
|
| 222 |
if ($teaser && $node->teaser) {
|
| 223 |
$output .= $node->teaser;
|
| 224 |
}
|
| 225 |
else {
|
| 226 |
$output .= $node->body;
|
| 227 |
}
|
| 228 |
|
| 229 |
$output .= "\n </div>\n";
|
| 230 |
if ($node->links) {
|
| 231 |
$output .= "<div class=\"nodelinks\">". theme('links', $node->links) ."</div>\n";
|
| 232 |
}
|
| 233 |
|
| 234 |
return $output;
|
| 235 |
}
|
| 236 |
|
| 237 |
function interlaced_comment($comment, $links = array()) {
|
| 238 |
$output = "<div class=\"boxtitle\">$comment->subject</div>\n";
|
| 239 |
|
| 240 |
$output .= "<div class=\"nodebody\"><span class=\"nodedate\">".theme("links", array(theme('username', $comment),format_date($comment->timestamp, "small")," "))."</span>\n";
|
| 241 |
|
| 242 |
if ($comment->comment) {
|
| 243 |
$output .= $comment->comment;
|
| 244 |
}
|
| 245 |
|
| 246 |
$output .= '</div>';
|
| 247 |
|
| 248 |
$output .= ' <div class="nodelinks">'. theme('links', $links) ."</div>\n";
|
| 249 |
$output .= "<br />\n\n";
|
| 250 |
|
| 251 |
return $output;
|
| 252 |
}
|
| 253 |
|
| 254 |
function interlaced_block($block) {
|
| 255 |
return ' <table style="width: 100%;" cellspacing="0" cellpadding="0" class="block block-'.$block->module.'" id="block-'.$block->module.'-'.$block->delta.'">
|
| 256 |
|
| 257 |
<tr>
|
| 258 |
<td style="vertical-align: top;" class="boxtitle">
|
| 259 |
' . $block->subject . '
|
| 260 |
</td>
|
| 261 |
</tr>
|
| 262 |
|
| 263 |
<tr>
|
| 264 |
<td style="vertical-align: top;" class="boxbody">
|
| 265 |
' . $block->content . '
|
| 266 |
</td>
|
| 267 |
</tr>
|
| 268 |
|
| 269 |
</table>
|
| 270 |
<br />
|
| 271 |
<br />
|
| 272 |
';
|
| 273 |
}
|
| 274 |
|
| 275 |
function interlaced_links($links, $delimiter = " · ") {
|
| 276 |
if (!is_array($links)) {
|
| 277 |
return '';
|
| 278 |
}
|
| 279 |
|
| 280 |
foreach ($links as $key => $link) {
|
| 281 |
|
| 282 |
if ($link['href']) {
|
| 283 |
$links[$key] = l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);
|
| 284 |
}
|
| 285 |
else if ($link['title']) {
|
| 286 |
//Some links are actually not links--output directly.
|
| 287 |
$links[$key] = check_plain($link['title']);
|
| 288 |
}
|
| 289 |
}
|
| 290 |
return implode('<span class="delimiter"> </span>', $links);
|
| 291 |
}
|
| 292 |
|
| 293 |
function interlaced_help() {
|
| 294 |
if ($help = menu_get_active_help()) {
|
| 295 |
return '<div class="help">'. $help .'</div><hr />';
|
| 296 |
}
|
| 297 |
}
|