You are here

function recipe_view in Recipe 5

Same name and namespace in other branches
  1. 6 recipe.module \recipe_view()
  2. 7.2 recipe.module \recipe_view()
  3. 7 recipe.module \recipe_view()

Implementation of hook_view().

File

./recipe.module, line 524
recipe.module - share recipes for drupal 5.x

Code

function recipe_view(&$node, $teaser = FALSE, $page = FALSE) {
  if ($page) {
    drupal_set_breadcrumb(array(
      l(t('Home'), ''),
      l(t('Recipes'), 'recipe'),
    ));
    drupal_add_css(drupal_get_path('module', 'recipe') . '/recipe.css');
  }
  $node = recipe_node_prepare($node, $teaser);
  $node->content['body'] = array(
    '#value' => $teaser ? $node->teaser : theme('node_recipe', $node, $page),
    '#weight' => 1,
  );
  return $node;
}