You are here

function farm_movement_entity_view_alter in farmOS 7

Implements hook_entity_view_alter().

File

modules/farm/farm_movement/farm_movement.module, line 313
Farm movement.

Code

function farm_movement_entity_view_alter(&$build, $type) {

  // If it's not a farm_asset, or if the entity object is not available, bail.
  if ($type != 'farm_asset' || empty($build['#entity'])) {
    return;
  }

  // Generate markup to describe the location.
  $output = farm_movement_asset_location_markup($build['#entity']);

  // Add it to the build array.
  $build['location'] = array(
    '#markup' => $output,
    '#prefix' => '<div class="location">',
    '#suffix' => '</div>',
    '#weight' => -100,
  );
}