You are here

public function ShortenKeysForm::buildForm in Shorten URLs 8.2

Same name and namespace in other branches
  1. 8 src/Form/ShortenKeysForm.php \Drupal\shorten\Form\ShortenKeysForm::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/ShortenKeysForm.php, line 33

Class

ShortenKeysForm
Keys Page.

Namespace

Drupal\shorten\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL) {
  $config = $this
    ->config('shorten.settings');
  $form['shorten_bitly'] = [
    '#type' => 'fieldset',
    '#title' => t('Bit.ly and j.mp'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  ];
  $form['shorten_bitly']['shorten_bitly_login'] = [
    '#type' => 'textfield',
    '#title' => t('Bit.ly Login'),
    '#default_value' => $config
      ->get('shorten_bitly_login'),
  ];
  $form['shorten_bitly']['shorten_bitly_key'] = [
    '#type' => 'textfield',
    '#title' => t('Bit.ly API Key'),
    '#default_value' => $config
      ->get('shorten_bitly_key'),
  ];
  $form['shorten_budurl'] = [
    '#type' => 'textfield',
    '#title' => t('BudURL API Key'),
    '#default_value' => $config
      ->get('shorten_budurl'),
  ];
  $form['shorten_cligs'] = [
    '#type' => 'textfield',
    '#title' => t('Cligs API Key'),
    '#default_value' => $config
      ->get('shorten_cligs'),
  ];
  $form['shorten_ez'] = [
    '#type' => 'textfield',
    '#title' => t('Ez API Key'),
    '#default_value' => $config
      ->get('shorten_ez'),
  ];
  $form['shorten_fwd4me'] = [
    '#type' => 'textfield',
    '#title' => t('Fwd4.me API Key'),
    '#default_value' => $config
      ->get('shorten_fwd4me'),
  ];
  $form['shorten_googl'] = [
    '#type' => 'textfield',
    '#title' => t('Goo.gl API Key'),
    '#default_value' => $config
      ->get('shorten_googl'),
  ];
  $form['shorten_redirec'] = [
    '#type' => 'textfield',
    '#title' => t('Redir.ec API Key'),
    '#default_value' => $config
      ->get('shorten_redirec'),
  ];
  return parent::buildForm($form, $form_state);
}