You are here

function party_view_data_set in Party 7

Same name and namespace in other branches
  1. 8.2 party.pages.inc \party_view_data_set()

Page callback to view a data set.

Used for display of data sets that don't use Views or provide their own page callback.

Parameters

$party: A loaded party object.

$data_set_name: A data set name.

See also

party_party_party_pieces().

1 string reference to 'party_view_data_set'
party_party_party_pieces in ./party.party_info.inc
Implements hook_party_party_pieces().

File

./party.pages.inc, line 217
party.pages.inc

Code

function party_view_data_set($party, $data_set_name) {
  $attached_entities = $party
    ->getDataSetController($data_set_name)
    ->getEntities();
  $build = array();
  foreach ($attached_entities as $delta => $entity) {
    $build[$data_set_name . '_' . $delta] = array(
      // @todo: this is sort of an abuse of what fieldsets are meant for... :/
      '#type' => 'fieldset',
      '#title' => $data_set_controller
        ->getLabel($delta),
    );
    $build[$data_set_name . '_' . $delta]['view'] = $data_set_controller
      ->display($delta);
  }
  return $build;
}