You are here

function rooms_unit_page_view in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Sets up content to show an individual unit. @todo - get rid of drupal_set_title();

1 string reference to 'rooms_unit_page_view'
RoomsUnitUIController::hook_menu in modules/rooms_unit/rooms_unit.admin.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.

File

modules/rooms_unit/rooms_unit.module, line 551
Manage units - Units are things that can be booked on a nightly basis (e.g. rooms - but also villas bungalows, etc).

Code

function rooms_unit_page_view($unit, $view_mode = 'full') {
  $controller = entity_get_controller('rooms_unit');
  $content = $controller
    ->view(array(
    $unit->unit_id => $unit,
  ), $view_mode);
  drupal_set_title($unit->name);
  return $content;
}