You are here

function party_data_set_form in Party 7

Same name and namespace in other branches
  1. 8.2 party.module \party_data_set_form()

Get the form for a data set (more to the point get a set of fields for the data set might need to work on this). This function checks the edit party attached data set permission.

@todo: On adding a party work well.

Parameters

$party: The party object of the party we're concerned with.

$data_set_name: The data set name as defined in hook_data_set_info().

$set_id: The set id as stored in the related table

Return value

A form array.

File

./party.module, line 831
Provides a generic CRM party entity.

Code

function party_data_set_form($party, $data_set_name, $set_id = FALSE) {

  // Check that the user has access to this form
  if (!party_access('edit', $party, $data_set_name)) {
    return FALSE;
  }
  $set = party_get_data_set_info($data_set_name);
  $function = $set['form callback'];
  if (function_exists($function)) {
    $result = call_user_func($function, $party, $set_type, $set_id);
  }
  else {
    return FALSE;
  }
  return $result;
}