You are here

public function LockrKeyProvider::buildConfigurationForm in Lockr 4.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/KeyProvider/LockrKeyProvider.php \Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider::buildConfigurationForm()
  2. 8.2 src/Plugin/KeyProvider/LockrKeyProvider.php \Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider::buildConfigurationForm()
  3. 8.3 src/Plugin/KeyProvider/LockrKeyProvider.php \Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider::buildConfigurationForm()

File

src/Plugin/KeyProvider/LockrKeyProvider.php, line 127
Contains Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider.

Class

LockrKeyProvider
Adds a key provider that allows a key to be stored in Lockr.

Namespace

Drupal\lockr\Plugin\KeyProvider

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $info = $this->lockr
    ->getInfo();
  if (!$info) {
    $form['need_register'] = [
      '#prefix' => '<p>',
      '#markup' => $this
        ->t('This site has not yet registered with Lockr, please <a href="@link">click here to register</a>.', [
        '@link' => Url::fromRoute('lockr.admin')
          ->toString(),
      ]),
      '#suffix' => '</p>',
    ];
  }
  return $form;
}