public function EditableFieldsHelper::getModesOptions in Editable Fields 1.0.x
Same name and namespace in other branches
- 8 src/services/EditableFieldsHelper.php \Drupal\editablefields\services\EditableFieldsHelper::getModesOptions()
Helper method to prepare the list of the form modes.
Return value
array Array of form modes.
Overrides EditableFieldsHelperInterface::getModesOptions
File
- src/
services/ EditableFieldsHelper.php, line 125
Class
- EditableFieldsHelper
- Class EditableFieldsHelper.
Namespace
Drupal\editablefields\servicesCode
public function getModesOptions() {
$options[self::DEFAULT_FORM_MODE] = self::DEFAULT_FORM_MODE;
$form_modes = $this->entityDisplayRepository
->getAllFormModes();
/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface[] $modes */
foreach ($form_modes as $entity_type => $modes) {
foreach ($modes as $mode) {
$label = explode('.', $mode['id']);
$label = end($label);
$options[$entity_type][$label] = $label;
}
}
return $options;
}