Add 'add more' button, if not working with a programmed form.
array The form element array.
protected function buildAddActions() {
if (count($this
->getAccessibleOptions()) === 0) {
if (count($this
->getAllowedTypes()) === 0) {
$add_more_elements['icons'] = $this
->createMessage($this
->t('You are not allowed to add any of the @title types.', [
'@title' => $this
->getSetting('title'),
]));
}
else {
$add_more_elements['icons'] = $this
->createMessage($this
->t('You did not add any @title types yet.', [
'@title' => $this
->getSetting('title'),
]));
}
return $add_more_elements;
}
if (in_array($this
->getSetting('add_mode'), [
'button',
'dropdown',
'modal',
])) {
return $this
->buildButtonsAddMode();
}
return $this
->buildSelectAddMode();
}