You are here

public function SalvattoreAdminSettingsForm::buildForm in Salvattore (CSS driven Masonry) 8

Same name in this branch
  1. 8 src/SalvattoreAdminSettingsForm.php \Drupal\salvattore\SalvattoreAdminSettingsForm::buildForm()
  2. 8 src/Form/SalvattoreAdminSettingsForm.php \Drupal\salvattore\Form\SalvattoreAdminSettingsForm::buildForm()

File

src/SalvattoreAdminSettingsForm.php, line 38

Class

SalvattoreAdminSettingsForm

Namespace

Drupal\salvattore

Code

public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
  $form = [];
  $form['salvattore_use_min_js'] = [
    '#title' => t('Javascript file to use'),
    '#description' => t('Please choose whether you want the minified or the full version of the JS file.'),
    '#type' => 'radios',
    '#options' => [
      '1' => 'Minified',
      '0' => 'Full (debug)',
    ],
    '#default_value' => \Drupal::config('salvattore.settings')
      ->get('salvattore_use_min_js'),
  ];
  $form['salvattore_load_default_css'] = [
    '#title' => t('Load default CSS'),
    '#description' => t('Salvattore is easily configurable via CSS and you should write your own in your theme.<br>If some reason you want to use the default then enable this setting.'),
    '#type' => 'checkbox',
    '#default_value' => \Drupal::config('salvattore.settings')
      ->get('salvattore_load_default_css'),
  ];
  return parent::buildForm($form, $form_state);
}