You are here

public function OAuthSettingsForm::buildForm in OAuth 1.0 8

Same name and namespace in other branches
  1. 8.2 src/Form/OAuthSettingsForm.php \Drupal\oauth\Form\OAuthSettingsForm::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

src/Form/OAuthSettingsForm.php, line 58
Contains \Drupal\oauth\Form\OAuthSettingsForm.

Class

OAuthSettingsForm
Provides a deletion confirmation form for the block instance deletion form.

Namespace

Drupal\oauth\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('oauth.settings');
  $form = array();
  $form['request_token_lifetime'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->t('Request token lifetime (in seconds)'),
    '#default_value' => $config
      ->get('request_token_lifetime'),
  );
  $form['login_path'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->t('Login page'),
    '#description' => $this
      ->t('Specify an alternative login page. This is useful when, for example, you want to show a mobile-enhanced login page.'),
    '#default_value' => $config
      ->get('login_path'),
  );
  $form['#submit'][] = array(
    $this,
    'submitForm',
  );
  return parent::buildForm($form, $form_state);
}