You are here

function paymentreference_field_instance_settings_form in Payment 7

Implements hook_field_instance_settings_form().

File

modules/paymentreference/paymentreference.module, line 146
Hook implementations and general functions.

Code

function paymentreference_field_instance_settings_form($field, $instance) {
  $form = array();
  if ($instance['widget']['type'] == 'paymentreference') {
    $form['currency_code'] = array(
      '#type' => 'select',
      '#title' => t('Currency'),
      '#options' => payment_currency_options(),
      '#default_value' => $instance['settings']['currency_code'],
      '#required' => TRUE,
    );
    $form['amount'] = array(
      '#type' => 'payment_amount',
      '#title' => t('Amount'),
      '#default_value' => $instance['settings']['amount'],
      '#required' => TRUE,
      '#currency_code' => '',
    );
    $form['description'] = array(
      '#type' => 'textfield',
      '#title' => t('Payment description'),
      '#default_value' => $instance['settings']['description'],
      '#required' => TRUE,
    );
  }
  return $form;
}