You are here

public function AuthUnlinkForm::buildForm in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  2. 8.2 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  3. 8.3 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  4. 8.4 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  5. 8.5 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  6. 8.6 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  7. 8.7 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()
  8. 8.8 modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php \Drupal\social_auth_extra\Form\AuthUnlinkForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

modules/custom/social_auth_extra/src/Form/AuthUnlinkForm.php, line 110

Class

AuthUnlinkForm
Class AuthUnlinkForm.

Namespace

Drupal\social_auth_extra\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $network = NULL) {
  $network_manager = \Drupal::service('plugin.network.manager');
  $definitions = $network_manager
    ->getDefinitions();
  foreach ($definitions as $definition) {
    $instance = $network_manager
      ->createInstance($definition['id']);
    if ($network == $instance
      ->getSocialNetworkKey()) {
      $this->socialNetwork = $definition;
      break;
    }
  }
  return parent::buildForm($form, $form_state);
}