You are here

public function FeedsNodeProcessor::configForm in Feeds 7.2

Same name and namespace in other branches
  1. 6 plugins/FeedsNodeProcessor.inc \FeedsNodeProcessor::configForm()
  2. 7 plugins/FeedsNodeProcessor.inc \FeedsNodeProcessor::configForm()

Override parent::configForm().

Overrides FeedsProcessor::configForm

File

plugins/FeedsNodeProcessor.inc, line 227
Class definition of FeedsNodeProcessor.

Class

FeedsNodeProcessor
Creates nodes from feed items.

Code

public function configForm(&$form_state) {
  $form = parent::configForm($form_state);
  $author = user_load($this->config['author']);
  $form['author'] = array(
    '#type' => 'textfield',
    '#title' => t('Author'),
    '#description' => t('Select the author of the nodes to be created - leave empty to assign "anonymous".'),
    '#autocomplete_path' => 'user/autocomplete',
    '#default_value' => empty($author->name) ? 'anonymous' : check_plain($author->name),
  );
  $form['authorize'] = array(
    '#type' => 'checkbox',
    '#title' => t('Authorize'),
    '#description' => t('Check that the author has permission to create the node.'),
    '#default_value' => $this->config['authorize'],
  );
  $period = drupal_map_assoc(array(
    FEEDS_EXPIRE_NEVER,
    3600,
    10800,
    21600,
    43200,
    86400,
    259200,
    604800,
    2592000,
    2592000 * 3,
    2592000 * 6,
    31536000,
  ), 'feeds_format_expire');
  $form['expire'] = array(
    '#type' => 'select',
    '#title' => t('Expire nodes'),
    '#options' => $period,
    '#description' => t("Select after how much time nodes should be deleted. The node's published date will be used for determining the node's age, see Mapping settings."),
    '#default_value' => $this->config['expire'],
  );

  // Add on the "Unpublish" option for nodes, update wording.
  if (isset($form['update_non_existent'])) {
    $form['update_non_existent']['#options'][FEEDS_UNPUBLISH_NON_EXISTENT] = t('Unpublish non-existent nodes');
  }
  return $form;
}