You are here

public function LinkIconSettingsForm::buildForm in Link Icon 8

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

Overrides ConfigFormBase::buildForm

File

src/Form/LinkIconSettingsForm.php, line 58

Class

LinkIconSettingsForm
Defines the Slick admin settings form.

Namespace

Drupal\linkicon\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('linkicon.settings');
  $form['linkicon'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Linkicon settings'),
    '#description' => $this
      ->t('Import a custom icon font CSS located on the file system.'),
    '#open' => TRUE,
    '#collapsible' => FALSE,
  ];
  $form['linkicon']['font'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Icon font CSS file path'),
    '#description' => $this
      ->t('Valid path to CSS file. Use comma separated value for multiple CSS files, e.g.: /libraries/fontello/css/fontello.css, /libraries/fontello/css/other.css. <br />Please be aware of potential namespace conflicts if you import additional icon fonts through a theme, as most icon fonts use the same selectors (.icon:before). <br />Leave it empty if using FontAwesome (5+) module and SVG with JS method, or your theme has already defined one.'),
    '#default_value' => $config
      ->get('font'),
  ];
  return parent::buildForm($form, $form_state);
}