Skip to content
Snippets Groups Projects

Add image title field export, remove image loading setting

Open Reinhard Hutter requested to merge issue/rest_views-3473318:3.0.x into 3.0.x
1 file
+ 14
26
Compare changes
  • Side-by-side
  • Inline
@@ -39,32 +39,20 @@ class ImageExportFormatter extends ImageFormatter {
public function settingsForm(array $form, FormStateInterface $formState): array {
$form = parent::settingsForm($form, $formState);
unset($form['image_link']);
$alt = $this->getFieldSetting('alt_field');
$title = $this->getFieldSetting('title_field');
if ($alt) {
$form['export_alt'] = [
'#type' => 'checkbox',
'#title' => $this->t('Export <em>Alt</em> field'),
'#description' => $this->t('Enabling this will export an object instead of a string.'),
'#default_value' => $this->getSetting('export_alt'),
];
}
else {
$form['export_alt'] = ['#type' => 'value', '#value' => FALSE];
}
if ($title) {
$form['export_title'] = [
'#type' => 'checkbox',
'#title' => $this->t('Export <em>Title</em> field'),
'#description' => $this->t('Enabling this will export an object instead of a string.'),
'#default_value' => $this->getSetting('export_title'),
];
}
else {
$form['export_title'] = ['#type' => 'value', '#value' => FALSE];
}
unset($form['image_loading']);
$form['export_alt'] = [
'#type' => 'checkbox',
'#title' => $this->t('Export <em>Alt</em> field'),
'#description' => $this->t('Enabling this will export an object instead of a string.'),
'#default_value' => $this->getSetting('export_alt'),
];
$form['export_title'] = [
'#type' => 'checkbox',
'#title' => $this->t('Export <em>Title</em> field'),
'#description' => $this->t('Enabling this will export an object instead of a string.'),
'#default_value' => $this->getSetting('export_title'),
];
return $form;
}
Loading