You are here

class HttpFetcherForm in Feeds 8.3

The configuration form for http fetchers.

Hierarchy

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\Form
View 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

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
ExternalPluginFormBase::$plugin protected property The Feeds plugin.
ExternalPluginFormBase::setPlugin public function Sets the plugin for this object. Overrides PluginAwareInterface::setPlugin
ExternalPluginFormBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm 4
ExternalPluginFormBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm 5
HttpFetcherForm::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.