public function FeedsCommentProcessor::configForm in Feeds Comment Processor 6
Same name and namespace in other branches
- 7 FeedsCommentProcessor.inc \FeedsCommentProcessor::configForm()
Override parent::configForm().
Overrides FeedsConfigurable::configForm
File
- ./
FeedsCommentProcessor.inc, line 169 - Class definition of FeedsCommentProcessor.
Class
- FeedsCommentProcessor
- Creates comments from feed items.
Code
public function configForm(&$form_state) {
$form = array();
$format_options = array(
FILTER_FORMAT_DEFAULT => t('Default format'),
);
$formats = filter_formats();
foreach ($formats as $format) {
$format_options[$format->format] = $format->name;
}
$form['input_format'] = array(
'#type' => 'select',
'#title' => t('Input format'),
'#description' => t('Select the input format for the comments to be created.'),
'#options' => $format_options,
'#default_value' => $this->config['input_format'],
);
$author = user_load(array(
'uid' => $this->config['author'],
));
$form['author'] = array(
'#type' => 'textfield',
'#title' => t('Author'),
'#description' => t('Select the author of the comments 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,
604800 * 4,
604800 * 12,
604800 * 24,
31536000,
), 'feeds_format_expire');
$form['expire'] = array(
'#type' => 'select',
'#title' => t('Expire comments'),
'#options' => $period,
'#description' => t('Select after how much time comments should be deleted. The comment\'s published date will be used for determining the comment\'s age, see Mapping settings.'),
'#default_value' => $this->config['expire'],
);
$form['update_existing'] = array(
'#type' => 'radios',
'#title' => t('Update existing comments'),
'#description' => t('Select how existing comments should be updated. Existing comments will be determined using mappings that are a "unique target".'),
'#options' => array(
FEEDS_SKIP_EXISTING => 'Do not update existing comments',
FEEDS_REPLACE_EXISTING => 'Replace existing comments',
FEEDS_UPDATE_EXISTING => 'Update existing comments (slower than replacing them)',
),
'#default_value' => $this->config['update_existing'],
);
return $form;
}