You are here

function minisite_asset_field_values in Mini site 7

Return minisite asset field values.

1 call to minisite_asset_field_values()
minisite_site_paths_info in includes/minisite.site.inc
Return minisite paths information.

File

includes/minisite.func.inc, line 11
minisite.func.inc

Code

function minisite_asset_field_values($entity_type, $entity, $minisite_asset_field_name = NULL) {

  // Try to get minisite field name if NULL is given.
  if (empty($minisite_asset_field_name)) {
    $minisite_asset_field_name = minisite_asset_field_name($entity_type, $entity);
  }
  if (module_exists('entity')) {
    $wrapper = entity_metadata_wrapper($entity_type, $entity);
    $minisite_asset_field_values = $wrapper->{$minisite_asset_field_name}
      ->value();
  }
  else {
    $minisite_field = $entity->{$minisite_asset_field_name};
    $minisite_asset_field_values = $minisite_field[LANGUAGE_NONE][0];
  }
  return $minisite_asset_field_values;
}