diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
commit | 18d22419f3da39ca4bf92f46d605a25957f311be (patch) | |
tree | d72732b1a23d479c4f2adc4d671d8ec901e2a187 /includes | |
parent | 9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff) | |
download | brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2 |
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 52725b9df..1580a437b 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1978,29 +1978,29 @@ function template_preprocess_page(&$variables) { */ function template_preprocess_node(&$variables) { $node = $variables['node']; - if (module_exists('taxonomy')) { - $variables['taxonomy'] = taxonomy_link('taxonomy terms', $node); - } - else { - $variables['taxonomy'] = array(); - } - - if ($variables['teaser'] && $node->teaser) { - $variables['content'] = $node->teaser; - } - elseif (isset($node->body)) { - $variables['content'] = $node->body; - } - else { - $variables['content'] = ''; - } $variables['date'] = format_date($node->created); - $variables['links'] = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : ''; $variables['name'] = theme('username', $node); $variables['node_url'] = url('node/' . $node->nid); - $variables['terms'] = theme('links', $variables['taxonomy'], array('class' => 'links inline')); $variables['title'] = check_plain($node->title); + + if ($node->build_mode == NODE_BUILD_PREVIEW) { + unset($node->content['links']); + } + + // Render taxonomy links separately. + $variables['terms'] = !empty($node->content['links']['terms']) ? drupal_render($node->content['links']['terms']) : ''; + + // Render all remaining node links. + $variables['links'] = !empty($node->content['links']) ? drupal_render($node->content['links']) : ''; + + // Render the rest of the node into $content. + if (!empty($node->content['teaser'])) { + $variables['content'] = drupal_render($node->content['teaser']); + } + else { + $variables['content'] = drupal_render($node->content); + } // Flatten the node object's member fields. $variables = array_merge((array)$node, $variables); |