You are here

function rh_field_collection_field_collection_item_view in Rabbit Hole 7.2

Implements hook_field_collection_item_view().

File

modules/rh_field_collection/rh_field_collection.module, line 63
Main module file for Rabbit Hole field collections module.

Code

function rh_field_collection_field_collection_item_view($field_collection_item, $view_mode, $langcode) {

  // Execute Rabbit Hole, if the field collection item is being viewed at its
  // own page using the full view mode, and the current user isn't able to
  // override Rabbit Hole.
  $item_page = menu_get_object('field_collection_item', 2);
  $is_page = $item_page ? $item_page->item_id == $field_collection_item->item_id : FALSE;
  if ($is_page && $view_mode == 'full' && !user_access('bypass rh_field_collection')) {
    rabbit_hole_execute('field_collection_item', $field_collection_item);
  }
}