function entity_legal_document_page in Entity Legal 7
Same name and namespace in other branches
- 7.2 entity_legal.pages.inc \entity_legal_document_page()
The page view for the entity legal document.
Parameters
EntityLegalDocument $entity_legal_document: The entity object for the document.
Return value
string The page markup.
1 string reference to 'entity_legal_document_page'
- entity_legal_menu in ./
entity_legal.module - Implements hook_menu().
File
- ./
entity_legal.pages.inc, line 16 - Page callbacks for entity_legal module.
Code
function entity_legal_document_page(EntityLegalDocument $entity_legal_document, EntityLegalDocumentVersion $entity_legal_document_version = NULL) {
// If a specific version is specified, load it.
if ($entity_legal_document_version) {
if ($entity_legal_document_version
->identifier() != $entity_legal_document
->getPublishedVersion()
->identifier()) {
drupal_set_message('You are viewing an unpublished version of this legal document.', 'warning');
}
$entity_legal_document
->setPublishedVersion($entity_legal_document_version);
}
return entity_view(ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, array(
$entity_legal_document,
));
}