You are here

function merci_view in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2

Same name and namespace in other branches
  1. 6 merci.module \merci_view()
  2. 7.2 merci.module \merci_view()

Implementation of hook_view().

File

./merci.module, line 283
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_view($node, $teaser = FALSE, $page = FALSE) {

  // TODO: should we fix node previews?
  if (!isset($node->preview)) {
    $node->content['merci_reservation_status'] = array(
      '#value' => drupal_get_form('merci_display_reservation_status', merci_record_status($node->merci_reservation_status)),
      '#weight' => 0,
    );
    if ($page) {
      $reservation_table = drupal_get_form('merci_build_reservation_table_form', $node);
      $node = node_prepare($node, $teaser);
      $node->content['merci_reservation_items'] = array(
        '#value' => $reservation_table,
        '#weight' => 1,
      );
    }
    return $node;
  }
}