You are here

function farm_group_asset_membership_action_form in farmOS 7

Configuration form for farm_group_asset_membership action.

Parameters

array $context: The context passed into the action form function.

array $form_state: The form state passed into the action form function.

Return value

array Returns a form array.

File

modules/farm/farm_group/farm_group.module, line 348

Code

function farm_group_asset_membership_action_form(array $context, array $form_state) {

  // Date field.
  $form['date'] = array(
    '#type' => 'date_select',
    '#title' => t('Date'),
    '#date_format' => 'M j Y',
    '#date_type' => DATE_FORMAT_UNIX,
    '#date_year_range' => '-10:+3',
    '#default_value' => date('Y-m-d H:i', REQUEST_TIME),
    '#required' => TRUE,
  );

  // Group reference field.
  $form['groups'] = array(
    '#type' => 'select',
    '#title' => t('Group'),
    '#options' => farm_group_options(),
    '#required' => TRUE,
    '#multiple' => TRUE,
  );

  // Done field.
  $form['done'] = array(
    '#type' => 'checkbox',
    '#title' => t('This membership change has taken place (mark the log as done)'),
    '#default_value' => TRUE,
  );

  // Return the form.
  return $form;
}