public function EntityVisibilityForm::buildForm in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.2 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.3 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.4 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.5 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.6 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.7 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 8.8 modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 10.3.x modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 10.0.x modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::buildForm()
- 10.2.x modules/custom/entity_access_by_field/src/Form/EntityVisibilityForm.php \Drupal\entity_access_by_field\Form\EntityVisibilityForm::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
- modules/
custom/ entity_access_by_field/ src/ Form/ EntityVisibilityForm.php, line 34
Class
- EntityVisibilityForm
- Class EntityVisibilityForm.
Namespace
Drupal\entity_access_by_field\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
// Get config for this form.
$config = $this
->config('entity_access_by_field.settings');
$form['disable_public_visibility'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Disable public visibility'),
'#description' => $this
->t('Turning on this feature makes sure regular user can no longer post public content anywhere on the platform.'),
'#default_value' => $config
->get('disable_public_visibility'),
];
$form['default_visibility'] = [
'#type' => 'select',
'#title' => $this
->t('Default visibility'),
'#default_value' => $config
->get('default_visibility'),
'#options' => [
'public' => $this
->t('Public - visible to everyone including people who are not a member'),
'community' => $this
->t('Community - visible only to logged in members'),
],
];
return parent::buildForm($form, $form_state);
}