You are here

public function RedhenOrg::buildContent in RedHen CRM 7

Override buildContent() to add organization properties.

Overrides Entity::buildContent

File

modules/redhen_org/lib/redhen_org.entity.inc, line 44
Redhen Group entity classes

Class

RedhenOrg
The class used for group entities.

Code

public function buildContent($view_mode = 'full', $langcode = NULL) {
  $wrapper = entity_metadata_wrapper('redhen_org', $this);
  $primary_contact = $wrapper->primary_contact
    ->value();
  $content['redhen_state'] = array(
    '#theme' => 'redhen_property_field',
    '#label' => t('State'),
    '#items' => array(
      array(
        '#markup' => $this->redhen_state == REDHEN_STATE_ACTIVE ? t('Active') : t('Inactive'),
      ),
    ),
    '#classes' => 'field field-label-inline clearfix',
  );
  if (isset($primary_contact->contact_id)) {
    $contact_array = $primary_contact
      ->view('teaser');
    $content['primary_contact'] = array(
      '#theme' => 'fieldset',
      '#title' => t('Primary Contact'),
      '#children' => drupal_render($contact_array),
    );
  }
  return entity_get_controller($this->entityType)
    ->buildContent($this, $view_mode, $langcode, $content);
}