You are here

public function FeedsFileFetcher::sourceForm in Feeds 7

Same name and namespace in other branches
  1. 6 plugins/FeedsFileFetcher.inc \FeedsFileFetcher::sourceForm()
  2. 7.2 plugins/FeedsFileFetcher.inc \FeedsFileFetcher::sourceForm()

Source form.

Overrides FeedsPlugin::sourceForm

File

plugins/FeedsFileFetcher.inc, line 55
Home of the FeedsFileFetcher and related classes.

Class

FeedsFileFetcher
Fetches data via HTTP.

Code

public function sourceForm($source_config) {
  $form = array();
  $form['fid'] = array(
    '#type' => 'value',
    '#value' => empty($source_config['fid']) ? 0 : $source_config['fid'],
  );
  $form['source'] = array(
    '#type' => empty($this->config['direct']) ? 'value' : 'textfield',
    '#title' => t('File'),
    '#description' => t('Specify a file in the site\'s file system path or upload a file below.'),
    '#default_value' => empty($source_config['source']) ? '' : $source_config['source'],
  );
  $form['upload'] = array(
    '#type' => 'file',
    '#title' => empty($this->config['direct']) ? t('File') : NULL,
    '#description' => empty($source_config['source']) ? t('Select the file to be imported from your local system.') : t('Select a different file to be imported from your local system.'),
    '#theme' => 'feeds_upload',
    '#file_info' => empty($source_config['fid']) ? NULL : file_load($source_config['fid']),
    '#size' => 10,
  );
  return $form;
}