You are here

function party_view_data_set in Party 8.2

Same name and namespace in other branches
  1. 7 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().

2 string references to 'party_view_data_set'
party_commerce_party_data_set_info in modules/party_commerce/party_commerce.module
Implements hook_party_data_set_info().
party_party_party_pieces in ./party.module
Implements hook_party_party_pieces().

File

./party.pages.inc, line 168
party.pages.inc

Code

function party_view_data_set($party, $data_set_name) {

  // TODO: some of these calls are redundant!
  $data_set_controller = party_get_crm_controller($party, $data_set_name);
  $attached_entities = party_get_attached_entities($party, $data_set_name);
  $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;
}