You are here

public function LinkedinAuthSettingsForm::buildForm in Social Auth LinkedIn 8

Same name and namespace in other branches
  1. 8.2 src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  2. 3.x src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()

File

src/Form/LinkedinAuthSettingsForm.php, line 30

Class

LinkedinAuthSettingsForm
Settings form for Social Auth Linkedin.

Namespace

Drupal\social_auth_linkedin\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('social_auth_linkedin.settings');
  $form['linkedin_settings'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Linkedin Client settings'),
    '#open' => TRUE,
  ];
  $form['linkedin_settings']['client_id'] = [
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => $this
      ->t('Client ID'),
    '#default_value' => $config
      ->get('client_id'),
    '#description' => $this
      ->t('Copy the Client ID here'),
  ];
  $form['linkedin_settings']['client_secret'] = [
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => $this
      ->t('Client Secret'),
    '#default_value' => $config
      ->get('client_secret'),
    '#description' => $this
      ->t('Copy the Client Secret here'),
  ];
  return parent::buildForm($form, $form_state);
}