You are here

public function EntityLegalDocumentVersion::buildContent in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.entity.inc \EntityLegalDocumentVersion::buildContent()

Override buildContent() to add the acceptance form.

Overrides Entity::buildContent

File

./entity_legal.entity.inc, line 412
Entity API main classes used by entity_legal module.

Class

EntityLegalDocumentVersion
Legal Document entity version class.

Code

public function buildContent($view_mode = 'full', $langcode = NULL) {
  $content = parent::buildContent($view_mode, $langcode);

  // Get acceptance form or information for the current user.
  $document = $this
    ->getDocument();
  if ($document
    ->userMustAgree() && user_is_logged_in() && !$document
    ->userHasAgreed()) {
    $content['acceptance'] = $document
      ->getAcceptanceForm();
  }

  // Move acceptance to the bottom of the agreement.
  $content['acceptance']['#weight'] = 99;
  return $content;
}