class HttpFetcherForm in Feeds 8.3
The configuration form for http fetchers.
Hierarchy
- class \Drupal\feeds\Plugin\Type\ExternalPluginFormBase implements PluginFormInterface, PluginAwareInterface uses DependencySerializationTrait, StringTranslationTrait
- class \Drupal\feeds\Feeds\Fetcher\Form\HttpFetcherForm
Expanded class hierarchy of HttpFetcherForm
1 file declares its use of HttpFetcherForm
- HttpFetcherFormTest.php in tests/
src/ Unit/ Feeds/ Fetcher/ Form/ HttpFetcherFormTest.php
File
- src/
Feeds/ Fetcher/ Form/ HttpFetcherForm.php, line 11
Namespace
Drupal\feeds\Feeds\Fetcher\FormView source
class HttpFetcherForm extends ExternalPluginFormBase {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['auto_detect_feeds'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Auto detect feeds'),
'#description' => $this
->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->plugin
->getConfiguration('auto_detect_feeds'),
];
$form['use_pubsubhubbub'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Use PubSubHubbub'),
'#description' => $this
->t('Attempt to use a <a href="http://en.wikipedia.org/wiki/PubSubHubbub">PubSubHubbub</a> subscription if available.'),
'#default_value' => $this->plugin
->getConfiguration('use_pubsubhubbub'),
];
$form['always_download'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Always download'),
'#description' => $this
->t('Always download the feed, even if the feed has not been updated.'),
'#default_value' => $this->plugin
->getConfiguration('always_download'),
];
$form['fallback_hub'] = [
'#type' => 'url',
'#title' => $this
->t('Fallback hub'),
'#description' => $this
->t('Enter the URL of a fallback hub. <a href="https://pubsubhubbub.superfeedr.com">Superfeedr</a> is a good choice. If given, this hub will be used if a hub for the feed could not be found.'),
'#default_value' => $this->plugin
->getConfiguration('fallback_hub'),
'#states' => [
'visible' => [
'input[name="fetcher_configuration[use_pubsubhubbub]"]' => [
'checked' => TRUE,
],
],
],
];
// Per feed type override of global http request timeout setting.
$form['request_timeout'] = [
'#type' => 'number',
'#title' => $this
->t('Request timeout'),
'#description' => $this
->t('Timeout in seconds to wait for an HTTP request to finish.'),
'#default_value' => $this->plugin
->getConfiguration('request_timeout'),
'#min' => 0,
];
return $form;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
ExternalPluginFormBase:: |
protected | property | The Feeds plugin. | |
ExternalPluginFormBase:: |
public | function |
Sets the plugin for this object. Overrides PluginAwareInterface:: |
|
ExternalPluginFormBase:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
4 |
ExternalPluginFormBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
5 |
HttpFetcherForm:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |