You are here

public function External::settingsForm in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x src/Plugin/freelinking/External.php \Drupal\freelinking\Plugin\freelinking\External::settingsForm()

Plugin configuration form.

Parameters

array $form: The form element array for the filter plugin.

\Drupal\Core\Form\FormStateInterface $form_state: The form state of the parent form.

Return value

array The configuration form to attach to Freelinking settings form.

Overrides FreelinkingPluginBase::settingsForm

1 call to External::settingsForm()
DrupalOrg::settingsForm in src/Plugin/freelinking/DrupalOrg.php
Plugin configuration form.
1 method overrides External::settingsForm()
DrupalOrg::settingsForm in src/Plugin/freelinking/DrupalOrg.php
Plugin configuration form.

File

src/Plugin/freelinking/External.php, line 79

Class

External
Freelinking external link plugin.

Namespace

Drupal\freelinking\Plugin\freelinking

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $settings = $this
    ->getConfiguration()['settings'];
  $element['scrape'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Scrape external URLs'),
    '#description' => $this
      ->t('Should freelinking try to scrape external URLs?'),
    '#options' => [
      '0' => $this
        ->t('No'),
      '1' => $this
        ->t('Yes'),
    ],
    '#default_value' => isset($settings['scrape']) ? $settings['scrape'] : '1',
  ];
  return $element;
}