You are here

function og_remove_group_action_form in Organic groups 6

Same name and namespace in other branches
  1. 6.2 modules/og_actions/og_actions.module \og_remove_group_action_form()

Configuration form for Remove Group action.

File

modules/og_actions/og_actions.module, line 190

Code

function og_remove_group_action_form($context) {
  if (!isset($context['group'])) {
    $context['group'] = '';
  }
  $groups = og_all_groups_options();
  if (count($groups)) {
    $form = array();
    $form['group'] = array(
      '#type' => 'select',
      '#title' => t('Group'),
      '#options' => $groups,
      '#description' => t('Select the group to remove from the node.'),
      '#default_value' => $context['group'],
      '#required' => TRUE,
    );
  }
  else {
    drupal_set_message(t('There are no groups. You must have at least one existing group with nodes assigned to use this action.'));
  }
  return $form;
}