public function RevisionLogWidget::settingsSummary in Hide Revision Field 8.2
Returns a short summary for the current widget settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.
Return value
array A short summary of the widget settings.
Overrides StringTextareaWidget::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ RevisionLogWidget.php, line 126
Class
- RevisionLogWidget
- Plugin implementation of the 'hide_revision_field_log_widget' widget.
Namespace
Drupal\hide_revision_field\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$settings = $this
->getSettings();
if ($settings['show']) {
$summary[] = $this
->t('Shown by default');
}
else {
$summary[] = $this
->t('Hidden by default');
}
if ($settings['default']) {
$summary[] = $this
->t('Default value: %default', [
'%default' => $settings['default'],
]);
}
if ($settings['allow_user_settings']) {
$summary[] = $this
->t('Users allowed to customize their default');
}
if ($settings['permission_based']) {
$summary[] = $this
->t('Show if user has permission');
}
return $summary;
}