public function LinkUrl::settingsSummary in ShrinkTheWeb 8
Returns a short summary for the current formatter settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.
Return value
string[] A short summary of the formatter settings.
Overrides FormatterBase::settingsSummary
File
- src/
Plugin/ Field/ FieldFormatter/ LinkUrl.php, line 116
Class
- LinkUrl
- Plugin annotation @FieldFormatter( id = "shrinktheweb_link_url", label = @Translation("[ShrinkTheWeb] URL as link"), field_types = {"link"} )
Namespace
Drupal\shrinktheweb\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = array();
$settings = $this
->getSettings();
if (!empty($settings['custom_width'])) {
$summary[] = t('Custom Width is @custom_width px', array(
'@custom_width' => $settings['custom_width'],
));
}
else {
$summary[] = t('Custom Width is not set');
}
if (!empty($settings['full_length'])) {
if ($settings['full_length'] == 1) {
$summary[] = t('Full-Length capture enabled');
}
else {
$summary[] = t('Full-Length capture disabled');
}
}
else {
$summary[] = t('Full-Length is not set');
}
if (!empty($settings['max_height'])) {
$summary[] = t('Max height is @max_height px', array(
'@max_height' => $settings['max_height'],
));
}
else {
$summary[] = t('Max height is not set');
}
if (!empty($settings['native_resolution'])) {
$summary[] = t('Native resolution is @native_resolution px', array(
'@native_resolution' => $settings['native_resolution'],
));
}
else {
$summary[] = t('Native resolution is not set');
}
if (!empty($settings['widescreen_resolution_y'])) {
$summary[] = t('Widescreen resolution Y is @widescreen_resolution_y px', array(
'@widescreen_resolution_y' => $settings['widescreen_resolution_y'],
));
}
else {
$summary[] = t('Widescreen resolution Y is not set');
}
if (!empty($settings['delay'])) {
$summary[] = t('Delay is @delay seconds', array(
'@delay' => $settings['delay'],
));
}
else {
$summary[] = t('Delay is not set');
}
if (!empty($settings['quality'])) {
$summary[] = t('Quality is @quality %', array(
'@quality' => $settings['quality'],
));
}
else {
$summary[] = t('Quality is not set');
}
return $summary;
}