You are here

public function RedHenOrgInlineEntityFormController::entityForm in RedHen CRM 7

Overrides EntityInlineEntityFormController::entityForm().

Overrides EntityInlineEntityFormController::entityForm

File

modules/redhen_org/lib/redhen_org.inline_entity_form.inc, line 27
Defines the inline entity form controller for RedHen Orgs.

Class

RedHenOrgInlineEntityFormController
Class RedHenOrgInlineEntityFormController.

Code

public function entityForm($entity_form, &$form_state) {
  $org = $entity_form['#entity'];

  // Do some prep work on the contact, similarly to node_form().
  if (!isset($org->label)) {
    $org->label = NULL;
  }
  $entity_form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#default_value' => $org->label,
    '#maxlength' => 255,
    '#required' => TRUE,
  );
  field_attach_form('redhen_org', $org, $entity_form, $form_state);
  return $entity_form;
}