You are here

public function LinkedInAuthSettingsForm::buildForm in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  2. 8.2 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  3. 8.3 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  4. 8.4 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  5. 8.5 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  6. 8.6 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  7. 8.7 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::buildForm()
  8. 8.8 modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php \Drupal\social_auth_linkedin\Form\LinkedInAuthSettingsForm::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 ConfigFormBase::buildForm

File

modules/custom/social_auth_linkedin/src/Form/LinkedInAuthSettingsForm.php, line 34

Class

LinkedInAuthSettingsForm
Class LinkedInAuthSettingsForm.

Namespace

Drupal\social_auth_linkedin\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('social_auth_linkedin.settings');
  $form['settings'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('LinkedIn client settings'),
    '#open' => TRUE,
  ];
  $form['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 of your LinkedIn Client here. This value can be found from your Client Dashboard.'),
  ];
  $form['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 of your LinkedIn Client here. This value can be found from your Client Dashboard.'),
  ];
  $form['settings']['status'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Active'),
    '#default_value' => $config
      ->get('status'),
    '#description' => $this
      ->t('Determines whether this social network can be used.'),
  ];
  return parent::buildForm($form, $form_state);
}