You are here

function redhen_org_org_form in RedHen CRM 7

Form callback: create or edit a contact.

Parameters

$org: The organization object to edit or for a create form an empty organization object with only an org type defined.

4 string references to 'redhen_org_org_form'
redhen_org_add in modules/redhen_org/includes/redhen_org.forms.inc
@file Forms for creating, editing, and deleting organizations.
redhen_org_add_page in modules/redhen_org/includes/redhen_org.pages.inc
Page callback for adding an organization.
redhen_org_menu in modules/redhen_org/redhen_org.module
Implements hook_menu().
redhen_relation_connection_form in modules/redhen_relation/includes/redhen_relation.forms.inc
Return a form array for adding/editing a connection.

File

modules/redhen_org/includes/redhen_org.forms.inc, line 20
Forms for creating, editing, and deleting organizations.

Code

function redhen_org_org_form($form, &$form_state, $org) {

  // Add the default field elements.
  $form['name'] = array(
    '#type' => 'container',
  );
  $form['name']['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#default_value' => $org->label,
    '#maxlength' => 255,
    '#required' => TRUE,
    '#weight' => -6,
  );

  // Add the field related form elements.
  $form_state['redhen_org'] = $org;
  field_attach_form('redhen_org', $org, $form, $form_state);
  $form['actions'] = array(
    '#type' => 'container',
    '#attributes' => array(
      'class' => array(
        'form-actions',
      ),
    ),
    '#weight' => 40,
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save organization'),
  );
  return $form;
}