Index: themes/chameleon/chameleon.theme =================================================================== RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v retrieving revision 1.88 diff -u -r1.88 chameleon.theme --- themes/chameleon/chameleon.theme 26 Jan 2009 14:08:44 -0000 1.88 +++ themes/chameleon/chameleon.theme 17 Feb 2009 07:38:03 -0000 @@ -13,7 +13,8 @@ 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 @@ $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 @@ } $links = ''; - if ($node->content['links']) { + if (!empty($node->content['links'])) { $links = drupal_render($node->content['links']); } @@ -152,11 +152,20 @@ $output .= '\n"; } + // Render remaining parts of the node content. + $output .= drupal_render($node->content); + $output .= "\n"; - if ($node->content['comments']) { - $output .= drupal_render($node->content['comments']); + // Render comments. + if (!empty($node->content['comments'])) { + $comments = drupal_render($node->content['comments']); } + else { + $comments = ''; + } + + $output .= $comments; return $output; }