forum_view

Versions
4.6 – 5
forum_view(&$node, $teaser = FALSE, $page = FALSE)

Implementation of hook_view().

Code

modules/forum/forum.module, line 288

<?php
function forum_view(&$node, $teaser = FALSE, $page = FALSE) {
  drupal_add_css(drupal_get_path('module', 'forum') .'/forum.css');
  if ($page) {
    $vocabulary = taxonomy_get_vocabulary(variable_get('forum_nav_vocabulary', ''));
    // Breadcrumb navigation
    $breadcrumb = array();
    $breadcrumb[] = array('path' => 'forum', 'title' => $vocabulary->name);
    if ($parents = taxonomy_get_parents_all($node->tid)) {
      $parents = array_reverse($parents);
      foreach ($parents as $p) {
        $breadcrumb[] = array('path' => 'forum/'. $p->tid, 'title' => $p->name);
      }
    }
    $breadcrumb[] = array('path' => 'node/'. $node->nid);
    menu_set_location($breadcrumb);
  }

  $node = node_prepare($node, $teaser);
  if (!$teaser) {
    $node->content['forum_navigation'] = array(
      '#value' => theme('forum_topic_navigation', $node),
      '#weight' => 100,
    );
  }
  return $node;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.