You are here

public function LinkCssAdminForm::buildForm in Link CSS 8

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/LinkCssAdminForm.php, line 33
Contains \Drupal\link_css\LinkCssAdminForm.

Class

LinkCssAdminForm

Namespace

Drupal\link_css

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('link_css.settings');
  $system_css_preprocess = \Drupal::config('system.performance')
    ->get('css.preprocess');
  $form = array();
  if ($system_css_preprocess) {
    drupal_set_message(t('<a href="/admin/config/development/performance">Aggregate CSS files</a> is turned on! This development module working when <em>Aggregate CSS files</em> is turned off.', array()), 'warning');
  }
  $form['link_css_skip_system'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Skip system links'),
    '#default_value' => $config
      ->get('link_css_skip_system'),
    '#description' => t('Leave core CSS files loaded with @import. This helps
      avoid hitting IE\'s limit and saves any live refresh scripts monitoring
      files which are unlikely to change'),
  );
  $form['link_css_warn_ie_limit'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Warn if IE limit exceeded'),
    '#default_value' => $config
      ->get('link_css_warn_ie_limit'),
    '#description' => t('Internet Explorer <=7 will not load more than 31 linked styelsheets. Display a warning if this limit is exceeded.'),
  );
  return parent::buildForm($form, $form_state);
}