You are here

function ginvite_by_mail_edit_form in Group 7

Group e-mail invite edit form.

1 string reference to 'ginvite_by_mail_edit_form'
ginvite_menu in modules/ginvite/ginvite.router.inc
Implements hook_menu().

File

modules/ginvite/admin/ginvite.inc, line 92
Group member invite admin callback and pages.

Code

function ginvite_by_mail_edit_form($form, &$form_state, Group $group, $iid) {
  $data = db_select('group_invite', 'gi')
    ->fields('gi')
    ->condition('iid', $iid)
    ->execute()
    ->fetch();
  $message = 'Edit invitation for %mail in %group';
  $replace = array(
    '%mail' => $data->mail,
    '%group' => $group
      ->label(),
  );
  drupal_set_title(t($message, $replace), PASS_THROUGH);
  $roles = array();
  foreach ($group
    ->getRoles(FALSE) as $group_role) {
    $roles[$group_role->name] = $group_role
      ->label();
  }
  $form['roles'] = array(
    '#title' => t('Group roles'),
    '#type' => 'checkboxes',
    '#options' => $roles,
    '#default_value' => unserialize($data->roles),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Edit invitation'),
  );
  return $form;
}