public function FieldConfigListBuilder::getDefaultOperations in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::getDefaultOperations()
Gets this list's default operations.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.
Return value
array The array structure is identical to the return value of self::getOperations().
Overrides ConfigEntityListBuilder::getDefaultOperations
File
- core/
modules/ field_ui/ src/ FieldConfigListBuilder.php, line 160 - Contains \Drupal\field_ui\FieldConfigListBuilder.
Class
- FieldConfigListBuilder
- Provides lists of field config entities.
Namespace
Drupal\field_uiCode
public function getDefaultOperations(EntityInterface $entity) {
/** @var \Drupal\field\FieldConfigInterface $entity */
$operations = parent::getDefaultOperations($entity);
if ($entity
->access('update') && $entity
->hasLinkTemplate("{$entity->getTargetEntityTypeId()}-field-edit-form")) {
$operations['edit'] = array(
'title' => $this
->t('Edit'),
'weight' => 10,
'url' => $entity
->urlInfo("{$entity->getTargetEntityTypeId()}-field-edit-form"),
);
}
if ($entity
->access('delete') && $entity
->hasLinkTemplate("{$entity->getTargetEntityTypeId()}-field-delete-form")) {
$operations['delete'] = array(
'title' => $this
->t('Delete'),
'weight' => 100,
'url' => $entity
->urlInfo("{$entity->getTargetEntityTypeId()}-field-delete-form"),
);
}
$operations['storage-settings'] = array(
'title' => $this
->t('Storage settings'),
'weight' => 20,
'attributes' => array(
'title' => $this
->t('Edit storage settings.'),
),
'url' => $entity
->urlInfo("{$entity->getTargetEntityTypeId()}-storage-edit-form"),
);
$operations['edit']['attributes']['title'] = $this
->t('Edit field settings.');
$operations['delete']['attributes']['title'] = $this
->t('Delete field.');
return $operations;
}