$entities['global']] + $entities; } /** * {@inheritdoc} */ public function buildHeader() { $header['label'] = $this->t('Type'); return $header + parent::buildHeader(); } /** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { $row['label'] = $this->getLabelAndConfig($entity); return $row + parent::buildRow($entity); } /** * {@inheritdoc} */ public function getOperations(EntityInterface $entity) { $operations = parent::getOperations($entity); // Set the defaults that should not be deletable $protected_defaults = ['global', '403', '404', 'node', 'front', 'taxonomy_term', 'user']; // Global and entity defaults can be reverted but not deleted. if (in_array($entity->id(), $protected_defaults)) { unset($operations['delete']); $operations['revert'] = [ 'title' => t('Revert'), 'weight' => $operations['edit']['weight'] + 1, 'url' => $entity->toUrl('revert-form'), ]; } return $operations; } /** * Renders the Metatag defaults label plus its configuration. * * @param EntityInterface $entity * The Metatag defaults entity. * * @return * Render array for a table cell. */ public function getLabelAndConfig(EntityInterface $entity) { $output = '
' . t('Inherits meta tags from: @inherits', ['@inherits' => $inherits]) . '
' . $tag_id . ': | ' . $tag_value . ' |