You are here

public function PhotoswipeAdminSettings::buildForm in PhotoSwipe 8

Same name and namespace in other branches
  1. 8.2 src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::buildForm()
  2. 3.x src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::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/PhotoswipeAdminSettings.php, line 49

Class

PhotoswipeAdminSettings

Namespace

Drupal\photoswipe\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['photoswipe_always_load_non_admin'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Load PhotoSwipe on all non-admin pages'),
    '#default_value' => \Drupal::config('photoswipe.settings')
      ->get('photoswipe_always_load_non_admin'),
    '#description' => $this
      ->t('Useful if you want to use photoswipe elsewhere by just adding the <code>.photoswipe</code> CSS class.'),
  ];
  return parent::buildForm($form, $form_state);
}