You are here

public function BiblioController::buildContent in Bibliography Module 7.2

Implements EntityAPIControllerInterface.

Parameters

$content: Optionally. Allows pre-populating the built content to ease overriding this method.

Overrides EntityAPIController::buildContent

File

includes/biblio.controller.inc, line 33

Class

BiblioController
Biblio controller class

Code

public function buildContent($entity, $view_mode = 'full', $langcode = NULL, $content = array()) {
  $wrapper = entity_metadata_wrapper('biblio', $entity);
  $content['author'] = array(
    '#markup' => t('Created by: !author', array(
      '!author' => $wrapper->uid->name
        ->value(array(
        'sanitize' => TRUE,
      )),
    )),
  );

  // Make Description and Status themed like default fields.
  // @todo: figure out what we can replace description with.
  $content['description'] = array(
    '#theme' => 'field',
    '#weight' => 0,
    '#title' => t('Description'),
    '#access' => TRUE,
    '#label_display' => 'above',
    '#view_mode' => 'full',
    '#language' => LANGUAGE_NONE,
    '#field_name' => 'field_fake_description',
    '#field_type' => 'text',
    '#entity_type' => 'biblio_contributor',
    '#bundle' => $entity->type,
    '#items' => array(
      array(
        'value' => $entity->description,
      ),
    ),
    '#formatter' => 'text_default',
    0 => array(
      '#markup' => check_plain($entity->description),
    ),
  );
  return parent::buildContent($entity, $view_mode, $langcode, $content);
}