You are here

function rb_cck_action_copy_field_form in Rules Bonus Pack 6

Configuration form for 'rb_cck_action_copy_field'.

File

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

Code

function rb_cck_action_copy_field_form($settings, &$form) {

  // Get a list of all existing fields in a plain array.
  $fields = rb_cck_get_fields(array(
    'all',
  ));

  // Set from and to fields.
  $form['settings']['source_field'] = array(
    '#type' => 'select',
    '#title' => t('Field in source node'),
    '#options' => $fields,
    '#default_value' => $settings['source_field'],
    '#description' => t('The content of the selected field will be munged into
      the target field below. They must be of the same type.'),
  );
  $form['settings']['target_field'] = array(
    '#type' => 'select',
    '#title' => t('Field in target node'),
    '#options' => $fields,
    '#default_value' => $settings['target_field'],
    '#description' => t('The content of the selected field will be replaced with
      the content of the field above. They must be of the same type.'),
  );
}