You are here

protected function InstagramAccountForm::getAuthWindowButton in Instagram Feeds 8

Gets link to Instagram Auth Window.

Return value

array Form link element renderable array.

1 call to InstagramAccountForm::getAuthWindowButton()
InstagramAccountForm::actions in src/Form/InstagramAccountForm.php
Returns an array of supported actions for the current entity form.

File

src/Form/InstagramAccountForm.php, line 117

Class

InstagramAccountForm
Provides the InstagramAccount add/edit form.

Namespace

Drupal\instagram_feeds\Form

Code

protected function getAuthWindowButton() : array {

  /** @var \Drupal\instagram_feeds\Entity\InstagramAccountInterface $i_account */
  $i_account = $this
    ->getEntity();
  return [
    'auth' => [
      '#type' => 'link',
      '#title' => $this
        ->t('Authenticate Instagram App'),
      '#attributes' => [
        'class' => [
          'button',
          'button--primary',
        ],
      ],
      '#url' => $i_account
        ->getOauthUrl($this
        ->getConfig('client_id')),
    ],
  ];
}