You are here

public function SeedsToolbarSettingsForm::buildForm in Seeds Toolbar 8

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfigFormBase::buildForm

File

src/Form/SeedsToolbarSettingsForm.php, line 32

Class

SeedsToolbarSettingsForm
Displays the seeds_toolbar settings form.

Namespace

Drupal\seeds_toolbar\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = \Drupal::config('seeds_toolbar.settings');
  $form['style'] = [
    '#type' => 'select',
    '#title' => t('Style'),
    '#options' => [
      'light' => 'Light',
      'dark' => 'Dark',
    ],
    '#default_value' => $config
      ->get('style'),
  ];
  $form['compact'] = [
    '#type' => 'checkbox',
    '#title' => t('Compact'),
    '#default_value' => $config
      ->get('compact'),
    '#description' => t('Choose if you don\'t want the toolbar to be opened by default.'),
  ];
  $form['support'] = [
    '#type' => 'textfield',
    '#title' => t('Support URL'),
    '#default_value' => $config
      ->get('support'),
    '#description' => t('If you want to add your support system URL to be shown on client area. Leave empty to hide the link.'),
  ];
  $form['custom_style'] = [
    '#type' => 'textfield',
    '#title' => t('Custom Style'),
    '#default_value' => $config
      ->get('custom_style'),
    '#description' => t('Provide your link to css file for use in seeds toolbar.'),
  ];
  $form['dark_logo'] = [
    '#type' => 'textfield',
    '#title' => t('Custom Dark Logo Link'),
    '#default_value' => $config
      ->get('dark_logo'),
    '#description' => t('Leave empty to use the default logo.'),
  ];
  $form['light_logo'] = [
    '#type' => 'textfield',
    '#title' => t('Custom Light Logo Link'),
    '#default_value' => $config
      ->get('light_logo'),
    '#description' => t('Leave empty to use the default logo.'),
  ];
  return parent::buildForm($form, $form_state);
}