You are here

public function FeedsFieldCollectionProcessor::configForm in Field collection feeds 7

Override parent::configForm().

File

plugins/FeedsFieldCollectionProcessor.inc, line 119
Class definition of FeedsFieldCollectionProcessor.

Class

FeedsFieldCollectionProcessor
Creates field collection from feed items.

Code

public function configForm(&$form_state) {
  $form = parent::configForm($form_state);
  $field_names = array();
  foreach (field_read_fields(array(
    'type' => 'field_collection',
  )) as $field_name => $field) {
    $field_names[$field_name] = $field_name;
  }
  $form['field_name'] = array(
    '#type' => 'select',
    '#title' => t('Field name'),
    '#options' => $field_names,
    '#default_value' => isset($this->config['field_name']) ? $this->config['field_name'] : NULL,
    '#description' => t('The machine-readable name of the field collection field containing this item.'),
  );
  $entity_types = array();
  foreach (entity_get_info() as $entity_type => $entity_info) {
    $entity_types[$entity_type] = $entity_info['label'];
  }
  $form['host_entity_type'] = array(
    '#type' => 'select',
    '#title' => t('Host entity type'),
    '#options' => $entity_types,
    '#default_value' => isset($this->config['host_entity_type']) ? $this->config['host_entity_type'] : NULL,
  );
  $form['is_field'] = array(
    '#type' => 'checkbox',
    '#title' => t('Is field'),
    '#description' => t('A flag that indicate that whether it is a property or field.'),
    '#default_value' => isset($this->config['is_field']) ? $this->config['is_field'] : NULL,
  );
  $form['guid_field_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Field/property name of Host entity GUID'),
    '#description' => t('Machine name of the field/property that used for Host Entity GUID.'),
    '#default_value' => isset($this->config['guid_field_name']) ? $this->config['guid_field_name'] : '',
  );
  $form['identifier_field_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Identifier field name'),
    '#description' => t('Machine name of the identifier field which is unique in host entity.'),
    '#default_value' => isset($this->config['identifier_field_name']) ? $this->config['identifier_field_name'] : '',
  );
  return $form;
}