You are here

public function ParagraphsSettingsForm::buildForm in Paragraphs 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/Form/ParagraphsSettingsForm.php, line 30

Class

ParagraphsSettingsForm
Form for Paragraphs settings.

Namespace

Drupal\paragraphs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('paragraphs.settings');
  $form['show_unpublished'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Show unpublished Paragraphs'),
    '#default_value' => $config
      ->get('show_unpublished'),
    '#description' => $this
      ->t('Allow users with "View unpublished paragraphs" permission to see unpublished Paragraphs. Disable this if unpublished paragraphs should be hidden for all users, including super administrators.'),
  ];
  return parent::buildForm($form, $form_state);
}