You are here

public function FeedsHTTPFetcher::configForm in Feeds 8.2

Override parent::configForm().

Overrides FeedsConfigurable::configForm

File

lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsHTTPFetcher.php, line 97
Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsHTTPFetcher.

Class

FeedsHTTPFetcher
Defines an HTTP fetcher.

Namespace

Drupal\feeds\Plugin\feeds\fetcher

Code

public function configForm(&$form_state) {
  $form = array();
  $form['auto_detect_feeds'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto detect feeds'),
    '#description' => t('If the supplied URL does not point to a feed but an HTML document, attempt to extract a feed URL from the document.'),
    '#default_value' => $this->config['auto_detect_feeds'],
  );
  $form['use_pubsubhubbub'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use PubSubHubbub'),
    '#description' => t('Attempt to use a <a href="http://en.wikipedia.org/wiki/PubSubHubbub">PubSubHubbub</a> subscription if available.'),
    '#default_value' => $this->config['use_pubsubhubbub'],
  );
  $form['designated_hub'] = array(
    '#type' => 'textfield',
    '#title' => t('Designated hub'),
    '#description' => t('Enter the URL of a designated PubSubHubbub hub (e. g. superfeedr.com). If given, this hub will be used instead of the hub specified in the actual feed.'),
    '#default_value' => $this->config['designated_hub'],
    '#dependency' => array(
      'edit-use-pubsubhubbub' => array(
        1,
      ),
    ),
  );

  // Per importer override of global http request timeout setting.
  $form['request_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Request timeout'),
    '#description' => t('Timeout in seconds to wait for an HTTP get request to finish.</br>' . '<b>Note:</b> this setting will override the global setting.</br>' . 'When left empty, the global value is used.'),
    '#default_value' => $this->config['request_timeout'],
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#maxlength' => 3,
    '#size' => 30,
  );
  return $form;
}