You are here

public function TwitterApiForm::buildForm in Heartbeat 8

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 FormInterface::buildForm

File

modules/statusmessage/src/Form/TwitterApiForm.php, line 53

Class

TwitterApiForm
Class TwitterApiForm.

Namespace

Drupal\statusmessage\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $muhTokens = $this->twitterConfig
    ->get('oauth_access_token');
  $form['oauth_access_token'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Oauth Access Token'),
    //      '#description' => $this->t('Oauth Access Token'),
    '#maxlength' => 64,
    '#size' => 64,
    '#value' => $this->twitterConfig
      ->get('oauth_access_token'),
  ];
  $form['oauth_access_token_secret'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Oauth Access Token Secret'),
    //      '#description' => $this->t('Oauth Access Token Secret'),
    '#maxlength' => 64,
    '#size' => 64,
    '#value' => $this->twitterConfig
      ->get('oauth_access_token_secret'),
  ];
  $form['consumer_key'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Consumer Key'),
    //      '#description' => $this->t('Consumer Key'),
    '#maxlength' => 64,
    '#size' => 64,
    '#value' => $this->twitterConfig
      ->get('consumer_key'),
  ];
  $form['consumer_secret'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Consumer Secret'),
    //      '#description' => $this->t('Consumer Secret'),
    '#maxlength' => 64,
    '#sizeue' => 64,
    '#value' => $this->twitterConfig
      ->get('consumer_secret'),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}