diff --git themes/chameleon/chameleon.theme themes/chameleon/chameleon.theme index 73fa66e..d763a8d 100644 --- themes/chameleon/chameleon.theme +++ themes/chameleon/chameleon.theme @@ -13,7 +13,8 @@ function chameleon_theme($existing, $type, $theme, $path) { return drupal_find_theme_functions($existing, array($theme)); } -function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) { +function chameleon_page($content) { + $show_blocks = $content['#show_blocks']; $language = $GLOBALS['language']->language; $direction = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; @@ -25,8 +26,8 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) { $rdf_namespaces = drupal_get_rdf_namespaces(); // Get blocks before so that they can alter the header (JavaScript, Stylesheets etc.) - $blocks_left = theme_blocks('left'); - $blocks_right = theme_blocks('right'); + $blocks_left = drupal_render($content['left']); + $blocks_right = drupal_render($content['right']); $output = "\n"; $output .= "status) ? ' node-unpublished' : '') . (($node->sticky) ? ' sticky' : '') . "\">\n"; - if (!$page) { + // Check if we're on a node page. + if (!menu_get_object()) { $output .= "

" . ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) . "

\n"; } $output .= "
\n"; - if ($teaser && $node->teaser) { - $output .= $node->teaser; - } - elseif (isset($node->body)) { - $output .= $node->body; - } + // Render the node body (or teaser). + $output .= drupal_render($node->content['body']); $output .= "
\n"; @@ -144,7 +144,7 @@ function chameleon_node($node, $teaser = 0) { } $links = ''; - if ($node->content['links']) { + if (!empty($node->content['links'])) { $links = drupal_render($node->content['links']); } @@ -152,11 +152,20 @@ function chameleon_node($node, $teaser = 0) { $output .= '\n"; } + // Render comments. + if (!empty($node->content['comments'])) { + $comments = drupal_render($node->content['comments']); + } + else { + $comments = ''; + } + + // Render remaining parts of the node content. + $output .= drupal_render($node->content); + $output .= "\n"; - if ($node->content['comments']) { - $output .= drupal_render($node->content['comments']); - } + $output .= $comments; return $output; }