You are here

public function Biblio::buildContent in Bibliography Module 7.3

Builds a structured array representing the entity's content.

Overrides Entity::buildContent

See also

entity_build_content()

File

includes/biblio.controller.inc, line 12

Class

Biblio
Biblio class.

Code

public function buildContent($view_mode = 'full', $langcode = NULL, $content = array()) {

  // Add the export if it is visible.
  $fields = field_extra_fields_get_display('biblio', $this->type, $view_mode);
  if (isset($fields['export']) && $fields['export']['visible']) {
    $variables = array();
    $variables['bid'] = $this->bid;
    $content['export'] = array(
      '#markup' => theme('biblio_ui_entity_export_area', $variables),
      '#weight' => $fields['export']['weight'],
    );
  }
  if (isset($fields['biblio_get_text']) && $fields['biblio_get_text']['visible']) {
    $options = variable_get('biblio_views_biblio_render_options', array());
    $content['biblio_get_text'] = array(
      '#markup' => $this
        ->getText(variable_get('biblio_default_style', 'citeproc'), $options),
      '#weight' => $fields['biblio_get_text']['weight'],
    );
  }
  $content['#theme'] = 'biblio';

  // Calling parent::buildContent() won't work, since we need to send the
  // content as well.
  return entity_get_controller($this->entityType)
    ->buildContent($this, $view_mode, $langcode, $content);
}