public function ActivityEntityReferenceFormatter::settingsForm in Open Social 8.9
Same name and namespace in other branches
- 8 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.2 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.3 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.4 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.5 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.6 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.7 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 8.8 modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 10.3.x modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 10.0.x modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 10.1.x modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
- 10.2.x modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php \Drupal\activity_viewer\Plugin\Field\FieldFormatter\ActivityEntityReferenceFormatter::settingsForm()
File
- modules/
custom/ activity_viewer/ src/ Plugin/ Field/ FieldFormatter/ ActivityEntityReferenceFormatter.php, line 63
Class
- ActivityEntityReferenceFormatter
- Provides a custom dynamic entity reference formatter.
Namespace
Drupal\activity_viewer\Plugin\Field\FieldFormatterCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$options = $this->entityDisplayRepository
->getAllViewModes();
$only_view_modes = [];
foreach ($options as $entity) {
foreach ($entity as $key => $view_mode) {
$only_view_modes[$key] = $view_mode['label'];
}
}
$elements['view_mode'] = [
'#type' => 'select',
'#options' => $only_view_modes,
'#title' => t('View mode'),
'#default_value' => $this
->getSetting('view_mode'),
'#required' => TRUE,
];
return $elements;
}