daily_view

Definition

daily_view($node, $teaser = FALSE, $page = FALSE)
daily/daily_container.inc, line 201

Description

Implementation of hook_view(): Add extra fields to display.

We add the daily node we need this time.

Related topics

Namesort iconDescription
Daily Container node type functionsAll functions which define the node type Daily Container.
Hook implementationsFunctions that implement standard Drupal hooks.

Code

<?php
function daily_view($node, $teaser = FALSE, $page = FALSE) { 
  $node = node_prepare($node, $teaser);
  
  $contained_node = _daily_node_by_tid($node->tid, $node->nr);
  if (is_object($contained_node)) {
    $node->content['daily_container'] = array(
      # TODO: Weight
      '#prefix' => '<div class="daily-contained">',
      '#value' => node_view(_daily_node_by_tid($node->tid, $node->nr), $teaser, FALSE),
      '#suffix' => '</div>',
    );
  }
  else {
    # Usually, the calendar display will add the CSS.
    _daily_css();
    $node->content['daily_container'] = array(
      '#value' => '<div class="daily-empty">'. _daily_form_error_no_nodes_found($node->tid) .'</div>',
    );
  }
      
  return $node;
}
?>