You are here

public function ShortenKeysForm::buildForm in Shorten URLs 8

Same name and namespace in other branches
  1. 8.2 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'] = array(
    '#type' => 'fieldset',
    '#title' => t('Bit.ly and j.mp'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['shorten_bitly']['shorten_bitly_login'] = array(
    '#type' => 'textfield',
    '#title' => t('Bit.ly Login'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_bitly_login'),
  );
  $form['shorten_bitly']['shorten_bitly_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Bit.ly API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_bitly_key'),
  );
  $form['shorten_budurl'] = array(
    '#type' => 'textfield',
    '#title' => t('BudURL API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_budurl'),
  );
  $form['shorten_cligs'] = array(
    '#type' => 'textfield',
    '#title' => t('Cligs API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_cligs'),
  );
  $form['shorten_ez'] = array(
    '#type' => 'textfield',
    '#title' => t('Ez API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_ez'),
  );
  $form['shorten_fwd4me'] = array(
    '#type' => 'textfield',
    '#title' => t('Fwd4.me API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_fwd4me'),
  );
  $form['shorten_googl'] = array(
    '#type' => 'textfield',
    '#title' => t('Goo.gl API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_googl'),
  );
  $form['shorten_redirec'] = array(
    '#type' => 'textfield',
    '#title' => t('Redir.ec API Key'),
    '#default_value' => \Drupal::config('shorten.settings')
      ->get('shorten_redirec'),
  );
  return parent::buildForm($form, $form_state);
}