You are here

function rb_cck_action_set_multiple_values_form in Rules Bonus Pack 6

Configuration form for 'rb_cck_action_set_multiple_values'.

File

./rb_cck.module, line 713
Functions for extending CCK field management with Rules.

Code

function rb_cck_action_set_multiple_values_form($settings, &$form) {
  $form['settings']['field'] = array(
    '#type' => 'select',
    '#title' => t('Multiple-value field'),
    '#options' => rb_cck_get_fields(array(
      'multiple',
    )),
    '#default_value' => $settings['field'],
    '#description' => t('Note that only fields with a single storage values are
      supported.'),
  );
  $form['settings']['values'] = array(
    '#type' => 'textarea',
    '#title' => t('Value(s) to insert'),
    '#default_value' => $settings['values'],
    '#description' => t('The values to insert into the field. Enter one per
      line. Only new values will be added – duplicates will be ignored.'),
  );
  $form['settings']['replace'] = array(
    '#type' => 'checkbox',
    '#title' => t('Empty the field before inserting new values.'),
    '#default_value' => $settings['no-replace'],
    '#description' => t('Use this option if you don\'t want to keep existing
      field values. Note that values still won\'t be repeated – only unique
      values will be added.'),
  );
}