You are here

function invite_form in Invite 7.4

Same name and namespace in other branches
  1. 5.2 invite.module \invite_form()
  2. 5 invite.module \invite_form()
  3. 6.2 invite.module \invite_form()
  4. 7.2 invite.module \invite_form()

Invite Form.

_state

Parameters

$form:

Invite $invite:

Return value

array

3 string references to 'invite_form'
invite_add in includes/invite.admin.inc
Add new invite page callback.
invite_block_view in ./invite.module
Implements hook_block_view().
invite_menu in ./invite.module
Implements hook_menu().

File

includes/invite.admin.inc, line 181

Code

function invite_form($form, &$form_state, $invite) {
  $form['#entity'] = $form_state['invite'] = $invite;
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $invite->uid,
  );
  field_attach_form('invite', $invite, $form, $form_state);
  $submit = array();
  if (!empty($form['#submit'])) {
    $submit += $form['#submit'];
  }
  $form['actions'] = array(
    '#weight' => 100,
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save invite'),
    '#submit' => $submit + array(
      'invite_form_submit',
    ),
  );

  // Show Delete button if we edit invite.
  $invite_id = entity_id('invite', $invite);
  if (!empty($invite_id) && invite_access('edit', $invite)) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
      '#submit' => array(
        'invite_form_submit_delete',
      ),
    );
  }
  $form['#validate'][] = 'invite_form_validate';
  return $form;
}