public function ParagraphsTableWidget::settingsSummary in Paragraphs table 8
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 ParagraphsWidget::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ ParagraphsTableWidget.php, line 83
Class
- ParagraphsTableWidget
- Plugin implementation of the 'paragraphs_table_widget' widget.
Namespace
Drupal\paragraphs_table\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = [];
if (!empty($this
->getSetting('vertical'))) {
$summary[] = t('Table mode vertical');
}
if (!empty($this
->getSetting('paste_clipboard'))) {
$summary[] = t('Paste from Excel');
}
if (!empty($this
->getSetting('show_all'))) {
$cardinality = $this->fieldDefinition
->get('fieldStorage')
->get('cardinality');
$summary[] = t('Show all %cardinality elements in form', [
'%cardinality' => $cardinality,
]);
}
$features = array_filter($this
->getSetting('features'));
if (!empty($features)) {
$summary[] = $this
->t('Features: @features', [
'@features' => implode(', ', $features),
]);
}
return $summary;
}