function tripal_view_entity
3.x TripalEntityUIController.inc | tripal_view_entity($entity, $view_mode = 'full') |
Menu callback to display an entity.
As we load the entity for display, we're responsible for invoking a number of hooks in their proper order.
See also
hook_entity_prepare_view()
hook_entity_view()
hook_entity_view_alter()
1 string reference to 'tripal_view_entity'
- TripalEntityUIController::hook_menu in tripal/
includes/ TripalEntityUIController.inc - Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.
File
- tripal/
includes/ TripalEntityUIController.inc, line 117
Code
function tripal_view_entity($entity, $view_mode = 'full') {
$content = '';
$controller = entity_get_controller($entity->type);
$content = $controller->view(array($entity->id => $entity));
drupal_set_title($entity->title);
if ($entity->status == 0) {
drupal_set_message('This page is currently unpublished', 'warning');
}
return $content;
}